}
// create all required RemoteListeners
for (int i = 0; i < NUMBER_OF_RENEWAL_SETS; ++i) {
logger.log(Level.FINE, "Creating remote listener #" + i);
listener[i] = new RememberingRemoteListener(getExporter());
}
// register first listener for ExpirationWarningEvents
EventRegistration evReg =
renewalSet[0].setExpirationWarningListener(listener[0], 1,
null);
evReg = prepareRegistration(evReg);
/* ASSERTION #1
The set lease and the registration lease are the same. */
Lease lease01 = prepareLease(renewalSet[0].getRenewalSetLease());
Lease lease02 = evReg.getLease();
if (lease01.equals(lease02) == false) {
String message = "The renewal set lease and the warning " +
"event registration lease are not the same.";
throw new TestException(message);
}
// register for RenewalFailureEvents
evReg = renewalSet[0].setRenewalFailureListener(listener[0], null);
evReg = prepareRegistration(evReg);
/* ASSERTION #1 cont'd
The set lease and the registration lease are the same. */
Lease lease03 = evReg.getLease();
if (lease01.equals(lease03) == false) {
String message = "The renewal set lease and the failure" +
"event registration lease are not the same.";
throw new TestException(message);
}
logger.log(Level.FINE, "Assertion #1 passed.");
// register all twenty remote listeners
for (int i = 0; i < NUMBER_OF_RENEWAL_SETS; ++i) {
evReg =
renewalSet[i].setExpirationWarningListener(listener[i], 1,
null);
evReg = prepareRegistration(evReg);
warnReg[i] = evReg;
evReg =
renewalSet[i].setRenewalFailureListener(listener[i], null);
evReg = prepareRegistration(evReg);
failReg[i] = evReg;
}
/* ASSERTION #2
The registrations are unique and event ids are valid across
all active registrations. */
for (int i = 0; i < NUMBER_OF_RENEWAL_SETS; ++i) {
if (rstUtil.isValidExpWarnEventReg(warnReg[i],
renewalSet[i]) == false) {
String message = "Warning event registration # " + i +
" is invalid." + rstUtil.getFailureReason();
throw new TestException(message);
}
if (rstUtil.isValidRenewFailEventReg(failReg[i],
renewalSet[i]) == false) {
String message = "Failure event registration # " + i +
" is invalid." + rstUtil.getFailureReason();
throw new TestException(message);
}
// create yet another RemoteEventListener
Exporter exp = null;
RememberingRemoteListener newListener =
new RememberingRemoteListener(getExporter());
evReg =
renewalSet[0].setExpirationWarningListener(newListener,
1, null);
evReg = prepareRegistration(evReg);