Skip to content
Permalink
Browse files
8270553: Tests should not use (real, in-use, routable) 1.1.1.1 as dum…
…my IP value

Reviewed-by: shade, dfuchs
  • Loading branch information
Jonathan Dowland authored and dfuch committed Sep 14, 2021
1 parent 0f31d0f commit 394ebc8642366bc16aedde0d7f09fe4214f14cdd
Showing 1 changed file with 5 additions and 3 deletions.
@@ -55,7 +55,8 @@ public static void main(String... arg) throws Exception {
// Remove the default nonProxyHosts to use localhost for testing
System.setProperty("http.nonProxyHosts", "");

System.setProperty("http.proxyHost", "1.1.1.1");
// 240.0.0.0/4 is unallocated and "reserved for future use" (RFC 1112, Section 4)
System.setProperty("http.proxyHost", "240.0.0.1");
System.setProperty("http.proxyPort", "1111");

// Use the logger to help verify the Proxy was used
@@ -131,8 +132,9 @@ class MyProxySelector extends ProxySelector {
List<Proxy> proxies = new ArrayList<>();

MyProxySelector() {
Proxy p1 = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("2.2.2.2", 2222));
Proxy p2 = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("3.3.3.3", 3333));
// 240.0.0.0/4 is unallocated and "reserved for future use" (RFC 1112, Section 4)
Proxy p1 = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("240.0.0.2", 2222));
Proxy p2 = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("240.0.0.3", 3333));
proxies.add(p1);
proxies.add(p2);
}

1 comment on commit 394ebc8

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 394ebc8 Sep 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.