use of org.camunda.bpm.dmn.engine.DmnEngineConfiguration in project camunda-engine-dmn by camunda.
the class DmnEngineConfigurationApiTest method shouldCreateDefaultEngineConfiguration.
@Test
public void shouldCreateDefaultEngineConfiguration() {
DmnEngineConfiguration configuration = DmnEngineConfiguration.createDefaultDmnEngineConfiguration();
assertThat(configuration).isInstanceOf(DefaultDmnEngineConfiguration.class).isNotNull();
}
use of org.camunda.bpm.dmn.engine.DmnEngineConfiguration in project camunda-engine-dmn by camunda.
the class DmnEngineConfigurationApiTest method shouldBeFluentConfigurable.
@Test
public void shouldBeFluentConfigurable() {
DefaultEngineMetricCollector metricCollector = new DefaultEngineMetricCollector();
ArrayList<DmnDecisionTableEvaluationListener> preListeners = new ArrayList<DmnDecisionTableEvaluationListener>();
preListeners.add(new DefaultEngineMetricCollector());
ArrayList<DmnDecisionTableEvaluationListener> postListeners = new ArrayList<DmnDecisionTableEvaluationListener>();
preListeners.add(new DefaultEngineMetricCollector());
ArrayList<DmnDecisionEvaluationListener> preDecisionListeners = new ArrayList<DmnDecisionEvaluationListener>();
preDecisionListeners.add(new TestDecisionEvaluationListener());
ArrayList<DmnDecisionEvaluationListener> postDecisionListeners = new ArrayList<DmnDecisionEvaluationListener>();
postDecisionListeners.add(new TestDecisionEvaluationListener());
DmnEngine engine = DmnEngineConfiguration.createDefaultDmnEngineConfiguration().engineMetricCollector(metricCollector).customPreDecisionTableEvaluationListeners(preListeners).customPostDecisionTableEvaluationListeners(postListeners).customPreDecisionEvaluationListeners(preDecisionListeners).customPostDecisionEvaluationListeners(postDecisionListeners).buildEngine();
DmnEngineConfiguration configuration = engine.getConfiguration();
assertThat(configuration.getEngineMetricCollector()).isEqualTo(metricCollector);
assertThat(configuration.getCustomPreDecisionTableEvaluationListeners()).containsExactlyElementsOf(preListeners);
assertThat(configuration.getCustomPostDecisionTableEvaluationListeners()).containsExactlyElementsOf(postListeners);
assertThat(configuration.getCustomPreDecisionEvaluationListeners()).containsExactlyElementsOf(preDecisionListeners);
assertThat(configuration.getCustomPostDecisionEvaluationListeners()).containsExactlyElementsOf(postDecisionListeners);
}
use of org.camunda.bpm.dmn.engine.DmnEngineConfiguration in project camunda-engine-dmn by camunda.
the class DmnEngineMetricCollectorTest method testCustomEngineMetricCollector.
@Test
public void testCustomEngineMetricCollector() {
DmnEngineConfiguration configuration = DmnEngineConfiguration.createDefaultDmnEngineConfiguration();
DmnEngineMetricCollector mockMetricCollector = mock(DmnEngineMetricCollector.class);
configuration.setEngineMetricCollector(mockMetricCollector);
DmnEngine engine = configuration.buildEngine();
// evaluate one decision table
engine.evaluateDecisionTable(parseDecisionFromFile("decision", EXAMPLE_DMN), variables);
verify(mockMetricCollector, times(1)).notify(any(DmnDecisionTableEvaluationEvent.class));
// evaluate one decision literal expression
engine.evaluateDecision(parseDecisionFromFile("c", DRG_WITH_LITERAL_EXPRESSIONS), variables);
verify(mockMetricCollector, times(1)).notify(any(DmnDecisionTableEvaluationEvent.class));
}
use of org.camunda.bpm.dmn.engine.DmnEngineConfiguration 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();
}
Aggregations