use of org.drools.workbench.models.testscenarios.backend.ScenarioRunner4JUnit in project drools-wb by kiegroup.
the class ScenarioRunnerService method run.
public TestScenarioResult run(final String identifier, final Scenario scenario, final KieModule module) {
try {
final HashMap<String, KieSession> ksessions = new HashMap<String, KieSession>();
final String ksessionName = getKSessionName(scenario.getKSessions());
ksessions.put(ksessionName, loadKSession(module, ksessionName));
final AuditLogger auditLogger = new AuditLogger(ksessions);
final ScenarioRunner4JUnit scenarioRunner = new ScenarioRunner4JUnit(scenario, ksessions, getMaxRuleFirings());
run(identifier, scenarioRunner, defaultTestResultMessageEvent);
return new TestScenarioResult(scenario, auditLogger.getLog());
} catch (InitializationError initializationError) {
throw new GenericPortableException(initializationError.getMessage());
}
}
use of org.drools.workbench.models.testscenarios.backend.ScenarioRunner4JUnit in project drools-wb by kiegroup.
the class ScenarioRunnerService method runAllTests.
@Override
public void runAllTests(final String identifier, final Path path, final Event<TestResultMessage> customTestResultEvent) {
try {
final List<Scenario> scenarios = scenarioLoader.loadScenarios(path);
ScenarioRunner4JUnit scenarioRunner = new ScenarioRunner4JUnit(scenarios, getKSessions(path, scenarios), getMaxRuleFirings());
run(identifier, scenarioRunner, customTestResultEvent);
} catch (Exception e) {
throw ExceptionUtilities.handleException(e);
}
}
Aggregations