use of org.drools.core.reteoo.Rete in project drools by kiegroup.
the class Misc2Test method testFromEPDontRequireLeftInput.
@Test
public void testFromEPDontRequireLeftInput() {
// DROOLS-1014
String drl = "rule R when\n" + " $s1 : String() from entry-point \"xxx\"\n" + "then\n" + "end\n";
KieBase kbase = KieBaseUtil.getKieBaseFromKieModuleFromDrl("test", kieBaseTestConfiguration, drl);
Rete rete = ((RuleBase) kbase).getRete();
LeftInputAdapterNode liaNode = null;
for (ObjectTypeNode otn : rete.getObjectTypeNodes()) {
Class<?> otnType = ((ClassObjectType) otn.getObjectType()).getClassType();
if (String.class == otnType) {
assertEquals(1, otn.getObjectSinkPropagator().size());
} else if (InitialFact.class.isAssignableFrom(otnType)) {
assertEquals(0, otn.getObjectSinkPropagator().size());
} else {
fail("There shouldn't be other OTNs");
}
}
}
Aggregations