assertEquals( 2,
m.lhs.length );
IPattern p0 = m.lhs[ 0 ];
assertTrue( p0 instanceof FactPattern );
FactPattern fp0 = (FactPattern) p0;
assertEquals( "Transactions",
fp0.getFactType() );
assertEquals( "$trans",
fp0.getBoundName() );
assertEquals( 0,
fp0.getNumberOfConstraints() );
IPattern p1 = m.lhs[ 1 ];
assertTrue( p1 instanceof FromCollectCompositeFactPattern );
FromCollectCompositeFactPattern fp1 = (FromCollectCompositeFactPattern) p1;
assertEquals( "java.util.List",
fp1.getFactPattern().getFactType() );
assertEquals( "$transactions",
fp1.getFactPattern().getBoundName() );
assertEquals( 1,
fp1.getFactPattern().getNumberOfConstraints() );
assertTrue( fp1.getFactPattern().getConstraint( 0 ) instanceof SingleFieldConstraint );
SingleFieldConstraint fp1sfc = (SingleFieldConstraint) fp1.getFactPattern().getConstraint( 0 );
assertEquals( "size > 0",
fp1sfc.getValue() );
assertEquals( BaseSingleFieldConstraint.TYPE_PREDICATE,
fp1sfc.getConstraintValueType() );
assertTrue( fp1.getRightPattern() instanceof FromCompositeFactPattern );
FromCompositeFactPattern fp2 = (FromCompositeFactPattern) fp1.getRightPattern();
assertNotNull( fp2.getFactPattern() );
FactPattern fp3 = fp2.getFactPattern();
assertEquals( "Transaction",
fp3.getFactType() );
assertEquals( 0,
fp3.getNumberOfConstraints() );
assertNotNull( fp2.getExpression() );
ExpressionFormLine efl = fp2.getExpression();
assertEquals( 3,
efl.getParts().size() );