Test of rejectAlternatives method, of class com.sun.xml.ws.policy.util.PolicyMapUtil.
PolicyMap map = null;
try {
PolicyMapUtil.rejectAlternatives(map);
fail("Expected NullPointerException");
} catch (NullPointerException e) {
}
PolicyMapExtender extender = PolicyMapExtender.createPolicyMapExtender();
PolicyMapMutator[] mutators = new PolicyMapMutator[] {extender};
PolicyMapKey key = map.createWsdlServiceScopeKey(new QName("service"));
map = PolicyMap.createPolicyMap(Arrays.asList(mutators));
Policy policy = Policy.createEmptyPolicy();
PolicySubject subject = new PolicySubject(new Object(), policy);
extender.putServiceSubject(key, subject);
PolicyMapUtil.rejectAlternatives(map);
mutators[0].disconnect();
key = map.createWsdlEndpointScopeKey(new QName("service"), new QName("port"));
map = PolicyMap.createPolicyMap(Arrays.asList(mutators));
policy = PolicyResourceLoader.loadPolicy("merge/policy2.xml");
subject = new PolicySubject(new Object(), policy);
extender.putServiceSubject(key, subject);
try {
PolicyMapUtil.rejectAlternatives(map);
fail("Expected PolicyException");
} catch (PolicyException e) {
}