maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tibordig...@apache.org
Subject [05/19] maven-surefire git commit: Modify existing integration tests so they actually use junit48 for method filtering
Date Thu, 26 Mar 2015 00:15:47 GMT
Modify existing integration tests so they actually use junit48 for method filtering


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

Branch: refs/heads/master
Commit: dbcb32ea7bbae17cdeed74bd42236e189f3079de
Parents: bbf9b25
Author: Jörn Horstmann <git@jhorstmann.net>
Authored: Sun Dec 21 17:02:56 2014 +0100
Committer: Jörn Horstmann <git@jhorstmann.net>
Committed: Sun Dec 21 17:02:56 2014 +0100

----------------------------------------------------------------------
 .../apache/maven/surefire/its/TestMethodPatternIT.java    |  9 ++++++---
 .../apache/maven/surefire/its/TestMultipleMethodsIT.java  | 10 +++++++---
 .../org/apache/maven/surefire/its/TestSingleMethodIT.java |  9 ++++++---
 .../src/test/resources/junit48-multiple-methods/pom.xml   |  9 ++++++++-
 .../src/test/resources/junit48-single-method/pom.xml      |  9 ++++++++-
 5 files changed, 35 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/dbcb32ea/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TestMethodPatternIT.java
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TestMethodPatternIT.java
b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TestMethodPatternIT.java
index 8438dd2..2fb082e 100644
--- a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TestMethodPatternIT.java
+++ b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TestMethodPatternIT.java
@@ -19,6 +19,7 @@ package org.apache.maven.surefire.its;
  * under the License.
  */
 
+import org.apache.maven.surefire.its.fixture.OutputValidator;
 import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
 import org.junit.Test;
 
@@ -30,9 +31,11 @@ import org.junit.Test;
 public class TestMethodPatternIT
     extends SurefireJUnit4IntegrationTestCase
 {
-    public void runMethodPattern( String projectName )
+    private static final String RUNNING_WITH_JUNIT48 = "parallel='none', perCoreThreadCount=true,
threadCount=0";
+
+    public OutputValidator runMethodPattern( String projectName )
     {
-        unpack( projectName ).executeTest().assertTestSuiteResults( 2, 0, 0, 0 );
+        return unpack( projectName ).executeTest().assertTestSuiteResults( 2, 0, 0, 0 );
     }
 
     @Test
@@ -44,7 +47,7 @@ public class TestMethodPatternIT
     @Test
     public void testJUnit48()
     {
-        runMethodPattern( "junit48-method-pattern" );
+        runMethodPattern( "junit48-method-pattern" ).verifyTextInLog( RUNNING_WITH_JUNIT48
);
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/dbcb32ea/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TestMultipleMethodsIT.java
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TestMultipleMethodsIT.java
b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TestMultipleMethodsIT.java
index 1544fe0..efbb965 100644
--- a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TestMultipleMethodsIT.java
+++ b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TestMultipleMethodsIT.java
@@ -1,5 +1,6 @@
 package org.apache.maven.surefire.its;
 
+import org.apache.maven.surefire.its.fixture.OutputValidator;
 import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
 import org.junit.Test;
 /*
@@ -30,10 +31,13 @@ import org.junit.Test;
 public class TestMultipleMethodsIT
     extends SurefireJUnit4IntegrationTestCase
 {
-    public void multipleMethod( String projectName )
+
+    private static final String RUNNING_WITH_JUNIT48 = "parallel='none', perCoreThreadCount=true,
threadCount=0";
+
+    public OutputValidator multipleMethod( String projectName )
         throws Exception
     {
-        unpack( projectName ).executeTest().verifyErrorFreeLog().assertTestSuiteResults(
3, 0, 0, 0 );
+        return unpack( projectName ).executeTest().verifyErrorFreeLog().assertTestSuiteResults(
3, 0, 0, 0 );
     }
 
     @Test
@@ -47,7 +51,7 @@ public class TestMultipleMethodsIT
     public void testJunit48()
         throws Exception
     {
-        multipleMethod( "junit48-multiple-methods" );
+        multipleMethod( "junit48-multiple-methods" ).verifyTextInLog( RUNNING_WITH_JUNIT48
);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/dbcb32ea/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TestSingleMethodIT.java
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TestSingleMethodIT.java
b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TestSingleMethodIT.java
index 39d2ab9..34b52a5 100644
--- a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TestSingleMethodIT.java
+++ b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TestSingleMethodIT.java
@@ -19,6 +19,7 @@ package org.apache.maven.surefire.its;
  * under the License.
  */
 
+import org.apache.maven.surefire.its.fixture.OutputValidator;
 import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
 import org.junit.Test;
 
@@ -30,10 +31,12 @@ import org.junit.Test;
 public class TestSingleMethodIT
     extends SurefireJUnit4IntegrationTestCase
 {
-    public void singleMethod( String projectName )
+    private static final String RUNNING_WITH_JUNIT48 = "parallel='none', perCoreThreadCount=true,
threadCount=0";
+
+    public OutputValidator singleMethod( String projectName )
         throws Exception
     {
-        unpack( projectName ).executeTest().verifyErrorFreeLog().assertTestSuiteResults(
1, 0, 0, 0 );
+        return unpack( projectName ).executeTest().verifyErrorFreeLog().assertTestSuiteResults(
1, 0, 0, 0 );
     }
 
     @Test
@@ -47,7 +50,7 @@ public class TestSingleMethodIT
     public void testJunit48()
         throws Exception
     {
-        singleMethod( "junit48-single-method" );
+        singleMethod( "junit48-single-method" ).verifyTextInLog( RUNNING_WITH_JUNIT48 );
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/dbcb32ea/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..df8a981 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
@@ -41,7 +41,7 @@
       <scope>test</scope>
     </dependency>
   </dependencies>
-  
+
   <build>
     <plugins>
       <plugin>
@@ -59,6 +59,13 @@
         <configuration>
           <test>junit4.BasicTest#testSuccessOne+testFailOne,junit4.TestThree#testSuccessTwo</test>
         </configuration>
+        <dependencies>
+          <dependency>
+            <groupId>org.apache.maven.surefire</groupId>
+            <artifactId>surefire-junit47</artifactId>
+            <version>${surefire.version}</version>
+          </dependency>
+        </dependencies>
       </plugin>
     </plugins>
   </build>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/dbcb32ea/surefire-integration-tests/src/test/resources/junit48-single-method/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/resources/junit48-single-method/pom.xml b/surefire-integration-tests/src/test/resources/junit48-single-method/pom.xml
index 9297159..ae544d1 100644
--- a/surefire-integration-tests/src/test/resources/junit48-single-method/pom.xml
+++ b/surefire-integration-tests/src/test/resources/junit48-single-method/pom.xml
@@ -41,7 +41,7 @@
       <scope>test</scope>
     </dependency>
   </dependencies>
-  
+
   <build>
     <plugins>
       <plugin>
@@ -59,6 +59,13 @@
         <configuration>
           <test>BasicTest#testSuccessOne</test>
         </configuration>
+        <dependencies>
+          <dependency>
+            <groupId>org.apache.maven.surefire</groupId>
+            <artifactId>surefire-junit47</artifactId>
+            <version>${surefire.version}</version>
+          </dependency>
+        </dependencies>
       </plugin>
     </plugins>
   </build>


Mime
View raw message