use of org.drools.scenariosimulation.api.model.ScenarioWithIndex in project drools by kiegroup.
the class ScenarioResultMetadataTest method setup.
@Before
public void setup() {
scenarioMock = mock(Scenario.class);
scenarioWithIndex = new ScenarioWithIndex(SCENARIO_INDEX, scenarioMock);
scenarioResultMetadata = new ScenarioResultMetadata(scenarioWithIndex);
}
use of org.drools.scenariosimulation.api.model.ScenarioWithIndex in project drools by kiegroup.
the class AbstractScenarioRunner method run.
@Override
public void run(RunNotifier notifier) {
simulationRunMetadataBuilder = SimulationRunMetadataBuilder.create();
notifier.fireTestStarted(getDescription());
for (ScenarioWithIndex scenarioWithIndex : scenarioRunnerDTO.getScenarioWithIndices()) {
singleRunScenario(scenarioWithIndex, notifier, scenarioRunnerDTO.getSettings(), scenarioRunnerDTO.getBackground()).ifPresent(simulationRunMetadataBuilder::addScenarioResultMetadata);
}
notifier.fireTestStarted(getDescription());
}
use of org.drools.scenariosimulation.api.model.ScenarioWithIndex in project drools-wb by kiegroup.
the class ScenarioSimulationEditorBusinessCentralWrapperTest method onRunScenario.
@Test
public void onRunScenario() {
scenarioWithIndexLocal.add(new ScenarioWithIndex(1, new Scenario()));
scenarioWithIndexLocal.add(new ScenarioWithIndex(2, new Scenario()));
scenarioWithIndexLocal.add(new ScenarioWithIndex(3, new Scenario()));
RemoteCallback<SimulationRunResult> remoteCallback = mock(RemoteCallback.class);
ScenarioSimulationHasBusyIndicatorDefaultErrorCallback errorCallback = mock(ScenarioSimulationHasBusyIndicatorDefaultErrorCallback.class);
scenarioSimulationEditorBusinessClientWrapper.onRunScenario(remoteCallback, errorCallback, simulationDescriptorMock, settingsLocal, scenarioWithIndexLocal, backgroundLocal);
verify(scenarioSimulationEditorBusinessClientWrapper, times(1)).unpublishTestResultsAlerts();
verify(scenarioSimulationCaller, times(1)).call(eq(remoteCallback), eq(errorCallback));
verify(scenarioSimulationServiceMock, times(1)).runScenario(eq(observablePathMock), eq(simulationDescriptorMock), eq(scenarioWithIndexLocal), eq(settingsLocal), eq(backgroundLocal));
}
use of org.drools.scenariosimulation.api.model.ScenarioWithIndex in project drools-wb by kiegroup.
the class CoverageReportPresenterTest method setup.
@Before
public void setup() {
presenterSpy = spy(presenter);
presenterSpy.downloadReportCommand = downloadReportCommandMock;
when(coverageReportViewMock.getDonutChart()).thenReturn(donutChartMock);
when(coverageReportViewMock.getList()).thenReturn(list);
when(coverageReportViewMock.getScenarioList()).thenReturn(scenarioList);
when(coverageReportViewMock.getDownloadReportButton()).thenReturn(downloadReportButtonMock);
availableLocal = 10;
executedLocal = 6;
coverageLocal = (double) executedLocal / availableLocal * 100;
outputCounterLocal = new HashMap<>();
outputCounterLocal.put("d1", 1);
outputCounterLocal.put("d2", 2);
scenarioCounterLocal = new HashMap<>();
Map<String, Integer> scenario1Data = new HashMap<>();
scenario1Data.put("d1", 1);
scenario1Data.put("d2", 1);
Map<String, Integer> scenario2Data = new HashMap<>();
scenario2Data.put("d2", 1);
scenarioCounterLocal.put(new ScenarioWithIndex(1, new Scenario()), scenario1Data);
scenarioCounterLocal.put(new ScenarioWithIndex(2, new Scenario()), scenario2Data);
simulationRunMetadataLocal = new SimulationRunMetadata(availableLocal, executedLocal, outputCounterLocal, scenarioCounterLocal, auditLog);
}
use of org.drools.scenariosimulation.api.model.ScenarioWithIndex in project drools-wb by kiegroup.
the class CoverageReportPresenter method populateScenarioList.
protected void populateScenarioList(Map<ScenarioWithIndex, Map<String, Integer>> scenarioCounter, Type type) {
coverageScenarioListPresenter.clear();
List<ScenarioWithIndex> scenarioIndexes = new ArrayList<>(scenarioCounter.keySet());
scenarioIndexes.sort(Comparator.comparingInt(ScenarioWithIndex::getIndex));
for (ScenarioWithIndex scenarioWithIndex : scenarioIndexes) {
coverageScenarioListPresenter.addScesimDataGroup(scenarioWithIndex, scenarioCounter.get(scenarioWithIndex), type);
}
}
Aggregations