You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2018/05/03 21:02:42 UTC

[maven-integration-testing] branch MNG-6386 updated (0d4ed62 -> 1f4912c)

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

michaelo pushed a change to branch MNG-6386
in repository https://gitbox.apache.org/repos/asf/maven-integration-testing.git.


 discard 0d4ed62  [MNG-6386] ${project.baseUri} is not a valid URI (according to RFC 3986)
     new 1f4912c  [MNG-6386] ${project.baseUri} is not a valid URI (according to RFC 3986)

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (0d4ed62)
            \
             N -- N -- N   refs/heads/MNG-6386 (1f4912c)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:

-- 
To stop receiving notification emails like this one, please contact
michaelo@apache.org.

[maven-integration-testing] 01/01: [MNG-6386] ${project.baseUri} is not a valid URI (according to RFC 3986)

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch MNG-6386
in repository https://gitbox.apache.org/repos/asf/maven-integration-testing.git

commit 1f4912cda5f49b6ba36a2693bb5c1701ea4d9b86
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Thu May 3 23:01:45 2018 +0200

    [MNG-6386] ${project.baseUri} is not a valid URI (according to RFC 3986)
    
    File#toURI()#toString() produces a non-compliant URI making tools like
    Subversion or Git to choke on those URIs. Whereas Path#toUri()#toASCIIString()
    does the right job.
---
 .../org/apache/maven/it/IntegrationTestSuite.java  |  1 +
 .../it/MavenITmng3760BaseUriPropertyTest.java      |  2 +-
 ...java => MavenITmng6386BaseUriPropertyTest.java} | 42 ++++++++-------
 .../pom.xml"                                       | 61 ++++++++++++++++++++++
 core-it-suite/src/test/resources/mng-6386/pom.xml  | 61 ++++++++++++++++++++++
 5 files changed, 146 insertions(+), 21 deletions(-)

diff --git a/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java b/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
index ca46e3a..9dcef0b 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
@@ -106,6 +106,7 @@ public class IntegrationTestSuite
         // -------------------------------------------------------------------------------------------------------------
         // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
 
+        suite.addTestSuite( MavenITmng6386BaseUriPropertyTest.class );
         suite.addTestSuite( MavenITmng6330RelativePath.class );
         suite.addTestSuite( MavenITmng6240PluginExtensionAetherProvider.class );
         suite.addTestSuite( MavenITmng6223FindBasedir.class );
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3760BaseUriPropertyTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3760BaseUriPropertyTest.java
index 4e42ce6..4116330 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3760BaseUriPropertyTest.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3760BaseUriPropertyTest.java
@@ -37,7 +37,7 @@ public class MavenITmng3760BaseUriPropertyTest
 
     public MavenITmng3760BaseUriPropertyTest()
     {
-        super( "(2.1.0-M1,3.0-alpha-1),(3.0-alpha-2,)" ); // 2.1.0-M2+
+        super( "(2.1.0-M1,3.0-alpha-1),(3.0-alpha-2,3.5.4)" ); // 2.1.0-M2+
     }
 
     public void testitMNG3760()
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3760BaseUriPropertyTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6386BaseUriPropertyTest.java
similarity index 61%
copy from core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3760BaseUriPropertyTest.java
copy to core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6386BaseUriPropertyTest.java
index 4e42ce6..b7e0a4e 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3760BaseUriPropertyTest.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6386BaseUriPropertyTest.java
@@ -26,24 +26,21 @@ import org.apache.maven.it.Verifier;
 import org.apache.maven.it.util.ResourceExtractor;
 
 /**
- * This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-3760">MNG-3760</a>.
- * 
- * @author Brett Porter
- * @version $Id$
+ * This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-6386">MNG-6386</a>.
  */
-public class MavenITmng3760BaseUriPropertyTest
+public class MavenITmng6386BaseUriPropertyTest
     extends AbstractMavenIntegrationTestCase
 {
 
-    public MavenITmng3760BaseUriPropertyTest()
+    public MavenITmng6386BaseUriPropertyTest()
     {
-        super( "(2.1.0-M1,3.0-alpha-1),(3.0-alpha-2,)" ); // 2.1.0-M2+
+        super( "[3.5.4,)" );
     }
 
-    public void testitMNG3760()
+    public void testitMNG6386()
         throws Exception
     {
-        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3760" ).getCanonicalFile();
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-6386" ).getCanonicalFile();
 
         Verifier verifier = newVerifier( testDir.getAbsolutePath() );
         verifier.setAutoclean( false );
@@ -54,32 +51,37 @@ public class MavenITmng3760BaseUriPropertyTest
         verifier.resetStreams();
 
         Properties props = verifier.loadProperties( "target/profile.properties" );
+        String pomProperty = props.getProperty( "project.properties.pomProperty" );
         // set via project
-        assertEquals( testDir.toURI().toString(), props.getProperty( "project.properties.pomProperty" ) );
-        // check that project prefix is required
-        assertEquals( "${baseUri}", props.getProperty( "project.properties.baseUriProperty" ) );
+        assertEquals( testDir.toPath().toUri().toASCIIString(), pomProperty );
+        // check that baseUri begins with file:///
+        assertTrue( pomProperty.startsWith( "file:///" ) );
     }
 
-    public void testitMNG3760SystemPropertyOverride()
+     public void testitMNG6386UnicodeChars()
         throws Exception
     {
-        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3760" ).getCanonicalFile();
+        String fileEncoding = System.getProperty( "file.encoding" );
+        org.junit.Assume.assumeTrue( "UTF-8".equalsIgnoreCase( fileEncoding ) || "UTF8".equalsIgnoreCase( fileEncoding ) );
+
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-6386-это по-русский" ).getCanonicalFile();
 
-        // check that setting baseUri doesn't override project value
         Verifier verifier = newVerifier( testDir.getAbsolutePath() );
         verifier.setAutoclean( false );
         verifier.deleteDirectory( "target" );
-        verifier.addCliOption( "-DbaseUri=myBaseUri" );
-        verifier.setLogFileName( "log-sysprop.txt" );
+        verifier.setLogFileName( "log-basic.txt" );
         verifier.executeGoal( "validate" );
         verifier.verifyErrorFreeLog();
         verifier.resetStreams();
 
         Properties props = verifier.loadProperties( "target/profile.properties" );
+        String pomProperty = props.getProperty( "project.properties.pomProperty" );
         // set via project
-        assertEquals( testDir.toURI().toString(), props.getProperty( "project.properties.pomProperty" ) );
-        // check that project prefix is required
-        assertEquals( "myBaseUri", props.getProperty( "project.properties.baseUriProperty" ) );
+        assertEquals( testDir.toPath().toUri().toASCIIString(), pomProperty );
+        // check that baseUri begins with file:///
+        assertTrue( pomProperty.startsWith( "file:///" ) );
+        // check that baseUri ends with это по-русский/
+        assertTrue( pomProperty.endsWith( "%D1%8D%D1%82%D0%BE%20%D0%BF%D0%BE-%D1%80%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9/" ) );
     }
 
 }
diff --git "a/core-it-suite/src/test/resources/mng-6386-\321\215\321\202\320\276 \320\277\320\276-\321\200\321\203\321\201\321\201\320\272\320\270\320\271/pom.xml" "b/core-it-suite/src/test/resources/mng-6386-\321\215\321\202\320\276 \320\277\320\276-\321\200\321\203\321\201\321\201\320\272\320\270\320\271/pom.xml"
new file mode 100644
index 0000000..fe7dacf
--- /dev/null
+++ "b/core-it-suite/src/test/resources/mng-6386-\321\215\321\202\320\276 \320\277\320\276-\321\200\321\203\321\201\321\201\320\272\320\270\320\271/pom.xml"	
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project>
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.its.mng6386</groupId>
+  <artifactId>child</artifactId>
+  <version>0.1</version>
+
+  <name>Maven Integration Test :: MNG-6386 (Unicode Chars)</name>
+  <description>
+    Test project.baseUri property (RFC 3986 compliance).
+  </description>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.its.plugins</groupId>
+        <artifactId>maven-it-plugin-expression</artifactId>
+        <version>2.1-SNAPSHOT</version>
+        <executions>
+          <execution>
+            <phase>validate</phase>
+            <goals>
+              <goal>eval</goal>
+            </goals>
+            <configuration>
+              <outputFile>target/profile.properties</outputFile>
+              <expressions>
+                <expression>project/properties</expression>
+              </expressions>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
+  <properties>
+    <pomProperty>${project.baseUri}</pomProperty>
+  </properties>
+</project>
diff --git a/core-it-suite/src/test/resources/mng-6386/pom.xml b/core-it-suite/src/test/resources/mng-6386/pom.xml
new file mode 100644
index 0000000..8ecb601
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-6386/pom.xml
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project>
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.its.mng6386</groupId>
+  <artifactId>child</artifactId>
+  <version>0.1</version>
+
+  <name>Maven Integration Test :: MNG-6386</name>
+  <description>
+    Test project.baseUri property (RFC 3986 compliance).
+  </description>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.its.plugins</groupId>
+        <artifactId>maven-it-plugin-expression</artifactId>
+        <version>2.1-SNAPSHOT</version>
+        <executions>
+          <execution>
+            <phase>validate</phase>
+            <goals>
+              <goal>eval</goal>
+            </goals>
+            <configuration>
+              <outputFile>target/profile.properties</outputFile>
+              <expressions>
+                <expression>project/properties</expression>
+              </expressions>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
+  <properties>
+    <pomProperty>${project.baseUri}</pomProperty>
+  </properties>
+</project>

-- 
To stop receiving notification emails like this one, please contact
michaelo@apache.org.