maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tibordig...@apache.org
Subject maven-surefire git commit: UnicodeTestNamesIT should be able to run multiple times [Forced Update!]
Date Fri, 05 Jan 2018 02:39:16 GMT
Repository: maven-surefire
Updated Branches:
  refs/heads/UnicodeTestNamesIT 9d6632923 -> 67c901811 (forced update)


UnicodeTestNamesIT should be able to run multiple times


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

Branch: refs/heads/UnicodeTestNamesIT
Commit: 67c9018119100ee639ff7807c30a3a60a6f07b22
Parents: 2f16bc7
Author: Tibor17 <tibordigana@apache.org>
Authored: Thu Jan 4 01:06:04 2018 +0100
Committer: Tibor17 <tibordigana@apache.org>
Committed: Fri Jan 5 03:39:05 2018 +0100

----------------------------------------------------------------------
 .../maven/surefire/its/UnicodeTestNamesIT.java  | 45 +++++++++++++-------
 1 file changed, 29 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/67c90181/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/UnicodeTestNamesIT.java
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/UnicodeTestNamesIT.java
b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/UnicodeTestNamesIT.java
index 5470a3f..22ae481 100644
--- a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/UnicodeTestNamesIT.java
+++ b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/UnicodeTestNamesIT.java
@@ -20,41 +20,54 @@ package org.apache.maven.surefire.its;
  */
 
 import java.io.File;
+
 import org.apache.maven.surefire.its.fixture.OutputValidator;
 import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
 import org.apache.maven.surefire.its.fixture.SurefireLauncher;
 import org.apache.maven.surefire.its.fixture.TestFile;
 
-import org.junit.Assert;
-import org.junit.Assume;
 import org.junit.Test;
 
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assume.assumeFalse;
+
 /**
  * Verifies unicode filenames pass through correctly.
- * <br>
- * If the underlying file system turns out not to support unicode, we just fail an assumption.s
  */
 public class UnicodeTestNamesIT
-    extends SurefireJUnit4IntegrationTestCase
+        extends SurefireJUnit4IntegrationTestCase
 {
     @Test
     public void checkFileNamesWithUnicode()
     {
         SurefireLauncher unpacked = unpack( "unicode-testnames" );
-        File xxyz = new File( unpacked.getUnpackedAt(), "src/test/java/junit/twoTestCases/XXYZTest.java"
);
+        File basedir = unpacked.getUnpackedAt();
+
+        unpacked.execute( "clean" );
+
+        File xxyz = new File( basedir, "src/test/java/junit/twoTestCases/XXYZTest.java" );
+        File dest = new File( basedir, "src/test/java/junit/twoTestCases/\u800C\u7D22\u5176\u60C5Test.java"
);
+
+        //noinspection ResultOfMethodCallIgnored
+        dest.delete();
+        assertTrue( xxyz.renameTo( dest ) );
+
+        assertTrue( dest.exists() );
+        assumeFalse( new File( basedir, "src/test/java/junit/twoTestCases/????Test.java"
).exists() );
 
-        File dest = new File( unpacked.getUnpackedAt(),
-                              "src/test/java/junit/twoTestCases/\u800C\u7D22\u5176\u60C5Test.java"
);
+        OutputValidator outputValidator =
+                unpacked.executeTest()
+                        .assertTestSuiteResults( 2, 0, 0, 0 );
 
-        Assume.assumeTrue( xxyz.renameTo( dest ) );
-        Assume.assumeTrue( dest.exists() );
-        Assume.assumeTrue(
-            !new File( unpacked.getUnpackedAt(), "src/test/java/junit/twoTestCases/????Test.java"
).exists() );
+        TestFile surefireReportFile =
+                outputValidator.getSurefireReportsFile( "junit.twoTestCases.而索其情Test.txt"
);
+        assertTrue( surefireReportFile.exists() );
+        surefireReportFile.assertContainsText( "junit.twoTestCases.????Test" );
 
-        OutputValidator outputValidator = unpacked.executeTest().assertTestSuiteResults(
2, 0, 0, 0 );
-        TestFile surefireReportsFile = outputValidator.getSurefireReportsFile( "junit.twoTestCases.而索其情Test.txt"
);
-        Assert.assertTrue( surefireReportsFile.exists() );
-        //surefireReportsFile .assertContainsText( "junit.twoTestCases.\u800C\u7D22\u5176\u60C5Test.txt"
);
+        TestFile surefireXmlReportFile =
+                outputValidator.getSurefireReportsFile( "TEST-junit.twoTestCases.而索其情Test.xml"
);
+        assertTrue( surefireXmlReportFile.exists() );
+        surefireXmlReportFile.assertContainsText( "junit.twoTestCases.而索其情Test" );
     }
 
 }


Mime
View raw message