Repository: maven-surefire
Updated Branches:
  refs/heads/master 1c9df460e -> 2360dacc9


[SUREFIRE-1332] SurefireLauncher duplicates functions and breaks build with 
Maven 3.5.0


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

Branch: refs/heads/master
Commit: 2360dacc974c112a3ca14d7a27535c6241275357
Parents: 1c9df46
Author: Tibor17 <tibo...@lycos.com>
Authored: Mon Feb 13 08:03:09 2017 +0100
Committer: Tibor17 <tibo...@lycos.com>
Committed: Mon Feb 13 08:03:09 2017 +0100

----------------------------------------------------------------------
 .../maven/surefire/its/CrashDetectionIT.java       | 17 +++++++++++++++--
 .../org/apache/maven/surefire/its/ForkModeIT.java  | 13 ++++++++++---
 .../surefire/its/fixture/SurefireLauncher.java     |  7 +------
 .../Surefire1295AttributeJvmCrashesToTestsIT.java  |  3 ++-
 .../jiras/Surefire839TestWithoutCategoriesIT.java  |  9 +++++++--
 .../Surefire907PerThreadWithoutThreadCountIT.java  |  8 +++++++-
 ...Surefire946KillMainProcessInReusableForkIT.java |  2 +-
 7 files changed, 43 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/2360dacc/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CrashDetectionIT.java
----------------------------------------------------------------------
diff --git 
a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CrashDetectionIT.java
 
b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CrashDetectionIT.java
index 90c4630..b5489d1 100644
--- 
a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CrashDetectionIT.java
+++ 
b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CrashDetectionIT.java
@@ -37,12 +37,25 @@ public class CrashDetectionIT
     @Test
     public void crashInReusableFork()
     {
-        unpack( "crash-detection" ).forkOncePerThread().threadCount( 1 
).maven().withFailure().executeTest();
+        unpack( "crash-detection" )
+                .forkPerThread()
+                .reuseForks( true )
+                .threadCount( 1 )
+                .maven()
+                .withFailure()
+                .executeTest();
     }
 
     @Test
     public void hardCrashInReusableFork()
     {
-        unpack( "crash-detection" ).forkOncePerThread().threadCount( 1 
).addGoal( "-DkillHard=true" ).maven().withFailure().executeTest();
+        unpack( "crash-detection" )
+                .forkPerThread()
+                .reuseForks( true )
+                .threadCount( 1 )
+                .addGoal( "-DkillHard=true" )
+                .maven()
+                .withFailure()
+                .executeTest();
     }
 }

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/2360dacc/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ForkModeIT.java
----------------------------------------------------------------------
diff --git 
a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ForkModeIT.java
 
b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ForkModeIT.java
index 061c5a6..0be2123 100644
--- 
a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ForkModeIT.java
+++ 
b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ForkModeIT.java
@@ -91,7 +91,11 @@ public class ForkModeIT
     @Test
     public void testForkModeOncePerThreadSingleThread()
     {
-        String[] pids = doTest( unpack( getProject() 
).setForkJvm().forkOncePerThread().threadCount( 1 ) );
+        String[] pids = doTest( unpack( getProject() )
+                .setForkJvm()
+                .forkPerThread()
+                .reuseForks( true )
+                .threadCount( 1 ) );
         assertSamePids( pids );
         assertEndWith( pids, "_1_1", 3 );
         assertFalse( "pid 1 is not the same as the main process' pid", 
pids[0].equals( getMainPID() ) );
@@ -100,8 +104,11 @@ public class ForkModeIT
     @Test
     public void testForkModeOncePerThreadTwoThreads()
     {
-        String[] pids =
-            doTest( unpack( getProject() ).forkOncePerThread().threadCount( 2 
).addGoal( "-DsleepLength=1200" ) );
+        String[] pids = doTest( unpack( getProject() )
+                .forkPerThread()
+                .reuseForks( true )
+                .threadCount( 2 )
+                .addGoal( "-DsleepLength=1200" ) );
         assertDifferentPids( pids, 2 );
         assertFalse( "pid 1 is not the same as the main process' pid", 
pids[0].equals( getMainPID() ) );
     }

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/2360dacc/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java
----------------------------------------------------------------------
diff --git 
a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java
 
b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java
index cf0d90d..23a09b0 100755
--- 
a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java
+++ 
b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java
@@ -264,12 +264,7 @@ public class SurefireLauncher
 
     public SurefireLauncher forkPerThread()
     {
-        return forkMode( "perthread" ).reuseForks( false );
-    }
-
-    public SurefireLauncher forkOncePerThread()
-    {
-        return forkPerThread().reuseForks( true );
+        return forkMode( "perthread" );
     }
 
     public SurefireLauncher threadCount( int threadCount )

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/2360dacc/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1295AttributeJvmCrashesToTestsIT.java
----------------------------------------------------------------------
diff --git 
a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1295AttributeJvmCrashesToTestsIT.java
 
b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1295AttributeJvmCrashesToTestsIT.java
index 94532b9..f7f518d 100644
--- 
a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1295AttributeJvmCrashesToTestsIT.java
+++ 
b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1295AttributeJvmCrashesToTestsIT.java
@@ -70,7 +70,8 @@ public class Surefire1295AttributeJvmCrashesToTestsIT
     public void crashInReusableFork() throws VerificationException
     {
         SurefireLauncher launcher = unpack( "crash-during-test" )
-                                            .forkOncePerThread()
+                                            .forkPerThread()
+                                            .reuseForks( true )
                                             .threadCount( 1 );
 
         checkCrashTypes( launcher );

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/2360dacc/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire839TestWithoutCategoriesIT.java
----------------------------------------------------------------------
diff --git 
a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire839TestWithoutCategoriesIT.java
 
b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire839TestWithoutCategoriesIT.java
index ebb6672..0babe66 100755
--- 
a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire839TestWithoutCategoriesIT.java
+++ 
b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire839TestWithoutCategoriesIT.java
@@ -34,7 +34,12 @@ public class Surefire839TestWithoutCategoriesIT
     @Test
     public void classWithoutCategoryForked()
     {
-        unpack( "junit48-categories" ).setJUnitVersion( "4.11" 
).forkOncePerThread().threadCount(
-            2 ).executeTest().verifyErrorFree( 3 );
+        unpack( "junit48-categories" )
+                .setJUnitVersion( "4.11" )
+                .forkPerThread()
+                .reuseForks( true )
+                .threadCount( 2 )
+                .executeTest()
+                .verifyErrorFree( 3 );
     }
 }

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/2360dacc/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire907PerThreadWithoutThreadCountIT.java
----------------------------------------------------------------------
diff --git 
a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire907PerThreadWithoutThreadCountIT.java
 
b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire907PerThreadWithoutThreadCountIT.java
index 96e913c..8317c52 100755
--- 
a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire907PerThreadWithoutThreadCountIT.java
+++ 
b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire907PerThreadWithoutThreadCountIT.java
@@ -29,7 +29,13 @@ public class Surefire907PerThreadWithoutThreadCountIT
     @Test
     public void categoryAB()
     {
-        OutputValidator validator = unpack( "fork-mode" 
).forkPerThread().maven().withFailure().executeTest();
+        OutputValidator validator = unpack( "fork-mode" )
+                .forkPerThread()
+                .reuseForks( false )
+                .maven()
+                .withFailure()
+                .executeTest();
+
         validator.verifyTextInLog( "Fork mode perthread requires a thread 
count" );
     }
 

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/2360dacc/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire946KillMainProcessInReusableForkIT.java
----------------------------------------------------------------------
diff --git 
a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire946KillMainProcessInReusableForkIT.java
 
b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire946KillMainProcessInReusableForkIT.java
index bef2378..ea663ab 100644
--- 
a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire946KillMainProcessInReusableForkIT.java
+++ 
b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire946KillMainProcessInReusableForkIT.java
@@ -66,6 +66,6 @@ public class Surefire946KillMainProcessInReusableForkIT
             .sysProp( "testSleepTime", String.valueOf( TEST_SLEEP_TIME ) )
             .addGoal( 
"org.apache.maven.plugins.surefire:maven-selfdestruct-plugin:selfdestruct" )
             .setForkJvm()
-            .forkOncePerThread().threadCount( 1 
).maven().withFailure().executeTest();
+            .forkPerThread().threadCount( 1 ).reuseForks( true 
).maven().withFailure().executeTest();
     }
 }

Reply via email to