HCOLL-276 Improve serializer resilience

This commit is contained in:
Rob Austin
2014-12-26 16:53:43 +00:00
parent 74cd5c7335
commit 86fa01a137
@@ -18,6 +18,7 @@
package net.openhft.chronicle.map;
import junit.framework.Assert;
import net.openhft.chronicle.hash.replication.TcpTransportAndNetworkConfig;
import net.openhft.lang.io.ByteBufferBytes;
import net.openhft.lang.io.Bytes;
@@ -679,6 +680,34 @@ public class StatelessClientTest {
}
}
@org.junit.Ignore("HCOLL-276 Improve serializer resilience")
@Test
public void startChronicleMapServer() throws IOException {
TcpTransportAndNetworkConfig serverConfig = TcpTransportAndNetworkConfig.of(8875)
.name("serverMap");
try (ChronicleMap server = ChronicleMapBuilder.of(byte[].class, CharSequence.class)
.replication((byte) 1, serverConfig)
.constantKeySizeBySample(new byte[14])
.create()) {
try (ChronicleMap<byte[], CharSequence> map2 = ChronicleMapBuilder.of(byte[].class, CharSequence.class)
// .constantKeySizeBySample(new byte[14])
.statelessClient(new InetSocketAddress("localhost", 8875))
.create()) {
byte[] key = new byte[14];
System.arraycopy("A".getBytes(), 0, key, 0, "A".length());
map2.put(key, "hello world");
Assert.assertNotNull(map2.get(key));
}
}
}
@Test(timeout = 10000)
public void testGetServerVersion() throws IOException, InterruptedException {
int port = s_port++;