new InvocationConstraint[] {
new ClientMaxPrincipal(
new Principal[] {cps[0], cps[1], cps[2]})},
new InvocationConstraint[] {
Integrity.NO, // will be ignored
new ClientMinPrincipal(cps[1]),
Delegation.YES}),
emptyConstraints, /* clientUnfulfilledConstraints */
null,
emptyConstraints, /* serverUnfulfilledConstraints */
new KerberosPrincipal[] {cps[1]}, null, false, true),
new EndpointTest( // test preference, delegation not necessary
"PreferenceConstraintTestDelegationNotPreferred",
new InvocationConstraints(
new InvocationConstraint[] {
new ClientMaxPrincipal(
new Principal[] {cps[0], cps[1], cps[2]})},
new InvocationConstraint[] {
new ClientMinPrincipal(cps[2]), // not necessary
Integrity.YES,
Confidentiality.YES}), // preferred, but not necessary
integrityPreferredConstraints, /* clientUnfulfilledCs */
null,
emptyConstraints, /* serverUnfulfilledConstraints */
new KerberosPrincipal[] {cps[2]}, null, true, false),
/* -- permission tests -- */
new EndpointTest(
"ClientPermissionNoSocketPermTest",
new Permission[0], /* clientPerms = default + auth */
false,
null, /* serverPerms, default to the right set */
true,
defaultPermsNoSocketPerm),
new EndpointTest(
"ServerPermissionNoSocketPermTest",
null, /* clientPerms, default to the right set */
true,
new Permission[0], /* serverPerms = default + auth */
false,
defaultPermsNoSocketPerm),
new EndpointTest(
"ClientPermissionNoAuthPermTest",
defaultPermsWithSocketPerm, /* clientPerms */
false,
null, /* serverPerms, default to the right set */
true,
null),
new EndpointTest(
"ServerPermissionNoAuthPermtest",
null, /* clientPerms, default to the right set */
true,
defaultPermsWithSocketPerm, /* serverPerms */
false,
null),
/* -- connection time constraint tests -- */
new EndpointTest(
"ConnectionAbsoluteTimeConstraintClientPassTest",
new InvocationConstraints(
new InvocationConstraint[] {
new ConnectionAbsoluteTime(
System.currentTimeMillis() + 1000 * 1800)},
null),
emptyConstraints, /* clientUnfulfilledConstraints */
null,
emptyConstraints, /* serverUnfulfilledConstraints */
null, null, false, false),
new EndpointTest(
"ConnectionAbsoluteTimeConstraintAlternativesClientPassTest",
new InvocationConstraints(
new ConstraintAlternatives(
new InvocationConstraint[] {
new ConnectionAbsoluteTime(
System.currentTimeMillis() + 1000 * 1800),
new ConnectionAbsoluteTime(3)}),
null),
emptyConstraints, /* clientUnfulfilledConstraints */
null,
emptyConstraints, /* serverUnfulfilledConstraints */
null, null, false, false),
new EndpointTest(
"ConnectionAbsoluteTimeConstraintClientFailTest1",
new InvocationConstraints(
new InvocationConstraint[] {
new ConnectionAbsoluteTime(3)},
null),
null, // clientUnfulfilledConstraints, null indicates failure
null,
emptyConstraints, /* serverUnfulfilledConstraints */
null, null, false, false),
new EndpointTest(
"ConnectionAbsoluteTimeConstraintClientFailTest2",
new InvocationConstraints(
new InvocationConstraint[] {
new ConnectionAbsoluteTime(
System.currentTimeMillis() + 1000 * 1800),
new ConnectionAbsoluteTime(3)},
null),
null, // clientUnfulfilledConstraints, null indicates failure
null,
emptyConstraints, /* serverUnfulfilledConstraints */
null, null, false, false),
new EndpointTest(
"ConnectionAbsoluteTimeConstraintServerPassTest1",
null,
emptyConstraints, /* clientUnfulfilledConstraints */
new InvocationConstraints(
new InvocationConstraint[] {
new ConnectionAbsoluteTime(3)},
null),
emptyConstraints, /* serverUnfulfilledConstraints */
null, null, false, false),
new EndpointTest(
"ConnectionAbsoluteTimeConstraintServerPassTest2",
null,
emptyConstraints, /* clientUnfulfilledConstraints */
new InvocationConstraints(
new InvocationConstraint[] {
new ConnectionAbsoluteTime(
System.currentTimeMillis() + 1000 * 1800)},
null),
emptyConstraints, /* serverUnfulfilledConstraints */
null, null, false, false),
new EndpointTest(
"ConnectionRelativeTimeConstraintClientPassTest",
new InvocationConstraints(
new InvocationConstraint[] {
new ConnectionRelativeTime(1000 * 1800)},
null),
emptyConstraints, /* clientUnfulfilledConstraints */
null,
emptyConstraints, /* serverUnfulfilledConstraints */
null, null, false, false),
new EndpointTest(
"ConnectionRelativeTimeConstraintServerFailTest",
null,
emptyConstraints, /* clientUnfulfilledConstraints */
new InvocationConstraints(
new InvocationConstraint[] {
new ConnectionRelativeTime(1000 * 1800)},
null),
emptyConstraints, /* clientUnfulfilledConstraints */
null, null, false, false),
/* -- authentication tests -- */
new EndpointTest(
"AuthenticatonYESTest",
new InvocationConstraints(
new InvocationConstraint[] {ClientAuthentication.YES},
null),
emptyConstraints, /* clientUnfulfilledCs */
new InvocationConstraints(
new InvocationConstraint[] {ServerAuthentication.YES},
null),
emptyConstraints, /* serverUnfulfilledConstraints */
null, null, false, false),
new EndpointTest(
"AuthenticationNOTest1",
new InvocationConstraints(
new InvocationConstraint[] {ClientAuthentication.NO},
null),
null, // clientUnfulfilledConstraints, null indicates failure
null,
emptyConstraints, /* serverUnfulfilledConstraints */
null, null, false, false),
new EndpointTest(
"AuthenticationNOTest2",
null,
emptyConstraints, /* clientUnfulfilledConstraints */
new InvocationConstraints(
new InvocationConstraint[] {ServerAuthentication.NO},
null),
null, // serverUnfulfilledConstraints, null indicates failure
null, null, false, false),
/* -- unfulfilled constraints tests -- */
new EndpointTest(
"UnfulfilledConstraintClientIntegrityRequiredTest",
new InvocationConstraints(
new InvocationConstraint[] {
ClientAuthentication.YES, Integrity.YES},
null),
integrityRequiredConstraints, /* clientUnfulfilledCs */
new InvocationConstraints(
new InvocationConstraint[] {ServerAuthentication.YES},
null),
emptyConstraints, /* serverUnfulfilledConstraints */
null, null, false, false),
new EndpointTest(
"UnfulfilledConstraintClientIntegrityPreferredTest",
new InvocationConstraints(
null, new InvocationConstraint[] {Integrity.YES}),
integrityPreferredConstraints, /* clientUnfulfilledCs */
new InvocationConstraints(
new InvocationConstraint[] {ServerAuthentication.YES},
null),
emptyConstraints, /* serverUnfulfilledConstraints */
null, null, false, false),
new EndpointTest(
"UnfulfilledConstraintServerIntegrityRequiredTest",
new InvocationConstraints(
new InvocationConstraint[] {ClientAuthentication.YES},
null),
emptyConstraints, /* serverUnfulfilledConstraints */
new InvocationConstraints(
new InvocationConstraint[] {Integrity.YES},
null),
integrityRequiredConstraints, /* clientUnfulfilledCs */
null, null, false, false),
new EndpointTest(
"UnfulfilledConstraintServerIntegrityPreferredTest",
new InvocationConstraints(
new InvocationConstraint[] {ClientAuthentication.YES},
null),
emptyConstraints, /* serverUnfulfilledConstraints */
new InvocationConstraints(
null, new InvocationConstraint[] {Integrity.YES}),
integrityPreferredConstraints, /* clientUnfulfilledCs */
null, null, false, false),
/* -- principal constraint tests -- */
new EndpointTest(
"ClientPrincipalConstraintValidMinMaxTest",
new InvocationConstraints(
new InvocationConstraint[] {
new ClientMinPrincipal(cps[1]),
new ClientMaxPrincipal(
new Principal[] {cps[1], cps[2], cps[3]})},
null),
emptyConstraints, /* clientUnfulfilledConstraints */
null,
emptyConstraints, /* serverUnfulfilledConstraints */
new KerberosPrincipal[] {cps[1]}, null, false, false),
new EndpointTest(
"ClientPrincipalConstraintInvalidMinMaxTest",
new InvocationConstraints(
new InvocationConstraint[] {
new ClientMinPrincipal(cps[2]),
new ClientMaxPrincipal(
new Principal[] {cps[1], cps[3]})},
null),
null, // clientUnfulfilledConstraints, null indicates failure
null,
emptyConstraints, /* serverUnfulfilledConstraints */
new KerberosPrincipal[] {cps[2]}, null, false, false),
new EndpointTest(
"ClientPrincipalConstraintNonKerberosPrincipalTest",
new InvocationConstraints(
new InvocationConstraint[] {
new ClientMinPrincipal(
new TestPrincipal("CPCT3testPrincipal"))},
null),
null, // clientUnfulfilledConstraints, null indicates failure
null,
emptyConstraints, /* serverUnfulfilledConstraints */
new KerberosPrincipal[] {cps[2]}, null, false, false),
new EndpointTest(
"ServerPrincipalConstraintValidServerMinTest",
null,
emptyConstraints, /* clientUnfulfilledConstraints */
new InvocationConstraints(
new InvocationConstraint[] {
new ServerMinPrincipal(defaultServerPrincipal)},
null),
emptyConstraints, /* serverUnfulfilledConstraints */
null, null, false, false),
new EndpointTest(
"ServerPrincipalConstraintInvalidServerMinTest",
null,
emptyConstraints, /* clientUnfulfilledConstraints */
new InvocationConstraints(
new InvocationConstraint[] {
new ServerMinPrincipal(sps[0])},
null),
null, // serverUnfulfilledConstraints, null indicates failure
null, null, false, false),
new EndpointTest(
"ServerPrincipalConstraintNonKerberosServerMinTest",
null,
emptyConstraints, /* clientUnfulfilledConstraints */
new InvocationConstraints(
new InvocationConstraint[] {
new ClientMinPrincipal(
new TestPrincipal("SPCT3testPrincipal"))},
null),
null, // serverUnfulfilledConstraints, null indicates failure
null, null, false, false),
new EndpointTest(
"ClientMaxPrincipalConstraintClientSideTest",
new InvocationConstraints(
new InvocationConstraint[] {
new ClientMaxPrincipal(
new Principal[] {cps[1], cps[2], cps[3]}),
new ClientMaxPrincipal(
new Principal[] {cps[1], cps[2]}),
new ClientMaxPrincipal(cps[3])},
null),
null, // clientUnfulfilledConstraints, null indicates failure
null,
emptyConstraints, /* serverUnfulfilledConstraints */
null, null, false, false),
new EndpointTest(
"ClientMaxPrincipalConstraintServerSideTest",
null,
emptyConstraints, /* clientUnfulfilledConstraints */
new InvocationConstraints(
new InvocationConstraint[] {
new ClientMaxPrincipal(
new Principal[] {cps[1], cps[2], cps[3]}),
new ClientMaxPrincipal(
new Principal[] {cps[1], cps[3]}),
new ClientMaxPrincipal(cps[2])},
null),
null, // serverUnfulfilledConstraints, null indicates failure
null, null, false, false),
/* -- integrity tests -- */
new EndpointTest(
"IntegrityYESRequiredTest",
new InvocationConstraints(
new InvocationConstraint[] {
new ClientMinPrincipal(cps[1]),
new ClientMaxPrincipal(
new Principal[] {cps[0], cps[1], cps[2]}),
Integrity.YES},
null),
integrityRequiredConstraints, /* clientUnfulfilledConstrain */
new InvocationConstraints(
new InvocationConstraint[] {
new ClientMinPrincipal(cps[1]),
new ClientMaxPrincipal(
new Principal[] {cps[0], cps[1]}),
new ServerMinPrincipal(defaultServerPrincipal),
Integrity.YES},
null),
integrityRequiredConstraints, /* serverUnfulfilledConstrain */
new KerberosPrincipal[] {cps[1]},
new KerberosPrincipal[] {defaultServerPrincipal},
false, false),
new EndpointTest(
"IntegrityYESPreferredTest",
new InvocationConstraints(
null,
new InvocationConstraint[] {
new ClientMinPrincipal(cps[1]),
new ClientMaxPrincipal(
new Principal[] {cps[0], cps[1], cps[2]}),
Integrity.YES}),
integrityPreferredConstraints, /* clientUnfulfilledConstrain */
new InvocationConstraints(
null,
new InvocationConstraint[] {
new ClientMinPrincipal(cps[1]),
new ClientMaxPrincipal(
new Principal[] {cps[0], cps[1]}),
new ServerMinPrincipal(defaultServerPrincipal),
Integrity.YES}),
integrityPreferredConstraints, /* serverUnfulfilledConstrain */
new KerberosPrincipal[] {cps[1]},
new KerberosPrincipal[] {defaultServerPrincipal},
false, false),
new EndpointTest(
"ClientIntegrityNOTest",
new InvocationConstraints(
new InvocationConstraint[] {
new ClientMinPrincipal(cps[1]),
new ClientMaxPrincipal(
new Principal[] {cps[0], cps[1], cps[2]}),
Integrity.NO},
null),
null, // clientUnfulfilledConstraints, null indicates failure
null,
emptyConstraints, /* serverUnfulfilledConstraints */
new KerberosPrincipal[] {cps[1]}, null, false, false),
new EndpointTest(
"ServerIntegrityNOTest",
new InvocationConstraints(
new InvocationConstraint[] {
new ClientMinPrincipal(cps[1])}, null),
emptyConstraints, /* clientUnfulfilledConstraints */
new InvocationConstraints(
new InvocationConstraint[] {
new ClientMinPrincipal(cps[1]),
new ClientMaxPrincipal(
new Principal[] {cps[0], cps[1]}),
new ServerMinPrincipal(defaultServerPrincipal),
Integrity.NO},
null),
null, // serverUnfulfilledConstraints, null indicates failure
new KerberosPrincipal[] {cps[1]},
new KerberosPrincipal[] {defaultServerPrincipal},
false, false),
/* -- constraint alternatives tests -- */
new EndpointTest(
"ClientConstraintAlternativesPassTest",
new InvocationConstraints(
new InvocationConstraint[] {
new ClientMinPrincipal(cps[2]),
new ConstraintAlternatives(
new InvocationConstraint[] {
new ServerMinPrincipal(sps[3]),
new ClientMaxPrincipal(
new Principal[] {cps[1], cps[2]}),
new ClientMaxPrincipal(cps[3])})},
null),
emptyConstraints, /* clientUnfulfilledConstraints */
null,
emptyConstraints, /* serverUnfulfilledConstraints */
new KerberosPrincipal[] {cps[2]}, null, false, false),
new EndpointTest(
"ClientConstraintAlternativesFailTest",
new InvocationConstraints(
new InvocationConstraint[] {
new ClientMinPrincipal(cps[0]),
new ConstraintAlternatives(
new InvocationConstraint[] {
new ServerMinPrincipal(sps[3]),
new ClientMaxPrincipal(
new Principal[] {cps[1], cps[2]}),
new ClientMaxPrincipal(cps[3])})},
null),
null, // clientUnfulfilledConstraints, null indicates failure
null,
emptyConstraints, /* serverUnfulfilledConstraints */
new KerberosPrincipal[] {cps[2]}, null, false, false),
new EndpointTest(
"ServerConstraintAlternativesPassTest",
new InvocationConstraints(
new InvocationConstraint[] {
new ClientMinPrincipal(cps[2])},
null),
emptyConstraints, /* clientUnfulfilledConstraints */
new InvocationConstraints(
new InvocationConstraint[] {
new ConstraintAlternatives(
new InvocationConstraint[] {
new ServerMinPrincipal(sps[3]),
new ClientMinPrincipal(
new Principal[] {cps[1], cps[2]}),
new ClientMaxPrincipal(
new Principal[] {cps[2], cps[3]})}),
new ServerMinPrincipal(defaultServerPrincipal)},
null),
emptyConstraints, /* serverUnfulfilledConstraints */
new KerberosPrincipal[] {cps[2]}, null, false, false),
new EndpointTest(
"ServerConstraintAlternativesFailTest1",
new InvocationConstraints(
new InvocationConstraint[] {
new ClientMinPrincipal(cps[0])},
null),
emptyConstraints, /* clientUnfulfilledConstraints */
new InvocationConstraints(
new InvocationConstraint[] {
new ConstraintAlternatives(
new InvocationConstraint[] {
new ServerMinPrincipal(sps[3]),
new ClientMinPrincipal(
new Principal[] {cps[1], cps[2]}),
new ClientMaxPrincipal(
new Principal[] {cps[2], cps[3]})}),
new ServerMinPrincipal(defaultServerPrincipal)},
null),
null, // serverUnfulfilledConstraints, null indicates failure
new KerberosPrincipal[] {cps[0]}, null, false, false),
new EndpointTest(
"ServerConstraintAlternativesFailTest2",
new InvocationConstraints(
new InvocationConstraint[] {
new ClientMinPrincipal(cps[0])},
null),
emptyConstraints, /* clientUnfulfilledConstraints */
new InvocationConstraints(
new InvocationConstraint[] {
new ConstraintAlternatives(
new InvocationConstraint[] {
new ClientMinPrincipal(
new Principal[] {cps[0], cps[2]}),
new ClientMinPrincipal(
new Principal[] {cps[0], cps[3]})}),
new ServerMinPrincipal(defaultServerPrincipal)},
null),
null, // serverUnfulfilledConstraints, null indicates failure
new KerberosPrincipal[] {cps[0]}, null, false, false),
/* -- confidentiality tests -- */
new EndpointTest(
"ConfidentialityYESTest1", // only client requests
new InvocationConstraints(
new InvocationConstraint[] {
new ClientMinPrincipal(cps[1]),
new ClientMaxPrincipal(
new Principal[] {cps[0], cps[1], cps[2]}),
Confidentiality.YES},
null),
emptyConstraints, /* clientUnfulfilledConstraints */
new InvocationConstraints(
new InvocationConstraint[] {
new ClientMinPrincipal(cps[1]),
new ClientMaxPrincipal(
new Principal[] {cps[0], cps[1]}),
new ServerMinPrincipal(defaultServerPrincipal),
Integrity.YES},
null),
integrityRequiredConstraints, /* serverUnfulfilledConstrain */
new KerberosPrincipal[] {cps[1]},
new KerberosPrincipal[] {defaultServerPrincipal},
true, false),
new EndpointTest(
"ConfidentialityYESTest2", // only server requests
new InvocationConstraints(
new InvocationConstraint[] {
new ClientMinPrincipal(cps[1]),
new ClientMaxPrincipal(
new Principal[] {cps[0], cps[1], cps[2]})},
null),
emptyConstraints, /* clientUnfulfilledConstraints */
new InvocationConstraints(
new InvocationConstraint[] {
new ClientMinPrincipal(cps[1]),
new ClientMaxPrincipal(
new Principal[] {cps[0], cps[1]}),
new ServerMinPrincipal(defaultServerPrincipal),
Confidentiality.YES},
null),
null, // serverUnfulfilledConstraints, null indicates failure
new KerberosPrincipal[] {cps[1]},
new KerberosPrincipal[] {defaultServerPrincipal},
false, false),
new EndpointTest(
"ConfidentialityYESTest3", // both client and server request
new InvocationConstraints(
new InvocationConstraint[] {
new ClientMinPrincipal(cps[1]),
new ClientMaxPrincipal(
new Principal[] {cps[0], cps[1], cps[2]}),
Confidentiality.YES},
null),
emptyConstraints, /* clientUnfulfilledConstraints */
new InvocationConstraints(
new InvocationConstraint[] {
new ClientMinPrincipal(cps[1]),
new ClientMaxPrincipal(
new Principal[] {cps[0], cps[1]}),
new ServerMinPrincipal(defaultServerPrincipal),
Confidentiality.YES},
null),
emptyConstraints, /* serverUnfulfilledConstraints */
new KerberosPrincipal[] {cps[1]},
new KerberosPrincipal[] {defaultServerPrincipal},
true, false),
new EndpointTest(
"ClientConfidentialityNOTest",
new InvocationConstraints(
new InvocationConstraint[] {
new ClientMinPrincipal(cps[1]),
new ClientMaxPrincipal(
new Principal[] {cps[0], cps[1], cps[2]}),
Confidentiality.NO},
null),
emptyConstraints, /* clientUnfulfilledConstraints */
null,
emptyConstraints, /* serverUnfulfilledConstraints */
new KerberosPrincipal[] {cps[1]}, null, false, false),
new EndpointTest(
"ServerConfidentialityNOTest",
new InvocationConstraints(
new InvocationConstraint[] {
new ClientMinPrincipal(cps[1])}, null),
emptyConstraints, /* clientUnfulfilledConstraints */
new InvocationConstraints(
new InvocationConstraint[] {
new ClientMinPrincipal(cps[1]),
new ClientMaxPrincipal(
new Principal[] {cps[0], cps[1]}),
new ServerMinPrincipal(defaultServerPrincipal),
Confidentiality.NO},
null),
emptyConstraints, /* serverUnfulfilledConstraints */
new KerberosPrincipal[] {cps[1]},
new KerberosPrincipal[] {defaultServerPrincipal},
false, false),
/* -- delegation tests -- */
new EndpointTest(
"DelegationYESTest",
new InvocationConstraints(
new InvocationConstraint[] {
new ClientMinPrincipal(cps[2]),
new ClientMaxPrincipal(
new Principal[] {cps[1], cps[2], cps[3]}),
Delegation.YES},
null),
emptyConstraints, /* clientUnfulfilledConstraints */
null,
emptyConstraints, /* serverUnfulfilledConstraints */
new KerberosPrincipal[] {cps[2]}, null, false, true),
new EndpointTest(
"DelegationNOTest",
new InvocationConstraints(
new InvocationConstraint[] {
new ClientMinPrincipal(cps[2]),
new ClientMaxPrincipal(
new Principal[] {cps[1], cps[2], cps[3]}),
Delegation.NO},
null),
emptyConstraints, /* clientUnfulfilledConstraints */
null,
emptyConstraints, /* serverUnfulfilledConstraints */
new KerberosPrincipal[] {cps[2]}, null, false, false),
/* -- data tests -- */
new EndpointTest(
"OneWriteShortDataNoEncryptionTest",
oneShortArray1, null, true,
new InvocationConstraints(
new InvocationConstraint[] {
new ClientMinPrincipal(cps[1]),
Delegation.YES},
null),
emptyConstraints, /* clientUnfulfilledConstraints */
oneShortArray2, null, true,
null,
emptyConstraints, /* serverUnfulfilledConstraints */
new KerberosPrincipal[] {cps[1]}, null, false, true, null),
new EndpointTest(
"MultiWriteShortDataNoEncryptionTest",
multiShortArray1, null, true,
new InvocationConstraints(
new InvocationConstraint[] {
new ClientMinPrincipal(cps[1]),
Delegation.YES},
null),
emptyConstraints, /* clientUnfulfilledConstraints */
multiShortArray2, null, true,
null,
emptyConstraints, /* serverUnfulfilledConstraints */
new KerberosPrincipal[] {cps[1]}, null, false, true, null),
new EndpointTest(
"OneWriteLongDataNoEncryptionTest1",
oneLongArray1, null, true,
new InvocationConstraints(
new InvocationConstraint[] {
new ClientMinPrincipal(cps[1]),
Delegation.YES},
null),
emptyConstraints, /* clientUnfulfilledConstraints */
oneLongArray2, null, true,
null,
emptyConstraints, /* serverUnfulfilledConstraints */
new KerberosPrincipal[] {cps[1]}, null, false, true, null),
new EndpointTest(
"OneWriteLongDataNoEncryptionTest2",
oneLongArray3, null, true,
new InvocationConstraints(
new InvocationConstraint[] {
new ClientMinPrincipal(cps[1]),
Delegation.YES},
null),
emptyConstraints, /* clientUnfulfilledConstraints */
oneLongArray4, null, true,
null,
emptyConstraints, /* serverUnfulfilledConstraints */
new KerberosPrincipal[] {cps[1]}, null, false, true, null),
new EndpointTest(
"MultiWriteLongDataNoEncryptionTest",
multiLongArray1, null, true,
new InvocationConstraints(
new InvocationConstraint[] {
new ClientMinPrincipal(cps[1]),
Delegation.YES},
null),
emptyConstraints, /* clientUnfulfilledConstraints */
multiLongArray2, null, true,
null,
emptyConstraints, /* serverUnfulfilledConstraints */
new KerberosPrincipal[] {cps[1]}, null, false, true, null),
new EndpointTest(
"OneWriteShortDataWithEncryptionTest",
oneShortArray1, null, true,
new InvocationConstraints(
new InvocationConstraint[] {
new ClientMinPrincipal(cps[1]),
Confidentiality.YES,
Delegation.YES},
null),
emptyConstraints, /* clientUnfulfilledConstraints */
oneShortArray2, null, true,
null,
emptyConstraints, /* serverUnfulfilledConstraints */
new KerberosPrincipal[] {cps[1]}, null, true, true, null),
new EndpointTest(
"MultiWriteShortDataWithEncryptionTest",
multiShortArray1, null, true,
new InvocationConstraints(
new InvocationConstraint[] {
new ClientMinPrincipal(cps[1]),
Confidentiality.YES,
Delegation.YES},
null),
emptyConstraints, /* clientUnfulfilledConstraints */
multiShortArray2, null, true,
null,
emptyConstraints, /* serverUnfulfilledConstraints */
new KerberosPrincipal[] {cps[1]}, null, true, true, null),
new EndpointTest(
"OneWriteLongDataWithEncryptionTest1",
oneLongArray1, null, true,
new InvocationConstraints(
new InvocationConstraint[] {
new ClientMinPrincipal(cps[1]),
Confidentiality.YES,
Delegation.YES},
null),
emptyConstraints, /* clientUnfulfilledConstraints */
oneLongArray2, null, true,
null,
emptyConstraints, /* serverUnfulfilledConstraints */
new KerberosPrincipal[] {cps[1]}, null, true, true, null),
new EndpointTest(
"OneWriteLongDataWithEncryptionTest2",
oneLongArray3, null, true,
new InvocationConstraints(
new InvocationConstraint[] {
new ClientMinPrincipal(cps[1]),
Confidentiality.YES,
Delegation.YES},
null),
emptyConstraints, /* clientUnfulfilledConstraints */
oneLongArray4, null, true,
null,
emptyConstraints, /* serverUnfulfilledConstraints */
new KerberosPrincipal[] {cps[1]}, null, true, true, null),
new EndpointTest(
"MultiWriteLongDataWithEncryptionTest",
multiLongArray1, null, true,
new InvocationConstraints(
new InvocationConstraint[] {
new ClientMinPrincipal(cps[1]),
Confidentiality.YES,
Delegation.YES},
null),
emptyConstraints, /* clientUnfulfilledConstraints */
multiLongArray2, null, true,
null,
emptyConstraints, /* serverUnfulfilledConstraints */
new KerberosPrincipal[] {cps[1]}, null, true, true, null),
/* -- server capability tests -- */
new ServerCapabilityTest(
"ServerCapabilityNullConstraintsTest",
serverEndpoint, null,
null, /* constraints */
emptyConstraints, /* unfulfilledConstraints */
"null constraints, should not return", /* returnErrMsg */
null, /* nullPointerExceptionErrMsg */
"unsupportedConstraintException thrown",
"SecurityException thrown when perms granted"),
new ServerCapabilityTest(
"ServerCapabilityNoAuthenticationPermissionTest",
serverEndpoint, defaultPermsNoSocketPerm,
null, /* constraints */
emptyConstraints, /* unfulfilledConstraints */
"null constraints, should not return", /* returnErrMsg */
"NullPointerException thrown", /* nullPointerExceptionErrMsg */
"unsupportedConstraintException thrown",
null), /* securityExceptionErrMsg */
new ServerCapabilityTest(
"ServerCapabilitySubjectNoCredentialPermissionTest",
serverEndpointNoCred, null,
null, /* constraints */
emptyConstraints, /* unfulfilledConstraints */
"null constraints, should not return", /* returnErrMsg */
"NullPointerException thrown", /* nullPointerExceptionErrMsg */
null, /* unsupportedConstraintExceptionErrMsg */
"SecurityException thrown when perms granted"),
new ServerCapabilityTest(
"ServerCapabilityValidPrincipalConstraintsTest",
serverEndpoint, null,
new InvocationConstraints(
new InvocationConstraint[] {
new ClientMinPrincipal(cps[1]),
new ClientMaxPrincipal(
new Principal[] {cps[1], cps[2], cps[3]}),
new ServerMinPrincipal(defaultServerPrincipal)},
null),
emptyConstraints, /* unfulfilledConstraints */
null, /* returnErrMsg */
"NullPointerException thrown", /* nullPointerExceptionErrMsg */
"unsupportedConstraintException thrown",
"SecurityException thrown when perms granted"),
new ServerCapabilityTest(
"ServerCapabilityConstraintAlternativesPassTest",
serverEndpoint, null,
new InvocationConstraints(
new InvocationConstraint[] {
new ConstraintAlternatives(
new InvocationConstraint[] {
new ServerMinPrincipal(sps[3]),
new ClientMinPrincipal(
new Principal[] {cps[1], cps[2]}),
new ClientMaxPrincipal(cps[3])}),
new ServerMinPrincipal(defaultServerPrincipal)},
null),
emptyConstraints, /* unfulfilledConstraints */
null, /* returnErrMsg */
"NullPointerException thrown", /* nullPointerExceptionErrMsg */
"unsupportedConstraintException thrown",
"SecurityException thrown when perms granted"),
new ServerCapabilityTest(
"ServerCapabilityConstraintAlternativesFailTest",
serverEndpoint, null,
new InvocationConstraints(
new InvocationConstraint[] {
new ConstraintAlternatives(
new InvocationConstraint[] {
new ServerMinPrincipal(sps[3]),
new ClientMinPrincipal(
new Principal[] {cps[1], cps[2]}),
new ClientMinPrincipal(
new Principal[] {cps[2], cps[3]})}),
new ServerMinPrincipal(defaultServerPrincipal)},
null),
null, /* unfulfilledConstraints */
"invalid constraints, should not return", /* returnErrMsg */
"NullPointerException thrown", /* nullPointerExceptionErrMsg */
null, /* unsupportedConstraintExceptionErrMsg */
"SecurityException thrown when perms granted"),
new ServerCapabilityTest(
"ServerCapabilityInvalidPrincipalConstraintsTest1",
serverEndpoint, null,
new InvocationConstraints(
new InvocationConstraint[] {
new ClientMinPrincipal(
new Principal[] {cps[1], cps[2]}),
new ClientMaxPrincipal(cps[3]),
new ServerMinPrincipal(defaultServerPrincipal)},
null),
emptyConstraints, /* unfulfilledConstraints */
"conflict constraints, should not return", /* returnErrMsg */
"NullPointerException thrown", /* nullPointerExceptionErrMsg */
null, /* unsupportedConstraintExceptionErrMsg */
"SecurityException thrown when perms granted"),
new ServerCapabilityTest(
"ServerCapabilityInvalidPrincipalConstraintsTest2",
serverEndpoint, null,
new InvocationConstraints(
new InvocationConstraint[] {
new ClientMinPrincipal(cps[1]),
new ClientMaxPrincipal(
new Principal[] {cps[1], cps[2], cps[3]}),
new ServerMinPrincipal(sps[2])},
null),
emptyConstraints, /* unfulfilledConstraints */