From 34699bf8c66296f8eabb03e9658646ceac19c88b Mon Sep 17 00:00:00 2001 From: Random Committer Date: Fri, 20 Apr 2018 09:53:49 -0700 Subject: [PATCH] proxyTest.java: unset proxy/socks before testing it --- src/test/java/com/rarchives/ripme/tst/proxyTest.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/test/java/com/rarchives/ripme/tst/proxyTest.java b/src/test/java/com/rarchives/ripme/tst/proxyTest.java index 1d702c6b..36ea2f55 100644 --- a/src/test/java/com/rarchives/ripme/tst/proxyTest.java +++ b/src/test/java/com/rarchives/ripme/tst/proxyTest.java @@ -9,8 +9,14 @@ import com.rarchives.ripme.utils.Http; public class proxyTest extends TestCase { + + // This test will only run on machines where the user has added a entry for proxy.socks public void testSocksProxy() throws IOException { + // Unset proxy before testing + System.setProperty("http.proxyHost", ""); + System.setProperty("https.proxyHost", ""); + System.setProperty("socksProxyHost", ""); URL url = new URL("https://icanhazip.com"); String proxyConfig = Utils.getConfigString("proxy.socks", ""); if (!proxyConfig.equals("")) { @@ -26,6 +32,10 @@ public class proxyTest extends TestCase { // This test will only run on machines where the user has added a entry for proxy.http public void testHTTPProxy() throws IOException { + // Unset proxy before testing + System.setProperty("http.proxyHost", ""); + System.setProperty("https.proxyHost", ""); + System.setProperty("socksProxyHost", ""); URL url = new URL("https://icanhazip.com"); String proxyConfig = Utils.getConfigString("proxy.http", ""); if (!proxyConfig.equals("")) {