/** * create the cache to be used by this migration server * @throws Exception if there are any problems */ private void createCache() throws Exception { if (this.distributedSystem == null) { this.distributedSystem = InternalDistributedSystem.getConnectedInstance(); } this.cache = CacheFactory.create(this.distributedSystem); }
protected void setUp() throws java.lang.Exception { Properties properties = new Properties(); distributedSystem = DistributedSystem.connect(properties); cache = CacheFactory.create(distributedSystem); }
public PRConcurrentMapOpsJUnitTest(String str) throws CacheException { super(str); if (cache == null) { Properties dsProps = new Properties(); dsProps.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); // Connect to a DS and create a Cache. sys = DistributedSystem.connect(dsProps); cache = CacheFactory.create(sys); } }
private void connectDSandCache() throws Exception { Properties props = new Properties(); props.setProperty("mcast-port", "0"); props.setProperty("locators", ""); props.setProperty("log-level", "config"); // to keep diskPerf logs smaller props.setProperty("statistic-sampling-enabled", "true"); props.setProperty("enable-time-statistics", "true"); props.setProperty("statistic-archive-file", "stats.gfs"); ds = DistributedSystem.connect(props); cache = CacheFactory.create(ds); }
protected void setUp() throws Exception { //Read the Cache.xml placed in test.lib folder Properties props = new Properties(); String path = System.getProperty("INDEXQUERYXMLFILE"); //String path = "/home/shobhit/gemfire/branches/gemfire66_maint/tests/lib/cachequeryindex.xml"; props.setProperty("cache-xml-file", path); //props.setProperty("cache-xml-file","D:\\program // files\\eclipse\\workspace\\Gemfire\\cache.xml"); DistributedSystem ds = DistributedSystem.connect(props); cache = CacheFactory.create(ds); }
public void run() { Properties props = new Properties(); props.setProperty("mcast-port", "0"); props.setProperty("locators", locators); props.setProperty("groups", "bs1Group1, bs1Group2"); props.setProperty("log-level", getDUnitLogLevel()); CacheFactory.create(DistributedSystem.connect(props)); } });
public void run() { Properties props = new Properties(); props.setProperty("mcast-port", "0"); props.setProperty("locators", locators); dsProps.setProperty("log-level", getDUnitLogLevel()); CacheFactory.create(DistributedSystem.connect(props)); } };
public PRDataStoreMemoryJUnitTest(String str) throws CacheException { super(str); if (cache == null) { // Connect to a DS and create a Cache. sys = DistributedSystem.connect(getDistributedSystemProperties()); cache = CacheFactory.create(sys); } }
private void createCache(Properties props) throws Exception { DistributedSystem ds = getSystem(props); cache = CacheFactory.create(ds); assertNotNull(cache); }
private void createCache(Properties props) throws Exception { DistributedSystem ds = getSystem(props); cache = CacheFactory.create(ds); assertNotNull(cache); }
public void run2() throws CacheException { System.setProperty("gemfire.DISABLE_DISCONNECT_DS_ON_CACHE_CLOSE", "true"); try { Cache cache2 = CacheFactory.create(getSystem()); cache2.setLockLease(oldLockLease); cache2.setLockTimeout(oldLockTimeout); cache2.setSearchTimeout(oldSearchTimeout); } finally { System.clearProperty("gemfire.DISABLE_DISCONNECT_DS_ON_CACHE_CLOSE"); } } });
public static void caseSetUp() throws Exception { Properties properties = new Properties(); properties.setProperty("mcast-port", "0"); properties.setProperty("locators", ""); distributedSystem = DistributedSystem.connect(properties); Cache cache = CacheFactory.create(distributedSystem); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.GLOBAL); RegionAttributes regionAttributes = factory.create(); testRegion = cache.createRegion("TestRegion", regionAttributes); }
public static void caseSetUp() throws Exception { Properties properties = new Properties(); properties.setProperty("mcast-port", "0"); properties.setProperty("locators", ""); distributedSystem = DistributedSystem.connect(properties); Cache cache = CacheFactory.create(distributedSystem); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.GLOBAL); RegionAttributes regionAttributes = factory.create(); testRegion = cache.createRegion("TestRegion", regionAttributes); }
public static void startCache() { try { if (cache.isClosed()) { cache = new CacheFactory(props).create(); ds = cache.getDistributedSystem(); qs = cache.getQueryService(); } } catch (Exception e) { e.printStackTrace(); } }
public void run() { InternalDistributedSystem system = getSystem(); Cache cache = CacheFactory.create(system); CacheServer server = cache.addCacheServer(); try { server.start(); } catch (IOException e) { fail("failed to start server", e); } } });
public void testCacheClose() throws Exception { cache = CacheFactory.create(DistributedSystem.connect(props)); PoolFactory cpf = PoolManager.createFactory(); cpf.addLocator("localhost", AvailablePortHelper.getRandomAvailableTCPPort()); Pool pool1 = cpf.create("pool1"); Pool pool2 = cpf.create("pool2"); cache.close(); Assert.assertTrue(pool1.isDestroyed()); Assert.assertTrue(pool2.isDestroyed()); }
public void createCache(Properties props) throws Exception { DistributedSystem ds = getSystem(props); ds.disconnect(); ds = getSystem(props); assertNotNull(ds); cache = CacheFactory.create(ds); assertNotNull(cache); }
private void createCache(Properties props) throws Exception { DistributedSystem ds = getSystem(props); ds.disconnect(); ds = getSystem(props); assertNotNull(ds); cache = CacheFactory.create(ds); assertNotNull(cache); }
public void test_GatewaySenderWithGatewaySenderEventListener2() { cache = new CacheFactory().create(); GatewaySenderFactory fact = cache.createGatewaySenderFactory(); AsyncEventListener listener = new MyGatewaySenderEventListener(); ((GatewaySenderFactoryImpl)fact).addAsyncEventListener(listener); try { ((GatewaySenderFactoryImpl)fact).create("ln"); } catch (Exception e) { fail("Received Exception :" + e); } }