HCOLL-184 added a method to return the server version from the stateless client

This commit is contained in:
Rob Austin
2014-12-23 11:25:58 +00:00
parent 12fe331c55
commit 9b7279daf0
3 changed files with 48 additions and 0 deletions
@@ -120,6 +120,7 @@ public class StatelessClientTest {
.statelessClient(new InetSocketAddress("localhost", port)).create()) {
String actual = statelessMap.getMapped(10, ToString.INSTANCE);
assertEquals("{10=Hello World}", statelessMap.toString());
assertEquals("Hello World", actual);
}
}
@@ -677,6 +678,24 @@ public class StatelessClientTest {
}
}
@Test(timeout = 10000)
public void testGetServerVersion() throws IOException, InterruptedException {
int port = s_port++;
try (ChronicleMap<Integer, StringBuilder> serverMap = ChronicleMapBuilder
.of(Integer.class, StringBuilder.class)
.replication((byte) 2, TcpTransportAndNetworkConfig.of(port))
.create()) {
try (ChronicleMap<Integer, StringBuilder> statelessMap = ChronicleMapBuilder.of(Integer
.class, StringBuilder.class)
.statelessClient(new InetSocketAddress("localhost", port)).create()) {
assertTrue(!((StatelessChronicleMap) statelessMap).version().isEmpty());
}
}
}
}