[jboss-jira] [JBoss JIRA] (AS7-2086) TS: Tests grouping
Honza Brázdil (JIRA)
jira-events at lists.jboss.org
Tue Jul 24 08:20:06 EDT 2012
[ https://issues.jboss.org/browse/AS7-2086?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12707509#comment-12707509 ]
Honza Brázdil edited comment on AS7-2086 at 7/24/12 8:19 AM:
-------------------------------------------------------------
Hierarchical structure of Categories is not possible in surefire.
fx: Category hierarchy and tests:
{code:java}
interface AllTests;
interface ATests extends AllTests;
interface BTests extends AllTests;
interface AaTests extends ATests;
@Category(ATests.class) public void ATest();
@Category(AaTests.class) public void AaTest();
@Category(BTests.class) public void BTest();
{code}
and surefire groups set to:
{code:xml}<groups>eu.janinko.test.category.ATests</groups>{code}
runs only test
{code}ATest{code}
not
{code}
ATest
AaTest
{code}
as wanted.
It is because surefire's GroupMatcher ( http://svn.apache.org/repos/asf/maven/surefire/trunk/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/SingleGroupMatcher.java ) in it's method enabled( Class<?>... cats ) compares classes according their names.
{code:java}
String name = cls.getName();
if ( enabledClass != null && enabledClass.getName().equals( name ) ) {
{code}
JUnit instead of using string comparisons uses Class.isAssignableFrom(Class cls).
was (Author: janinko):
Hierarchical structure (fx:
{code:java}
interface AllTests;
{code}
of Categories is not possible in surefire because surefire's GroupMatcher ( http://svn.apache.org/repos/asf/maven/surefire/trunk/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/SingleGroupMatcher.java ) in method enabled( Class<?>... cats ) compares classes according their names.
JUnit instead of using string comparisons uses Class.isAssignableFrom(Class cls) so it accepts classes according to their hierarchical structure.
> TS: Tests grouping
> ------------------
>
> Key: AS7-2086
> URL: https://issues.jboss.org/browse/AS7-2086
> Project: Application Server 7
> Issue Type: Sub-task
> Components: Test Suite
> Reporter: Ondrej Zizka
> Assignee: Ondrej Zizka
> Fix For: 7.2.0.Alpha1
>
> Attachments: BooleanExpression.g
>
>
> Decide which mechanism to use to assign the tests into one or multiple groups.
> Posibilities:
> 1)
> {code}
> @Test
> @Category(IntegrationTests.class)
> {code}
> http://weblogs.java.net/blog/johnsmart/archive/2010/04/25/grouping-tests-using-junit-categories-0
> Also, Arquillian itself supports grouping: https://github.com/weld/core/blob/master/tests-arquillian/src/test/java/org/jboss/weld/tests/Categories.java
> 2)
> {code}
> @Ignore
> {code}
> 3) Maven Surefire <includes> and <excludes>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list