Skip to content

Commit

Permalink
➕ add bucket4j dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
sanshengshui committed Sep 26, 2021
1 parent 8067cf9 commit 0eb4585
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
public class ActorSystemTest {

public static final String ROOT_DISPATCHER = "root-dispatcher";
private static final int _100K = 1000;
private static final int _100K = 100 * 1000;
public static final int TIMEOUT_AWAIT_MAX_SEC = 100;

private volatile ActorSystem actorSystem;
Expand Down Expand Up @@ -140,11 +140,9 @@ public void testActorsAndMessages(int actorsCount, int msgNumber, int times) thr
randomIntegers[i] = tmp;
sumTmp += tmp;
}

long expected = sumTmp;

List<ActorTestCtx> testCtxes = new ArrayList<>();

List<ActorRef> actorRefs = new ArrayList<>();
for (int actorIdx = 0; actorIdx < actorsCount; actorIdx++) {
ActorTestCtx testCtx = getActorTestCtx(msgNumber);
Expand Down
51 changes: 48 additions & 3 deletions IOT-Guide-RateLimiting/pom.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright © 2019-2021 The IOT Technical Guide Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
Expand All @@ -12,8 +28,37 @@
<artifactId>IOT-Guide-RateLimiting</artifactId>

<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>

<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.vladimir-bukhtoyarov</groupId>
<artifactId>bucket4j-core</artifactId>
<version>6.2.0</version>
</dependency>
</dependencies>

</project>
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
<leshan-server.version>1.3.1</leshan-server.version>
<leshan-core.version>1.3.1</leshan-core.version>
<leshan-client.version>1.3.1</leshan-client.version>
<bucket4j.version>6.2.0</bucket4j.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -182,6 +183,11 @@
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.vladimir-bukhtoyarov</groupId>
<artifactId>bucket4j-core</artifactId>
<version>${bucket4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
Expand Down

0 comments on commit 0eb4585

Please sign in to comment.