Search in sources :

Example 1 with SimpleValueResolver

use of org.mule.mvel2.integration.impl.SimpleValueResolver in project mule by mulesoft.

the class MVELExpressionLanguageContextTestCase method testGetVariableResolver.

@Test
public void testGetVariableResolver() {
    MuleBaseVariableResolverFactory resoverFactory = new MVELExpressionLanguageContext(parserConfig, muleContext);
    resoverFactory.addResolver("foo", new SimpleValueResolver("val"));
    assertNotNull(resoverFactory.getVariableResolver("foo"));
    assertEquals("val", resoverFactory.getVariableResolver("foo").getValue());
    assertNull(resoverFactory.getVariableResolver("bar"));
}
Also used : MuleBaseVariableResolverFactory(org.mule.runtime.core.internal.el.mvel.MuleBaseVariableResolverFactory) MVELExpressionLanguageContext(org.mule.runtime.core.internal.el.mvel.MVELExpressionLanguageContext) SimpleValueResolver(org.mule.mvel2.integration.impl.SimpleValueResolver) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 SimpleValueResolver (org.mule.mvel2.integration.impl.SimpleValueResolver)1 MVELExpressionLanguageContext (org.mule.runtime.core.internal.el.mvel.MVELExpressionLanguageContext)1 MuleBaseVariableResolverFactory (org.mule.runtime.core.internal.el.mvel.MuleBaseVariableResolverFactory)1