summaryrefslogtreecommitdiffstats
path: root/support
diff options
context:
space:
mode:
Diffstat (limited to 'support')
-rw-r--r--support/src/test/java/tests/net/StuckServer.java21
-rw-r--r--support/src/test/java/tests/support/Support_Configuration.java10
2 files changed, 15 insertions, 16 deletions
diff --git a/support/src/test/java/tests/net/StuckServer.java b/support/src/test/java/tests/net/StuckServer.java
index f7a3118..d6b038b 100644
--- a/support/src/test/java/tests/net/StuckServer.java
+++ b/support/src/test/java/tests/net/StuckServer.java
@@ -21,6 +21,7 @@ import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;
+import java.net.UnknownHostException;
import java.util.ArrayList;
/**
@@ -29,6 +30,19 @@ import java.util.ArrayList;
public final class StuckServer {
private static final boolean DEBUG = false;
+ // RFC 5737 implies this network -- "test net 1" -- will be unreachable.
+ // (There are two other networks to try if we have trouble with this one.)
+ // We've had trouble with 10.* in the past (because test labs running CTS often use
+ // net 10!) but hopefully this network will be better.
+ public static final InetAddress UNREACHABLE_ADDRESS;
+ static {
+ try {
+ UNREACHABLE_ADDRESS = InetAddress.getByAddress(new byte[] { (byte) 192, 0, 2, 0 });
+ } catch (UnknownHostException ex) {
+ throw new AssertionError(ex);
+ }
+ }
+
private ServerSocket serverSocket;
private InetSocketAddress address;
private ArrayList<Socket> clients = new ArrayList<Socket>();
@@ -57,12 +71,7 @@ public final class StuckServer {
}
} else {
// In general, though, you don't want to rely on listen(2) backlog. http://b/6971145.
- // RFC 5737 implies this network will be unreachable. (There are two other networks
- // to try if we have trouble with this one.)
- // We've had trouble with 10.* in the past (because test labs running CTS often use
- // net 10!) but hopefully this network will be better.
- InetAddress testNet1 = InetAddress.getByAddress(new byte[] { (byte) 192, 0, 2, 0 });
- this.address = new InetSocketAddress(testNet1, 80);
+ this.address = new InetSocketAddress(UNREACHABLE_ADDRESS, 80);
}
}
diff --git a/support/src/test/java/tests/support/Support_Configuration.java b/support/src/test/java/tests/support/Support_Configuration.java
index 9cb617d..0658d54 100644
--- a/support/src/test/java/tests/support/Support_Configuration.java
+++ b/support/src/test/java/tests/support/Support_Configuration.java
@@ -75,11 +75,6 @@ public class Support_Configuration {
public static String IPv6GlobalAddressJcl4 = "2001:4860:8004::67"; // ipv6.google.com
- // ip address that resolves to a host that is not present on the local
- // network
- // this allows us to check the timeouts for connect
- public static String ResolvedNotExistingHost = "9.26.194.72";
-
// BEGIN android-changed
/**
* An address that resolves to more than one IP address so that the
@@ -279,11 +274,6 @@ public class Support_Configuration {
URLConnectionDate = Long.parseLong(value);
}
- value = props.get("ResolvedNotExistingHost");
- if (value != null) {
- ResolvedNotExistingHost = value;
- }
-
value = props.get("InetAlias1");
if (value != null) {
InetAlias1 = value;