@Test public void runTestWithScenarios() throws Exception { ScesimModelDescriptor simulationDescriptor = new ScesimModelDescriptor(); List<ScenarioWithIndex> scenarios = new ArrayList<>(); SimulationRunResult test = scenarioRunnerService.runTest("test", mock(Path.class), simulationDescriptor, scenarios, settingsLocal, backgroundLocal); verify(builder).build(); assertNotNull(test.getTestResultMessage()); assertNotNull(test.getScenarioWithIndex()); assertNotNull(test.getSimulationRunMetadata()); }
@Override public SimulationRunResult runTest(final String identifier, final Path path, final ScesimModelDescriptor simulationDescriptor, final List<ScenarioWithIndex> scenarios, final Settings settings, final Background background) { final KieContainer kieContainer = getKieContainerClone(path); final ScenarioRunnerDTO scenarioRunnerDTO = new ScenarioRunnerDTO(simulationDescriptor, scenarios, null, settings, background); final AbstractScenarioRunner scenarioRunner = getOrCreateRunnerSupplier(settings.getType()) .create(kieContainer, scenarioRunnerDTO); final List<Failure> failures = new ArrayList<>(); final List<Failure> failureDetails = new ArrayList<>(); final Result result = runWithJunit(path, scenarioRunner, failures, failureDetails); return new SimulationRunResult(scenarios, background.getBackgroundDataWithIndex(), scenarioRunner.getLastRunResultMetadata() .orElseThrow(() -> new IllegalStateException("SimulationRunMetadata should be available after a run")), new TestResultMessage( identifier, result.getRunCount(), result.getRunTime(), failures)); }
ScenarioRunnerServiceImpl extends AbstractKieContainerService implements ScenarioRunnerService { @Override public SimulationRunResult runTest(final String identifier, final Path path, final ScesimModelDescriptor simulationDescriptor, final List<ScenarioWithIndex> scenarios, final Settings settings, final Background background) { final KieContainer kieContainer = getKieContainerClone(path); final ScenarioRunnerDTO scenarioRunnerDTO = new ScenarioRunnerDTO(simulationDescriptor, scenarios, null, settings, background); final AbstractScenarioRunner scenarioRunner = getOrCreateRunnerSupplier(settings.getType()) .create(kieContainer, scenarioRunnerDTO); final List<Failure> failures = new ArrayList<>(); final List<Failure> failureDetails = new ArrayList<>(); final Result result = runWithJunit(path, scenarioRunner, failures, failureDetails); return new SimulationRunResult(scenarios, background.getBackgroundDataWithIndex(), scenarioRunner.getLastRunResultMetadata() .orElseThrow(() -> new IllegalStateException("SimulationRunMetadata should be available after a run")), new TestResultMessage( identifier, result.getRunCount(), result.getRunTime(), failures)); } }
ScenarioRunnerServiceImpl extends AbstractKieContainerService implements ScenarioRunnerService { @Override public SimulationRunResult runTest(final String identifier, final Path path, final ScesimModelDescriptor simulationDescriptor, final List<ScenarioWithIndex> scenarios, final Settings settings, final Background background) { final KieContainer kieContainer = getKieContainerClone(path); final ScenarioRunnerDTO scenarioRunnerDTO = new ScenarioRunnerDTO(simulationDescriptor, scenarios, null, settings, background); final AbstractScenarioRunner scenarioRunner = getOrCreateRunnerSupplier(settings.getType()) .create(kieContainer, scenarioRunnerDTO); final List<Failure> failures = new ArrayList<>(); final List<Failure> failureDetails = new ArrayList<>(); final Result result = runWithJunit(path, scenarioRunner, failures, failureDetails); return new SimulationRunResult(scenarios, background.getBackgroundDataWithIndex(), scenarioRunner.getLastRunResultMetadata() .orElseThrow(() -> new IllegalStateException("SimulationRunMetadata should be available after a run")), new TestResultMessage( identifier, result.getRunCount(), result.getRunTime(), failures)); }  }
ScenarioRunnerServiceImpl extends AbstractKieContainerService implements ScenarioRunnerService { @Override public SimulationRunResult runTest(final String identifier, final Path path, final ScesimModelDescriptor simulationDescriptor, final List<ScenarioWithIndex> scenarios, final Settings settings, final Background background) { final KieContainer kieContainer = getKieContainerClone(path); final ScenarioRunnerDTO scenarioRunnerDTO = new ScenarioRunnerDTO(simulationDescriptor, scenarios, null, settings, background); final AbstractScenarioRunner scenarioRunner = getOrCreateRunnerSupplier(settings.getType()) .create(kieContainer, scenarioRunnerDTO); final List<Failure> failures = new ArrayList<>(); final List<Failure> failureDetails = new ArrayList<>(); final Result result = runWithJunit(path, scenarioRunner, failures, failureDetails); return new SimulationRunResult(scenarios, background.getBackgroundDataWithIndex(), scenarioRunner.getLastRunResultMetadata() .orElseThrow(() -> new IllegalStateException("SimulationRunMetadata should be available after a run")), new TestResultMessage( identifier, result.getRunCount(), result.getRunTime(), failures)); }  @Override List<TestResultMessage> runAllTests(final String identifier,
                                               final Path path); @Override SimulationRunResult runTest(final String identifier,
                                       final Path path,
                                       final ScesimModelDescriptor simulationDescriptor,
                                       final List<ScenarioWithIndex> scenarios,
                                       final Settings settings,
                                       final Background background); ScenarioRunnerProvider getOrCreateRunnerSupplier(ScenarioSimulationModel.Type type); void setRunnerSupplier(ScenarioRunnerProvider runnerSupplier); }
ScenarioRunnerServiceImpl extends AbstractKieContainerService implements ScenarioRunnerService { @Override public SimulationRunResult runTest(final String identifier, final Path path, final ScesimModelDescriptor simulationDescriptor, final List<ScenarioWithIndex> scenarios, final Settings settings, final Background background) { final KieContainer kieContainer = getKieContainerClone(path); final ScenarioRunnerDTO scenarioRunnerDTO = new ScenarioRunnerDTO(simulationDescriptor, scenarios, null, settings, background); final AbstractScenarioRunner scenarioRunner = getOrCreateRunnerSupplier(settings.getType()) .create(kieContainer, scenarioRunnerDTO); final List<Failure> failures = new ArrayList<>(); final List<Failure> failureDetails = new ArrayList<>(); final Result result = runWithJunit(path, scenarioRunner, failures, failureDetails); return new SimulationRunResult(scenarios, background.getBackgroundDataWithIndex(), scenarioRunner.getLastRunResultMetadata() .orElseThrow(() -> new IllegalStateException("SimulationRunMetadata should be available after a run")), new TestResultMessage( identifier, result.getRunCount(), result.getRunTime(), failures)); }  @Override List<TestResultMessage> runAllTests(final String identifier,
                                               final Path path); @Override SimulationRunResult runTest(final String identifier,
                                       final Path path,
                                       final ScesimModelDescriptor simulationDescriptor,
                                       final List<ScenarioWithIndex> scenarios,
                                       final Settings settings,
                                       final Background background); ScenarioRunnerProvider getOrCreateRunnerSupplier(ScenarioSimulationModel.Type type); void setRunnerSupplier(ScenarioRunnerProvider runnerSupplier);  }