use of org.infinispan.server.core.test.ServerTestingUtil in project infinispan by infinispan.
the class HotRodConcurrentStartTest method testConcurrentStartup.
public void testConcurrentStartup(Method m) throws Exception {
int initialPort = serverPort();
List<HotRodServer> servers = new ArrayList<>();
try {
List<Future<HotRodServer>> futures = new ArrayList<>();
for (int i = 0; i < NUMBER_OF_SERVERS; i++) {
int finalI = i;
futures.add(fork(() -> {
HotRodServer server = startHotRodServer(getCacheManagers().get(finalI), initialPort + (finalI * 10));
servers.add(server);
return server;
}));
}
for (Future<HotRodServer> hotRodServerFuture : futures) {
hotRodServerFuture.get(30, TimeUnit.SECONDS);
}
try (HotRodClient client = new HotRodClient(servers.get(0).getHost(), servers.get(0).getPort(), CACHE_NAME, HotRodConstants.VERSION_30)) {
client.assertPut(m);
}
} finally {
servers.forEach(ServerTestingUtil::killServer);
}
}
Aggregations