public void testDumpBindings2() throws Exception {
String input = "( $a : a > $b : b[10].prop || 10 != 20 ) && $x : someMethod(10) == 20";
String expected = "( a > b[10].prop || 10 != 20 ) && someMethod(10) == 20";
ConstraintConnectiveDescr descr = parse( input );
MVELDumperContext ctx = new MVELDumperContext();
String result = dumper.dump( descr,
ctx );
assertEquals( expected,
result );
assertEquals( 3,
ctx.getBindings().size() );
BindingDescr bind = ctx.getBindings().get( 0 );
assertEquals( "$a",
bind.getVariable() );
assertEquals( "a",
bind.getExpression() );
bind = ctx.getBindings().get( 1 );
assertEquals( "$b",
bind.getVariable() );
assertEquals( "b[10].prop",
bind.getExpression() );
bind = ctx.getBindings().get( 2 );
assertEquals( "$x",
bind.getVariable() );
assertEquals( "someMethod(10)",
bind.getExpression() );
}