final Package pkg = SerializationHelper.serializeObject( builder.getPackage() );
assertEquals( 0,
builder.getErrors().getErrors().length );
RuleBase ruleBase = getRuleBase();
StatefulSession session = ruleBase.newStatefulSession();
ruleBase.addPackage( pkg );
session.setGlobal( "list",
new ArrayList() );
final Person bob = new Person( "bob" );
session.insert( bob );
// serialise a hashmap with the RuleBase as a key, after WM population
Map map = new HashMap();
map.put( "x",
ruleBase );
map = SerializationHelper.serializeObject( map );
ruleBase = (RuleBase) map.get( "x" );
// now try serialising with a fully populated wm from a serialised rulebase
session = SerializationHelper.getSerialisedStatefulSession( session,
ruleBase );
final Rule[] rules = ruleBase.getPackages()[0].getRules();
assertEquals( 4,
rules.length );
assertEquals( "match Person 1",