use of org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration in project camunda-engine-dmn by camunda.
the class DmnDataTypeTransformerTest method initRegistry.
@Before
public void initRegistry() {
DmnEngineConfiguration configuration = dmnEngine.getConfiguration();
registry = ((DefaultDmnEngineConfiguration) configuration).getTransformer().getDataTypeTransformerRegistry();
}
use of org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration in project camunda-engine-dmn by camunda.
the class ExpressionCachingTest method setup.
@Before
public void setup() {
ScriptEngineManager scriptEngineManager = spy(new ScriptEngineManager());
when(scriptEngineManager.getEngineByName(anyString())).then(new Answer<ScriptEngine>() {
public ScriptEngine answer(InvocationOnMock invocation) throws Throwable {
scriptEngineSpy = spy((ScriptEngine) invocation.callRealMethod());
compilableSpy = (Compilable) scriptEngineSpy;
return scriptEngineSpy;
}
});
DefaultDmnEngineConfiguration configuration = new DefaultDmnEngineConfiguration();
configuration.setScriptEngineResolver(new DefaultScriptEngineResolver(scriptEngineManager));
configuration.init();
elProviderSpy = spy(configuration.getElProvider());
configuration.setElProvider(elProviderSpy);
expressionEvaluationHandler = new ExpressionEvaluationHandler(configuration);
}
use of org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration in project camunda-engine-dmn by camunda.
the class FeelIntegrationTest method testFeelOutputEntryWithCustomEngine.
@Test
@DecisionResource(resource = DMN)
public void testFeelOutputEntryWithCustomEngine() {
DefaultDmnEngineConfiguration configuration = (DefaultDmnEngineConfiguration) getDmnEngineConfiguration();
configuration.setDefaultOutputEntryExpressionLanguage(DefaultDmnEngineConfiguration.FEEL_EXPRESSION_LANGUAGE);
DmnEngine engine = configuration.buildEngine();
// stubbing the default FEEL engine behavior
doReturn("a").when(feelEngineSpy).evaluateSimpleExpression(eq("\"a\""), any(VariableContext.class));
DmnDecisionResult decisionResult = engine.evaluateDecision(decision, Variables.createVariables().putValue("score", 3));
assertThat(decisionResult.getSingleEntry()).isEqualTo("a");
verify(feelEngineSpy).evaluateSimpleExpression(anyString(), any(VariableContext.class));
}
use of org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration in project camunda-engine-dmn by camunda.
the class FeelIntegrationTest method testFeelInputExpression.
@Test
@DecisionResource(resource = DMN)
public void testFeelInputExpression() {
DefaultDmnEngineConfiguration configuration = (DefaultDmnEngineConfiguration) getDmnEngineConfiguration();
configuration.setDefaultInputExpressionExpressionLanguage(DefaultDmnEngineConfiguration.FEEL_EXPRESSION_LANGUAGE);
DmnEngine engine = configuration.buildEngine();
try {
engine.evaluateDecision(decision, Variables.createVariables().putValue("score", 3));
failBecauseExceptionWasNotThrown(UnsupportedOperationException.class);
} catch (UnsupportedOperationException e) {
assertThat(e).hasMessageStartingWith("FEEL-01016");
verify(feelEngineSpy).evaluateSimpleExpression(anyString(), any(VariableContext.class));
}
}
Aggregations