Uploaded image for project: 'Kogito'
  1. Kogito
  2. KOGITO-4859

Kogito Test Scenario Editor Throws Stack Trace With No Additional Information When Scenario Test Assertion Fails

XMLWordPrintable

    • False
    • False
    • Undefined
    • Hide
      1. Pull the dmn-quarkus project from kogito-examples (https://github.com/kiegroup/kogito-examples/tree/stable/dmn-quarkus-example)
      2. run a `mvn clean test`.  The tests pass.
      3. Open the `dmn-quarkus-example/src/test/resources/TrafficViolationTest.scesim` file and modify one of the expected values.  Save the file.
      4. run `mvn clean test` again and the following stack dump is produced:

       

      ```

      [INFO] Running testscenario.KogitoScenarioJunitActivatorTest
      [ERROR] Tests run: 5, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.75 s <<< FAILURE! - in testscenario.KogitoScenarioJunitActivatorTest
      [ERROR] #1: Above speed limit: 10km/h and 30 km/h Time elapsed: 0.573 s <<< ERROR!
      org.drools.scenariosimulation.backend.runner.IndexedScenarioException: #1: Scenario 'Above speed limit: 10km/h and 30 km/h' failed(/workspaces/kogito-examples/dmn-quarkus-example/target/test-classes/TrafficViolationTest.scesim)
      at org.drools.scenariosimulation.backend.runner.AbstractScenarioRunner.singleRunScenario(AbstractScenarioRunner.java:107)
      at org.drools.scenariosimulation.backend.runner.AbstractScenarioRunner.run(AbstractScenarioRunner.java:86)
      at org.kogito.scenariosimulation.runner.KogitoJunitActivator.runChild(KogitoJunitActivator.java:32)
      at org.kogito.scenariosimulation.runner.KogitoJunitActivator.runChild(KogitoJunitActivator.java:23)
      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
      at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
      at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
      at org.junit.vintage.engine.execution.RunnerExecutor.execute(RunnerExecutor.java:43)
      at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
      at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
      at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
      at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
      at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
      at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
      at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
      at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
      at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
      at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
      at org.junit.vintage.engine.VintageTestEngine.executeAllChildren(VintageTestEngine.java:82)
      at org.junit.vintage.engine.VintageTestEngine.execute(VintageTestEngine.java:73)
      at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:220)
      at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:188)
      at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:202)
      at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:181)
      at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:128)
      at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:150)
      at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:124)
      at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:384)
      at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:345)
      at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:126)
      at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418)
      Caused by: org.drools.scenariosimulation.backend.runner.ScenarioException: Scenario 'Above speed limit: 10km/h and 30 km/h' failed
      at org.drools.scenariosimulation.backend.runner.AbstractRunnerHelper.validateAssertion(AbstractRunnerHelper.java:274)
      at org.drools.scenariosimulation.backend.runner.AbstractRunnerHelper.run(AbstractRunnerHelper.java:100)
      at org.drools.scenariosimulation.backend.runner.AbstractScenarioRunner.internalRunScenario(AbstractScenarioRunner.java:123)
      at org.drools.scenariosimulation.backend.runner.AbstractScenarioRunner.singleRunScenario(AbstractScenarioRunner.java:105)
      ... 35 more

      [INFO]
      [INFO] Results:
      [INFO]
      [ERROR] Errors:
      [ERROR] KogitoScenarioJunitActivatorTest » IndexedScenario #1: Scenario 'Above speed l...
      [INFO]
      [ERROR] Tests run: 6, Failures: 0, Errors: 1, Skipped: 0

      ```

      Show
      Pull the dmn-quarkus project from kogito-examples ( https://github.com/kiegroup/kogito-examples/tree/stable/dmn-quarkus-example) run a `mvn clean test`.  The tests pass. Open the `dmn-quarkus-example/src/test/resources/TrafficViolationTest.scesim` file and modify one of the expected values.  Save the file. run `mvn clean test` again and the following stack dump is produced:   ``` [INFO] Running testscenario.KogitoScenarioJunitActivatorTest [ERROR] Tests run: 5, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.75 s <<< FAILURE! - in testscenario.KogitoScenarioJunitActivatorTest [ERROR] #1: Above speed limit: 10km/h and 30 km/h Time elapsed: 0.573 s <<< ERROR! org.drools.scenariosimulation.backend.runner.IndexedScenarioException: #1: Scenario 'Above speed limit: 10km/h and 30 km/h' failed(/workspaces/kogito-examples/dmn-quarkus-example/target/test-classes/TrafficViolationTest.scesim) at org.drools.scenariosimulation.backend.runner.AbstractScenarioRunner.singleRunScenario(AbstractScenarioRunner.java:107) at org.drools.scenariosimulation.backend.runner.AbstractScenarioRunner.run(AbstractScenarioRunner.java:86) at org.kogito.scenariosimulation.runner.KogitoJunitActivator.runChild(KogitoJunitActivator.java:32) at org.kogito.scenariosimulation.runner.KogitoJunitActivator.runChild(KogitoJunitActivator.java:23) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at org.junit.runner.JUnitCore.run(JUnitCore.java:115) at org.junit.vintage.engine.execution.RunnerExecutor.execute(RunnerExecutor.java:43) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133) at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497) at org.junit.vintage.engine.VintageTestEngine.executeAllChildren(VintageTestEngine.java:82) at org.junit.vintage.engine.VintageTestEngine.execute(VintageTestEngine.java:73) at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:220) at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:188) at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:202) at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:181) at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:128) at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:150) at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:124) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:384) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:345) at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:126) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418) Caused by: org.drools.scenariosimulation.backend.runner.ScenarioException: Scenario 'Above speed limit: 10km/h and 30 km/h' failed at org.drools.scenariosimulation.backend.runner.AbstractRunnerHelper.validateAssertion(AbstractRunnerHelper.java:274) at org.drools.scenariosimulation.backend.runner.AbstractRunnerHelper.run(AbstractRunnerHelper.java:100) at org.drools.scenariosimulation.backend.runner.AbstractScenarioRunner.internalRunScenario(AbstractScenarioRunner.java:123) at org.drools.scenariosimulation.backend.runner.AbstractScenarioRunner.singleRunScenario(AbstractScenarioRunner.java:105) ... 35 more [INFO] [INFO] Results: [INFO] [ERROR] Errors: [ERROR] KogitoScenarioJunitActivatorTest » IndexedScenario #1: Scenario 'Above speed l... [INFO] [ERROR] Tests run: 6, Failures: 0, Errors: 1, Skipped: 0 ```

      The test scenario runner under kogito throws an exception whenever the test assertions fail.  No information about the failed assertion is displayed such as "expected x value in the y column but instead found value z."  Furthermore, the documentation (https://docs.jboss.org/kogito/release/latest/html_single/#proc-kogito-testing-decision-logic_kogito-creating-running) suggests that the detailed information can be found in the sure fire reports.  These reports only contain the stack trace.

              dzonca@redhat.com Daniele Zonca
              rhn-gps-davidwil David Williams
              Jan Stastny Jan Stastny
              Jan Stastny Jan Stastny
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: