You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Tibor Digana (JIRA)" <ji...@codehaus.org> on 2011/09/12 17:35:07 UTC

[jira] Commented: (SUREFIRE-329) Support for JUNIT extensions

    [ https://jira.codehaus.org/browse/SUREFIRE-329?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=278463#comment-278463 ] 

Tibor Digana commented on SUREFIRE-329:
---------------------------------------

Hi guys,
I have working fix for this issue perhaps one month. How this can be provided?
I had to update org.junit.experimental.categories.Categories.

The user needs to pass two properties (or one of them at least) via the Maven surefire plugin namely:
org.junit.categories.included
org.junit.categories.excluded

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.6</version>
    <configuration>
        <systemPropertyVariables>
            <org.junit.categories.included>org/IRelationalDB.java</org.junit.categories.included>
            <org.junit.categories.excluded>org/IRunWithMySQL.java</org.junit.categories.excluded>
        </systemPropertyVariables>
    </configuration>
</plugin>

Both properties are in plural because the java classes can be separated by colon.
Inheritance of the types in the categories are also working fine.

> Support for JUNIT extensions
> ----------------------------
>
>                 Key: SUREFIRE-329
>                 URL: https://jira.codehaus.org/browse/SUREFIRE-329
>             Project: Maven Surefire
>          Issue Type: Wish
>          Components: Junit 4.x support
>            Reporter: Anuj Kathuria
>            Assignee: Kristian Rosenvold
>             Fix For: Backlog
>
>         Attachments: surefire-329.txt, surefire-329.txt
>
>
> Is there any plan to support using JUNIT extensions such as @Category,@PreRequisite with Maven2 SureFire plugin?
> The JUNIT EXTENSION URL:
> http://www.junitext.org/
> We would like to specify the categories to run via a configurable option in the maven surefire plugin that supports JUNIT extensions
> See example Java Code: The following runs only tests with Category - Z.
>          //In JUnit4
>         JUnitCore core = new JUnitCore();
>         // use for categories special listener, give some statistics
>         core.addListener(new CategoryTextListener(System.out));
>         Request req = Request.aClass(SpcfXXXXTest.class);
>         core.run(req.filterWith(new CategoryFilter("Z")));

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira