ep = getServerEndpoint();
if (!(ep instanceof ServerCapabilities)){
throw new TestException(ep + " does not implement"
+ " ServerCapabilities.");
}
ServerCapabilities serverEndpoint = (ServerCapabilities) ep;
//Obtain constraints
InvocationConstraints conflictingConstraints =
(InvocationConstraints) getConfigObject(
InvocationConstraints.class, "conflictingConstraints");
InvocationConstraints unsupportedConstraints =
(InvocationConstraints) getConfigObject(
InvocationConstraints.class, "unsupportedConstraints");
boolean integritySupported = ((Boolean)getConfigObject(
Boolean.class, "integritySupported")).booleanValue();
//Verify conflicting constraints
boolean exceptionThrown = false;
try {
serverEndpoint.checkConstraints(conflictingConstraints);
} catch (UnsupportedConstraintException e){
exceptionThrown = true;
}
if (!exceptionThrown) {
throw new TestException("Conflicting constraints"
+ " did not generate an UnsupportedConstraintsException"
+ " for " + ep);
}
//Verify unsupported constraints
exceptionThrown = false;
try {
serverEndpoint.checkConstraints(unsupportedConstraints);
} catch (UnsupportedConstraintException e){
exceptionThrown = true;
}
if (!exceptionThrown) {
throw new TestException("Unsupported constraints"
+ " did not generate an UnsupportedConstraintsException"
+ " for " + ep);
}
if (integritySupported) {
//Verify integrity
boolean integrityReturned = false;
InvocationConstraints returned = serverEndpoint
.checkConstraints(
new InvocationConstraints(Integrity.YES,null));
Iterator it = returned.requirements().iterator();
while (it.hasNext()) {
InvocationConstraint ic = (InvocationConstraint) it.next();