ReteooRuleBase ruleBase = (ReteooRuleBase) RuleBaseFactory
.newRuleBase();
BuildContext buildContext = new BuildContext(ruleBase, ruleBase
.getReteooBuilder().getIdGenerator());
final JoinNode joinNode = new JoinNode(1, this.tupleSource,
this.objectSource, EmptyBetaConstraints.getInstance(), buildContext);
// Add the first tuple sink and assert a tuple and object
// The sink has no memory
final MockLeftTupleSink sink1 = new MockLeftTupleSink(2);
joinNode.addTupleSink(sink1);
final DefaultFactHandle f0 = new DefaultFactHandle(0, "string0");
final LeftTupleImpl tuple1 = new LeftTupleImpl(f0, this.node, true);
joinNode.assertLeftTuple(tuple1, this.context, workingMemory);
final String string1 = "string1";
final DefaultFactHandle string1Handle = new DefaultFactHandle(1, string1);
ModifyPreviousTuples modifyPreviousTuples = new ModifyPreviousTuples(null, null, new EntryPointNode() );
assertLength(0, sink1.getAsserted());
joinNode.modifyObject(string1Handle, modifyPreviousTuples, contextPassNothing, workingMemory);
assertLength(0, sink1.getAsserted());
joinNode.setRightDeclaredMask(0);
joinNode.initInferredMask();
joinNode.modifyObject(string1Handle, modifyPreviousTuples, contextPass2And3, workingMemory);
assertLength(0, sink1.getAsserted());
joinNode.setRightDeclaredMask(9);
joinNode.initInferredMask();
joinNode.modifyObject(string1Handle, modifyPreviousTuples, contextPass2And3, workingMemory);
assertLength(0, sink1.getAsserted());
joinNode.setRightDeclaredMask(3);
joinNode.initInferredMask();
joinNode.modifyObject(string1Handle, modifyPreviousTuples, contextPass2And3, workingMemory);
assertLength(1, sink1.getAsserted());
joinNode.modifyObject(string1Handle, modifyPreviousTuples, contextPassAll, workingMemory);
assertLength(2, sink1.getAsserted());
}