events[i] = myGen.generateEvent(evtReg.getID(), 3);
}
myTplCount += NUM_EVENTS;
RemoteEvent[] bogus = {
new RemoteEvent(myGen, 9999, 9999, null),
new RemoteEvent(myGen2, 1234, 1, null),
};
// Collect events and verify
logger.log(Level.INFO, "Getting events");
getCollectedRemoteEvents(tpl, mr, myTplCount, MAX_WAIT);
logger.log(Level.INFO, "Verifying event delivery");
assertCount(tpl, myTplCount);
logger.log(Level.INFO, "Verifying events");
assertEvents(tpl, events);
// Generate some more events
for (i = 0; i < NUM_EVENTS; i++) {
events[i] = myGen.generateEvent(evtReg.getID(), 3);
}
myTplCount += NUM_EVENTS;
logger.log(Level.INFO, "Getting more events");
getCollectedRemoteEvents(tpl, mr, myTplCount, MAX_WAIT);
logger.log(Level.INFO, "Verifying event delivery");
assertCount(tpl, myTplCount);
logger.log(Level.INFO, "Verifying events");
assertEvents(tpl, events);
// Generate some more events from second generator
for (i = 0; i < NUM_EVENTS; i++) {
events[i] = myGen2.generateEvent(evtReg2.getID(), 3);
}
myTplCount += NUM_EVENTS;
logger.log(Level.INFO, "Getting more events");
getCollectedRemoteEvents(tpl, mr, myTplCount, MAX_WAIT);
logger.log(Level.INFO, "Verifying event delivery");
assertCount(tpl, myTplCount);
logger.log(Level.INFO, "Verifying events");
assertEvents(tpl, events);
// Generate some more events from each generator
logger.log(Level.INFO, "Generating more events");
for (i = 0; i < NUM_EVENTS; i++) {
events[i] = myGen.generateEvent(evtReg.getID(), 3);
}
RemoteEvent[] events2 = new RemoteEvent[NUM_EVENTS];
for (i = 0; i < NUM_EVENTS; i++) {
events2[i] = myGen2.generateEvent(evtReg2.getID(), 3);
}
myTplCount += NUM_EVENTS*2;
// Collect events and verify
logger.log(Level.INFO, "Getting more events");
getCollectedRemoteEvents(tpl, mr, myTplCount, MAX_WAIT);
logger.log(Level.INFO, "Verifying event delivery");
assertCount(tpl, myTplCount);
logger.log(Level.INFO, "Verifying events");
assertEvents(tpl, events);
assertEvents(tpl, events2);
logger.log(Level.INFO, "Cancelling registration lease");
mrl.cancel();
logger.log(Level.INFO, "Generating another event");
RemoteEvent evt;
try {
evt = myGen.generateEvent(evtReg.getID(), 3);
throw new TestException("Successfully sent an event to "
+ "an expired registration");
} catch (ServerException e) {