objectTypeNode.assertObject( string1,
handle1,
context,
workingMemory );
/* check asserted object was added to memory */
PrimitiveLongMap memory = (PrimitiveLongMap) workingMemory.getNodeMemory( objectTypeNode );
assertEquals( 1,
memory.size() );
/* shouldn't retract as ObjectType does not match */
objectTypeNode.retractObject( handle2,
context,
workingMemory );
/* check asserted object was not removed from memory */
assertEquals( 1,
memory.size() );
/* should retract as ObjectType matches */
objectTypeNode.retractObject( handle1,
context,
workingMemory );
/* check asserted object was removed from memory */
assertEquals( 0,
memory.size() );
/* make sure its just the handle1 for string1 that was propagated */
List retracted = sink.getRetracted();
assertLength( 1,
retracted );