assertTrue( xml.startsWith( "<rule>" ) );
assertTrue( xml.endsWith( "</rule>" ) );
}
public void testBasics() {
final BRLPersistence p = BRXMLPersistence.getInstance();
final RuleModel m = new RuleModel();
m.addLhsItem( new FactPattern( "Person" ) );
m.addLhsItem( new FactPattern( "Accident" ) );
m.addAttribute( new RuleAttribute( "no-loop",
"true" ) );
m.addRhsItem( new ActionInsertFact( "Report" ) );
ActionGlobalCollectionAdd ag = new ActionGlobalCollectionAdd();
ag.factName = "x";
ag.globalName = "g";
m.addRhsItem( ag);
m.name = "my rule";
final String xml = p.marshal( m );
System.out.println(xml);
assertTrue( xml.indexOf( "Person" ) > -1 );
assertTrue( xml.indexOf( "Accident" ) > -1 );
assertTrue( xml.indexOf( "no-loop" ) > -1 );
assertTrue( xml.indexOf( "org.drools" ) == -1 );