Search in sources :

Example 1 with ExpressionFactoryImpl

use of de.odysseus.el.ExpressionFactoryImpl in project camel by apache.

the class JuelTest method testJuel.

@Test
public void testJuel() throws Exception {
    ExpressionFactory factory = new ExpressionFactoryImpl();
    ELContext context = new SimpleContext();
    ValueExpression valueExpression = factory.createValueExpression(context, "${123 * 2}", Object.class);
    Object value = valueExpression.getValue(context);
    assertEquals("Result is a Long object", 246L, value);
}
Also used : ELContext(javax.el.ELContext) SimpleContext(de.odysseus.el.util.SimpleContext) ExpressionFactory(javax.el.ExpressionFactory) ExpressionFactoryImpl(de.odysseus.el.ExpressionFactoryImpl) ValueExpression(javax.el.ValueExpression) Test(org.junit.Test)

Aggregations

ExpressionFactoryImpl (de.odysseus.el.ExpressionFactoryImpl)1 SimpleContext (de.odysseus.el.util.SimpleContext)1 ELContext (javax.el.ELContext)1 ExpressionFactory (javax.el.ExpressionFactory)1 ValueExpression (javax.el.ValueExpression)1 Test (org.junit.Test)1