use of org.apache.geode.distributed.DistributedSystem in project geode by apache.
the class Bug36995DUnitTest method createCache.
private void createCache(Properties props) throws Exception {
DistributedSystem ds = getSystem(props);
ds.disconnect();
ds = getSystem(props);
assertNotNull(ds);
cache = CacheFactory.create(ds);
assertNotNull(cache);
}
use of org.apache.geode.distributed.DistributedSystem in project geode by apache.
the class CacheServerTestUtil method createClientCache.
private void createClientCache(Properties props, ClientCacheFactory ccf) throws Exception {
DistributedSystem ds = getSystem(props);
assertNotNull(ds);
ds.disconnect();
ClientCache cc = ccf.create();
setSystem(props, cc.getDistributedSystem());
cache = (Cache) cc;
assertNotNull(cache);
expected = IgnoredException.addIgnoredException("java.net.ConnectionException||java.net.SocketException");
}
use of org.apache.geode.distributed.DistributedSystem in project geode by apache.
the class HAStartupAndFailoverDUnitTest method createCache.
private void createCache(Properties props) throws Exception {
DistributedSystem ds = getSystem(props);
assertNotNull(ds);
ds.disconnect();
ds = getSystem(props);
cache = CacheFactory.create(ds);
assertNotNull(cache);
}
use of org.apache.geode.distributed.DistributedSystem in project geode by apache.
the class EventIDVerificationDUnitTest method createCache.
private void createCache(Properties props) throws Exception {
DistributedSystem ds = getSystem(props);
ds.disconnect();
ds = getSystem(props);
assertNotNull(ds);
cache = CacheFactory.create(ds);
assertNotNull(cache);
}
use of org.apache.geode.distributed.DistributedSystem in project geode by apache.
the class LonerDMJUnitTest method testLonerWithStats.
@Test
public void testLonerWithStats() throws CacheException {
long start;
long end;
DistributedSystem ds = null;
Cache c = null;
Properties cfg = new Properties();
cfg.setProperty(MCAST_PORT, "0");
cfg.setProperty(LOCATORS, "");
cfg.setProperty(STATISTIC_SAMPLING_ENABLED, "true");
cfg.setProperty(STATISTIC_ARCHIVE_FILE, "lonerStats.gfs");
cfg.setProperty(ENABLE_NETWORK_PARTITION_DETECTION, "false");
for (int i = 0; i < 1; i++) {
start = System.currentTimeMillis();
ds = DistributedSystem.connect(cfg);
end = System.currentTimeMillis();
System.out.println("ds.connect took " + (end - start) + " ms");
try {
start = System.currentTimeMillis();
c = CacheFactory.create(ds);
end = System.currentTimeMillis();
System.out.println("Cache create took " + (end - start) + " ms");
try {
AttributesFactory af = new AttributesFactory();
af.setScope(Scope.GLOBAL);
Region r = c.createRegion("loner", af.create());
r.put("key1", "value1");
r.get("key1");
r.get("key2");
r.invalidate("key1");
r.destroy("key1");
r.destroyRegion();
} finally {
{
start = System.currentTimeMillis();
c.close();
end = System.currentTimeMillis();
System.out.println("Cache close took " + (end - start) + " ms");
}
}
} finally {
if (ds != null) {
start = System.currentTimeMillis();
ds.disconnect();
end = System.currentTimeMillis();
System.out.println("ds.disconnect took " + (end - start) + " ms");
}
ds = null;
}
}
}
Aggregations