use of org.drools.scenariosimulation.api.model.Settings in project drools-wb by kiegroup.
the class AbstractDMNTest method init.
protected void init() {
settingsLocal = new Settings();
settingsLocal.setType(ScenarioSimulationModel.Type.DMN);
inputDataNodes = new HashSet<>();
simpleTypeNoCollection = getSimpleNoCollection();
InputDataNode inputDataNodeSimpleNoCollection = getInputDataNode(simpleTypeNoCollection, SIMPLE_INPUT_DATA_NAME_NO_COLLECTION);
inputDataNodes.add(inputDataNodeSimpleNoCollection);
simpleTypeSimpleCollectionOfSimple = getSimpleCollection();
InputDataNode inputDataNodeSimpleCollectionOfSimple = getInputDataNode(simpleTypeSimpleCollectionOfSimple, SIMPLE_INPUT_DATA_NAME_SIMPLE_COLLECTION_OF_SIMPLE);
inputDataNodes.add(inputDataNodeSimpleCollectionOfSimple);
compositeTypeNoCollection = getSingleCompositeWithSimpleCollection();
simpleTypeSimpleCollectionOfComposite = getSimpleCollection(compositeTypeNoCollection);
InputDataNode inputDataNodeSimpleCollectionOfComposite = getInputDataNode(simpleTypeSimpleCollectionOfComposite, SIMPLE_INPUT_DATA_NAME_SIMPLE_COLLECTION_OF_COMPOSITE);
inputDataNodes.add(inputDataNodeSimpleCollectionOfComposite);
compositeTypeCollection = getCompositeCollection();
InputDataNode inputDataNodeCompositeCollection = getInputDataNode(compositeTypeCollection, COMPOSITE_INPUT_DATA_NAME_COLLECTION);
inputDataNodes.add(inputDataNodeCompositeCollection);
decisionNodes = new HashSet<>();
DecisionNode decisionNodeSimpleNoCollection = getDecisionNode(simpleTypeNoCollection, SIMPLE_DECISION_DATA_NAME);
decisionNodes.add(decisionNodeSimpleNoCollection);
DecisionNode decisionNodeCompositeNoCollection = getDecisionNode(compositeTypeNoCollection, COMPOSITE_DECISION_DATA_NAME);
decisionNodes.add(decisionNodeCompositeNoCollection);
setDmnModelLocal("dmn-list.dmn", NAMESPACE, MODEL_NAME);
}
use of org.drools.scenariosimulation.api.model.Settings in project drools-wb by kiegroup.
the class ScenarioSimulationBuilderTest method createSettings.
@Test
public void createSettings() throws Exception {
Settings settingsRetrieved = scenarioSimulationBuilder.createSettings(contextMock, ScenarioSimulationModel.Type.RULE, VALUE);
assertNotNull(settingsRetrieved);
assertEquals(ruleSettingsMock, settingsRetrieved);
settingsRetrieved = scenarioSimulationBuilder.createSettings(contextMock, ScenarioSimulationModel.Type.DMN, VALUE);
assertNotNull(settingsRetrieved);
assertEquals(dmnSettingsMock, settingsRetrieved);
}
use of org.drools.scenariosimulation.api.model.Settings in project drools-wb by kiegroup.
the class ScenarioSimulationEventHandlerTest method onUpdateSettingDataEventNoChangedValue.
@Test
public void onUpdateSettingDataEventNoChangedValue() {
Predicate<Settings> predicateMock = mock(Predicate.class);
when(predicateMock.test(eq(settingsLocal))).thenReturn(false);
Consumer<Settings> consumerMock = mock(Consumer.class);
UpdateSettingsDataEvent event = new UpdateSettingsDataEvent(consumerMock, predicateMock);
scenarioSimulationEventHandler.onEvent(event);
verify(predicateMock, times(1)).test(eq(settingsLocal));
verify(scenarioSimulationEventHandler, never()).commonExecution(isA(UpdateSettingsDataCommand.class), eq(false));
verify(scenarioSimulationEditorPresenterMock, never()).unpublishTestResultsAlerts();
}
use of org.drools.scenariosimulation.api.model.Settings in project drools-wb by kiegroup.
the class UpdateSettingsDataCommandTest method setRestorableStatus.
@Test
public void setRestorableStatus() {
Settings clonedStatus = commandSpy.setRestorableStatusPreExecution(scenarioSimulationContextLocal);
assertNotNull(clonedStatus);
}
Aggregations