mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
HCOLL-167 more refactors statelss client
This commit is contained in:
@@ -36,7 +36,7 @@ import static net.openhft.chronicle.common.StatelessBuilder.remoteAddress;
|
||||
public class StatelessClientTest {
|
||||
|
||||
|
||||
public static final int SIZE = 1000;
|
||||
public static final int SIZE = 100000;
|
||||
|
||||
|
||||
@Test
|
||||
@@ -78,11 +78,50 @@ public class StatelessClientTest {
|
||||
|
||||
serverMap.close();
|
||||
statelessMap.close();
|
||||
|
||||
// System.out.print("" + entries);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testBufferOverFlowPutAllAndKeySet() throws IOException, InterruptedException {
|
||||
|
||||
final ChronicleMap<Integer, CharSequence> serverMap;
|
||||
final ChronicleMap<Integer, CharSequence> statelessMap;
|
||||
|
||||
|
||||
// stateless client
|
||||
{
|
||||
statelessMap = ChronicleMapBuilder.of(Integer
|
||||
.class, CharSequence.class)
|
||||
.stateless(remoteAddress(new InetSocketAddress("localhost", 8076))).create();
|
||||
}
|
||||
|
||||
// server
|
||||
{
|
||||
serverMap = ChronicleMapBuilder.of(Integer.class, CharSequence.class)
|
||||
.replicators((byte) 2, TcpReplicationConfig.of(8076)).create();
|
||||
}
|
||||
|
||||
|
||||
Map<Integer, CharSequence> payload = new HashMap<Integer, CharSequence>();
|
||||
|
||||
for (int i = 0; i < SIZE; i++) {
|
||||
payload.put(i, "some value=" + i);
|
||||
}
|
||||
|
||||
|
||||
statelessMap.putAll(payload);
|
||||
|
||||
|
||||
final Set<Integer> keys = statelessMap.keySet();
|
||||
|
||||
Assert.assertEquals(keys.size(), payload.size());
|
||||
|
||||
|
||||
serverMap.close();
|
||||
statelessMap.close();
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void test() throws IOException, InterruptedException {
|
||||
|
||||
@@ -187,9 +226,6 @@ public class StatelessClientTest {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Test
|
||||
public void testEquals() throws IOException, InterruptedException {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user