}
@Test
public void testUsingExplicit() {
FluentStandardSimulation f = new FluentStandardSimulationImpl();
VariableContext<Person> pc = f.<Person> getVariableContext();
List<String> imports = new ArrayList<String>();
imports.add( "org.hamcrest.MatcherAssert.assertThat" );
imports.add( "org.hamcrest.CoreMatchers.is" );
imports.add( "org.hamcrest.CoreMatchers.equalTo" );
imports.add( "org.hamcrest.CoreMatchers.allOf" );
ReflectiveMatcherFactory rf = new ReflectiveMatcherFactory( imports );
String str1 = "package org.drools.simulation.test\n" +
"import " + Person.class.getName() + "\n" +
"global java.util.List list\n" +
"rule setTime when then list.add( kcontext.getKnowledgeRuntime().getSessionClock().getCurrentTime() );\n end\n " +
"rule updateAge no-loop when $p : Person() then list.add( kcontext.getKnowledgeRuntime().getSessionClock().getCurrentTime() );\n modify( $p ) { setAge( $p.getAge() + 20 ) }; end\n";
String str2 = "package org.drools.simulation.test\n" +
"import " + Person.class.getName() + "\n" +
"global java.util.List list\n" +
"rule setTime when then list.add( kcontext.getKnowledgeRuntime().getSessionClock().getCurrentTime() );\n end\n " +
"rule updateAge no-loop when $p : Person() then list.add( kcontext.getKnowledgeRuntime().getSessionClock().getCurrentTime() );\n modify( $p ) { setAge( $p.getAge() + 10 ) }; end\n";
List list1 = new ArrayList();
List list2 = new ArrayList();
VariableContext<?> vc = f.getVariableContext();
// @formatter:off
f.newPath("init")
.newStep( 0 )
.newKnowledgeBuilder()
.add( ResourceFactory.newByteArrayResource( str1.getBytes() ),
ResourceType.DRL )
.end(ContextManager.ROOT, KnowledgeBuilder.class.getName() )