Search in sources :

Example 1 with CompilerContextImpl

use of org.kie.dmn.feel.lang.impl.CompilerContextImpl in project drools by kiegroup.

the class FEELParserSeverityTest method parseSeverity.

private ASTNode parseSeverity(String input, FEELEvent.Severity severity) {
    FEELEventListenersManager mgr = new FEELEventListenersManager();
    CompilerContext ctx = new CompilerContextImpl(mgr);
    final FEELEventListener listener = mock(FEELEventListener.class);
    mgr.addListener(listener);
    mgr.addListener(e -> LOG.info("{}", e));
    ProcessedExpression processedExpression = new ProcessedExpression(input, ctx, ProcessedFEELUnit.DefaultMode.Interpreted, Collections.emptyList());
    final ArgumentCaptor<FEELEvent> captor = ArgumentCaptor.forClass(FEELEvent.class);
    verify(listener, atLeastOnce()).onEvent(captor.capture());
    assertThat(captor.getValue().getSeverity(), is(severity));
    return processedExpression.getInterpreted().getASTNode();
}
Also used : CompilerContext(org.kie.dmn.feel.lang.CompilerContext) FEELEventListenersManager(org.kie.dmn.feel.lang.impl.FEELEventListenersManager) ProcessedExpression(org.kie.dmn.feel.codegen.feel11.ProcessedExpression) FEELEventListener(org.kie.dmn.api.feel.runtime.events.FEELEventListener) CompilerContextImpl(org.kie.dmn.feel.lang.impl.CompilerContextImpl) FEELEvent(org.kie.dmn.api.feel.runtime.events.FEELEvent)

Aggregations

FEELEvent (org.kie.dmn.api.feel.runtime.events.FEELEvent)1 FEELEventListener (org.kie.dmn.api.feel.runtime.events.FEELEventListener)1 ProcessedExpression (org.kie.dmn.feel.codegen.feel11.ProcessedExpression)1 CompilerContext (org.kie.dmn.feel.lang.CompilerContext)1 CompilerContextImpl (org.kie.dmn.feel.lang.impl.CompilerContextImpl)1 FEELEventListenersManager (org.kie.dmn.feel.lang.impl.FEELEventListenersManager)1