public static void createCacheInVm() { new LocalDataSetDUnitTest("temp").createCache(); }
public void createCache() { try { /*Properties props = new Properties(); DistributedSystem ds = getSystem(props); assertNotNull(ds); ds.disconnect(); ds = getSystem(props);*/ cache = getCache();//CacheFactory.create(ds); assertNotNull(cache); } catch (Exception e) { fail("Failed while creating the cache", e); } }
public void testLocalDataSet() { createCacheInAllVms(); createCustomerPR(); createOrderPR(); createShipmentPR(); putInPRs(); registerFunctions(); executeFunctions(); }
public void testLocalDataSetIteration() { createCacheInAllVms(); createCustomerPR(); createOrderPR(); createShipmentPR(); putInPRs(); registerIteratorFunctionOnAll(); invokeInAllDataStores(installHook); accessor.invoke(new SerializableCallable() { public Object call() throws Exception { Integer ds2 = (Integer)dataStore2.invoke(bucketRead); Integer ds3 = (Integer)dataStore3.invoke(bucketRead); assertEquals(1, ds1+ds2+ds3);
AttributesFactory attr = new AttributesFactory(); attr.setPartitionAttributes(prAttr); assertNotNull(cache); assertNotNull(customerPR); getLogWriter().info( "Partitioned Region " + partitionedRegionName + " created Successfully :" + customerPR); assertNotNull(orderPR); getLogWriter().info( "Partitioned Region " + partitionedRegionName + " created Successfully :" + orderPR); assertNotNull(shipmentPR); getLogWriter().info( "Partitioned Region " + partitionedRegionName + " created Successfully :" + shipmentPR);
public static void executeFunction() { try { FunctionService.onRegion(customerPR).execute( "LocalDataSetFunction" + true,true,false,true).getResult(); FunctionService.onRegion(customerPR).execute( "LocalDataSetFunction" + false,true,false,false).getResult(); Set<String> filter = new HashSet<String>(); filter.add("YOYO-CUST-KEY-"+0); FunctionService.onRegion(customerPR).withFilter(filter).execute( "LocalDataSetFunction" + true,true,false,true).getResult(); FunctionService.onRegion(customerPR).withFilter(filter).execute( "LocalDataSetFunction" + false,true,false,false).getResult(); filter.clear(); for(int i=0 ; i<6 ; i++){ filter.add("YOYO-CUST-KEY-"+i); } FunctionService.onRegion(customerPR).withFilter(filter).execute( "LocalDataSetFunction" + true,true,false,true).getResult(); FunctionService.onRegion(customerPR).withFilter(filter).execute( "LocalDataSetFunction" + false,true,false,false).getResult(); } catch (Exception e) { e.printStackTrace(); fail("Test failed due to ", e); } } private void registerFunctions() {