[
https://issues.apache.org/jira/browse/DELTASPIKE-63?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13195807#comment-13195807
]
Christian Kaltepoth commented on DELTASPIKE-63:
-----------------------------------------------
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! :)
> Integration test profiles for OWB and Weld don't honor category annotations
> ---------------------------------------------------------------------------
>
> Key: DELTASPIKE-63
> URL: https://issues.apache.org/jira/browse/DELTASPIKE-63
> Project: DeltaSpike
> Issue Type: Bug
> Components: Tests
> Environment: Apache Maven 3.0.3 (r1075438; 2011-02-28 18:31:09+0100)
> Reporter: Christian Kaltepoth
> Assignee: Gerhard Petracek
> Attachments: DELTASPIKE-63.patch
>
>
> It seems like the integration test profiles for OWB and Weld ignore the
> @Category annotations used to restrict tests to a certain runtime environment
> like "WebProfile" or "FullProfile". This problem occurs when running the
> tests in both "core-impl" and "integration-test".
> To reproduce this just add this failing method to some test class and execute
> the tests in the default profile OWB:
> @Test
> @Category(WebProfileCategory.class)
> public void testCategory() {
> fail("Should not get executed!");
> }
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira