use of org.mvel2.tests.core.res.Status in project mvel by mvel.
the class CoreConfidenceTests method testPackageImportEnum.
// public void testSysoutNullVariable() {
// // Create our root Map object
// Map<String, String> map = new HashMap<String, String>();
// map.put("foo", null);
//
// VariableResolverFactory factory = new MapVariableResolverFactory(new HashMap<String, Object>());
// factory.createVariable("this", map);
//
// org.mvel2.MVEL.executeExpression(org.mvel2.MVEL.compileExpression("System.out.println(foo);"), map, factory);
// }
public void testPackageImportEnum() {
String str = "new Status( START )";
ParserConfiguration pconf = new ParserConfiguration();
pconf.addPackageImport("org.mvel2.tests.core.res");
pconf.addPackageImport("org.mvel2.tests.core.res.Status");
ParserContext context = new ParserContext(pconf);
context.setStrongTyping(true);
Serializable s = MVEL.compileExpression(str.trim(), context);
assertEquals(new Status(Status.START), MVEL.executeExpression(s));
assertFalse(new Status(Status.STOP).equals(MVEL.executeExpression(s)));
}
Aggregations