use of org.drools.workbench.models.testscenarios.shared.Scenario in project drools-wb by kiegroup.
the class ScenarioKSessionSelectorTest method testNoSessionSet.
@Test
public void testNoSessionSet() throws Exception {
selector.show(path, new Scenario());
verify(innerSelector).init(path, null);
}
use of org.drools.workbench.models.testscenarios.shared.Scenario in project drools-wb by kiegroup.
the class FixtureLayoutTest method testDeleteExecutionTraceButtonNoExecutionTraceRenderedAlready.
@Test
public void testDeleteExecutionTraceButtonNoExecutionTraceRenderedAlready() throws Exception {
final Scenario scenario = mock(Scenario.class);
final ExecutionTrace executionTrace = null;
final ScenarioParentWidget parentWidgetToRender = mock(ScenarioParentWidget.class);
testedLayout.addDeleteExecutionTraceButtonIfNotNull(scenario, executionTrace, parentWidgetToRender);
verify(testedLayout, never()).setWidget(anyInt(), anyInt(), any(DeleteExecutionTraceButton.class));
}
use of org.drools.workbench.models.testscenarios.shared.Scenario in project drools-wb by kiegroup.
the class SettingsPageTest method testRefresh.
@Test
public void testRefresh() throws Exception {
final ScenarioParentWidget parentWidget = mock(ScenarioParentWidget.class);
final Path path = mock(Path.class);
final Scenario scenario = mock(Scenario.class);
settingsPage.refresh(parentWidget, path, scenario);
verify(settingsPageView).refresh(parentWidget, path, scenario);
}
use of org.drools.workbench.models.testscenarios.shared.Scenario in project drools-wb by kiegroup.
the class ScenarioUtilsTest method testFindExecutionTrace.
@Test
public void testFindExecutionTrace() throws Exception {
final Scenario scenario = new Scenario();
final ExecutionTrace executionTrace = new ExecutionTrace();
scenario.getFixtures().add(executionTrace);
Assert.assertEquals(executionTrace, ScenarioUtils.findExecutionTrace(scenario));
}
use of org.drools.workbench.models.testscenarios.shared.Scenario in project drools-wb by kiegroup.
the class ScenarioTestEditorServiceImplTest method loadScenario.
@Test
public void loadScenario() throws Exception {
final URL scenarioResource = getClass().getResource("Are they old enough.scenario");
final Path scenarioPath = PathFactory.newPath(scenarioResource.getFile(), scenarioResource.toURI().toString());
final Scenario loadedScenario = testEditorService.load(scenarioPath);
assertNotNull(loadedScenario);
assertEquals("mortgages.mortgages", loadedScenario.getPackageName());
assertEquals(5, loadedScenario.getFixtures().size());
assertTrue(loadedScenario.getFixtures().get(0) instanceof FactData);
assertTrue(loadedScenario.getFixtures().get(1) instanceof FactData);
assertTrue(loadedScenario.getFixtures().get(2) instanceof FactData);
assertTrue(loadedScenario.getFixtures().get(3) instanceof ExecutionTrace);
assertTrue(loadedScenario.getFixtures().get(4) instanceof VerifyFact);
}
Aggregations