You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ti...@apache.org on 2015/03/09 00:25:31 UTC

maven-surefire git commit: [SUREFIRE] keep using same syntax -Dtest=**/**/**

Repository: maven-surefire
Updated Branches:
  refs/heads/master cc4dac274 -> a577d094e


[SUREFIRE] keep using same syntax -Dtest=**/**/**


Project: http://git-wip-us.apache.org/repos/asf/maven-surefire/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/a577d094
Tree: http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/a577d094
Diff: http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/a577d094

Branch: refs/heads/master
Commit: a577d094e1dae59c465a68b341b8a82b914b9848
Parents: cc4dac2
Author: Tibor17 <ti...@lycos.com>
Authored: Mon Mar 9 00:24:55 2015 +0100
Committer: Tibor17 <ti...@lycos.com>
Committed: Mon Mar 9 00:24:55 2015 +0100

----------------------------------------------------------------------
 .../src/site/apt/examples/single-test.apt.vm              |  6 +++++-
 .../its/jiras/Surefire847AdditionalFailureIT.java         |  2 +-
 .../src/test/resources/junit44-multiple-methods/pom.xml   | 10 ++++++++--
 .../src/test/resources/junit48-multiple-methods/pom.xml   | 10 ++++++++--
 .../org/apache/maven/surefire/junit4/JUnit4Provider.java  |  8 ++++----
 5 files changed, 26 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a577d094/maven-surefire-plugin/src/site/apt/examples/single-test.apt.vm
----------------------------------------------------------------------
diff --git a/maven-surefire-plugin/src/site/apt/examples/single-test.apt.vm b/maven-surefire-plugin/src/site/apt/examples/single-test.apt.vm
index d069ab7..f77b45d 100644
--- a/maven-surefire-plugin/src/site/apt/examples/single-test.apt.vm
+++ b/maven-surefire-plugin/src/site/apt/examples/single-test.apt.vm
@@ -73,11 +73,15 @@ mvn -Dit.test=ITSquare,ITCi*le verify
 +---+
 #{end}
 
+  << NOTE: Use syntax e.g. "foo/MyTest.java", "**/MyTest.java", "MyTest" for "test" parameter (see includes/excludes)
+  instead of fully qualified Java class names. >>
+
 Running a Set of Methods in a Single Test Class
 
   As of Surefire 2.7.3, you can also run only a subset of the tests in a test class.
   
-  << NOTE : This feature is supported only for Junit 4.x and TestNG. >>
+  << NOTE : This feature is supported only for Junit 4.x and TestNG. Use syntax e.g. "foo/MyTest.java",
+  "**/MyTest.java", "MyTest" for "test" parameter (see includes/excludes) instead of fully qualified Java class names. >>
   
   You must use the following syntax:
   

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a577d094/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire847AdditionalFailureIT.java
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire847AdditionalFailureIT.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire847AdditionalFailureIT.java
index f267ee8..eaecc90 100755
--- a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire847AdditionalFailureIT.java
+++ b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire847AdditionalFailureIT.java
@@ -28,6 +28,6 @@ public class Surefire847AdditionalFailureIT
     public void testJUnitRunCategoryAB()
     {
         unpack( "surefire-847-testngfail" ).setTestToRun(
-            "org.codehaus.SomePassedTest" ).executeTest().verifyErrorFreeLog();
+            "org/codehaus/SomePassedTest" ).executeTest().verifyErrorFreeLog();
     }
 }

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a577d094/surefire-integration-tests/src/test/resources/junit44-multiple-methods/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/resources/junit44-multiple-methods/pom.xml b/surefire-integration-tests/src/test/resources/junit44-multiple-methods/pom.xml
index ea40f37..1d6f779 100644
--- a/surefire-integration-tests/src/test/resources/junit44-multiple-methods/pom.xml
+++ b/surefire-integration-tests/src/test/resources/junit44-multiple-methods/pom.xml
@@ -23,6 +23,13 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
 
+  <parent>
+    <groupId>org.apache.maven.surefire</groupId>
+    <artifactId>it-parent</artifactId>
+    <version>1.0</version>
+    <relativePath>../pom.xml</relativePath>
+  </parent>
+
   <groupId>org.apache.maven.plugins.surefire</groupId>
   <artifactId>junit4</artifactId>
   <version>1.0-SNAPSHOT</version>
@@ -55,9 +62,8 @@
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
-        <version>${surefire.version}</version>
         <configuration>
-          <test>junit4.BasicTest#testSuccessOne+testFailOne,junit4.TestThree#testSuccessTwo</test>
+          <test>junit4/BasicTest#testSuccessOne+testFailOne,junit4/TestThree#testSuccessTwo</test>
         </configuration>
       </plugin>
     </plugins>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a577d094/surefire-integration-tests/src/test/resources/junit48-multiple-methods/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/resources/junit48-multiple-methods/pom.xml b/surefire-integration-tests/src/test/resources/junit48-multiple-methods/pom.xml
index a0e9179..8948996 100644
--- a/surefire-integration-tests/src/test/resources/junit48-multiple-methods/pom.xml
+++ b/surefire-integration-tests/src/test/resources/junit48-multiple-methods/pom.xml
@@ -23,6 +23,13 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
 
+  <parent>
+    <groupId>org.apache.maven.surefire</groupId>
+    <artifactId>it-parent</artifactId>
+    <version>1.0</version>
+    <relativePath>../pom.xml</relativePath>
+  </parent>
+
   <groupId>org.apache.maven.plugins.surefire</groupId>
   <artifactId>junit4</artifactId>
   <version>1.0-SNAPSHOT</version>
@@ -55,9 +62,8 @@
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
-        <version>${surefire.version}</version>
         <configuration>
-          <test>junit4.BasicTest#testSuccessOne+testFailOne,junit4.TestThree#testSuccessTwo</test>
+          <test>junit4/BasicTest#testSuccessOne+testFailOne,junit4/TestThree#testSuccessTwo</test>
         </configuration>
       </plugin>
     </plugins>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a577d094/surefire-providers/surefire-junit4/src/main/java/org/apache/maven/surefire/junit4/JUnit4Provider.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit4/src/main/java/org/apache/maven/surefire/junit4/JUnit4Provider.java b/surefire-providers/surefire-junit4/src/main/java/org/apache/maven/surefire/junit4/JUnit4Provider.java
index 93922e1..8edad4d 100644
--- a/surefire-providers/surefire-junit4/src/main/java/org/apache/maven/surefire/junit4/JUnit4Provider.java
+++ b/surefire-providers/surefire-junit4/src/main/java/org/apache/maven/surefire/junit4/JUnit4Provider.java
@@ -285,9 +285,9 @@ public class JUnit4Provider
     }
 
     /**
-     * this method retrive testMethods from String like
-     * "com.xx.ImmutablePairTest#testBasic,com.xx.StopWatchTest#testLang315+testStopWatchSimpleGet" <br>
-     * and we need to think about cases that 2 or more method in 1 class. we should choose the correct method
+     * Return testMethods from String like
+     * "com/xx/ImmutablePairTest#testBasic,com/xx/StopWatchTest#testLang315+testStopWatchSimpleGet" <br>
+     * and we need to think about cases that 2 or more method in 1 class. We should choose the correct method
      *
      * @param testClass the testclass
      * @param testMethodStr the test method string
@@ -295,7 +295,7 @@ public class JUnit4Provider
      */
     private static String getMethod( Class testClass, String testMethodStr )
     {
-        final String className = testClass.getName();
+        final String className = testClass.getName().replace( '.', '/' );
 
         if ( !testMethodStr.contains( "#" ) && !testMethodStr.contains( "," ) )
         {