VerifierConfiguration vconf = new VerifierConfigurationImpl();
vconf.getVerifyingResources().put(ResourceFactory.newByteArrayResource(cons.getVerifierRule(this.conf).getBytes()), ResourceType.DRL);
Verifier verifier = vBuilder.newVerifier(vconf);
verifier.addResourcesToVerify(ResourceFactory.newByteArrayResource(ruleToVerify.getBytes()),
ResourceType.DRL);
if (verifier.hasErrors()) {
for (VerifierError error : verifier.getErrors()) {
System.out.println(error.getMessage());
}
throw new RuntimeException("Error building verifier");
}
assertFalse(verifier.hasErrors());
boolean noProblems = verifier.fireAnalysis();
assertTrue(noProblems);
VerifierReport result = verifier.getResult();
Collection<VerifierMessageBase> errors = result.getBySeverity(Severity.ERROR);
System.out.println(errors);
assertEquals(fail, errors.size());
// System.out.println("\nOrders:");
// for (VerifierMessageBase message : errors) {
// if (message.getFaulty() instanceof PatternComponent) {
// int rootPatternOrderNumber = this.getRootPatternOrderNumber((PatternComponent) message.getFaulty());
// System.out.println(((PatternComponent) message.getFaulty()).getPath()+". Order= "+rootPatternOrderNumber);
// }
// }
verifier.dispose();
}