KnowledgeAgent kagent = createKAgent( kbase, false, true );
ByteArrayResource bres = (ByteArrayResource) ResourceFactory.newByteArrayResource( s1.getBytes() );
bres.setResourceType( ResourceType.DRL );
ChangeSetImpl cs = new ChangeSetImpl();
cs.setResourcesAdded( Arrays.<Resource> asList( bres ) );
kagent.applyChangeSet( cs );
KnowledgePackage pack = kagent.getKnowledgeBase().getKnowledgePackage( "org.drools.test.pack1" );
assertNotNull( pack );
assertEquals( 0, pack.getRules().size() );
assertEquals( 1, pack.getFactTypes().size() );
ByteArrayResource bres2 = (ByteArrayResource) ResourceFactory.newByteArrayResource( s2.getBytes() );
bres2.setResourceType( ResourceType.DRL );
ChangeSetImpl cs2 = new ChangeSetImpl();
cs2.setResourcesAdded( Arrays.<Resource> asList( bres2 ) );
kagent.applyChangeSet( cs2 );
pack = kagent.getKnowledgeBase().getKnowledgePackage( "org.drools.test.pack1" );
assertNotNull( pack );
assertEquals( 0, pack.getRules().size() );