HCOLL-167 more refactors statelss client

This commit is contained in:
Rob Austin
2014-10-27 19:11:28 +00:00
parent 9f5ee2da1a
commit 03236f31e5
3 changed files with 108 additions and 55 deletions
@@ -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 {