use of org.infinispan.client.hotrod.test.InternalRemoteCacheManager in project infinispan by infinispan.
the class PingOnStartupTest method testTopologyFetched.
public void testTopologyFetched() {
HotRodServer hotRodServer2 = server(1);
org.infinispan.client.hotrod.configuration.ConfigurationBuilder clientBuilder = HotRodClientTestingUtil.newRemoteConfigurationBuilder(hotRodServer2);
withRemoteCacheManager(new RemoteCacheManagerCallable(new InternalRemoteCacheManager(clientBuilder.build())) {
@Override
public void call() {
ChannelFactory channelFactory = ((InternalRemoteCacheManager) rcm).getChannelFactory();
for (int i = 0; i < 10; i++) {
if (channelFactory.getServers().size() == 1) {
TestingUtil.sleepThread(1000);
} else {
break;
}
}
assertEquals(2, channelFactory.getServers().size());
}
});
}
use of org.infinispan.client.hotrod.test.InternalRemoteCacheManager in project infinispan by infinispan.
the class PingOnStartupTest method testHashAwareIntelligence.
public void testHashAwareIntelligence() {
org.infinispan.client.hotrod.configuration.ConfigurationBuilder clientBuilder = HotRodClientTestingUtil.newRemoteConfigurationBuilder();
clientBuilder.addServer().host("127.0.0.1").port(server(0).getPort());
clientBuilder.clientIntelligence(ClientIntelligence.HASH_DISTRIBUTION_AWARE);
withRemoteCacheManager(new RemoteCacheManagerCallable(new InternalRemoteCacheManager(clientBuilder.build())) {
@Override
public void call() {
rcm.getCache();
ChannelFactory channelFactory = ((InternalRemoteCacheManager) rcm).getChannelFactory();
assertEquals(2, channelFactory.getServers().size());
}
});
}
use of org.infinispan.client.hotrod.test.InternalRemoteCacheManager in project infinispan by infinispan.
the class PingOnStartupTest method testTopologyAwareIntelligence.
public void testTopologyAwareIntelligence() {
org.infinispan.client.hotrod.configuration.ConfigurationBuilder clientBuilder = HotRodClientTestingUtil.newRemoteConfigurationBuilder();
clientBuilder.addServer().host("127.0.0.1").port(server(0).getPort());
clientBuilder.clientIntelligence(ClientIntelligence.TOPOLOGY_AWARE);
withRemoteCacheManager(new RemoteCacheManagerCallable(new InternalRemoteCacheManager(clientBuilder.build())) {
@Override
public void call() {
rcm.getCache();
ChannelFactory channelFactory = ((InternalRemoteCacheManager) rcm).getChannelFactory();
assertEquals(2, channelFactory.getServers().size());
}
});
}
use of org.infinispan.client.hotrod.test.InternalRemoteCacheManager in project infinispan by infinispan.
the class RemoteAsyncAPITest method getRemoteCacheManager.
@Override
protected RemoteCacheManager getRemoteCacheManager() {
ConfigurationBuilder builder = HotRodClientTestingUtil.newRemoteConfigurationBuilder();
builder.forceReturnValues(isForceReturnValuesViaConfiguration());
builder.addServer().host("127.0.0.1").port(hotrodServer.getPort());
return new InternalRemoteCacheManager(builder.build());
}
use of org.infinispan.client.hotrod.test.InternalRemoteCacheManager in project infinispan by infinispan.
the class HotRodNonOwnerStatisticsTest method createCacheManagers.
@Override
protected void createCacheManagers() throws Throwable {
// Add 3 new nodes, but only start one server, so the client only has one connection
newCacheManager();
newCacheManager();
newCacheManager();
hotRodServer = startHotRodServer(cacheManagers.get(0));
org.infinispan.client.hotrod.configuration.ConfigurationBuilder clientBuilder = HotRodClientTestingUtil.newRemoteConfigurationBuilder(hotRodServer);
clientBuilder.statistics().enable();
// We only need one connection, avoid topology updates
clientBuilder.clientIntelligence(ClientIntelligence.BASIC);
remoteCacheManager = new InternalRemoteCacheManager(clientBuilder.build());
remoteCache = remoteCacheManager.getCache();
}
Aggregations