コード例 #1
0
 /** function to create client cache * */
 public static void createClientCache1(String host, Integer port1) throws Exception {
   PORT1 = port1.intValue();
   Properties props = new Properties();
   props.setProperty("mcast-port", "0");
   props.setProperty("locators", "");
   new PutAllDUnitTest("temp").createCache(props);
   props.setProperty("retryAttempts", "2");
   props.setProperty("endpoints", "ep1=" + host + ":" + PORT1);
   props.setProperty("redundancyLevel", "-1");
   props.setProperty("establishCallbackConnection", "true");
   props.setProperty("LBPolicy", "Sticky");
   props.setProperty("readTimeout", "2000");
   props.setProperty("socketBufferSize", "1000");
   props.setProperty("retryInterval", "250");
   props.setProperty("connectionsPerServer", "2");
   AttributesFactory factory = new AttributesFactory();
   factory.setScope(Scope.DISTRIBUTED_ACK);
   PoolImpl p =
       (PoolImpl)
           ClientServerTestCase.configureConnectionPool(
               factory, host, PORT1, -1, true, -1, 2, null);
   CacheListener clientListener = new HAEventIdPropagationListenerForClient1();
   factory.setCacheListener(clientListener);
   RegionAttributes attrs = factory.create();
   cache.createRegion(REGION_NAME, attrs);
   Region region = cache.getRegion(Region.SEPARATOR + REGION_NAME);
   assertNotNull(region);
   region.registerInterest("ALL_KEYS", InterestResultPolicy.NONE);
   pool = p;
 }
 @Override
 public void setUp() throws Exception {
   super.setUp();
   invokeInEveryVM(this.setHeapMemoryMonitorTestMode);
   addExpectedException("above heap critical threshold");
   addExpectedException("below heap critical threshold");
 }
 @Override
 public void tearDown2() throws Exception {
   invokeInEveryVM(resetQueryMonitor);
   invokeInEveryVM(resetResourceManager);
   super.tearDown2();
 }