Search in sources :

Example 1 with ExpressionContext

use of org.kaazing.k3po.lang.internal.el.ExpressionContext in project zilla by aklivity.

the class ProxyFunctionsTest method shouldResolveFunction.

@Test
public void shouldResolveFunction() throws Exception {
    final ELContext ctx = new ExpressionContext();
    final FunctionMapper mapper = ctx.getFunctionMapper();
    final Method function = mapper.resolveFunction("proxy", "beginEx");
    assertNotNull(function);
    assertSame(ProxyFunctions.class, function.getDeclaringClass());
}
Also used : ELContext(javax.el.ELContext) ExpressionContext(org.kaazing.k3po.lang.internal.el.ExpressionContext) Method(java.lang.reflect.Method) FunctionMapper(javax.el.FunctionMapper) Test(org.junit.Test)

Example 2 with ExpressionContext

use of org.kaazing.k3po.lang.internal.el.ExpressionContext in project zilla by aklivity.

the class FunctionsTest method shouldInvokeId.

@Test
public void shouldInvokeId() throws Exception {
    ExpressionFactory factory = newExpressionFactory();
    ExpressionContext environment = new ExpressionContext();
    String expressionText = "${zilla:id(\"test\")}";
    ValueExpression expression = factory.createValueExpression(environment, expressionText, int.class);
    Object id = expression.getValue(environment);
    assertThat(id, instanceOf(Integer.class));
    assertNotEquals(0, Integer.class.cast(id).intValue());
}
Also used : ExpressionFactoryUtils.newExpressionFactory(org.kaazing.k3po.lang.internal.el.ExpressionFactoryUtils.newExpressionFactory) ExpressionFactory(javax.el.ExpressionFactory) ExpressionContext(org.kaazing.k3po.lang.internal.el.ExpressionContext) ValueExpression(javax.el.ValueExpression) Test(org.junit.Test)

Example 3 with ExpressionContext

use of org.kaazing.k3po.lang.internal.el.ExpressionContext in project zilla by aklivity.

the class KafkaFunctionsTest method setUp.

@Before
public void setUp() throws Exception {
    factory = newExpressionFactory();
    ctx = new ExpressionContext();
}
Also used : ExpressionContext(org.kaazing.k3po.lang.internal.el.ExpressionContext) Before(org.junit.Before)

Example 4 with ExpressionContext

use of org.kaazing.k3po.lang.internal.el.ExpressionContext in project zilla by aklivity.

the class SseFunctionsTest method setUp.

@Before
public void setUp() throws Exception {
    factory = newExpressionFactory();
    ctx = new ExpressionContext();
}
Also used : ExpressionContext(org.kaazing.k3po.lang.internal.el.ExpressionContext) Before(org.junit.Before)

Example 5 with ExpressionContext

use of org.kaazing.k3po.lang.internal.el.ExpressionContext in project zilla by aklivity.

the class AmqpFunctionsTest method setUp.

@Before
public void setUp() throws Exception {
    factory = newExpressionFactory();
    ctx = new ExpressionContext();
}
Also used : ExpressionContext(org.kaazing.k3po.lang.internal.el.ExpressionContext) Before(org.junit.Before)

Aggregations

ExpressionContext (org.kaazing.k3po.lang.internal.el.ExpressionContext)8 Before (org.junit.Before)5 Test (org.junit.Test)3 Method (java.lang.reflect.Method)2 ELContext (javax.el.ELContext)2 FunctionMapper (javax.el.FunctionMapper)2 ExpressionFactory (javax.el.ExpressionFactory)1 ValueExpression (javax.el.ValueExpression)1 ExpressionFactoryUtils.newExpressionFactory (org.kaazing.k3po.lang.internal.el.ExpressionFactoryUtils.newExpressionFactory)1