[ https://issues.apache.org/jira/browse/SUREFIRE-1095?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14968854#comment-14968854 ]
Grzegorz Grzybek commented on SUREFIRE-1095: -------------------------------------------- [This change|https://github.com/apache/maven-surefire/commit/4df65165] in {{org/apache/maven/surefire/junit4/JUnit4Provider.java}}: {noformat} - runNotifer.fireTestRunStarted( null ); + runNotifier.fireTestRunStarted( createTestsDescription() ); {noformat} introduces additional creation of runners: {noformat} "main@1" prio=5 tid=0x1 nid=NA runnable java.lang.Thread.State: RUNNABLE at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:25) at org.junit.runner.Computer.getRunner(Computer.java:40) at org.junit.runner.Computer$1.runnerForClass(Computer.java:31) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:101) at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:87) at org.junit.runners.Suite.<init>(Suite.java:81) at org.junit.runner.Computer.getSuite(Computer.java:28) at org.junit.runner.Request.classes(Request.java:75) at org.junit.runner.Request.classes(Request.java:91) at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-1) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.apache.maven.surefire.common.junit4.JUnit4Reflector.createRequest(JUnit4Reflector.java:67) at org.apache.maven.surefire.common.junit4.JUnit4ProviderUtil.createSuiteDescription(JUnit4ProviderUtil.java:111) at org.apache.maven.surefire.junit4.JUnit4Provider.createTestsDescription(JUnit4Provider.java:328) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:166) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:286) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:240) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121) {noformat} And in case of Arquillian runner (when runners are counted, and suite cleanup is called only after the count drops to 0) we have problems because two runners are started for a class, but only one is finished (see https://issues.jboss.org/browse/ARQ-1940). > NPE in RunListener > ------------------ > > Key: SUREFIRE-1095 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1095 > Project: Maven Surefire > Issue Type: Bug > Components: Junit 4.x support > Affects Versions: 2.17 > Environment: Tested on Mac, using Maven 3.1, Java 7 > Reporter: Andrea Arcuri > Assignee: Tibor Digana > Fix For: 2.18 > > > In the surefire plugin, it is possible to specify one or more RunListener > when running tests with JUnit. > However, it does not look like the listener is properly called by the plugin. > In particular, there is a problem with the method: > public void testRunStarted(Description description) > it's javadoc at > http://junit.sourceforge.net/javadoc/org/junit/runner/notification/RunListener.html#testRunStarted%28org.junit.runner.Description%29 > states: > "Parameters: > description - describes the tests to be run " > however, in all maven projects I tried ("mvn test"), the surefire plugin > seems like passing a null reference instead of a Description instance that > "describes the tests to be run " > Note: other methods in the RunListener I tested seems fine (i.e., they get a > valid Description object as input) -- This message was sent by Atlassian JIRA (v6.3.4#6332)