Created
January 26, 2012 20:42
-
-
Save mdproctor/1684970 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void testOperatorWithoutSpace() { | |
String str = "length == ($c.length -1)"; // only works with a space after the minus operator | |
ParserConfiguration pconf = new ParserConfiguration(); | |
ParserContext pctx = new ParserContext(pconf); | |
ExecutableStatement stmt = (ExecutableStatement) MVEL.compileExpression(str, pctx); | |
Column col1 = new Column("x",0); | |
Column col2 = new Column("x", 0); | |
Map<String, Object> vars = new HashMap<String, Object> (); | |
vars.put( "$c", col2 ); | |
Boolean result = (Boolean) MVEL.executeExpression(stmt, col1, vars); | |
assertFalse(result); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment