# HG changeset patch # User michaelm # Date 1573645029 0 # Node ID 42bcf3042cd8dbd49b9cbcaa7c1246c000ddf9e0 # Parent 15e9a570c6e63c8adc78a6d4b9b1d7f1e9f36ce3 unixdomainchannels: update to unit tests diff -r 15e9a570c6e6 -r 42bcf3042cd8 test/jdk/java/nio/channels/unixdomain/Basic.java --- a/test/jdk/java/nio/channels/unixdomain/Basic.java Wed Nov 13 11:06:17 2019 +0000 +++ b/test/jdk/java/nio/channels/unixdomain/Basic.java Wed Nov 13 11:37:09 2019 +0000 @@ -45,6 +45,10 @@ public static void main(String args[]) throws Exception { if (args.length != 3) usage(); + if (!supported()) { + System.out.println("Unix domain channels not supported"); + return; + } sockRxBufsize = getInt(args[0]); sockTxBufsize = getInt(args[1]); if (args[2].equals("nagle-on")) @@ -57,11 +61,17 @@ test(8 * 1024, 10000); test(16 * 1024, 10000); test(32 * 1024, 10000); - // repeat - System.out.println("---- Repeating all tests again -----"); - test(128, 1000); - test(16 * 1024, 10000); - test(32 * 1024, 10000); + } + + 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; } static int getInt(String s) {