use of org.drools.scenariosimulation.api.model.ScenarioSimulationModel in project drools-wb by kiegroup.
the class ScenarioSimulationServiceImplTest method load.
@Test
public void load() {
ScenarioSimulationModel model = service.load(path);
assertEquals(Type.DMN, model.getSettings().getType());
verify(dmnTypeServiceMock, times(1)).initializeNameAndNamespace(any(), any(), any());
doThrow(new ImpossibleToFindDMNException("")).when(dmnTypeServiceMock).initializeNameAndNamespace(any(), any(), any());
try {
service.load(path);
} catch (Exception e) {
fail();
}
}
use of org.drools.scenariosimulation.api.model.ScenarioSimulationModel in project drools-wb by kiegroup.
the class ScenarioSimulationServiceImplTest method saveAndRename.
@Test
public void saveAndRename() {
final Metadata metadata = mock(Metadata.class);
final ScenarioSimulationModel model = new ScenarioSimulationModel();
service.saveAndRename(path, "newName.scesim", metadata, model, "comment");
verify(saveAndRenameServiceMock).saveAndRename(path, "newName.scesim", metadata, model, "comment");
}
use of org.drools.scenariosimulation.api.model.ScenarioSimulationModel in project drools-wb by kiegroup.
the class ScenarioSimulationEditorBusinessCentralWrapper method getModelSuccessCallbackMethod.
protected void getModelSuccessCallbackMethod(ScenarioSimulationModelContent content) {
// Path is set to null when the Editor is closed (which can happen before async calls complete).
if (versionRecordManager.getCurrentPath() == null) {
return;
}
scenarioSimulationEditorPresenter.setPackageName(content.getDataModel().getPackageName());
resetEditorPages(content.getOverview());
DataManagementStrategy dataManagementStrategy;
if (ScenarioSimulationModel.Type.RULE.equals(content.getModel().getSettings().getType())) {
dataManagementStrategy = new BusinessCentralDMODataManagementStrategy(oracleFactory);
} else {
dataManagementStrategy = new BusinessCentralDMNDataManagementStrategy(dmnTypeService, scenarioSimulationEditorPresenter.getEventBus());
}
dataManagementStrategy.manageScenarioSimulationModelContent(versionRecordManager.getCurrentPath(), content);
ScenarioSimulationModel model = content.getModel();
if (dataManagementStrategy instanceof BusinessCentralDMODataManagementStrategy) {
importsWidget.setContent(((BusinessCentralDMODataManagementStrategy) dataManagementStrategy).getOracle(), model.getImports(), isReadOnly);
addImportsTab(importsWidget);
}
baseView.hideBusyIndicator();
scenarioSimulationEditorPresenter.getModelSuccessCallbackMethod(dataManagementStrategy, model);
setOriginalHash(scenarioSimulationEditorPresenter.getJsonModel(model).hashCode());
}
use of org.drools.scenariosimulation.api.model.ScenarioSimulationModel in project drools-wb by kiegroup.
the class AbstractDataManagementStrategyTest method setModel.
@Test
public void setModel() {
abstractDataManagementStrategySpy.model = null;
ScenarioSimulationModel modelMock = mock(ScenarioSimulationModel.class);
abstractDataManagementStrategySpy.setModel(modelMock);
assertEquals(modelMock, abstractDataManagementStrategySpy.model);
}
Aggregations