import java.util.Iterator;
public class NewRequestConflictingConstraintsTest extends AbstractEndpointTest{
public void run() throws Exception {
Endpoint endpoint = null;
//Obtain endpoint
ServerEndpoint serverEndpoint = getServerEndpoint();
endpoint = serverEndpoint
.enumerateListenEndpoints(new SETContext());
//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 {
OutboundRequestIterator it = endpoint
.newRequest(conflictingConstraints);
while (it.hasNext()) {
OutboundRequest or = it.next();
log.finest("Obtained " + or + " from " + endpoint);
}
} catch (UnsupportedConstraintException e){
exceptionThrown = true;
}
if (!exceptionThrown) {
throw new TestException("Conflicting constraints"
+ " did not generate an UnsupportedConstraintsException"
+ " for " + endpoint + ".newRequest()");
}
//Verify unsupported constraints
exceptionThrown = false;
try {
OutboundRequestIterator it = endpoint
.newRequest(conflictingConstraints);
while (it.hasNext()) {
OutboundRequest or = it.next();
log.finest("Obtained " + or + " from " + endpoint);
}