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/20 22:25:00 UTC

[maven-integration-testing] branch MNG-6401 created (now 3bef390)

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

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


      at 3bef390  [MNG-6401] Cannot interpolate property in proxy port of settings.xml

This branch includes the following new commits:

     new 3bef390  [MNG-6401] Cannot interpolate property in proxy port of settings.xml

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.


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

[maven-integration-testing] 01/01: [MNG-6401] Cannot interpolate property in proxy port of settings.xml

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

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

commit 3bef390e5dc054448914d06c1d789a184678b405
Author: KATADA Junya <jk...@gmail.com>
AuthorDate: Sun May 6 13:23:19 2018 +0900

    [MNG-6401] Cannot interpolate property in proxy port of settings.xml
    
    This closes #31
---
 .../org/apache/maven/it/IntegrationTestSuite.java  |  1 +
 .../MavenITmng6401InterpolateSettingsXmlTest.java  | 43 +++++++++++++++++
 core-it-suite/src/test/resources/mng-6401/pom.xml  | 55 ++++++++++++++++++++++
 .../src/test/resources/mng-6401/settings.xml       | 13 +++++
 4 files changed, 112 insertions(+)

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 9dcef0b..8e9f24c 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( MavenITmng6401InterpolateSettingsXmlTest.class);
         suite.addTestSuite( MavenITmng6386BaseUriPropertyTest.class );
         suite.addTestSuite( MavenITmng6330RelativePath.class );
         suite.addTestSuite( MavenITmng6240PluginExtensionAetherProvider.class );
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6401InterpolateSettingsXmlTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6401InterpolateSettingsXmlTest.java
new file mode 100644
index 0000000..4307216
--- /dev/null
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6401InterpolateSettingsXmlTest.java
@@ -0,0 +1,43 @@
+package org.apache.maven.it;
+
+import java.io.File;
+import java.util.Properties;
+
+import org.apache.maven.it.util.ResourceExtractor;
+
+/**
+ * This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-6401">MNG-6401</a>:
+ * check interpolation for various types fields in settings.xml.
+ */
+public class MavenITmng6401InterpolateSettingsXmlTest
+    extends AbstractMavenIntegrationTestCase
+{
+
+    public MavenITmng6401InterpolateSettingsXmlTest()
+    {
+        super( "[3.5.4,)" );
+    }
+
+    public void testInterpolateSettingsXml()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-6401" );
+
+        Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+        verifier.addCliOption( "--settings" );
+        verifier.addCliOption( "settings.xml" );
+        verifier.setEnvironmentVariable("MAVEN_PROXY_ACTIVE_BOOLEAN", "true");
+        verifier.setEnvironmentVariable("MAVEN_PROXY_HOST_STRING", "myproxy.host.net");
+        verifier.setEnvironmentVariable("MAVEN_PROXY_PORT_INT", "18080");
+        verifier.executeGoal( "validate" );
+
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+
+        Properties props = verifier.loadProperties( "target/settings.properties" );
+        assertEquals( "true", props.getProperty( "settings.proxies.0.active" ) );
+        assertEquals( "myproxy.host.net", props.getProperty( "settings.proxies.0.host" ) );
+        assertEquals( "18080", props.getProperty( "settings.proxies.0.port" ) );
+    }
+}
+
diff --git a/core-it-suite/src/test/resources/mng-6401/pom.xml b/core-it-suite/src/test/resources/mng-6401/pom.xml
new file mode 100644
index 0000000..76358d7
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-6401/pom.xml
@@ -0,0 +1,55 @@
+<?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.mng6401</groupId>
+  <artifactId>test</artifactId>
+  <version>1.0.0-SNAPSHOT</version>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.its.plugins</groupId>
+        <artifactId>maven-it-plugin-expression</artifactId>
+        <version>2.1-SNAPSHOT</version>
+        <configuration>
+          <outputFile>target/settings.properties</outputFile>
+          <expressions>
+            <expression>settings/proxies/0/active</expression>
+            <expression>settings/proxies/0/host</expression>
+            <expression>settings/proxies/0/port</expression>
+          </expressions>
+        </configuration>
+        <executions>
+          <execution>
+            <id>test</id>
+            <phase>validate</phase>
+            <goals>
+              <goal>eval</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/core-it-suite/src/test/resources/mng-6401/settings.xml b/core-it-suite/src/test/resources/mng-6401/settings.xml
new file mode 100644
index 0000000..b0a01e4
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-6401/settings.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<settings>
+  <proxies>
+    <proxy>
+      <id>my_proxy</id>
+      <active>${env.MAVEN_PROXY_ACTIVE_BOOLEAN}</active>
+      <protocol>http</protocol>
+      <host>${env.MAVEN_PROXY_HOST_STRING}</host>
+      <port>${env.MAVEN_PROXY_PORT_INT}</port>
+      <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
+    </proxy>
+  </proxies>
+</settings>

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