use of org.drools.workbench.models.testscenarios.shared.Scenario in project drools-wb by kiegroup.
the class TestScenarioFactory method makeTestScenarioWithGlobalVerifyGlobal.
public static Scenario makeTestScenarioWithGlobalVerifyGlobal(final String packageName, final Collection<Import> imports, final String name) {
final Scenario model = new Scenario();
model.getImports().getImports().addAll(imports);
model.setPackageName(packageName);
model.setName(name);
model.getGlobals().add(new FactData("Date", "day", new ArrayList<Field>(), false));
model.getFixtures().add(new VerifyFact("day", new ArrayList<VerifyField>() {
{
add(new VerifyField("minutes", "45", "=="));
}
}, false));
return model;
}
use of org.drools.workbench.models.testscenarios.shared.Scenario in project drools-wb by kiegroup.
the class NewTestScenarioHandler method create.
@Override
public void create(final Package pkg, final String baseFileName, final NewResourcePresenter presenter) {
busyIndicatorView.showBusyIndicator(CommonConstants.INSTANCE.Saving());
service.call(getSuccessCallback(presenter), new HasBusyIndicatorDefaultErrorCallback(busyIndicatorView)).create(pkg.getPackageTestResourcesPath(), buildFileName(baseFileName, resourceType), new Scenario(pkg.getPackageName(), baseFileName), "");
}
use of org.drools.workbench.models.testscenarios.shared.Scenario in project drools-wb by kiegroup.
the class ScenarioEditorPresenterTest method testGetContentSupplier.
@Test
public void testGetContentSupplier() throws Exception {
final Scenario content = mock(Scenario.class);
doReturn(content).when(editor).getScenario();
final Supplier<Scenario> contentSupplier = editor.getContentSupplier();
assertEquals(content, contentSupplier.get());
}
use of org.drools.workbench.models.testscenarios.shared.Scenario in project drools-wb by kiegroup.
the class DeleteExecutionTraceButtonTest method testInit.
@Test
public void testInit() throws Exception {
final DeleteExecutionTraceButton testedButton = spy(new DeleteExecutionTraceButton());
final Scenario scenario = mock(Scenario.class);
final ExecutionTrace executionTrace = mock(ExecutionTrace.class);
final ScenarioParentWidget parentWidgetToRender = mock(ScenarioParentWidget.class);
doReturn(true).when(testedButton).deleteOperationConfirmed();
testedButton.init(scenario, executionTrace, parentWidgetToRender);
verify(testedButton).addClickHandler(clickCaptor.capture());
clickCaptor.getValue().onClick(null);
verify(scenario).removeExecutionTrace(executionTrace);
verify(parentWidgetToRender).renderEditor();
}
use of org.drools.workbench.models.testscenarios.shared.Scenario in project drools-wb by kiegroup.
the class ScenarioKSessionSelectorTest method testSetKBaseAndKSession.
@Test
public void testSetKBaseAndKSession() throws Exception {
Scenario scenario = new Scenario();
scenario.getKSessions().add("ksession2");
selector.show(path, scenario);
verify(innerSelector).init(path, "ksession2");
}
Aggregations