Skip to content

Commit ff0b6c3

Browse files
committed
Fix assertion of -J-Dhttp.nonProxyHosts argument including surrounding quotes
1 parent f845fe4 commit ff0b6c3

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/test/java/org/apache/maven/plugins/javadoc/JavadocReportTest.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
import org.codehaus.plexus.languages.java.version.JavaVersion;
6363
import org.hamcrest.MatcherAssert;
6464
import org.junit.AssumptionViolatedException;
65-
import org.junit.Ignore;
6665
import org.slf4j.Logger;
6766
import org.slf4j.LoggerFactory;
6867
import org.sonatype.aether.impl.internal.SimpleLocalRepositoryManager;
@@ -953,7 +952,6 @@ public void testJdk6()
953952
*
954953
* @throws Exception if any
955954
*/
956-
@Ignore("We don't really want to have unit test which need internet access")
957955
public void testProxy()
958956
throws Exception
959957
{
@@ -991,8 +989,15 @@ public void testProxy()
991989
Path commandLine = new File( getBasedir(), "target/test/unit/proxy-test/target/site/apidocs/javadoc." + ( SystemUtils.IS_OS_WINDOWS ? "bat" : "sh" ) ).toPath();
992990
assertThat( commandLine ).exists();
993991
String readed = readFile( commandLine );
994-
assertThat( readed ).contains( "-J-Dhttp.proxyHost=127.0.0.1" ).contains( "-J-Dhttp.proxyPort=80" )
995-
.contains( "-J-Dhttp.nonProxyHosts=\\\"www.google.com^|*.somewhere.com\\\"" );
992+
assertThat( readed ).contains( "-J-Dhttp.proxyHost=127.0.0.1" ).contains( "-J-Dhttp.proxyPort=80" );
993+
if ( SystemUtils.IS_OS_WINDOWS )
994+
{
995+
assertThat( readed ).contains( " -J-Dhttp.nonProxyHosts=\"www.google.com^|*.somewhere.com\" " );
996+
}
997+
else
998+
{
999+
assertThat( readed ).contains( " \"-J-Dhttp.nonProxyHosts=\\\"www.google.com^|*.somewhere.com\\\"\" " );
1000+
}
9961001

9971002
Path options = new File( getBasedir(), "target/test/unit/proxy-test/target/site/apidocs/options" ).toPath();
9981003
assertThat( options ).exists();

0 commit comments

Comments
 (0)