Search in sources :

Example 26 with ExecutionTrace

use of org.drools.workbench.models.testscenarios.shared.ExecutionTrace 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);
}
Also used : Path(org.uberfire.backend.vfs.Path) FactData(org.drools.workbench.models.testscenarios.shared.FactData) ExecutionTrace(org.drools.workbench.models.testscenarios.shared.ExecutionTrace) VerifyFact(org.drools.workbench.models.testscenarios.shared.VerifyFact) URL(java.net.URL) Scenario(org.drools.workbench.models.testscenarios.shared.Scenario) Test(org.junit.Test)

Aggregations

ExecutionTrace (org.drools.workbench.models.testscenarios.shared.ExecutionTrace)26 Test (org.junit.Test)22 Scenario (org.drools.workbench.models.testscenarios.shared.Scenario)20 FactData (org.drools.workbench.models.testscenarios.shared.FactData)16 VerifyFact (org.drools.workbench.models.testscenarios.shared.VerifyFact)13 VerifyField (org.drools.workbench.models.testscenarios.shared.VerifyField)9 FieldData (org.drools.workbench.models.testscenarios.shared.FieldData)8 VerifyRuleFired (org.drools.workbench.models.testscenarios.shared.VerifyRuleFired)8 ArrayList (java.util.ArrayList)7 KieSession (org.kie.api.runtime.KieSession)7 Import (org.kie.soup.project.datamodel.imports.Import)7 Expectation (org.drools.workbench.models.testscenarios.shared.Expectation)6 RetractFact (org.drools.workbench.models.testscenarios.shared.RetractFact)6 Field (org.drools.workbench.models.testscenarios.shared.Field)4 Fixture (org.drools.workbench.models.testscenarios.shared.Fixture)4 Date (java.util.Date)3 ActivateRuleFlowGroup (org.drools.workbench.models.testscenarios.shared.ActivateRuleFlowGroup)3 HashSet (java.util.HashSet)2 ProjectClassLoader (org.drools.core.common.ProjectClassLoader)2 KnowledgeBaseImpl (org.drools.core.impl.KnowledgeBaseImpl)2