List<Message> msg = helper.verify().getMessages( Message.Level.ERROR );
System.out.println( msg );
assertEquals( 0, msg.size() );
KieBase kieBase = helper.build();
FactType type = kieBase.getFactType( "org.kie1", "Foo" );
assertEquals( 2, type.getFields().size() );
Object foo = null;
try {
foo = type.newInstance();
type.set( foo, "name", "bar" );
assertEquals( "bar", type.get( foo, "name" ) );
} catch ( InstantiationException e ) {
fail( e.getMessage() );
} catch ( IllegalAccessException e ) {
fail( e.getMessage() );
}
KieSession session = kieBase.newKieSession();
FactHandle handle = session.insert( foo );
int n = session.fireAllRules( 5 );
assertTrue( handle instanceof EventFactHandle );
assertEquals( 1, n );