Closed avarabyeu closed 5 years ago
The problem has been fixed a bit in the latest version. After update i have the following:
java.lang.NullPointerException
at com.epam.reportportal.junit.ReportPortalListener.testStarted(ReportPortalListener.java:73)
at com.nordstrom.automation.junit.RunAnnouncer.testStarted(RunAnnouncer.java:36)
at org.junit.runner.notification.SynchronizedRunListener.testStarted(SynchronizedRunListener.java:49)
at org.junit.runner.notification.RunNotifier$3.notifyListener(RunNotifier.java:121)
at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:72)
at org.junit.runner.notification.RunNotifier.fireTestStarted(RunNotifier.java:118)
Which basically means that junit calls testStarted
method on watch providing NULL atomicTest
.
For example:
com.nordstrom.automation.junit.RunAnnouncer#testStarted
I would suggest that we add NULL validation in RunAnnouncer before calling any method on testWatcher.
I do not use Cucumber. Consequently, I have no way to reproduce this issue. However, the only way this could happen is if the Cucumber runner is using private internal JUnit entry points directly, which is unsupported behavior.
The AtomicTest
is required. This is what provides the context, identity, and status for the test. I could detect this bad behavior more gracefully, but the end result would be the same... No AtomicTest
, no reporting.
I stand corrected... I looked over the Cucumber runner, and it's done correctly. I just hadn't supported the ParentRunner generic implementation properly. I have a set of changes in the works that I think will handle this stuff the way it should.
In case tests are being executed with non-standard junit runner, the following class cast exception occurs:
Since
org.junit.runners.ParentRunner
does not explicitly specify object type of children, junit-found seems to be also should not rely onFrameworkMethod
only. For example, for Cucumber JUnit runner children havecucumber.runtime.junit.PickleRunners$NoStepDescriptions
type