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 2019/05/09 00:28:52 UTC

[maven-surefire] branch SUREFIRE-1617 updated: IT

This is an automated email from the ASF dual-hosted git repository.

tibordigana pushed a commit to branch SUREFIRE-1617
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git


The following commit(s) were added to refs/heads/SUREFIRE-1617 by this push:
     new 1d41ad7  IT
1d41ad7 is described below

commit 1d41ad7610209fa214bd56c7a9bb2c20d18064ac
Author: tibordigana <ti...@apache.org>
AuthorDate: Thu May 9 02:28:42 2019 +0200

    IT
---
 surefire-its/pom.xml                               |  2 +-
 .../org/apache/maven/surefire/its/UmlautDirIT.java | 53 ++++++++++++++++++++--
 2 files changed, 50 insertions(+), 5 deletions(-)

diff --git a/surefire-its/pom.xml b/surefire-its/pom.xml
index 2da331f..ca7ef60 100644
--- a/surefire-its/pom.xml
+++ b/surefire-its/pom.xml
@@ -170,7 +170,7 @@
                     <forkMode>once</forkMode>
                     <argLine>-server -Xmx64m -XX:+UseG1GC -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Djava.awt.headless=true -Djdk.net.URLClassPath.disableClassPathURLCheck=true</argLine>
                     <includes>
-                        <include>org/apache/**/*IT*.java</include>
+                        <include>org/apache/**/UmlautDirIT.java</include>
                     </includes>
                     <!-- Pass current surefire version to the main suite so that it -->
                     <!-- can forward to all integration test projects. SUREFIRE-513 -->
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/UmlautDirIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/UmlautDirIT.java
index 7b008bc..28cecf2 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/UmlautDirIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/UmlautDirIT.java
@@ -19,15 +19,19 @@ package org.apache.maven.surefire.its;
  * under the License.
  */
 
-import org.apache.maven.it.VerificationException;
 import org.apache.maven.surefire.its.fixture.MavenLauncher;
 import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
 import org.apache.maven.surefire.its.fixture.SurefireLauncher;
+import org.junit.After;
+import org.junit.Before;
 import org.junit.Test;
 
 import java.io.File;
 import java.io.IOException;
 
+import static org.apache.commons.lang3.SystemUtils.IS_OS_LINUX;
+import static org.junit.Assume.assumeTrue;
+
 /**
  * Test a directory with an umlaut
  *
@@ -36,11 +40,42 @@ import java.io.IOException;
 public class UmlautDirIT
     extends SurefireJUnit4IntegrationTestCase
 {
+    private String localRepo;
+
+    @Before
+    public void backupLocalRepo()
+    {
+        localRepo = System.getProperty( "maven.repo.local" );
+    }
+
+    @After
+    public void restoreLocalRepo()
+    {
+        if ( localRepo == null )
+        {
+            System.clearProperty( "maven.repo.local" );
+        }
+        else
+        {
+            System.setProperty( "maven.repo.local", localRepo );
+        }
+    }
+
+    @Test
+    public void surefire1617()
+    {
+        assumeTrue( IS_OS_LINUX );
+        unpackWithNewLocalRepo()
+                .executeTest()
+                .verifyErrorFreeLog()
+                .assertTestSuiteResults( 1, 0, 0, 0 );
+    }
+
     @Test
     public void testUmlaut()
         throws Exception
     {
-        specialUnpack( "1" )
+        unpackToGermanUmplautDirectory( "1" )
                 .executeTest()
                 .verifyErrorFreeLog()
                 .assertTestSuiteResults( 1, 0, 0, 0 );
@@ -50,13 +85,13 @@ public class UmlautDirIT
     public void testUmlautIsolatedClassLoader()
         throws Exception
     {
-        specialUnpack( "2" )
+        unpackToGermanUmplautDirectory( "2" )
                 .useSystemClassLoader( false )
                 .executeTest()
                 .assertTestSuiteResults( 1, 0, 0, 0 );
     }
 
-    SurefireLauncher specialUnpack( String postfix )
+    private SurefireLauncher unpackToGermanUmplautDirectory( String postfix )
         throws IOException
     {
         SurefireLauncher unpack = unpack( "junit-pathWithUmlaut" );
@@ -66,4 +101,14 @@ public class UmlautDirIT
         maven.moveUnpackTo( dest );
         return unpack;
     }
+
+    private SurefireLauncher unpackWithNewLocalRepo()
+    {
+        File target = new File( System.getProperty( "user.dir" ), "target" );
+        File newLocalRepo = new File( target, "local repo for : SUREFIRE-1617" );
+        //noinspection ResultOfMethodCallIgnored
+        newLocalRepo.mkdir();
+        System.setProperty( "maven.repo.local", newLocalRepo.getPath() );
+        return unpack( "junit-pathWithUmlaut" );
+    }
 }