StatelessKnowledgeSession ksession = getStatelessKnowledgeSession( ResourceFactory.newByteArrayResource( str.getBytes() ) );
setExec( ksession );
String outXml = execContent( "testManualFireAllRules.in.1" );
ExecutionResults result = unmarshalOutXml( outXml,
ExecutionResults.class );
assertXMLEqual( getContent( "testManualFireAllRules.expected.1",
((FactHandle) result.getFactHandle( "outBrie" )).toExternalForm() ),
outXml );
// brie should not have been added to the list
List list = (List) result.getValue( "list1" );
Cheese stilton25 = new Cheese( "stilton",
30 );
Cheese stilton30 = new Cheese( "stilton",
35 );
Set expectedList = new HashSet();
expectedList.add( stilton25 );
expectedList.add( stilton30 );
assertEquals( expectedList,
new HashSet( list ) );
// brie should not have changed
Cheese brie10 = new Cheese( "brie",
10 );
brie10.setOldPrice( 5 );
assertEquals( brie10,
result.getValue( "outBrie" ) );
}