use of org.infinispan.server.test.core.TestServer in project infinispan by infinispan.
the class InfinispanXSiteServerExtensionBuilder method build.
public InfinispanXSiteServerExtension build() {
Set<String> uniqueSiteName = new HashSet<>();
List<TestServer> testServers = sites.stream().map(it -> new TestServer(it.createServerTestConfiguration())).peek(testServer -> {
if (!uniqueSiteName.add(testServer.getSiteName())) {
throw new IllegalStateException("Site name already set: " + testServer.getSiteName());
}
}).collect(Collectors.toList());
return new InfinispanXSiteServerExtension(testServers);
}
use of org.infinispan.server.test.core.TestServer in project infinispan by infinispan.
the class XSiteCliOperations method hostAndPort.
private String hostAndPort(String site) {
for (TestServer server : SERVERS.getTestServers()) {
if (site.equals(server.getSiteName())) {
String host = server.getDriver().getServerAddress(0).getHostAddress();
int port = server.getDriver().getServerSocket(0, 11222).getPort();
return host + ":" + port;
}
}
throw new IllegalStateException("Site " + site + " not found.");
}
Aggregations