logger.log(Level.FINE,
"\n\t+++++ TestCase #19:: "
+ "Only duplicate DelegationRelativeTime constraints exist");
{
Collection argColl = new ArrayList();
DelegationRelativeTime ic = new DelegationRelativeTime((long) 0,
(long) 0, (long) 0, (long) 0);
argColl.add(ic);
argColl.add(ic);
if (!checker(argColl, ic)) {
throw new TestException(
"" + " test failed");
}
}
// TestCase #20
logger.log(Level.FINE,
"\n\t+++++ TestCase #20:: "
+ "There are several duplicate and non-duplicate constraints");
try {
// Argument for ConstraintAlternatives.create() methods
Collection argColl = new ArrayList();
argColl.add(ClientAuthentication.YES);
argColl.add(ClientAuthentication.YES);
argColl.add(ClientAuthentication.NO);
argColl.add(Confidentiality.YES);
argColl.add(Confidentiality.YES);
argColl.add(Confidentiality.NO);
argColl.add(Delegation.YES);
argColl.add(Delegation.YES);
argColl.add(Delegation.NO);
argColl.add(Integrity.YES);
argColl.add(Integrity.YES);
argColl.add(Integrity.NO);
argColl.add(ServerAuthentication.YES);
argColl.add(ServerAuthentication.YES);
argColl.add(ServerAuthentication.NO);
argColl.add(new ClientMaxPrincipal(new
KerberosPrincipal("duke@FOO.COM")));
argColl.add(new ClientMaxPrincipal(new
KerberosPrincipal("duke@FOO.COM")));
argColl.add(new ClientMaxPrincipal(new
X500Principal(
"CN=Duke, OU=JavaSoft, O=Sun Microsystems, C=US")));
argColl.add(new ClientMaxPrincipalType(KerberosPrincipal.class));
argColl.add(new ClientMaxPrincipalType(KerberosPrincipal.class));
argColl.add(new ClientMaxPrincipalType(X500Principal.class));
argColl.add(new ClientMinPrincipal(new
KerberosPrincipal("duke@FOO.COM")));
argColl.add(new ClientMinPrincipal(new
KerberosPrincipal("duke@FOO.COM")));
argColl.add(new ClientMinPrincipal(new
X500Principal(
"CN=Duke, OU=JavaSoft, O=Sun Microsystems, C=US")));
argColl.add(new ClientMinPrincipalType(KerberosPrincipal.class));
argColl.add(new ClientMinPrincipalType(KerberosPrincipal.class));
argColl.add(new ClientMinPrincipalType(X500Principal.class));
argColl.add(new ServerMinPrincipal(new
KerberosPrincipal("duke@FOO.COM")));
argColl.add(new ServerMinPrincipal(new
KerberosPrincipal("duke@FOO.COM")));
argColl.add(new ServerMinPrincipal(new
X500Principal(
"CN=Duke, OU=JavaSoft, O=Sun Microsystems, C=US")));
argColl.add(new ConnectionAbsoluteTime((long) 0));
argColl.add(new ConnectionAbsoluteTime((long) 0));
argColl.add(new ConnectionAbsoluteTime((long) 1));
argColl.add(new ConnectionRelativeTime((long) 0));
argColl.add(new ConnectionRelativeTime((long) 0));
argColl.add(new ConnectionRelativeTime((long) 1));
argColl.add(new DelegationAbsoluteTime((long) 0, (long) 0, (long) 0,
(long) 0));
argColl.add(new DelegationAbsoluteTime((long) 0, (long) 0, (long) 0,
(long) 0));
argColl.add(new DelegationAbsoluteTime((long) 1, (long) 1, (long) 1,
(long) 1));
argColl.add(new DelegationRelativeTime((long) 0, (long) 0, (long) 0,
(long) 0));
argColl.add(new DelegationRelativeTime((long) 0, (long) 0, (long) 0,
(long) 0));
argColl.add(new DelegationRelativeTime((long) 1, (long) 1, (long) 1,
(long) 1));
// Expected result of ConstraintAlternatives.create() methods
Collection expColl = new ArrayList();
expColl.add(ClientAuthentication.YES);
expColl.add(ClientAuthentication.NO);
expColl.add(Confidentiality.YES);
expColl.add(Confidentiality.NO);
expColl.add(Delegation.YES);
expColl.add(Delegation.NO);
expColl.add(Integrity.YES);
expColl.add(Integrity.NO);
expColl.add(ServerAuthentication.YES);
expColl.add(ServerAuthentication.NO);
expColl.add(new ClientMaxPrincipal(new
KerberosPrincipal("duke@FOO.COM")));
expColl.add(new ClientMaxPrincipal(new
X500Principal(
"CN=Duke, OU=JavaSoft, O=Sun Microsystems, C=US")));
expColl.add(new ClientMaxPrincipalType(KerberosPrincipal.class));
expColl.add(new ClientMaxPrincipalType(X500Principal.class));
expColl.add(new ClientMinPrincipal(new
KerberosPrincipal("duke@FOO.COM")));
expColl.add(new ClientMinPrincipal(new
X500Principal(
"CN=Duke, OU=JavaSoft, O=Sun Microsystems, C=US")));
expColl.add(new ClientMinPrincipalType(KerberosPrincipal.class));
expColl.add(new ClientMinPrincipalType(X500Principal.class));
expColl.add(new ServerMinPrincipal(new
KerberosPrincipal("duke@FOO.COM")));
expColl.add(new ServerMinPrincipal(new
X500Principal(
"CN=Duke, OU=JavaSoft, O=Sun Microsystems, C=US")));
expColl.add(new ConnectionAbsoluteTime((long) 0));
expColl.add(new ConnectionAbsoluteTime((long) 1));
expColl.add(new ConnectionRelativeTime((long) 0));
expColl.add(new ConnectionRelativeTime((long) 1));
expColl.add(new DelegationAbsoluteTime((long) 0, (long) 0, (long) 0,
(long) 0));
expColl.add(new DelegationAbsoluteTime((long) 1, (long) 1, (long) 1,
(long) 1));
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");