ObjectHashMap keys = tms.getEqualityKeyMap();
Iterator iter = keys.iterator();
ObjectHashMap.ObjectEntry entry;
while ( ( entry = ( ObjectHashMap.ObjectEntry) iter.next() ) != null ) {
EqualityKey key = (EqualityKey) entry.getValue();
Class factClass = key.getFactHandle().getObject().getClass();
if ( factClass == Xtype.getFactClass() ) {
checkStatus( key, 1, DefeasibilityStatus.DEFEATEDLY );
} else {
fail( "Unrecognized object has been logically justified : " + factClass );
}
}
assertEquals( 1, list.size() );
assertTrue( list.contains( "Stage1" ) );
assertEquals( 4, kSession.getObjects().size() );
FactHandle h = kSession.insert( "go" );
kSession.fireAllRules();
keys = tms.getEqualityKeyMap();
iter = keys.iterator();
while ( ( entry = ( ObjectHashMap.ObjectEntry) iter.next() ) != null ) {
EqualityKey key = (EqualityKey) entry.getValue();
Class factClass = key.getFactHandle().getObject().getClass();
if ( factClass == Xtype.getFactClass() ) {
checkStatus( key, 3, DefeasibilityStatus.DEFEASIBLY );
} else {
fail( "Unrecognized object has been logically justified : " + factClass );
}
}
kSession.retract( h );
kSession.fireAllRules();
keys = tms.getEqualityKeyMap();
iter = keys.iterator();
while ( ( entry = ( ObjectHashMap.ObjectEntry) iter.next() ) != null ) {
EqualityKey key = (EqualityKey) entry.getValue();
Class factClass = key.getFactHandle().getObject().getClass();
if ( factClass == Xtype.getFactClass() ) {
checkStatus( key, 1, DefeasibilityStatus.DEFEATEDLY );
} else {
fail( "Unrecognized object has been logically justified : " + factClass );
}