Hey all,
I spent quite some time on this one but now I think I got it right. I'll give a short summary of what was wrong and what I did to fix it.
- Surefire was ignoring the JUnit categories for some reason. I updated the Surefire plugin to version 2.11 and manually added the JUnit provider in the correct version as a dependency to the plugin. Now both <groups> and <excludedGroups> work fine.
- The OWB and Weld profiles didn't configure any JUnit categories for their test execution. Therefore both ran all the tests regardless of their category. Now both exclude WebProfileCategory and FullProfileCategory which works fine. I also updated the profiles for AS7 and Glassfish to execute all the tests as both containers support all the test categories.
- Another thing that went wrong was that the "integration-test" module didn't execute the core tests at all. But somehow this was fixed together with the update to Surefire 2.11. The only thing I had to change was to include "arquillian.xml" on the classpath for the core test execution as this file is required for the AS7 and Glassfish profiles.
- The test ExcludeTest didn't work correctly on AS7 which was caused by an invalid packaging of the test archive.
The nice thing about my changes is that now all tests without any @Category annotation are executed in all the profiles. Therefore we don't need to add SeCategory to all the tests. Actually we could even remove SeCategory as it isn't required anymore.
The only drawback of my changes is that every module that has "parent-code" or "parent-it" as it's parent needs to have the category marker interfaces in the test classpath, even "core-api". For now I copied the 3 interfaces to the "core-api" module. But we could thing about moving them to a separate dependency later.
I'm attaching the patch to this ticket. I would apply it but I didn't receive my Apache account up to now. If somebody runs into these problems, feel free to apply it!
I just want to let you know that I'm working on fixing this issue.
It took me quite some time to find out what's going wrong but now it seems to work fine. The nice thing is that it will even work without the need to add @Category(SeCategory.class) to all existing tests.
I'll prepare a patch and submit it later today.