protected void runInInterceptorAndValidate(Document document,
Policy policy, List<QName> assertedInAssertions,
List<QName> notAssertedInAssertions,
List<CoverageType> types) throws Exception {
final AssertionInfoMap aim = new AssertionInfoMap(policy);
this.runInInterceptorAndValidateWss(document, aim, types);
try {
aim.checkEffectivePolicy(policy);
} catch (PolicyException e) {
// Expected but not relevant
} finally {
if (assertedInAssertions != null) {
for (QName assertionType : assertedInAssertions) {
Collection<AssertionInfo> ais = aim.get(assertionType);
assertNotNull(ais);
for (AssertionInfo ai : ais) {
checkAssertion(aim, assertionType, ai, true);
}
}
}
/*
// Check that the things that weren't asserted are expected
Set<QName> assertions = aim.keySet();
for (QName assertionType : assertions) {
Collection<AssertionInfo> ais = aim.get(assertionType);
for (AssertionInfo ai : ais) {
if (!ai.isAsserted() && ((notAssertedInAssertions == null)
|| (!notAssertedInAssertions.contains(assertionType)))) {
throw new Exception("Assertion: " + assertionType + " is not asserted: "
+ ai.getErrorMessage());
}
}
}
*/
if (notAssertedInAssertions != null) {
for (QName assertionType : notAssertedInAssertions) {
Collection<AssertionInfo> ais = aim.get(assertionType);
assertNotNull(ais);
for (AssertionInfo ai : ais) {
checkAssertion(aim, assertionType, ai, false);
}
}