From commits-return-69455-archive-asf-public=cust-asf.ponee.io@maven.apache.org Fri Jan 12 03:57:17 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id 1C023180656 for ; Fri, 12 Jan 2018 03:57:17 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 0C2DB160C41; Fri, 12 Jan 2018 02:57:17 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 522E5160C13 for ; Fri, 12 Jan 2018 03:57:16 +0100 (CET) Received: (qmail 98648 invoked by uid 500); 12 Jan 2018 02:57:15 -0000 Mailing-List: contact commits-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@maven.apache.org Delivered-To: mailing list commits@maven.apache.org Received: (qmail 98639 invoked by uid 99); 12 Jan 2018 02:57:15 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Jan 2018 02:57:15 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 59CC1E9622; Fri, 12 Jan 2018 02:57:15 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: tibordigana@apache.org To: commits@maven.apache.org Message-Id: <3aa5d6bf6325435aaa31d51880d278ee@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: maven-surefire git commit: [SUREFIRE-1461] UnicodeTestNamesIT should be able to run multiple times [Forced Update!] Date: Fri, 12 Jan 2018 02:57:15 +0000 (UTC) Repository: maven-surefire Updated Branches: refs/heads/UnicodeTestNamesIT 09e9a904d -> 2c5c59452 (forced update) [SUREFIRE-1461] 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/2c5c5945 Tree: http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/2c5c5945 Diff: http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/2c5c5945 Branch: refs/heads/UnicodeTestNamesIT Commit: 2c5c59452c4034bd06a6d7e0212a4f7ac0ee54d5 Parents: 7a33fd6 Author: Tibor17 Authored: Thu Jan 4 01:06:04 2018 +0100 Committer: Tibor17 Committed: Fri Jan 12 03:57:04 2018 +0100 ---------------------------------------------------------------------- .../maven/surefire/its/UnicodeTestNamesIT.java | 51 +++++++++++++------- 1 file changed, 33 insertions(+), 18 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/2c5c5945/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..64db960 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 @@ -19,42 +19,57 @@ package org.apache.maven.surefire.its; * under the LicenseUni. */ -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 java.io.File; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.junit.Assume.assumeFalse; + /** * Verifies unicode filenames pass through correctly. - *
- * If the underlying file system turns out not to support unicode, we just fail an assumption.s */ public class UnicodeTestNamesIT - extends SurefireJUnit4IntegrationTestCase + extends SurefireJUnit4IntegrationTestCase { + private static final String TXT_REPORT = "junit.twoTestCases.\u800C\u7D22\u5176\u60C5Test.txt"; + private static final String XML_REPORT = "TEST-junit.twoTestCases.\u800C\u7D22\u5176\u60C5Test.xml"; + @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( TXT_REPORT ); + 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.getSurefireReportsXmlFile( XML_REPORT ); + assertTrue( surefireXmlReportFile.exists() ); + assertFalse( surefireXmlReportFile.readFileToString().isEmpty() ); + surefireXmlReportFile.assertContainsText( "junit.twoTestCases.\u800C\u7D22\u5176\u60C5Test" ); } }