assertEquals( 0, list.size() );
}
@Test(timeout=10000)
public void testDynamicRuleRemovalsUnusedWorkingMemorySubNetwork() throws Exception {
InternalKnowledgeBase kbase = (InternalKnowledgeBase) loadKnowledgeBase( "test_DynamicRulesWithSubnetwork1.drl",
"test_DynamicRulesWithSubnetwork2.drl",
"test_DynamicRulesWithSubnetwork.drl" );
assertEquals( 2, kbase.getKnowledgePackages().size() );
assertEquals( 4,
((InternalRuleBase)kbase.getRuleBase()).getPackagesMap().get("org.drools.compiler").getRules().length );
kbase.removeRule( "org.drools.compiler", "Apply Discount on all books" );
assertEquals( 3,
((InternalRuleBase)kbase.getRuleBase()).getPackagesMap().get("org.drools.compiler").getRules().length );
kbase.removeRule( "org.drools.compiler", "like book" );
assertEquals( 2,
((InternalRuleBase)kbase.getRuleBase()).getPackagesMap().get("org.drools.compiler").getRules().length );
kbase.removeKnowledgePackage( "org.drools.compiler" );
assertEquals( 1,
kbase.getKnowledgePackages().size() );
}