diff options
author | michaelm <none@none> | 2014-06-13 16:26:42 +0100 |
---|---|---|
committer | michaelm <none@none> | 2014-06-13 16:26:42 +0100 |
commit | 286c0c2eab1dfb03dea2e6263bee6d29bfda5555 (patch) | |
tree | de4cd5fd4065dc6ab7f628460d62cd8d51e36e14 /test/jdk | |
parent | 94b62a06ad826946c551b816167f124c6d7a4f0f (diff) |
8046588: test for SO_FLOW_SLA availability does not check for EACCESS
Reviewed-by: chegar, alanb
Diffstat (limited to 'test/jdk')
-rw-r--r-- | test/jdk/net/Sockets/Test.java | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/test/jdk/net/Sockets/Test.java b/test/jdk/net/Sockets/Test.java index 81ed76a95..8ab6c3cd9 100644 --- a/test/jdk/net/Sockets/Test.java +++ b/test/jdk/net/Sockets/Test.java @@ -30,8 +30,10 @@ */ import java.net.*; +import java.io.IOException; import java.nio.channels.*; import java.util.concurrent.*; +import java.util.Set; import jdk.net.*; public class Test { @@ -75,6 +77,13 @@ public class Test { DatagramSocket dg = new DatagramSocket(0); final int udp_port = dg.getLocalPort(); + // If option not available, end test + Set<SocketOption<?>> options = dg.supportedOptions(); + if (!options.contains(ExtendedSocketOptions.SO_FLOW_SLA)) { + System.out.println("SO_FLOW_SLA not supported"); + return; + } + final Socket s = new Socket("127.0.0.1", tcp_port); final SocketChannel sc = SocketChannel.open(); sc.connect (new InetSocketAddress("127.0.0.1", tcp_port)); @@ -149,6 +158,13 @@ public class Test { if (success) { throw new RuntimeException("Test failed"); } - } catch (UnsupportedOperationException e) {} + } catch (UnsupportedOperationException e) { + System.out.println (e); + } catch (IOException e) { + // Probably a permission error, but we're not + // going to check unless a specific permission exception + // is defined. + System.out.println (e); + } } } |