ObjectTypeNode otn = getObjectTypeNode(kbase, "A" );
assertNotNull( otn );
List<String> sp = getSettableProperties(wm, otn);
AlphaNode alphaNode1 = ( AlphaNode ) otn.getSinkPropagator().getSinks()[0];
assertEquals( calculatePositiveMask(list("a"), sp), alphaNode1.getDeclaredMask( ) );
assertEquals( calculatePositiveMask(list("a", "b", "c", "s", "i"), sp), alphaNode1.getInferredMask() );
// first share
AlphaNode alphaNode1_1 = ( AlphaNode ) alphaNode1.getSinkPropagator().getSinks()[0];
assertEquals( calculatePositiveMask(list("b"), sp), alphaNode1_1.getDeclaredMask( ) );
assertEquals( calculatePositiveMask(list("a", "b", "c"), sp), alphaNode1_1.getInferredMask() );
LeftInputAdapterNode liaNode1 = ( LeftInputAdapterNode ) alphaNode1_1.getSinkPropagator().getSinks()[0];
RuleTerminalNode rtNode1 = ( RuleTerminalNode ) liaNode1.getSinkPropagator().getSinks()[0];
assertEquals( calculatePositiveMask(list("c"), sp), rtNode1.getDeclaredMask() );
assertEquals( calculatePositiveMask(list("b", "c"), sp), rtNode1.getInferredMask() );
assertEquals( calculateNegativeMask(list("!a"), sp), rtNode1.getNegativeMask() );
// second share
AlphaNode alphaNode1_2 = ( AlphaNode ) alphaNode1.getSinkPropagator().getSinks()[1];
assertEquals( calculatePositiveMask(list("i"), sp), alphaNode1_2.getDeclaredMask( ) );
assertEquals( calculatePositiveMask(list("a", "i", "s"), sp), alphaNode1_2.getInferredMask() );
LeftInputAdapterNode liaNode2 = ( LeftInputAdapterNode ) alphaNode1_2.getSinkPropagator().getSinks()[0];
RuleTerminalNode rtNode2 = ( RuleTerminalNode ) liaNode2.getSinkPropagator().getSinks()[0];
assertEquals( calculatePositiveMask(list("s"), sp), rtNode2.getDeclaredMask() );
assertEquals( calculatePositiveMask(list("a", "s"), sp), rtNode2.getInferredMask() );
assertEquals( calculateNegativeMask(list("!i"), sp), rtNode2.getNegativeMask() );
// test rule removal
kbase.removeRule( "org.drools.compiler.integrationtests", "r0" );
assertEquals( calculatePositiveMask(list("a"), sp), alphaNode1.getDeclaredMask( ) );
assertEquals( calculatePositiveMask(list("a", "i", "s"), sp), alphaNode1.getInferredMask() );
assertEquals( calculatePositiveMask(list("i"), sp), alphaNode1_2.getDeclaredMask( ) );
assertEquals( calculatePositiveMask(list("a", "i", "s"), sp), alphaNode1_2.getInferredMask() );
assertEquals( calculatePositiveMask(list("s"), sp), rtNode2.getDeclaredMask() );
assertEquals( calculatePositiveMask(list("a", "s"), sp), rtNode2.getInferredMask() );
assertEquals( calculateNegativeMask(list("!i"), sp), rtNode2.getNegativeMask() );