You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2021/08/14 13:36:20 UTC

[maven-javadoc-plugin] branch master updated: Fix assertion of -J-Dhttp.nonProxyHosts argument including surrounding quotes

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

rfscholte pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-javadoc-plugin.git


The following commit(s) were added to refs/heads/master by this push:
     new ff0b6c3  Fix assertion of -J-Dhttp.nonProxyHosts argument including surrounding quotes
ff0b6c3 is described below

commit ff0b6c38800cda87c3bf4d7f6acfe1be57ebd104
Author: rfscholte <rf...@apache.org>
AuthorDate: Sat Aug 14 15:36:04 2021 +0200

    Fix assertion of -J-Dhttp.nonProxyHosts argument including surrounding quotes
---
 .../org/apache/maven/plugins/javadoc/JavadocReportTest.java | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/JavadocReportTest.java b/src/test/java/org/apache/maven/plugins/javadoc/JavadocReportTest.java
index 23c3998..7ade1a6 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/JavadocReportTest.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/JavadocReportTest.java
@@ -62,7 +62,6 @@ import org.apache.maven.shared.utils.io.FileUtils;
 import org.codehaus.plexus.languages.java.version.JavaVersion;
 import org.hamcrest.MatcherAssert;
 import org.junit.AssumptionViolatedException;
-import org.junit.Ignore;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.sonatype.aether.impl.internal.SimpleLocalRepositoryManager;
@@ -953,7 +952,6 @@ public class JavadocReportTest
      *
      * @throws Exception if any
      */
-    @Ignore("We don't really want to have unit test which need internet access")
     public void testProxy()
         throws Exception
     {
@@ -991,8 +989,15 @@ public class JavadocReportTest
         Path commandLine = new File( getBasedir(), "target/test/unit/proxy-test/target/site/apidocs/javadoc." + ( SystemUtils.IS_OS_WINDOWS ? "bat" : "sh" ) ).toPath();
         assertThat( commandLine ).exists();
         String readed = readFile( commandLine );
-        assertThat( readed ).contains( "-J-Dhttp.proxyHost=127.0.0.1" ).contains( "-J-Dhttp.proxyPort=80" )
-                .contains( "-J-Dhttp.nonProxyHosts=\\\"www.google.com^|*.somewhere.com\\\"" );
+        assertThat( readed ).contains( "-J-Dhttp.proxyHost=127.0.0.1" ).contains( "-J-Dhttp.proxyPort=80" );
+        if ( SystemUtils.IS_OS_WINDOWS )
+        {
+            assertThat( readed ).contains( " -J-Dhttp.nonProxyHosts=\"www.google.com^|*.somewhere.com\" " );
+        }
+        else
+        {
+            assertThat( readed ).contains( " \"-J-Dhttp.nonProxyHosts=\\\"www.google.com^|*.somewhere.com\\\"\" " );
+        }
 
         Path options = new File( getBasedir(), "target/test/unit/proxy-test/target/site/apidocs/options" ).toPath();
         assertThat( options ).exists();