// IllegalArgumentException should be thrown with arg of -99
logger.log(Level.FINE, "Creating the lease renewal set with " +
"-99 duration.");
try {
LeaseRenewalService lrs = getLRS();
LeaseRenewalSet set = lrs.createLeaseRenewalSet(-99);
set = prepareSet(set);
String message = "IllegalArgumentException expected from\n";
message += "createLeaseRenewalSet(-99)";
throw new TestException(message);
} catch (IllegalArgumentException ex) {
// we passed so just continue
logger.log(Level.FINE, "Caught IllegalArgumentException as " +
"expected.");
}
// No exception thrown for Lease.ANY argument
logger.log(Level.FINE, "Creating the lease renewal set with " +
"Lease.ANY duration.");
try {
LeaseRenewalService lrs = getLRS();
LeaseRenewalSet set = lrs.createLeaseRenewalSet(Lease.ANY);
set = prepareSet(set);
// we passed so just continue
logger.log(Level.FINE, "Caught no exceptions as expected.");
} catch (IllegalArgumentException ex) {
String message = "IllegalArgumentException caught from\n";
message += "createLeaseRenewalSet(Lease.ANY)";
throw new TestException(message, ex);
}
// No exception thrown for Lease.FOREVER argument
logger.log(Level.FINE, "Creating the lease renewal set with " +
"Lease.FOREVER duration.");
try {
LeaseRenewalService lrs = getLRS();
LeaseRenewalSet set = lrs.createLeaseRenewalSet(Lease.FOREVER);
set = prepareSet(set);
// we passed so just continue
logger.log(Level.FINE, "Caught no exceptions as expected.");
} catch (IllegalArgumentException ex) {
String message = "IllegalArgumentException caught from\n";
message += "createLeaseRenewalSet(Lease.FOREVER)";
throw new TestException(message, ex);
}
// No exception thrown for argument value of 0
logger.log(Level.FINE, "Creating the lease renewal set with " +
"0 duration.");
try {
LeaseRenewalService lrs = getLRS();
LeaseRenewalSet set = lrs.createLeaseRenewalSet(0);
set = prepareSet(set);
// we passed so just continue
logger.log(Level.FINE, "Caught no exceptions as expected.");
} catch (IllegalArgumentException ex) {
String message = "IllegalArgumentException caught from\n";
message += "createLeaseRenewalSet(0)";
throw new TestException(message, ex);
}
// No exception thrown for argument value of 1
logger.log(Level.FINE, "Creating the lease renewal set with " +
"1 duration.");
try {
LeaseRenewalService lrs = getLRS();
LeaseRenewalSet set = lrs.createLeaseRenewalSet(1);
set = prepareSet(set);
// we passed so just continue
logger.log(Level.FINE, "Caught no exceptions as expected.");
} catch (IllegalArgumentException ex) {
String message = "IllegalArgumentException caught from\n";