final FieldConstraintDescr fcdB = (FieldConstraintDescr) or.getDescrs().get( 0 );
assertEquals( 1,
fcdB.getRestrictions().size() );
assertTrue( fcdB.getRestrictions().get( 0 ) instanceof VariableRestrictionDescr );
final VariableRestrictionDescr rb = (VariableRestrictionDescr) fcdB.getRestrictions().get( 0 );
assertEquals( "after",
rb.getEvaluator() );
assertEquals( "$a",
rb.getText() );
assertEquals( "1,10",
rb.getParameterText() );
assertFalse( rb.isNegated() );
final FieldConstraintDescr fcdB2 = (FieldConstraintDescr) or.getDescrs().get( 1 );
assertEquals( 1,
fcdB2.getRestrictions().size() );
assertTrue( fcdB2.getRestrictions().get( 0 ) instanceof VariableRestrictionDescr );
final VariableRestrictionDescr rb2 = (VariableRestrictionDescr) fcdB2.getRestrictions().get( 0 );
assertEquals( "after",
rb2.getEvaluator() );
assertEquals( "$a",
rb2.getText() );
assertEquals( "15,20",
rb2.getParameterText() );
assertTrue( rb2.isNegated() );
final PatternDescr eventC = (PatternDescr) rule.getLhs().getDescrs().get( 2 );
assertEquals( "$c",
eventC.getIdentifier() );
assertEquals( "EventC",
eventC.getObjectType() );
assertEquals( 1,
eventC.getConstraint().getDescrs().size() );
final FieldConstraintDescr fcdC = (FieldConstraintDescr) eventC.getConstraint().getDescrs().get( 0 );
assertEquals( 1,
fcdC.getRestrictions().size() );
assertTrue( fcdC.getRestrictions().get( 0 ) instanceof VariableRestrictionDescr );
final VariableRestrictionDescr rc = (VariableRestrictionDescr) fcdC.getRestrictions().get( 0 );
assertEquals( "finishes",
rc.getEvaluator() );
assertEquals( "$b",
rc.getText() );
assertNull( rc.getParameterText() );
assertFalse( rc.isNegated() );
final PatternDescr eventD = (PatternDescr) rule.getLhs().getDescrs().get( 3 );
assertEquals( "$d",
eventD.getIdentifier() );
assertEquals( "EventD",
eventD.getObjectType() );
assertEquals( 1,
eventD.getConstraint().getDescrs().size() );
final FieldConstraintDescr fcdD = (FieldConstraintDescr) eventD.getConstraint().getDescrs().get( 0 );
assertEquals( 1,
fcdD.getRestrictions().size() );
assertTrue( fcdD.getRestrictions().get( 0 ) instanceof VariableRestrictionDescr );
final VariableRestrictionDescr rd = (VariableRestrictionDescr) fcdD.getRestrictions().get( 0 );
assertEquals( "starts",
rd.getEvaluator() );
assertEquals( "$a",
rd.getText() );
assertNull( rd.getParameterText() );
assertTrue( rd.isNegated() );
final PatternDescr eventE = (PatternDescr) rule.getLhs().getDescrs().get( 4 );
assertEquals( "$e",
eventE.getIdentifier() );
assertEquals( "EventE",
eventE.getObjectType() );
assertEquals( 2,
eventE.getConstraint().getDescrs().size() );
final AndDescr and = (AndDescr) eventE.getConstraint();
FieldConstraintDescr fcdE = (FieldConstraintDescr) and.getDescrs().get( 0 );
assertEquals( 1,
fcdE.getRestrictions().size() );
final RestrictionConnectiveDescr orrestr = (RestrictionConnectiveDescr) fcdE.getRestrictions().get( 0 );
assertEquals( RestrictionConnectiveDescr.OR,
orrestr.getConnective() );
assertEquals( 2,
orrestr.getRestrictions().size() );
assertTrue( orrestr.getRestrictions().get( 0 ) instanceof VariableRestrictionDescr );
VariableRestrictionDescr re = (VariableRestrictionDescr) orrestr.getRestrictions().get( 0 );
assertEquals( "before",
re.getEvaluator() );
assertEquals( "$b",
re.getText() );
assertEquals( "1, 10",
re.getParameterText() );
assertTrue( re.isNegated() );
re = (VariableRestrictionDescr) orrestr.getRestrictions().get( 1 );
assertEquals( "after",
re.getEvaluator() );
assertEquals( "$c",
re.getText() );
assertEquals( "1, 10",
re.getParameterText() );
assertFalse( re.isNegated() );
fcdE = (FieldConstraintDescr) and.getDescrs().get( 1 );
assertEquals( 1,
fcdE.getRestrictions().size() );
assertTrue( fcdE.getRestrictions().get( 0 ) instanceof VariableRestrictionDescr );
re = (VariableRestrictionDescr) fcdE.getRestrictions().get( 0 );
assertEquals( "after",
re.getEvaluator() );
assertEquals( "$d",
re.getText() );
assertEquals( "1, 5",
re.getParameterText() );
assertFalse( re.isNegated() );
}