[
https://jira.codehaus.org/browse/SUREFIRE-952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=318370#comment-318370
]
Henning Gross commented on SUREFIRE-952:
----------------------------------------
First the feature. Pretty easy. You just run mvn test on the project I
attached. You will see that with 4.12-SNAPSHOT (you need to provide that under
our groupId/artifactId to reproduce the bug. Just install the latest SS from
https://oss.sonatype.org/content/repositories/snapshots/ to your repo with
foo.platform:junit:4.12_24t_1) the test is ran. Its not annotated but inherits
its Category from the abstract test. That is because @Category now is
@inherited.
The bug(s?) is/are not easy to reproduce/nail down. I dont seem to be able to
reproduce the issue we have in our productive project with modules not having a
junit-dep failing to "testng or junit>4.7 is required in classpath" but maybe
you will find it. The reason why I cant do that can be oberserved when you run
mvn -Psf2.3 (which uses surefire 2.3 instead of 2.12.2). It results in a NPE
with the following Stacktrace:
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at
org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at
org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at
org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution
default-test of goal org.apache.maven.plugins:mav
en-surefire-plugin:2.3:test failed.
at
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: java.lang.NullPointerException
at
org.apache.maven.plugin.surefire.SurefirePlugin.constructSurefireBooter(SurefirePlugin.java:594)
at
org.apache.maven.plugin.surefire.SurefirePlugin.execute(SurefirePlugin.java:391)
at
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
Also I noticed that you do not use the Categories-Runner of Junit but instead
copy the behaviour. If that is only because of the fact that excludecategory
and includecategory did not accept more than one group before: this feature
will be introduced in 4.12, too.
> Incompatibility with future release 4.12 of junit (Categories)
> --------------------------------------------------------------
>
> Key: SUREFIRE-952
> URL: https://jira.codehaus.org/browse/SUREFIRE-952
> Project: Maven Surefire
> Issue Type: Bug
> Components: Junit 4.x support
> Affects Versions: 2.12.2, 2.12.4
> Reporter: Henning Gross
> Priority: Blocker
>
> Junit is introducing some interesting new features on Categories in 4.12.
> @Category will become @Inherited and @ExcludeCategory/@IncludeCategory will
> accept a class-array instead of just a single class. As we need these
> urgently we are currently testing with the current snapshot of junit
> (https://oss.sonatype.org/content/repositories/snapshots/junit/junit/4.12-SNAPSHOT/).
> Unfortuneately the version seems to be incompatible.
> All tests are executed always. Regardless of the settings in <groups> or
> <excludedgroups>. Using 4.11 works fine. I do not know why this happens and
> therefore cannot provide a patch but I would love to see it fixed. If someone
> points me at the cause I will happily find a solution.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira