mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
HCOLL-184 added a method to return the server version from the stateless client
This commit is contained in:
@@ -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());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user