public List getBridgeServers() { return getCacheServers(); } public List getCacheServers() {
public void testTwoCacheServerGroups() throws CacheException { CacheCreation cache = new CacheCreation(); CacheServer bs = cache.addCacheServer(); bs.setPort(AvailablePortHelper.getRandomAvailableTCPPort()); String[] groups = new String[]{"group1", "group2"}; bs.setGroups(groups); testXml(cache); Cache c = getCache(); assertNotNull(c); CacheServer server = (CacheServer)cache.getCacheServers().iterator().next(); assertNotNull(server); assertEquals(Arrays.asList(groups), Arrays.asList(server.getGroups())); } public void testDefaultCacheServerBindAddress() throws CacheException {
public void testOneCacheServerGroups() throws CacheException { CacheCreation cache = new CacheCreation(); CacheServer bs = cache.addCacheServer(); bs.setPort(AvailablePortHelper.getRandomAvailableTCPPort()); String[] groups = new String[]{"group1"}; bs.setGroups(groups); testXml(cache); Cache c = getCache(); assertNotNull(c); CacheServer server = (CacheServer)cache.getCacheServers().iterator().next(); assertNotNull(server); assertEquals(Arrays.asList(groups), Arrays.asList(server.getGroups())); } public void testTwoCacheServerGroups() throws CacheException {
public void testDefaultCacheServerBindAddress() throws CacheException { CacheCreation cache = new CacheCreation(); CacheServer bs = cache.addCacheServer(); bs.setPort(AvailablePortHelper.getRandomAvailableTCPPort()); testXml(cache); Cache c = getCache(); assertNotNull(c); CacheServer server = (CacheServer)cache.getCacheServers().iterator().next(); assertNotNull(server); assertEquals(CacheServer.DEFAULT_BIND_ADDRESS, server.getBindAddress()); } public void testCacheServerBindAddress() throws CacheException {
public void testCacheServerBindAddress() throws CacheException { CacheCreation cache = new CacheCreation(); CacheServer bs = cache.addCacheServer(); bs.setPort(AvailablePortHelper.getRandomAvailableTCPPort()); final String BA = ALIAS1; bs.setBindAddress(BA); testXml(cache); Cache c = getCache(); assertNotNull(c); CacheServer server = (CacheServer)cache.getCacheServers().iterator().next(); assertNotNull(server); assertEquals(BA, server.getBindAddress()); } public void testCacheServerHostnameForClients() throws CacheException {
/** * Tests the groups subelement on bridge-server. */ public void testDefaultCacheServerGroups() throws CacheException { CacheCreation cache = new CacheCreation(); CacheServer bs = cache.addCacheServer(); bs.setPort(AvailablePortHelper.getRandomAvailableTCPPort()); bs.setGroups(CacheServer.DEFAULT_GROUPS); testXml(cache); Cache c = getCache(); assertNotNull(c); CacheServer server = (CacheServer)cache.getCacheServers().iterator().next(); assertNotNull(server); assertEquals(CacheServer.DEFAULT_GROUPS, server.getGroups()); } public void testOneCacheServerGroups() throws CacheException {
Collection myBridges = this.getCacheServers(); Collection otherBridges = other.getCacheServers(); if (myBridges.size() != otherBridges.size()) {
Collection myBridges = this.getCacheServers(); Collection otherBridges = other.getCacheServers(); if (myBridges.size() != otherBridges.size()) {
public void testCacheServerHostnameForClients() throws CacheException { CacheCreation cache = new CacheCreation(); CacheServer bs = cache.addCacheServer(); bs.setPort(AvailablePortHelper.getRandomAvailableTCPPort()); final String BA = ALIAS1; bs.setBindAddress(BA); bs.setHostnameForClients("clientHostName"); testXml(cache); Cache c = getCache(); assertNotNull(c); CacheServer server = (CacheServer)cache.getCacheServers().iterator().next(); assertNotNull(server); assertEquals(BA, server.getBindAddress()); assertEquals("clientHostName", server.getHostnameForClients()); } public void testExplicitConnectionPool() throws CacheException {
Cache c = getCache(); assertNotNull(c); CacheServer server = (CacheServer)cache.getCacheServers().iterator() .next(); assertNotNull(server);
String serverBindAdd = CacheServerLauncher.getServerBindAddress(); Boolean disableDefaultServer = CacheServerLauncher.disableDefaultServer.get(); if (this.getCacheServers().size() > 1 && (serverPort != null || serverBindAdd != null)) { throw new RuntimeException( if (this.getCacheServers().isEmpty() && (serverPort != null || serverBindAdd != null) && (disableDefaultServer == null || !disableDefaultServer)) { this.getCacheServers().add(new BridgeServerCreation(cache, false)); for (Iterator iter = this.getCacheServers().iterator(); iter.hasNext();) { BridgeServerCreation bridge = (BridgeServerCreation)iter.next(); BridgeServerImpl impl = (BridgeServerImpl)cache.addCacheServer();
Cache c = getCache(); assertNotNull(c); CacheServer server = (CacheServer)cache.getCacheServers().iterator() .next(); assertNotNull(server);
Cache c = getCache(); assertNotNull(c); CacheServer server = (CacheServer)cache.getCacheServers().iterator() .next(); assertNotNull(server);
String serverBindAdd = CacheServerLauncher.getServerBindAddress(); Boolean disableDefaultServer = CacheServerLauncher.disableDefaultServer.get(); startCacheServers(this.getCacheServers(), cache, serverPort, serverBindAdd, disableDefaultServer); cache.setBackupFiles(this.backups); cache.addDeclarableProperties(this.declarablePropertiesMap);