Search in sources :

Example 1 with Outer

use of org.mvel2.tests.core.res.res2.Outer in project mvel by mikebrock.

the class CoreConfidenceTests method testMVEL187.

public void testMVEL187() {
    ParserContext context = new ParserContext();
    context.addPackageImport("test");
    context.addInput("outer", Outer.class);
    Object compiled = MVEL.compileExpression("outer.getInner().getValue()", context);
    Map<String, Object> vars = new HashMap<String, Object>();
    vars.put("outer", new Outer());
    VariableResolverFactory varsResolver = new MapVariableResolverFactory(vars);
    assertEquals(2, executeExpression(compiled, varsResolver));
}
Also used : DefaultLocalVariableResolverFactory(org.mvel2.integration.impl.DefaultLocalVariableResolverFactory) VariableResolverFactory(org.mvel2.integration.VariableResolverFactory) MapVariableResolverFactory(org.mvel2.integration.impl.MapVariableResolverFactory) MapVariableResolverFactory(org.mvel2.integration.impl.MapVariableResolverFactory) Outer(org.mvel2.tests.core.res.res2.Outer)

Aggregations

VariableResolverFactory (org.mvel2.integration.VariableResolverFactory)1 DefaultLocalVariableResolverFactory (org.mvel2.integration.impl.DefaultLocalVariableResolverFactory)1 MapVariableResolverFactory (org.mvel2.integration.impl.MapVariableResolverFactory)1 Outer (org.mvel2.tests.core.res.res2.Outer)1