mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-10-13 06:15:51 +00:00
test[protocol]: map test
This commit is contained in:
1 parent
98854ea38e
commit
4783a72703
1 file changed
+6
-10
@@ -66,8 +66,8 @@ public class ConcurrentTesting {
|
||||
Assert.assertTrue(map.isEmpty());
|
||||
}
|
||||
|
||||
public static final int num = 100_0000;
|
||||
public static final int maxCount = 10;
|
||||
public static final int num = 1_0000;
|
||||
public static final int maxCount = 10000;
|
||||
|
||||
@Test
|
||||
public void concurrentPrimitiveTest() throws InterruptedException {
|
||||
@@ -156,8 +156,7 @@ public class ConcurrentTesting {
|
||||
for (int j = 0; j < num; j++) {
|
||||
map.put((long) j, j);
|
||||
}
|
||||
map.forEach((key, value) -> {
|
||||
});
|
||||
map.forEach((key, value) -> value++);
|
||||
countDownLatch.countDown();
|
||||
}
|
||||
}).start();
|
||||
@@ -174,8 +173,7 @@ public class ConcurrentTesting {
|
||||
var value = (int) map.get((long) j);
|
||||
Assert.assertEquals(value, j);
|
||||
}
|
||||
map.forEach((key, value) -> {
|
||||
});
|
||||
map.forEach((key, value) -> value++);
|
||||
countDownLatch2.countDown();
|
||||
}
|
||||
}).start();
|
||||
@@ -190,8 +188,7 @@ public class ConcurrentTesting {
|
||||
for (int j = 0; j < num; j++) {
|
||||
map.put((long) j, j);
|
||||
}
|
||||
map.forEach((key, value) -> {
|
||||
});
|
||||
map.forEach((key, value) -> value++);
|
||||
countDownLatch3.countDown();
|
||||
}
|
||||
}).start();
|
||||
@@ -206,8 +203,7 @@ public class ConcurrentTesting {
|
||||
for (int j = 0; j < num; j++) {
|
||||
map.remove((long) j);
|
||||
}
|
||||
map.forEach((key, value) -> {
|
||||
});
|
||||
map.forEach((key, value) -> value++);
|
||||
countDownLatch4.countDown();
|
||||
}
|
||||
}).start();
|
||||
|
||||
Reference in new issue
Block a user