[ 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