use of org.infinispan.server.core.DummyServerManagement in project infinispan by infinispan.
the class RestTestingUtil method createRest.
public static RestServer createRest(String ctx, RestServerConfigurationBuilder configuration, GlobalConfigurationBuilder globalConfigurationBuilder, ConfigurationBuilder cacheConfigurationBuilder, String... definedCaches) {
configuration.contextPath(ctx);
RestServer nettyRestServer = new RestServer();
Configuration cacheConfiguration = cacheConfigurationBuilder.build();
DefaultCacheManager cacheManager = new DefaultCacheManager(globalConfigurationBuilder.build(), false);
for (String cache : definedCaches) {
cacheManager.defineConfiguration(cache, cacheConfiguration);
}
cacheManager.start();
nettyRestServer.setServerManagement(new DummyServerManagement(), true);
nettyRestServer.start(configuration.build(), cacheManager);
return nettyRestServer;
}
use of org.infinispan.server.core.DummyServerManagement in project infinispan by infinispan.
the class EndpointInteroperabilityTest method setup.
@BeforeClass
protected void setup() throws Exception {
cacheManager = TestCacheManagerFactory.createServerModeCacheManager();
cacheManager.defineConfiguration(DEFAULT_CACHE_NAME, getDefaultCacheConfiguration().build());
cacheManager.defineConfiguration(MARSHALLED_CACHE_NAME, getMarshalledCacheConfiguration().build());
cacheManager.defineConfiguration(STRING_CACHE_NAME, getStringsCacheConfiguration().build());
RestServerConfigurationBuilder builder = new RestServerConfigurationBuilder();
builder.port(findFreePort());
restServer = new RestServer();
restServer.setServerManagement(new DummyServerManagement(), true);
restServer.start(builder.build(), cacheManager);
RestClientConfigurationBuilder clientBuilder = new RestClientConfigurationBuilder();
RestClientConfiguration configuration = clientBuilder.addServer().host(restServer.getHost()).port(restServer.getPort()).build();
restClient = RestClient.forConfiguration(configuration);
HotRodServerConfigurationBuilder serverBuilder = new HotRodServerConfigurationBuilder();
serverBuilder.adminOperationsHandler(new EmbeddedServerAdminOperationHandler());
hotRodServer = startHotRodServer(cacheManager, serverBuilder);
defaultRemoteCache = createRemoteCacheManager(IdentityMarshaller.INSTANCE).getCache(DEFAULT_CACHE_NAME);
defaultMarshalledRemoteCache = createRemoteCacheManager(null).getCache(MARSHALLED_CACHE_NAME);
stringRemoteCache = createRemoteCacheManager(new UTF8StringMarshaller()).getCache(STRING_CACHE_NAME);
}
use of org.infinispan.server.core.DummyServerManagement in project infinispan by infinispan.
the class EndpointsCacheFactory method createRestCache.
private void createRestCache() {
RestServer restServer = startProtocolServer(findFreePort(), p -> {
RestServerConfigurationBuilder builder = new RestServerConfigurationBuilder();
builder.port(p);
rest = new RestServer();
rest.setServerManagement(new DummyServerManagement(), true);
rest.start(builder.build(), cacheManager);
return rest;
});
RestClientConfigurationBuilder builder = new RestClientConfigurationBuilder();
builder.addServer().host(restServer.getHost()).port(restServer.getPort());
restClient = RestClient.forConfiguration(builder.build());
restCacheClient = restClient.cache(cacheName);
}
use of org.infinispan.server.core.DummyServerManagement in project infinispan by infinispan.
the class BaseJsonTest method setup.
@BeforeClass
protected void setup() throws Exception {
cacheManager = TestCacheManagerFactory.createServerModeCacheManager(EndpointITSCI.INSTANCE, new ConfigurationBuilder());
cacheManager.getClassWhiteList().addRegexps(".*");
cacheManager.defineConfiguration(CACHE_NAME, getIndexCacheConfiguration().build());
RestServerConfigurationBuilder builder = new RestServerConfigurationBuilder();
int restPort = findFreePort();
builder.port(restPort);
restServer = new RestServer();
restServer.setServerManagement(new DummyServerManagement(), true);
restServer.start(builder.build(), cacheManager);
restClient = RestClient.forConfiguration(new RestClientConfigurationBuilder().addServer().host(restServer.getHost()).port(restServer.getPort()).build());
restCacheClient = restClient.cache(CACHE_NAME);
hotRodServer = startHotRodServer(cacheManager);
remoteCacheManager = createRemoteCacheManager();
remoteCache = remoteCacheManager.getCache(CACHE_NAME);
}
use of org.infinispan.server.core.DummyServerManagement in project infinispan by infinispan.
the class RestServerHelper method start.
public RestServerHelper start(String name) {
restServerConfigurationBuilder.name(name);
restServer.setServerManagement(new DummyServerManagement(), true);
restServer.start(restServerConfigurationBuilder.build(), cacheManager);
return this;
}
Aggregations