mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
HCOLL-276 Improve serializer resilience
This commit is contained in:
@@ -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++;
|
||||
|
||||
Reference in New Issue
Block a user