@Test
public void testRestrictionOrderInsideOperator() throws Exception {
KieSession session = getStatelessKieSession(this.getClass().getResourceAsStream("RestrictionOrder.drl"));
VerifierReport result = VerifierReportFactory.newVerifierReport();
Collection<? extends Object> testData = getTestData(this.getClass().getResourceAsStream("OptimisationRestrictionOrderTest.drl"),
result.getVerifierData());
// for ( Object object : testData ) {
// if ( object instanceof SubPattern ) {
// SubPattern s = (SubPattern) object;
// System.out.println( " - " + s );
// for ( PatternComponent o : s.getItems() ) {
// System.out.println( " -- " + o + " : " + o.getOrderNumber() );
// }
// }
// }
session.setGlobal("result",
result);
for (Object o : testData) {
session.insert(o);
}
session.fireAllRules(new RuleNameMatchesAgendaFilter("Optimise restrictions inside operator"));
Iterator<VerifierMessageBase> iter = result.getBySeverity(Severity.NOTE).iterator();
Collection<String> ruleNames = new ArrayList<String>();
while (iter.hasNext()) {
Object o = (Object) iter.next();
if (o instanceof VerifierMessage) {