"cheddar" ),
new FieldData( "price",
"42" ) ),
false )};
VerifyFact[] assertions = new VerifyFact[]{new VerifyFact( "c1",
ls( new VerifyField( "type",
"cheddar",
"==" ),
new VerifyField( "price",
"42",
"==" ) ) )};
sc.getFixtures().addAll( Arrays.asList( facts ) );
sc.getFixtures().addAll( Arrays.asList( assertions ) );
TypeResolver resolver = new ClassTypeResolver( new HashSet<String>(),
Thread.currentThread().getContextClassLoader() );
resolver.addImport( "org.drools.Cheese" );
MockWorkingMemory wm = new MockWorkingMemory();
ScenarioRunner runner = new ScenarioRunner( sc,
resolver,
wm );
assertEquals( 1,
wm.facts.size() );
assertEquals( runner.getPopulatedData().get( "c1" ),
wm.facts.get( 0 ) );
assertTrue( runner.getPopulatedData().containsKey( "c1" ) );
VerifyFact vf = (VerifyFact) assertions[0];
for ( int i = 0; i < vf.getFieldValues().size(); i++ ) {
assertTrue( ((VerifyField) vf.getFieldValues().get( i )).getSuccessResult() );
}
}