DURATION1); // Lease duration
Lease tgl = evtReg.getLease();
checkLease(tgl, DURATION1);
// Create "listener" to collect events for this test
TestPullListener tpl = TestUtils.createPullListener(manager);
int eventCount = 0;
// Generate some events
logger.log(Level.INFO, "Generating " + NUM_EVENTS + " events");
RemoteEvent[] events = new RemoteEvent[NUM_EVENTS];
for (i = 0; i < NUM_EVENTS; i++) {
events[i] = myGen.generateEvent(evtReg.getID(), 3);
}
RemoteEvent[] bogus = {
new RemoteEvent(myGen, 9999, 9999, null),
new RemoteEvent(myGen, 5678, 1234, null),
};
logger.log(Level.INFO, "Wating for event delivery");
eventCount = NUM_EVENTS;
getCollectedRemoteEvents(tpl, mr, eventCount, MAX_WAIT);
logger.log(Level.INFO, "Verifying event delivery count of " + eventCount);
assertCount(tpl, eventCount);
logger.log(Level.INFO, "Verifying events ");
assertEvents(tpl, events);
if(tpl.verifyEvents(bogus)) {
throw new TestException("Successfully verified bogus events");
}
// Get iterator handle before cancelling associated reg
RemoteEventIterator rei = mr.getRemoteEvents();