public static void getAll() { Region region = cache.getRegion(PartitionedRegionName); assertNotNull(region); final List testKeysList = new ArrayList(); for (int i = (totalNumBuckets.intValue() * 3); i > 0; i--) { testKeysList.add("execKey-" + i); } DistributedSystem.setThreadsSocketPolicy(false); try { int j = 0; Map origVals = new HashMap(); for (Iterator i = testKeysList.iterator(); i.hasNext();) { Integer val = new Integer(j++); Object key = i.next(); origVals.put(key, val); region.put(key, val); } Map resultMap = region.getAll(testKeysList); assertTrue(resultMap.equals(origVals)); pause(2000); Map secondResultMap = region.getAll(testKeysList); assertTrue(secondResultMap.equals(origVals)); } catch (Exception e) { fail("Test failed after the put operation", e); } }
public static void putAll() { Region region = cache.getRegion(PartitionedRegionName); assertNotNull(region); final List testKeysList = new ArrayList(); for (int i = (totalNumBuckets.intValue() * 3); i > 0; i--) { testKeysList.add("execKey-" + i); } DistributedSystem.setThreadsSocketPolicy(false); try { int j = 0; Map origVals = new HashMap(); for (Iterator i = testKeysList.iterator(); i.hasNext();) { Integer val = new Integer(j++); Object key = i.next(); origVals.put(key, val); region.put(key, val); } Map resultMap = region.getAll(testKeysList); assertTrue(resultMap.equals(origVals)); pause(2000); Map secondResultMap = region.getAll(testKeysList); assertTrue(secondResultMap.equals(origVals)); } catch (Exception e) { fail("Test failed after the put operation", e); } }
for (Iterator i = l2.iterator(); i.hasNext();) { ArrayList subL = (ArrayList)i.next(); assertTrue(subL.size() > 0); for (Iterator subI = subL.iterator(); subI.hasNext();) { assertTrue(foundVals.add(subI.next()));
for (Iterator i = l2.iterator(); i.hasNext();) { ArrayList subL = (ArrayList)(i.next()); assertTrue(subL.size() > 0); for (Iterator subI = subL.iterator(); subI.hasNext();) { assertTrue(foundVals.add(subI.next()));
public static void serverSingleKeyExecution_FunctionInvocationTargetException() { Region region = cache.getRegion(PartitionedRegionName); assertNotNull(region); final String testKey = "execKey"; final Set testKeysSet = new HashSet(); testKeysSet.add(testKey); DistributedSystem.setThreadsSocketPolicy(false); Function function = new TestFunction(true, TestFunction.TEST_FUNCTION_REEXECUTE_EXCEPTION); FunctionService.registerFunction(function); Execution dataSet = FunctionService.onRegion(region); region.put(testKey, new Integer(1)); try { ResultCollector rs = execute(dataSet, testKeysSet, Boolean.TRUE, function, false); ArrayList list = (ArrayList)rs.getResult(); assertTrue(((Integer)list.get(0)) >= 5); } catch (Exception ex) { ex.printStackTrace(); fail("This is not expected Exception", ex); } }
assertTrue(e instanceof EOFException || e instanceof SocketException || e instanceof SocketTimeoutException || e instanceof ServerException || e instanceof IOException
assertTrue(expected.getMessage().contains( "No target node found for KEY = " + testKey) || expected.getMessage()
expected.printStackTrace(); getLogWriter().info("Exception : " + expected.getMessage()); assertTrue(expected.getMessage().startsWith( (LocalizedStrings.ExecuteFunction_CANNOT_0_RESULTS_HASRESULT_FALSE .toLocalizedString("return any"))));
assertTrue(expected.getMessage().contains( "No target node found for KEY = " + testKey) || expected.getMessage()