private static void generateEvents() throws Exception {
  String regionName=Region.SEPARATOR + REGION_NAME;
  Region region=cache.getRegion(regionName);
  for (int i=0; i < TOTAL_PUTS; i++) {
    region.put("key" + i,"val-" + i);
  }
  Thread.sleep(DISPATCHER_SLOWSTART_TIME + 1000);
  for (int i=0; i < 25; i++) {
    region.put(LAST_KEY,"LAST_VALUE");
  }
}

private static void generateEvents ( ) throws Exception { String regionName = Region . SEPARATOR + REGION_NAME ; Region region = cache . getRegion ( regionName ) ; for ( int i = 0 ; i < TOTAL_PUTS ; i ++ ) { region . put ( "key" + i , "val-" + i ) ; } Thread . sleep ( DISPATCHER_SLOWSTART_TIME + 1000 ) ; for ( int i = 0 ; i < 25 ; i ++ ) { region . put ( LAST_KEY , "LAST_VALUE" ) ; } }
first generates some events , then waits for the time equal to that of delayed start of the dispatcher and then does put on the last key for few iterations . the idea is to let the events added , before waiting , to expire before the dispatcher to pick them up and then do a put on a last_key couple of times so that atleast one of these is dispatched to client and when client recieves this in the listener , the test is notified to proceed for validation .
