You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Henning Gross (JIRA)" <ji...@codehaus.org> on 2013/01/24 11:16:13 UTC

[jira] (SUREFIRE-952) Incompatibility with future release 4.12 of junit (Categories)

Henning Gross created SUREFIRE-952:
--------------------------------------

             Summary: 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.4, 2.12.2
            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

        

[jira] (SUREFIRE-952) Incompatibility with future release 4.12 of junit (Categories)

Posted by "Henning Gross (JIRA)" <ji...@codehaus.org>.
     [ https://jira.codehaus.org/browse/SUREFIRE-952?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henning Gross updated SUREFIRE-952:
-----------------------------------

    Attachment: surefire-952.zip
    
> 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
>         Attachments: surefire-952.zip
>
>
> 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

        

[jira] (SUREFIRE-952) Incompatibility with future release 4.12 of junit (Categories)

Posted by "Andreas Gudian (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/SUREFIRE-952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=318551#comment-318551 ] 

Andreas Gudian commented on SUREFIRE-952:
-----------------------------------------

No problem. I'm in favor of closing this issue, 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
>         Attachments: surefire-952.zip
>
>
> 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

        

[jira] (SUREFIRE-952) Incompatibility with future release 4.12 of junit (Categories)

Posted by "Henning Gross (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/SUREFIRE-952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=318366#comment-318366 ] 

Henning Gross commented on SUREFIRE-952:
----------------------------------------

As I already stated this issue has the wrong title. I got the wrong idea of the cause of the problem before I found it. I will attach a sample project with profiles for the issue and also the new junit-feature as requested.
                
> 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

        

[jira] (SUREFIRE-952) Incompatibility with future release 4.12 of junit (Categories)

Posted by "Henning Gross (JIRA)" <ji...@codehaus.org>.
     [ https://jira.codehaus.org/browse/SUREFIRE-952?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henning Gross closed SUREFIRE-952.
----------------------------------

    Resolution: Not A Bug
    
> 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
>         Attachments: surefire-952.zip
>
>
> 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

        

[jira] (SUREFIRE-952) Incompatibility with future release 4.12 of junit (Categories)

Posted by "Andreas Gudian (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/SUREFIRE-952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=318403#comment-318403 ] 

Andreas Gudian commented on SUREFIRE-952:
-----------------------------------------

First of all, thanks for the example. But I still don't really get what the remaining problem is.

This is what I tried with your demo projects (I changed the junit-dependencies to junit:junit:4.12-SNAPSHOT and removed the junitArtifactName-property):

* Groups and excludedGroups work as expected with the dummy test class and the @Category annotation on the super class. *No problem observed* (Which is what you meant with your first comment, right?)
* Leaving the groups-setting in the parent pom, but removing the junit-dependency in the module that does not contain any tests worked as expected (no tests were executed, no error was shown). *No problem observed*

So, I did some digging into the code and tried around a bit more: When using groups/excludedGroups, the artifacts of either {{testNGArtifactName}} or {{junitArtifactName}} (manually overwritten or default values) need to be on the classpath. Surefire will ignore that only if not "target/test-classes" directory was created by the build, which is typically the case when you have nothing within your src/test/java directory. That sounds somewhat reasonable to me, I guess it is not in violation of the documentation, and it is not that hard to accomplish (in my project, when I configure surefire in a parent pom, I also add the test-scope dependency for junit right away). So, I see *no real problem* here, too.

I tried Surefire 2.12.2 (what you included in the pom), 2.13 (the current release) and 2.14-SNAPSHOT (which will be released within the next very few weeks). I did not try 2.3 - too old for my taste ;).

>From where I'm standing, I see no action to take in Surefire. Did I miss something? Do you have an other opinion?

Btw, since 2.13 we do not try to compute the outcome of the JUnit {{@Category}}-filtering anymore and leave it to the JUnit implementation itself. :)


                
> 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
>         Attachments: surefire-952.zip
>
>
> 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

        

[jira] (SUREFIRE-952) Incompatibility with future release 4.12 of junit (Categories)

Posted by "Henning Gross (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/SUREFIRE-952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=318323#comment-318323 ] 

Henning Gross commented on SUREFIRE-952:
----------------------------------------

18:59:36 org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.13:test (default-test) on project tds-util-lib: groups/excludedGroups require TestNG or JUnit48+ on project test classpath

Happened to me in a module that does not have any tests and therefore does not include junit. The check should not be performed when there are not test classes at all, dont you think? I now need to include the dependency in every module in my multi-module-project.
                
> 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

        

[jira] (SUREFIRE-952) Incompatibility with future release 4.12 of junit (Categories)

Posted by "Andreas Gudian (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/SUREFIRE-952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=318356#comment-318356 ] 

Andreas Gudian commented on SUREFIRE-952:
-----------------------------------------

Could you attach a small sample project that demonstrates a) the new Junit features and b) the described behavior? I changed some coded around that in 2.13 and would like to have a closer look :). Thanks!
                
> 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

        

[jira] (SUREFIRE-952) Incompatibility with future release 4.12 of junit (Categories)

Posted by "Henning Gross (JIRA)" <ji...@codehaus.org>.
    [ 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

        

[jira] (SUREFIRE-952) Incompatibility with future release 4.12 of junit (Categories)

Posted by "Henning Gross (JIRA)" <ji...@codehaus.org>.
     [ https://jira.codehaus.org/browse/SUREFIRE-952?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henning Gross closed SUREFIRE-952.
----------------------------------

    Resolution: Not A Bug

Sorry. I do not know what was wrong but it seems to work now.
                
> 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

        

[jira] (SUREFIRE-952) Incompatibility with future release 4.12 of junit (Categories)

Posted by "Henning Gross (JIRA)" <ji...@codehaus.org>.
     [ https://jira.codehaus.org/browse/SUREFIRE-952?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henning Gross reopened SUREFIRE-952:
------------------------------------


Does fail with snapshots.
                
> 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

        

[jira] (SUREFIRE-952) Incompatibility with future release 4.12 of junit (Categories)

Posted by "Henning Gross (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/SUREFIRE-952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=318427#comment-318427 ] 

Henning Gross commented on SUREFIRE-952:
----------------------------------------

Hi! I am sorry. I got confused while putting together the example. Of course I wanted to do that with 2.13 not 2.3. That may also be the reason why I couldnt reproduce the issue. Your information solves all my confusion:

"Surefire will ignore that only if no "target/test-classes" directory was created by the build"

I am not sure and will not be able to check soon but this could be the reason why sometimes it would fail and in other modules not. I am really sorry for all the confusion but I just could not get it together. I has some example project and a real-life multi-module-project and simply did not get the behaviour. I dont know if that explains everything but I would suggest we close this issue and if I really come across a bug i can reproduce I will open a new issue w/o all this confusion.

Regards!
                
> 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
>         Attachments: surefire-952.zip
>
>
> 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

        

[jira] (SUREFIRE-952) Incompatibility with future release 4.12 of junit (Categories)

Posted by "Andreas Gudian (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/SUREFIRE-952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=318403#comment-318403 ] 

Andreas Gudian edited comment on SUREFIRE-952 at 1/31/13 1:38 PM:
------------------------------------------------------------------

First of all, thanks for the example. But I still don't really get what the remaining problem is.

This is what I tried with your demo projects (I changed the junit-dependencies to junit:junit:4.12-SNAPSHOT and removed the junitArtifactName-property):

* Groups and excludedGroups work as expected with the dummy test class and the @Category annotation on the super class. *No problem observed* (Which is what you meant with your first comment, right?)
* Leaving the groups-setting in the parent pom, but removing the junit-dependency in the module that does not contain any tests worked as expected (no tests were executed, no error was shown). *No problem observed*

So, I did some digging into the code and tried around a bit more: When using groups/excludedGroups, the artifacts of either {{testNGArtifactName}} or {{junitArtifactName}} (manually overwritten or default values) need to be on the classpath. Surefire will ignore that only if no "target/test-classes" directory was created by the build, which is typically the case when you have nothing within your src/test/java and src/test/resources directories. That sounds somewhat reasonable to me, I guess it is not in violation of the documentation, and it is not that hard to accomplish (in my project, when I configure surefire in a parent pom, I also add the test-scope dependency for junit right away). So, I see *no real problem* here, too.

I tried Surefire 2.12.2 (what you included in the pom), 2.13 (the current release) and 2.14-SNAPSHOT (which will be released within the next very few weeks). I did not try 2.3 - too old for my taste ;).

>From where I'm standing, I see no action to take in Surefire. Did I miss something? Do you have an other opinion?

Btw, since 2.13 we do not try to compute the outcome of the JUnit {{@Category}}-filtering anymore and leave it to the JUnit implementation itself. :)


                
      was (Author: agudian):
    First of all, thanks for the example. But I still don't really get what the remaining problem is.

This is what I tried with your demo projects (I changed the junit-dependencies to junit:junit:4.12-SNAPSHOT and removed the junitArtifactName-property):

* Groups and excludedGroups work as expected with the dummy test class and the @Category annotation on the super class. *No problem observed* (Which is what you meant with your first comment, right?)
* Leaving the groups-setting in the parent pom, but removing the junit-dependency in the module that does not contain any tests worked as expected (no tests were executed, no error was shown). *No problem observed*

So, I did some digging into the code and tried around a bit more: When using groups/excludedGroups, the artifacts of either {{testNGArtifactName}} or {{junitArtifactName}} (manually overwritten or default values) need to be on the classpath. Surefire will ignore that only if not "target/test-classes" directory was created by the build, which is typically the case when you have nothing within your src/test/java directory. That sounds somewhat reasonable to me, I guess it is not in violation of the documentation, and it is not that hard to accomplish (in my project, when I configure surefire in a parent pom, I also add the test-scope dependency for junit right away). So, I see *no real problem* here, too.

I tried Surefire 2.12.2 (what you included in the pom), 2.13 (the current release) and 2.14-SNAPSHOT (which will be released within the next very few weeks). I did not try 2.3 - too old for my taste ;).

>From where I'm standing, I see no action to take in Surefire. Did I miss something? Do you have an other opinion?

Btw, since 2.13 we do not try to compute the outcome of the JUnit {{@Category}}-filtering anymore and leave it to the JUnit implementation itself. :)


                  
> 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
>         Attachments: surefire-952.zip
>
>
> 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

        

[jira] (SUREFIRE-952) Incompatibility with future release 4.12 of junit (Categories)

Posted by "Henning Gross (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/SUREFIRE-952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=318366#comment-318366 ] 

Henning Gross edited comment on SUREFIRE-952 at 1/31/13 6:32 AM:
-----------------------------------------------------------------

As I already stated this issue has the wrong title. I got the wrong idea of the cause of the problem before I found it. I will try to create and attach a sample project with profiles for the issue and also the new junit-feature as requested.
                
      was (Author: gaffa):
    As I already stated this issue has the wrong title. I got the wrong idea of the cause of the problem before I found it. I will attach a sample project with profiles for the issue and also the new junit-feature as requested.
                  
> 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