# HG changeset patch # User michaelm # Date 1573720048 0 # Node ID 832b8a28e17f8d9bbb29b5815e43306da7d616f7 # Parent 42bcf3042cd8dbd49b9cbcaa7c1246c000ddf9e0 unixdomainchannels: test updates diff -r 42bcf3042cd8 -r 832b8a28e17f test/jdk/java/nio/channels/unixdomain/Basic.java --- a/test/jdk/java/nio/channels/unixdomain/Basic.java Wed Nov 13 11:37:09 2019 +0000 +++ b/test/jdk/java/nio/channels/unixdomain/Basic.java Thu Nov 14 08:27:28 2019 +0000 @@ -45,6 +45,7 @@ public static void main(String args[]) throws Exception { if (args.length != 3) usage(); + if (!supported()) { System.out.println("Unix domain channels not supported"); return; diff -r 42bcf3042cd8 -r 832b8a28e17f test/jdk/java/nio/channels/unixdomain/SocketOptions.java --- a/test/jdk/java/nio/channels/unixdomain/SocketOptions.java Wed Nov 13 11:37:09 2019 +0000 +++ b/test/jdk/java/nio/channels/unixdomain/SocketOptions.java Thu Nov 14 08:27:28 2019 +0000 @@ -42,10 +42,25 @@ public class SocketOptions { public static void main(String args[]) throws Exception { + if (!supported()) { + System.out.println("Unix domain channels not supported"); + return; + } test(ServerSocketChannel.open(StandardProtocolFamily.UNIX)); test(SocketChannel.open(StandardProtocolFamily.UNIX)); } + static boolean supported() { + try { + SocketChannel.open(StandardProtocolFamily.UNIX); + } catch (UnsupportedAddressTypeException e) { + return false; + } catch (Exception e) { + return true; // continue test to see what problem is + } + return true; + } + @SuppressWarnings("unchecked") public static void test(NetworkChannel chan) throws IOException { System.out.println("Checking: " + chan.getClass());