use of org.camunda.bpm.dmn.engine.impl.metrics.DefaultEngineMetricCollector in project camunda-engine-dmn by camunda.
the class DefaultDmnEngineConfigurationApiTest method shouldSetEngineMetricCollector.
@Test
public void shouldSetEngineMetricCollector() {
configuration.setEngineMetricCollector(null);
assertThat(configuration.getEngineMetricCollector()).isNull();
DefaultEngineMetricCollector metricCollector = new DefaultEngineMetricCollector();
configuration.setEngineMetricCollector(metricCollector);
assertThat(configuration.getEngineMetricCollector()).isEqualTo(metricCollector);
}
use of org.camunda.bpm.dmn.engine.impl.metrics.DefaultEngineMetricCollector in project camunda-engine-dmn by camunda.
the class DefaultDmnEngineConfigurationApiTest 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());
DefaultScriptEngineResolver scriptEngineResolver = new DefaultScriptEngineResolver();
ElProvider elProvider = new JuelElProvider();
FeelEngineFactory feelEngineFactory = new FeelEngineFactoryImpl();
DmnTransformer transformer = new DefaultDmnTransformer();
DmnEngine engine = configuration.engineMetricCollector(metricCollector).customPreDecisionTableEvaluationListeners(preListeners).customPostDecisionTableEvaluationListeners(postListeners).customPreDecisionEvaluationListeners(preDecisionListeners).customPostDecisionEvaluationListeners(postDecisionListeners).scriptEngineResolver(scriptEngineResolver).elProvider(elProvider).feelEngineFactory(feelEngineFactory).defaultInputExpressionExpressionLanguage("camunda").defaultInputEntryExpressionLanguage("camunda").defaultOutputEntryExpressionLanguage("camunda").transformer(transformer).buildEngine();
configuration = (DefaultDmnEngineConfiguration) 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);
assertThat(configuration.getScriptEngineResolver()).isEqualTo(scriptEngineResolver);
assertThat(configuration.getElProvider()).isEqualTo(elProvider);
assertThat(configuration.getFeelEngineFactory()).isEqualTo(feelEngineFactory);
assertThat(configuration.getDefaultInputExpressionExpressionLanguage()).isEqualTo("camunda");
assertThat(configuration.getDefaultInputEntryExpressionLanguage()).isEqualTo("camunda");
assertThat(configuration.getDefaultOutputEntryExpressionLanguage()).isEqualTo("camunda");
assertThat(configuration.getTransformer()).isEqualTo(transformer);
}
use of org.camunda.bpm.dmn.engine.impl.metrics.DefaultEngineMetricCollector in project camunda-engine-dmn by camunda.
the class DmnEngineConfigurationApiTest method shouldSetCustomPreDecisionTableEvaluationListeners.
@Test
public void shouldSetCustomPreDecisionTableEvaluationListeners() {
configuration.setCustomPreDecisionTableEvaluationListeners(null);
assertThat(configuration.getCustomPreDecisionTableEvaluationListeners()).isNull();
configuration.setCustomPreDecisionTableEvaluationListeners(Collections.<DmnDecisionTableEvaluationListener>emptyList());
assertThat(configuration.getCustomPreDecisionTableEvaluationListeners()).isEmpty();
ArrayList<DmnDecisionTableEvaluationListener> listeners = new ArrayList<DmnDecisionTableEvaluationListener>();
listeners.add(new DefaultEngineMetricCollector());
listeners.add(new DefaultEngineMetricCollector());
configuration.setCustomPreDecisionTableEvaluationListeners(listeners);
assertThat(configuration.getCustomPreDecisionTableEvaluationListeners()).containsExactlyElementsOf(listeners);
}
use of org.camunda.bpm.dmn.engine.impl.metrics.DefaultEngineMetricCollector in project camunda-engine-dmn by camunda.
the class DmnEngineConfigurationApiTest method shouldSetCustomPostDecisionTableEvaluationListeners.
@Test
public void shouldSetCustomPostDecisionTableEvaluationListeners() {
configuration.setCustomPostDecisionTableEvaluationListeners(null);
assertThat(configuration.getCustomPostDecisionTableEvaluationListeners()).isNull();
configuration.setCustomPostDecisionTableEvaluationListeners(Collections.<DmnDecisionTableEvaluationListener>emptyList());
assertThat(configuration.getCustomPostDecisionTableEvaluationListeners()).isEmpty();
ArrayList<DmnDecisionTableEvaluationListener> listeners = new ArrayList<DmnDecisionTableEvaluationListener>();
listeners.add(new DefaultEngineMetricCollector());
listeners.add(new DefaultEngineMetricCollector());
configuration.setCustomPostDecisionTableEvaluationListeners(listeners);
assertThat(configuration.getCustomPostDecisionTableEvaluationListeners()).containsExactlyElementsOf(listeners);
}
use of org.camunda.bpm.dmn.engine.impl.metrics.DefaultEngineMetricCollector in project camunda-engine-dmn by camunda.
the class DmnEngineConfigurationApiTest method shouldSetFluentCustomPostDecisionTableEvaluationListeners.
@Test
public void shouldSetFluentCustomPostDecisionTableEvaluationListeners() {
configuration.customPostDecisionTableEvaluationListeners(null);
assertThat(configuration.getCustomPostDecisionTableEvaluationListeners()).isNull();
configuration.customPostDecisionTableEvaluationListeners(Collections.<DmnDecisionTableEvaluationListener>emptyList());
assertThat(configuration.getCustomPostDecisionTableEvaluationListeners()).isEmpty();
ArrayList<DmnDecisionTableEvaluationListener> listeners = new ArrayList<DmnDecisionTableEvaluationListener>();
listeners.add(new DefaultEngineMetricCollector());
listeners.add(new DefaultEngineMetricCollector());
configuration.customPostDecisionTableEvaluationListeners(listeners);
assertThat(configuration.getCustomPostDecisionTableEvaluationListeners()).containsExactlyElementsOf(listeners);
}
Aggregations