8223652: Rename IPSupport.skipIfCurrentConfigurationIsInvalid() to IPSupport.throwSkippedExceptionIfNonOperational()
Reviewed-by: dfuchs, chegar
This commit is contained in:
parent
a5c506b411
commit
eff53ce5e9
@ -106,7 +106,7 @@ public class UnreferencedDatagramSockets {
|
||||
}
|
||||
|
||||
public static void main(String args[]) throws Exception {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
|
||||
// Create and close a DatagramSocket to warm up the FD count for side effects.
|
||||
try (DatagramSocket s = new DatagramSocket(0)) {
|
||||
|
@ -34,7 +34,7 @@ import jdk.test.lib.net.IPSupport;
|
||||
|
||||
public class MinimumPermissions {
|
||||
public static void main(String[] args) {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,7 @@ public class PingThis {
|
||||
if (System.getProperty("os.name").startsWith("Windows")) {
|
||||
return;
|
||||
}
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
|
||||
List<String> addrs = new ArrayList<String>();
|
||||
|
||||
|
@ -44,7 +44,7 @@ import jdk.test.lib.net.IPSupport;
|
||||
public class GetLocalHostWithSM {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
|
||||
// try setting the local hostname
|
||||
InetAddress localHost = InetAddress.getLocalHost();
|
||||
|
@ -43,7 +43,7 @@ import jdk.test.lib.net.IPSupport;
|
||||
public class JoinLeave {
|
||||
|
||||
public static void main(String args[]) throws IOException {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
InetAddress ip4Group = InetAddress.getByName("224.80.80.80");
|
||||
InetAddress ip6Group = InetAddress.getByName("ff02::a");
|
||||
|
||||
|
@ -115,7 +115,7 @@ public class Promiscuous {
|
||||
}
|
||||
|
||||
public static void main(String args[]) throws IOException {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
|
||||
String os = System.getProperty("os.name");
|
||||
|
||||
|
@ -42,7 +42,7 @@ import jdk.test.lib.net.IPSupport;
|
||||
public class SetGetNetworkInterfaceTest {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
NetworkConfiguration nc = NetworkConfiguration.probe();
|
||||
try (MulticastSocket ms = new MulticastSocket()) {
|
||||
nc.multicastInterfaces(true).forEach(nif -> setGetNetworkInterface(ms, nif));
|
||||
|
@ -159,7 +159,7 @@ public class Test {
|
||||
}
|
||||
|
||||
public static void main(String args[]) throws Exception {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
|
||||
Test t = new Test();
|
||||
|
||||
|
@ -107,7 +107,7 @@ public class UnreferencedMulticastSockets {
|
||||
}
|
||||
|
||||
public static void main(String args[]) throws Exception {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
|
||||
// Create and close a MulticastSocket to warm up the FD count for side effects.
|
||||
try (MulticastSocket s = new MulticastSocket(0)) {
|
||||
|
@ -52,7 +52,7 @@ public class NetworkInterfaceStreamTest extends OpTestCase {
|
||||
|
||||
@BeforeTest
|
||||
void setup() {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -37,7 +37,7 @@ public class Test {
|
||||
static final boolean isWindows = System.getProperty("os.name").startsWith("Windows");
|
||||
|
||||
public static void main(String args[]) throws Exception {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
|
||||
Enumeration nifs = NetworkInterface.getNetworkInterfaces();
|
||||
|
||||
|
@ -110,7 +110,7 @@ public class UnreferencedSockets {
|
||||
}
|
||||
|
||||
public static void main(String args[]) throws Exception {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
|
||||
// Create and close a ServerSocket to warm up the FD count for side effects.
|
||||
try (ServerSocket s = new ServerSocket(0)) {
|
||||
|
@ -155,7 +155,7 @@ public class AddressTest {
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
new AddressTest();
|
||||
}
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ import jdk.test.lib.net.IPSupport;
|
||||
public class B6210227 {
|
||||
public static void main(String[] args) throws Exception
|
||||
{
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
|
||||
ServerSocket ss = new ServerSocket(0);
|
||||
int port = ss.getLocalPort();
|
||||
|
@ -38,7 +38,7 @@ import jdk.test.lib.net.IPSupport;
|
||||
public class CloseAvailable {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
|
||||
testClose();
|
||||
|
||||
|
@ -37,7 +37,7 @@ import jdk.test.lib.net.IPSupport;
|
||||
|
||||
public class DeadlockTest {
|
||||
public static void main(String [] argv) throws Exception {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
|
||||
ServerSocket ss = new ServerSocket(0);
|
||||
Socket clientSocket = new Socket();
|
||||
|
@ -41,7 +41,7 @@ public class GetLocalAddress implements Runnable {
|
||||
static int port;
|
||||
|
||||
public static void main(String args[]) throws Exception {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
|
||||
testBindNull();
|
||||
|
||||
|
@ -56,7 +56,7 @@ public class HttpProxy {
|
||||
static final int SO_TIMEOUT = 15000;
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
|
||||
String host;
|
||||
int port;
|
||||
|
@ -47,7 +47,7 @@ public class InheritHandle
|
||||
"bin" + File.separator + "java";
|
||||
|
||||
public static void main(String[] args) {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
|
||||
if (args.length == 1) {
|
||||
doWait();
|
||||
|
@ -94,7 +94,7 @@ public class InheritTimeout {
|
||||
}
|
||||
|
||||
public static void main(String args[]) throws Exception {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
new InheritTimeout();
|
||||
}
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ public class LingerTest {
|
||||
}
|
||||
|
||||
public static void main(String args[]) throws Exception {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
|
||||
InetAddress loopback = InetAddress.getLoopbackAddress();
|
||||
ServerSocket ss = new ServerSocket(0, 50, loopback);
|
||||
|
@ -122,7 +122,7 @@ public class LinkLocal {
|
||||
}
|
||||
|
||||
public static void main(String args[]) throws Exception {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
|
||||
/*
|
||||
* If an argument is provided ensure that it's
|
||||
|
@ -80,7 +80,7 @@ public class ProxyCons {
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
|
||||
ProxyCons c = new ProxyCons();
|
||||
c.test();
|
||||
|
@ -80,7 +80,7 @@ public class RST implements Runnable {
|
||||
|
||||
|
||||
public static void main(String args[]) throws Exception {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
|
||||
new RST();
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ import jdk.test.lib.net.IPSupport;
|
||||
|
||||
public class ReadTimeout {
|
||||
public static void main(String args[]) throws Exception {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
|
||||
InetAddress sin = null;
|
||||
Socket soc = null,soc1 = null;
|
||||
|
@ -39,7 +39,7 @@ import jdk.test.lib.net.IPSupport;
|
||||
public class RejectIPv6 {
|
||||
|
||||
public static void main(String [] argv) throws Throwable {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
|
||||
ServerSocket serverSocket = new ServerSocket(0);
|
||||
serverSocket.setSoTimeout(1000);
|
||||
|
@ -37,7 +37,7 @@ public class SetSoLinger {
|
||||
static final int LINGER = 65546;
|
||||
|
||||
public static void main(String args[]) throws Exception {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
|
||||
int value;
|
||||
InetAddress addr = InetAddress.getLocalHost();
|
||||
|
@ -45,7 +45,7 @@ public class ShutdownInput {
|
||||
static boolean failed = false;
|
||||
|
||||
public static void main(String args[]) throws Exception {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
|
||||
InetAddress iaddr = InetAddress.getLocalHost();
|
||||
|
||||
|
@ -50,7 +50,7 @@ public class SocksConnectTimeout {
|
||||
static int failed, passed;
|
||||
|
||||
public static void main(String[] args) {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
|
||||
try {
|
||||
serverSocket = new ServerSocket(0);
|
||||
|
@ -40,7 +40,7 @@ public class TestAfterClose
|
||||
static int failCount;
|
||||
|
||||
public static void main(String[] args) {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
|
||||
try {
|
||||
InetAddress loopback = InetAddress.getLoopbackAddress();
|
||||
|
@ -37,7 +37,7 @@ import jdk.test.lib.net.IPSupport;
|
||||
public class TestClose {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
|
||||
ServerSocket ss;
|
||||
Socket s;
|
||||
|
@ -37,7 +37,7 @@ import jdk.test.lib.net.IPSupport;
|
||||
public class TestTcpNoDelay
|
||||
{
|
||||
public static void main(String[] args) {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
|
||||
try {
|
||||
Socket socket = new Socket();
|
||||
|
@ -35,7 +35,7 @@ import jdk.test.lib.net.IPSupport;
|
||||
|
||||
public class Timeout {
|
||||
public static void main(String[] args) throws Exception {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
|
||||
boolean success = false;
|
||||
ServerSocket sock = new ServerSocket(0);
|
||||
|
@ -63,7 +63,7 @@ public class TrafficClass {
|
||||
}
|
||||
|
||||
public static void main(String args[]) throws Exception {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
|
||||
DatagramSocket ds = new DatagramSocket();
|
||||
testDatagramSocket(ds);
|
||||
|
@ -53,7 +53,7 @@ public class UrgentDataTest {
|
||||
}
|
||||
|
||||
public static void main (String args[]) {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
|
||||
try {
|
||||
UrgentDataTest test = new UrgentDataTest ();
|
||||
|
@ -40,7 +40,7 @@ import static java.util.concurrent.CompletableFuture.*;
|
||||
public class AsyncClose {
|
||||
|
||||
public static void main(String args[]) throws Exception {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
|
||||
AsyncCloseTest tests[] = {
|
||||
new Socket_getInputStream_read(),
|
||||
|
@ -55,7 +55,7 @@ public class BrokenPipe {
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
|
||||
ServerSocket ss = new ServerSocket(0);
|
||||
Socket client = new Socket(InetAddress.getLocalHost(),
|
||||
|
@ -228,7 +228,7 @@ public class Basic {
|
||||
}
|
||||
|
||||
public static void main(String args[]) throws Exception {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
new Basic();
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,7 @@ public class Restart {
|
||||
*/
|
||||
|
||||
public static void main(String args[]) throws Exception {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
|
||||
ServerSocket ss = new ServerSocket(0);
|
||||
Socket s1 = null, s2 = null;
|
||||
|
@ -63,7 +63,7 @@ public class SocketClosedException {
|
||||
static Exception serverException = null;
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
serverSocket = new ServerSocket(0);
|
||||
startServer();
|
||||
try {
|
||||
|
@ -38,7 +38,7 @@ public class SocketTimeout {
|
||||
static final int TIMEOUT = 1000;
|
||||
|
||||
public static void main(String args[]) throws Exception {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
InetAddress sin = InetAddress.getLocalHost();
|
||||
Socket soc = null,soc1 = null;
|
||||
InputStream is = null;
|
||||
|
@ -44,7 +44,7 @@ public class ImmutableOptions {
|
||||
|
||||
@BeforeTest
|
||||
void setupServerSocketFactory() throws IOException {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
ServerSocket.setSocketFactory(new ServerSocketImplFactory());
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ import jdk.test.lib.net.IPSupport;
|
||||
public class MinimumRcvBufferSize {
|
||||
|
||||
public static void main(String args[]) throws Exception {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
|
||||
boolean error = false;
|
||||
ServerSocketChannel channel = ServerSocketChannel.open();
|
||||
|
@ -280,7 +280,7 @@ public class OptionsTest {
|
||||
}
|
||||
|
||||
public static void main(String args[]) throws Exception {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
doSocketTests();
|
||||
doServerSocketTests();
|
||||
doDgSocketTests();
|
||||
|
@ -44,7 +44,7 @@ import jdk.test.lib.net.IPSupport;
|
||||
public class SupportedOptionsSet {
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
|
||||
if (args[0].equals("first"))
|
||||
first();
|
||||
|
@ -72,7 +72,7 @@ public class UnsupportedOptionsTest {
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
|
||||
Socket s = new Socket();
|
||||
ServerSocket ss = new ServerSocket();
|
||||
|
@ -38,7 +38,7 @@ import jdk.test.lib.net.IPSupport;
|
||||
|
||||
public class Disconnect {
|
||||
public static void main(String[] args) throws IOException {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
|
||||
// test with default protocol family
|
||||
try (DatagramChannel dc = DatagramChannel.open()) {
|
||||
|
@ -240,7 +240,7 @@ public class MulticastSendReceiveTests {
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
|
||||
NetworkConfiguration config = NetworkConfiguration.probe();
|
||||
|
||||
|
@ -193,7 +193,7 @@ public class Promiscuous {
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
|
||||
String os = System.getProperty("os.name");
|
||||
|
||||
|
@ -48,7 +48,7 @@ public class UseDGWithIPv6 {
|
||||
|
||||
public static void main(String[] args) throws IOException
|
||||
{
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
|
||||
ByteBuffer data = ByteBuffer.wrap("TESTING DATA".getBytes());
|
||||
DatagramChannel dgChannel = DatagramChannel.open();
|
||||
|
@ -44,7 +44,7 @@ public class PrintSupportedOptions {
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
IPSupport.skipIfCurrentConfigurationIsInvalid();
|
||||
IPSupport.throwSkippedExceptionIfNonOperational();
|
||||
|
||||
test(() -> SocketChannel.open());
|
||||
test(() -> ServerSocketChannel.open());
|
||||
|
@ -123,9 +123,19 @@ public class IPSupport {
|
||||
}
|
||||
|
||||
/**
|
||||
* Throws a jtreg.SkippedException if the current networking configuration is invalid.
|
||||
* Ensures that the platform supports the ability to create a
|
||||
* minimally-operational socket whose protocol is either one of IPv4
|
||||
* or IPv6.
|
||||
*
|
||||
* <p> A minimally-operation socket is one that can be created and
|
||||
* bound to an IP-specific loopback address. IP support is
|
||||
* considered non-operational if a socket cannot be bound to either
|
||||
* one of, an IPv4 loopback address, or the IPv6 loopback address.
|
||||
*
|
||||
* @throws SkippedException if the current networking configuration
|
||||
* is non-operational
|
||||
*/
|
||||
public static void skipIfCurrentConfigurationIsInvalid() throws SkippedException {
|
||||
public static void throwSkippedExceptionIfNonOperational() throws SkippedException {
|
||||
if (!currentConfigurationIsValid()) {
|
||||
ByteArrayOutputStream os = new ByteArrayOutputStream();
|
||||
PrintStream ps = new PrintStream(os);
|
||||
|
Loading…
x
Reference in New Issue
Block a user