public void run2() throws CacheException { getSystem(p); DM dm = getSystem().getDistributionManager(); assertTrue(dm.getDistributionManagerIds().contains(controllerVM)); AttributesFactory af = new AttributesFactory(); af.setScope(Scope.DISTRIBUTED_NO_ACK); af.setDataPolicy(DataPolicy.REPLICATE); doTestMultipleRegionConflation_R1_Listener = new ControlListener(); af.setCacheListener(doTestMultipleRegionConflation_R1_Listener); createRootRegion("slowrec1", af.create()); doTestMultipleRegionConflation_R2_Listener = new ControlListener(); af.setCacheListener(doTestMultipleRegionConflation_R2_Listener); createRootRegion("slowrec2", af.create()); } });
public static void createRegionToTestRemove(){ try{ AttributesFactory factory2 = new AttributesFactory(); factory2.setScope(Scope.DISTRIBUTED_ACK); CacheWriter cacheWriter = new RemoveCacheWriter(); CacheListener cacheListener = new RemoveCacheListener(); factory2.setCacheWriter(cacheWriter); factory2.setCacheListener(cacheListener); RegionAttributes attr2 = factory2.create(); remRegion = cache.createRegion("remove", attr2); } catch (Exception ex){ ex.printStackTrace(); } }
@Override public void run2() throws CacheException { AttributesFactory factory = getBridgeServerRegionAttributes(null, null); factory.setCacheListener(new DelayListener(25)); createRegion(name, factory.create()); try { startBridgeServer(0); } catch (Exception ex) { fail("While starting CacheServer", ex); } } };
public static void createCache(){ try{ CacheListener aListener = new ListenerCallBk(); // props.setProperty("mcast-port", "1234"); // ds = DistributedSystem.connect(props); ds = (new ClearMultiVmCallBkDUnitTest("temp")).getSystem(props); cache = CacheFactory.create(ds); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_ACK); // Set Cachelisterner : aListener factory.setCacheListener(aListener); RegionAttributes attr = factory.create(); region = cache.createRegion("map", attr); } catch (Exception ex){ ex.printStackTrace(); } }
public void run2() throws CacheException { getSystem(p); AttributesFactory af = new AttributesFactory(); af.setScope(Scope.DISTRIBUTED_NO_ACK); af.setDataPolicy(DataPolicy.REPLICATE); doTestDisconnectCleanup_Listener = new ControlListener(); af.setCacheListener(doTestDisconnectCleanup_Listener); createRootRegion("slowrec", af.create()); } });
public void run2() throws CacheException { getSystem(p); AttributesFactory af = new AttributesFactory(); af.setScope(Scope.DISTRIBUTED_NO_ACK); af.setDataPolicy(DataPolicy.REPLICATE); doTestPartialMessage_Listener = new ControlListener(); af.setCacheListener(doTestPartialMessage_Listener); createRootRegion("slowrec", af.create()); } });
public static void createRegionQueue(Boolean isDurable) throws Exception { new HAExpiryDUnitTest("temp").createCache(new Properties()); HARegionQueueAttributes hattr = new HARegionQueueAttributes(); // setting expiry time for the regionqueue. hattr.setExpiryTime(4); RegionQueue regionqueue = HARegionQueue.getHARegionQueueInstance(regionQueueName, cache, hattr,HARegionQueue.NON_BLOCKING_HA_QUEUE, isDurable.booleanValue()); assertNotNull(regionqueue); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_ACK); factory.setDataPolicy(DataPolicy.REPLICATE); CacheListener serverListener = new vmListener(); factory.setCacheListener(serverListener); RegionAttributes attrs = factory.create(); cache.createRegion(REGION_NAME, attrs); }
public void run2() throws CacheException { getLonerSystem(); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.LOCAL); factory.setConcurrencyChecksEnabled(false); // create bridge writer BridgeTestCase.configureConnectionPool(factory,host0,port,-1,true,-1,-1, null); factory.setCacheListener(new ControlListener()); createRegion(name, factory.create()); } };
public static synchronized void createCache(){ try{ CacheListener aListener = new AfterCreateCallback(); CacheWriter aWriter = new BeforeCreateCallback(); ds = (new PutAllCallBkSingleVMDUnitTest("temp")).getSystem(props); cache = CacheFactory.create(ds); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_ACK); factory.setCacheWriter(aWriter); factory.setCacheListener(aListener); RegionAttributes attr = factory.create(); region = cache.createRegion("map", attr); } catch (Exception ex){ ex.printStackTrace(); } }
public void run2() throws CacheException { getLonerSystem(); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.LOCAL); factory.setConcurrencyChecksEnabled(false); // create bridge writer BridgeTestCase.configureConnectionPool(factory,host0,port,-1,true,-1,-1, null); factory.setCacheListener(new ControlListener()); factory.setDataPolicy(DataPolicy.EMPTY); // make sure empty works with client publishers createRegion(name, factory.create()); } };
public static Integer createServerCache() throws Exception { new DestroyEntryPropagationDUnitTest("temp").createCache(new Properties()); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_ACK); factory.setDataPolicy(DataPolicy.REPLICATE); factory.setCacheListener(new CertifiableTestCacheListener(getLogWriter())); RegionAttributes attrs = factory.create(); cache.createRegion(REGION_NAME, attrs); BridgeServer server = cache.addBridgeServer(); int port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET) ; server.setPort(port); server.setNotifyBySubscription(true); server.start(); return new Integer(server.getPort()); }
public static void createRegionQueue() throws Exception { new HAGIIBugDUnitTest("temp").createCache(new Properties()); HARegionQueueAttributes hattr = new HARegionQueueAttributes(); // setting expiry time for the regionqueue. hattr.setExpiryTime(12000000); RegionQueue regionqueue = HARegionQueue.getHARegionQueueInstance( regionQueueName, cache, hattr, HARegionQueue.NON_BLOCKING_HA_QUEUE, false); assertNotNull(regionqueue); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_ACK); factory.setDataPolicy(DataPolicy.REPLICATE); CacheListener regionListener = new vmListenerToPutInHARegionQueue(); factory.setCacheListener(regionListener); RegionAttributes attrs = factory.create(); cache.createRegion(REGION_NAME, attrs); }
public void run2() throws CacheException { getLonerSystem(); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.LOCAL); factory.setConcurrencyChecksEnabled(false); BridgeTestCase.configureConnectionPool(factory,host0,port,-1,true,-1,-1, null); factory.setCacheListener(new ControlListener()); factory.setDataPolicy(DataPolicy.EMPTY); factory.setSubscriptionAttributes(new SubscriptionAttributes(InterestPolicy.CACHE_CONTENT)); createRegion(name, factory.create()); } };
public void run2() throws CacheException { // recreate WAN region AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_ACK); factory.setDataPolicy(DataPolicy.REPLICATE); factory.setEnableWAN(true); getCache().getCacheTransactionManager().addListener(wanTxListener); factory.setCacheListener(wanRegionListener); getCache().createRegion( WAN_REGION_NAME, factory.create()); clearListeners(); } };
public void run2() throws CacheException { getLonerSystem(); getCache(); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.LOCAL); factory.setConcurrencyChecksEnabled(false); BridgeTestCase.configureConnectionPool(factory,host0,port,-1,true,-1,-1, null); CertifiableTestCacheListener l = new CertifiableTestCacheListener(getLogWriter()); factory.setCacheListener(l); Region rgn = createRegion(name, factory.create()); rgn.registerInterestRegex(".*", false, false); } };
public void run2() throws CacheException { getLonerSystem(); getCache(); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.LOCAL); factory.setConcurrencyChecksEnabled(false); BridgeTestCase.configureConnectionPool(factory,host0,port,-1,true,-1,-1, null); CertifiableTestCacheListener l = new CertifiableTestCacheListener(getLogWriter()); factory.setCacheListener(l); Region rgn = createRegion(name, factory.create()); rgn.registerInterestRegex(".*", false, false); } };
public void run2() throws CacheException { // recreate WAN region AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_ACK); factory.setDataPolicy(DataPolicy.REPLICATE); factory.setEnableWAN(true); getCache().getCacheTransactionManager().addListener(wanTxListener); factory.setCacheListener(wanRegionListener); getCache().createRegion( WAN_REGION_NAME, factory.create()); clearListeners(); } };
@Override public void run2() throws CacheException { getLonerSystem(); getCache(); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.LOCAL); factory.setConcurrencyChecksEnabled(false); BridgeTestCase.configureConnectionPool(factory,host0,port,-1,true,-1,-1, null); CertifiableTestCacheListener l = new CertifiableTestCacheListener(getLogWriter()); factory.setCacheListener(l); Region rgn = createRegion(name, factory.create()); rgn.registerInterestRegex(".*", false, false); } };
public void run2() throws CacheException { getLonerSystem(); getCache(); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.LOCAL); factory.setConcurrencyChecksEnabled(false); BridgeTestCase.configureConnectionPool(factory,host0,port,-1,true,-1,-1, null); CertifiableTestCacheListener l = new CertifiableTestCacheListener(getLogWriter()); factory.setCacheListener(l); factory.setDataPolicy(DataPolicy.EMPTY); factory.setSubscriptionAttributes(new SubscriptionAttributes(InterestPolicy.ALL)); Region rgn = createRegion(name, factory.create()); rgn.registerInterestRegex(".*", false, false); } };
public void run2() throws CacheException { getLonerSystem(); getCache(); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.LOCAL); factory.setConcurrencyChecksEnabled(false); BridgeTestCase.configureConnectionPool(factory,host0,port,-1,true,-1,-1, null); CertifiableTestCacheListener l = new CertifiableTestCacheListener(getLogWriter()); factory.setCacheListener(l); factory.setDataPolicy(DataPolicy.EMPTY); factory.setSubscriptionAttributes(new SubscriptionAttributes(InterestPolicy.CACHE_CONTENT)); Region rgn = createRegion(name, factory.create()); rgn.registerInterestRegex(".*", false, false); } };