You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Kristian Rosenvold (JIRA)" <ji...@codehaus.org> on 2011/05/09 21:57:22 UTC

[jira] Commented: (SUREFIRE-724) Running individual test cases does not work under JUnit 3.8.2

    [ http://jira.codehaus.org/browse/SUREFIRE-724?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=266119#action_266119 ] 

Kristian Rosenvold commented on SUREFIRE-724:
---------------------------------------------

The documentation for the "test" parameter states that this is not supported on JUnit 3 (http://maven.apache.org/plugins/maven-surefire-plugin/test-mojo.html). Neither does JUnit 3 support this feature out of the box, which means we'd be increasing the number of proxies.

Both TestNG and Junit4.x will be able to run single JUnit 3.x test methods.

I will be nominating this new feature as a won't fix on the mailing list some time in the future. Feel free to suggest why this should not be the case. As such a well-tested patch will also be required from "someone" for this to get included in surefire.

> Running individual test cases does not work under JUnit 3.8.2
> -------------------------------------------------------------
>
>                 Key: SUREFIRE-724
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-724
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: JUnit 3.x support
>    Affects Versions: 2.8
>         Environment: JDK 6u24, Ubuntu
>            Reporter: Jesse Glick
>
> See SUREFIRE-577. After
> {noformat}
> diff --git a/maven-model/pom.xml b/maven-model/pom.xml
> index bc66415..903648a 100644
> --- a/maven-model/pom.xml
> +++ b/maven-model/pom.xml
> @@ -74,6 +74,11 @@ under the License.
>            </moduleExcludes>
>          </configuration>
>        </plugin>
> +      <plugin>
> +        <groupId>org.apache.maven.plugins</groupId>
> +        <artifactId>maven-surefire-plugin</artifactId>
> +        <version>2.8</version>
> +      </plugin>
>      </plugins>
>    </build>
>  
> {noformat}
> if I run
> {noformat}
> mvn -f maven-model/pom.xml -Dtest=org.apache.maven.model.DependencyTest\#testEqualsIdentity surefire:test
> {noformat}
> I see
> {noformat}
> [INFO] --- maven-surefire-plugin:2.8:test (default-cli) @ maven-model ---
> [INFO] Surefire report directory: .../maven-model/target/surefire-reports
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running org.apache.maven.model.DependencyTest
> Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.02 sec
> Results :
> Tests run: 4, Failures: 0, Errors: 0, Skipped: 0
> {noformat}
> Similarly, in a new quickstart project if I create
> {noformat}
> package test.test196655;
> import junit.framework.TestCase;
> public class AppTest extends TestCase {
>     public void test1() {}
>     public void test2() {}
> }
> {noformat}
> and run
> {noformat}
> mvn -Dtest=test.test196655.AppTest#test1 test-compile surefire:test
> {noformat}
> both tests are run until I upgrade the JUnit dep from 3.8.1 to 4.8.2.
> By the way the corresponding function works as expected in Ant 1.8.2.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira