restored default ognl behavior
This commit is contained in:
@@ -30,6 +30,16 @@ public class ELExpressionParserTests extends TestCase {
|
||||
assertEquals(new Long(7), exp.getValue(null));
|
||||
}
|
||||
|
||||
public void testParseNullExpressionString() {
|
||||
String expressionString = null;
|
||||
try {
|
||||
parser.parseExpression(expressionString, null);
|
||||
fail("should have thrown iae");
|
||||
} catch (IllegalArgumentException e) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void testParseSimpleEvalExpressionNoEvalContextWithTypeCoersion() {
|
||||
String expressionString = "#{3 + 4}";
|
||||
Expression exp = parser.parseExpression(expressionString, new ParserContextImpl().expect(Integer.class));
|
||||
|
||||
@@ -33,6 +33,16 @@ public class OgnlExpressionParserTests extends TestCase {
|
||||
|
||||
public void testParseSimple() {
|
||||
String exp = "${flag}";
|
||||
assertTrue(parser.isDelimitedExpression(exp));
|
||||
Expression e = parser.parseExpression(exp, null);
|
||||
assertNotNull(e);
|
||||
Boolean b = (Boolean) e.getValue(bean);
|
||||
assertFalse(b.booleanValue());
|
||||
}
|
||||
|
||||
public void testParseSimpleNotDelimited() {
|
||||
String exp = "flag";
|
||||
assertFalse(parser.isDelimitedExpression(exp));
|
||||
Expression e = parser.parseExpression(exp, null);
|
||||
assertNotNull(e);
|
||||
Boolean b = (Boolean) e.getValue(bean);
|
||||
|
||||
Reference in New Issue
Block a user