right.getExpression() );
}
public void testAndConnective() throws Exception {
String source = "a > b && 10 != 20";
ConstraintConnectiveDescr result = parser.parse( source );
assertFalse( parser.getErrors().toString(),
parser.hasErrors() );
assertEquals( ConnectiveType.AND,
result.getConnective() );
assertEquals( 2,
result.getDescrs().size() );
RelationalExprDescr expr = (RelationalExprDescr) result.getDescrs().get( 0 );
assertEquals( ">",
expr.getOperator() );
AtomicExprDescr left = (AtomicExprDescr) expr.getLeft();
AtomicExprDescr right = (AtomicExprDescr) expr.getRight();
assertEquals( "a",
left.getExpression() );
assertEquals( "b",
right.getExpression() );
expr = (RelationalExprDescr) result.getDescrs().get( 1 );
assertEquals( "!=",
expr.getOperator() );
left = (AtomicExprDescr) expr.getLeft();
right = (AtomicExprDescr) expr.getRight();
assertEquals( "10",