expColl.add(new DelegationRelativeTime((long) 0, (long) 0, (long) 0,
(long) 0));
expColl.add(new DelegationRelativeTime((long) 1, (long) 1, (long) 1,
(long) 1));
if (!checker(argColl, new ConstraintAlternatives(expColl))) {
throw new TestException(
"" + " test failed");
}
} catch (Exception e) {
logger.log(Level.FINE,
"Exception has been thrown while creating constraint"
+ " objects: " + e);
throw new TestException(
"" + " test failed");
}
// TestCase #21
logger.log(Level.FINE,
"\n\t+++++ TestCase #21:: "
+ "Argument passed to ConstraintAlternatives.create() methods"
+ " is null");
{
if (!checkException((Collection) null,
java.lang.NullPointerException.class)) {
throw new TestException(
"" + " test failed");
}
if (!checkException((InvocationConstraint[]) null,
java.lang.NullPointerException.class)) {
throw new TestException(
"" + " test failed");
}
}
// TestCase #22
logger.log(Level.FINE,
"\n\t+++++ TestCase #22:: "
+ "Argument passed to ConstraintAlternatives.create() methods"
+ " is non-null, but contains null element");
{
Collection argColl = new ArrayList();
argColl.add(ClientAuthentication.YES);
argColl.add(null);
if (!checkException(argColl,
java.lang.NullPointerException.class)) {
throw new TestException(
"" + " test failed");
}
InvocationConstraint[] argArray = (InvocationConstraint[])
argColl.toArray(new InvocationConstraint[0]);
if (!checkException(argArray,
java.lang.NullPointerException.class)) {
throw new TestException(
"" + " test failed");
}
}
// TestCase #23
logger.log(Level.FINE,
"\n\t+++++ TestCase #23:: "
+ "Argument passed to ConstraintAlternatives.create() methods"
+ " is empty");
{
if (!checkException(Collections.EMPTY_LIST,
java.lang.IllegalArgumentException.class)) {
throw new TestException(
"" + " test failed");
}
if (!checkException(new InvocationConstraint[0],
java.lang.IllegalArgumentException.class)) {
throw new TestException(
"" + " test failed");
}
}
// TestCase #24
logger.log(Level.FINE,
"\n\t+++++ TestCase #24:: "
+ "Argument passed to ConstraintAlternatives.create() methods"
+ " contain element that is an instance of"
+ " ConstraintAlternatives");
try {
// Temporary Collection
Collection tmpColl = new ArrayList();
tmpColl.add(ClientAuthentication.YES);
tmpColl.add(Confidentiality.YES);
// Arguments
Collection argColl = new ArrayList();
argColl.add(ClientAuthentication.YES);
argColl.add(Confidentiality.YES);
argColl.add(new ConstraintAlternatives(tmpColl));
InvocationConstraint[] argArray = (InvocationConstraint[])
argColl.toArray(new InvocationConstraint[0]);
if (!checkException(argColl,
java.lang.IllegalArgumentException.class)) {