use of org.apache.geode.cache.client.internal.PoolImpl in project geode by apache.
the class Bug36995DUnitTest method createClientCacheWithDefaultMessageTrackingTimeout.
public static void createClientCacheWithDefaultMessageTrackingTimeout(String host, int port1, int port2, int port3) {
try {
Properties props = new Properties();
props.setProperty(MCAST_PORT, "0");
props.setProperty(LOCATORS, "");
new Bug36995DUnitTest().createCache(props);
PoolImpl p = (PoolImpl) PoolManager.createFactory().addServer(host, port1).addServer(host, port2).addServer(host, port3).create("Bug36995UnitTestPool2");
AttributesFactory factory = new AttributesFactory();
factory.setPoolName(p.getName());
RegionAttributes attrs = factory.create();
cache.createRegion(regionName, attrs);
pool = p;
} catch (Exception e) {
fail("Test failed due to ", e);
}
}
use of org.apache.geode.cache.client.internal.PoolImpl in project geode by apache.
the class CacheServerTestUtil method createCacheClient.
public static void createCacheClient(Pool poolAttr, String regionName1, String regionName2) throws Exception {
new CacheServerTestUtil().createCache(getClientProperties());
PoolFactoryImpl pf = (PoolFactoryImpl) PoolManager.createFactory();
pf.init(poolAttr);
PoolImpl p = (PoolImpl) pf.create("CacheServerTestUtil");
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.LOCAL);
factory.setPoolName(p.getName());
RegionAttributes attrs = factory.create();
cache.createRegion(regionName1, attrs);
cache.createRegion(regionName2, attrs);
pool = p;
}
use of org.apache.geode.cache.client.internal.PoolImpl in project geode by apache.
the class HAStartupAndFailoverDUnitTest method createClientCache.
public static void createClientCache(String testName, String host) throws Exception {
Properties props = new Properties();
props.setProperty(MCAST_PORT, "0");
props.setProperty(LOCATORS, "");
new HAStartupAndFailoverDUnitTest().createCache(props);
PoolImpl p = (PoolImpl) PoolManager.createFactory().addServer(host, PORT1.intValue()).addServer(host, PORT2.intValue()).addServer(host, PORT3.intValue()).setSubscriptionEnabled(true).setSubscriptionRedundancy(-1).setReadTimeout(10000).create("HAStartupAndFailoverDUnitTestPool");
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.LOCAL);
factory.setPoolName(p.getName());
RegionAttributes attrs = factory.create();
cache.createRegion(REGION_NAME, attrs);
pool = p;
conn = pool.acquireConnection();
assertNotNull(conn);
}
use of org.apache.geode.cache.client.internal.PoolImpl in project geode by apache.
the class HAStartupAndFailoverDUnitTest method createClientCacheWithIncorrectPrimary.
public static void createClientCacheWithIncorrectPrimary(String testName, String host) throws Exception {
Properties props = new Properties();
props.setProperty(MCAST_PORT, "0");
props.setProperty(LOCATORS, "");
new HAStartupAndFailoverDUnitTest().createCache(props);
final int INCORRECT_PORT = 1;
PoolImpl p = (PoolImpl) PoolManager.createFactory().addServer(host, INCORRECT_PORT).addServer(host, PORT2.intValue()).addServer(host, PORT3.intValue()).setSubscriptionEnabled(true).setSubscriptionRedundancy(-1).setReadTimeout(10000).create("HAStartupAndFailoverDUnitTestPool");
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.LOCAL);
factory.setPoolName(p.getName());
RegionAttributes attrs = factory.create();
cache.createRegion(REGION_NAME, attrs);
pool = p;
conn = pool.acquireConnection();
assertNotNull(conn);
}
use of org.apache.geode.cache.client.internal.PoolImpl in project geode by apache.
the class HAInterestTestCase method createClientPoolCache.
public static void createClientPoolCache(String testName, String host) throws Exception {
Properties props = new Properties();
props.setProperty(MCAST_PORT, "0");
props.setProperty(LOCATORS, "");
new HAInterestTestCase().createCache(props);
CacheServerTestUtil.disableShufflingOfEndpoints();
PoolImpl p;
try {
p = (PoolImpl) PoolManager.createFactory().addServer(host, PORT1).addServer(host, PORT2).addServer(host, PORT3).setSubscriptionEnabled(true).setSubscriptionRedundancy(-1).setReadTimeout(10000).setPingInterval(1000).create("HAInterestBaseTestPool");
} finally {
CacheServerTestUtil.enableShufflingOfEndpoints();
}
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.LOCAL);
factory.setConcurrencyChecksEnabled(true);
factory.setPoolName(p.getName());
cache.createRegion(REGION_NAME, factory.create());
pool = p;
conn = pool.acquireConnection();
assertNotNull(conn);
}
Aggregations