RFR [9] 8155086: Replace usage of -Djdk.launcher.limitmods in tests with -limitmods

2016-05-23 Thread Chris Hegarty
Replace usage of -Djdk.launcher.limitmods, in several networking and
NIO tests, with -limitmods now that jtreg with support for -limitmods is
available. 

-Chris.

diff --git a/test/java/net/SocketOption/OptionsTest.java 
b/test/java/net/SocketOption/OptionsTest.java
--- a/test/java/net/SocketOption/OptionsTest.java
+++ b/test/java/net/SocketOption/OptionsTest.java
@@ -26,7 +26,7 @@
  * @bug 8036979 8072384 8044773
  * @run main/othervm -Xcheck:jni OptionsTest
  * @run main/othervm -Xcheck:jni -Djava.net.preferIPv4Stack=true OptionsTest
- * @run main/othervm -Djdk.launcher.limitmods=java.base OptionsTest
+ * @run main/othervm -limitmods java.base OptionsTest
  */
 
 import java.lang.reflect.Method;
diff --git a/test/java/net/SocketOption/UnsupportedOptionsTest.java 
b/test/java/net/SocketOption/UnsupportedOptionsTest.java
--- a/test/java/net/SocketOption/UnsupportedOptionsTest.java
+++ b/test/java/net/SocketOption/UnsupportedOptionsTest.java
@@ -33,7 +33,7 @@
  * @summary Test checks that UnsupportedOperationException for unsupported
  * SOCKET_OPTIONS is thrown by both getOption() and setOption() methods.
  * @run main UnsupportedOptionsTest
- * @run main/othervm -Djdk.launcher.limitmods=java.base UnsupportedOptionsTest
+ * @run main/othervm -limitmods java.base UnsupportedOptionsTest
  */
 
 public class UnsupportedOptionsTest {
diff --git a/test/java/nio/channels/DatagramChannel/SocketOptionTests.java 
b/test/java/nio/channels/DatagramChannel/SocketOptionTests.java
--- a/test/java/nio/channels/DatagramChannel/SocketOptionTests.java
+++ b/test/java/nio/channels/DatagramChannel/SocketOptionTests.java
@@ -25,7 +25,7 @@
  * @bug 4640544 8044773
  * @summary Unit test for setOption/getOption/options methods
  * @run main SocketOptionTests
- * @run main/othervm -Djdk.launcher.limitmods=java.base SocketOptionTests
+ * @run main/othervm -limitmods java.base SocketOptionTests
  */
 
 import java.nio.*;
diff --git a/test/java/nio/channels/ServerSocketChannel/SocketOptionTests.java 
b/test/java/nio/channels/ServerSocketChannel/SocketOptionTests.java
--- a/test/java/nio/channels/ServerSocketChannel/SocketOptionTests.java
+++ b/test/java/nio/channels/ServerSocketChannel/SocketOptionTests.java
@@ -26,7 +26,7 @@
  * @summary Unit test for ServerSocketChannel setOption/getOption/options
  *  methods.
  * @run main SocketOptionTests
- * @run main/othervm -Djdk.launcher.limitmods=java.base SocketOptionTests
+ * @run main/othervm -limitmods java.base SocketOptionTests
  */
 
 import java.nio.*;
diff --git a/test/java/nio/channels/SocketChannel/SocketOptionTests.java 
b/test/java/nio/channels/SocketChannel/SocketOptionTests.java
--- a/test/java/nio/channels/SocketChannel/SocketOptionTests.java
+++ b/test/java/nio/channels/SocketChannel/SocketOptionTests.java
@@ -26,7 +26,7 @@
  * @summary Unit test to check SocketChannel setOption/getOption/options
  *  methods.
  * @run main SocketOptionTests
- * @run main/othervm -Djdk.launcher.limitmods=java.base SocketOptionTests
+ * @run main/othervm -limitmods java.base SocketOptionTests
  */
 
 import java.nio.*;



Re: RFR 8136933: Additional tests for Solaris SO_FLOW_SLA socket option in JDK 9

2016-05-23 Thread Svetlana Nikandrova

Alan, Chris,

thank you for your comments. I've decided to do as Chris suggested and 
updated existing  test test/jdk/net/Sockets/Test.java instead of 
creating a new one.

Please see updated review:

http://cr.openjdk.java.net/~snikandrova/8136933/webrev.03/ 



Thank you,
Svetlana

On 20.05.2016 18:19, Chris Hegarty wrote:

On 20 May 2016, at 14:10, Alan Bateman  wrote:

On 20/05/2016 14:05, Svetlana Nikandrova wrote:

Alan,

another test related to this option is on the same level 
(test/jdk/net/SocketFlow)

I added this recently, when working on a different issue, when I
noticed that there were no tests for the SocketFllow API, regardless
of the underlying system support. The test directory structure
matches the class package/name hierarchy.


so I thought it's ok to maintain the same hierarchy. I can move test to 
test/jdk/net/Sockets/ExtendedSocketOptions/SO_FLOW_SLA or to 
test/jdk/net/Sockets, but in that case won't it be a little bit confusing?

As for overlapping coverage: existing test silently exits if option is not in 
supported list while this one is focused on platform support check.

I think it would be good to put all the tests in the same place, will make it 
easier for further maintenance in this area.

The proposed new test seems, somewhat, to be a replacement for
test/jdk/net/Sockets/Test.java, but it does not assert that if set
succeeds that get should return something useful? Also set
typically cannot succeed unless run with privileges.  The test also
seems to focus on setting the option through the idk.net.Sockets API
rather than through the setOption of the socket types, any reason
for this? The jdk.net.Sockets API should be deprecated in 9, as
we have a standard replacement.

When working in the area previously, I ran
test/jdk/net/Sockets/Test.java manually and examined the output
to determine that the option was being set correctly.

It this test is merely to check that the option is supported on
S 11.2 +, then maybe that could be added to the existing
test/jdk/net/Sockets/Test.java  ?

-Chris.




Re: RFR 8143923 :DatagramSocket and MulticastSocket supportedOptions set depends on call order

2016-05-23 Thread Chris Hegarty


On 23/05/16 05:04, vyom wrote:

Hi All,

Please review the below code change.

Bug   : JDK-8143923 DatagramSocket and MulticastSocket
supportedOptions set depends on call order

Webrev :
http://cr.openjdk.java.net/~vtewari/8143923/webrev0.0/index.html



This looks ok to me Vyom.

-Chris.


Re: JDK 9 RFR of JDK-8157499: Mark several tests from jdk_net as intermittently failing

2016-05-23 Thread Chris Hegarty



On 23/05/16 07:39, Amy Lu wrote:

Below tests are known to fail intermittently. This patch is to mark the
test accordingly with keyword 'intermittent’ until issue resolved.

java/net/MulticastSocket/TestInterfaces.java (JDK-8134989)
java/net/DatagramSocket/PortUnreachable.java (JDK-8085875)
java/net/InetAddress/IsReachableViaLoopbackTest.java (JDK-8139929)
sun/net/www/http/ChunkedOutputStream/checkError.java (JDK-8041924)

bug: https://bugs.openjdk.java.net/browse/JDK-8157499
webrev: http://cr.openjdk.java.net/~amlu/8157499/webrev.00/


Looks ok to me Amy. Thanks.

-Chris.


Thanks,
Amy


--- old/test/java/net/DatagramSocket/PortUnreachable.java   2016-05-23 
14:31:49.0 +0800
+++ new/test/java/net/DatagramSocket/PortUnreachable.java   2016-05-23 
14:31:49.0 +0800
@@ -1,5 +1,5 @@
  /*
- * Copyright (c) 2000, 2013 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,7 @@
  /**
   * @test
   * @bug 4361783
+ * @key intermittent
   * @summary  Test to see if ICMP Port Unreachable on non-connected
   *   DatagramSocket causes a SocketException "socket closed"
   *   exception on Windows 2000.
--- old/test/java/net/InetAddress/IsReachableViaLoopbackTest.java   
2016-05-23 14:31:50.0 +0800
+++ new/test/java/net/InetAddress/IsReachableViaLoopbackTest.java   
2016-05-23 14:31:50.0 +0800
@@ -5,6 +5,7 @@
  /**
   * @test
   * @bug 8135305
+ * @key intermittent
   * @summary ensure we can't ping external hosts via loopback if
   */

--- old/test/java/net/MulticastSocket/TestInterfaces.java   2016-05-23 
14:31:50.0 +0800
+++ new/test/java/net/MulticastSocket/TestInterfaces.java   2016-05-23 
14:31:50.0 +0800
@@ -1,5 +1,5 @@
  /*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,7 @@
  /*
   * @test
   * @bug 4422122
+ * @key intermittent
   * @summary Test that MulticastSocket.getInterface returns the
   *  same InetAddress set by MulticastSocket.setInterface
   */
--- old/test/sun/net/www/http/ChunkedOutputStream/checkError.java   
2016-05-23 14:31:51.0 +0800
+++ new/test/sun/net/www/http/ChunkedOutputStream/checkError.java   
2016-05-23 14:31:51.0 +0800
@@ -1,5 +1,5 @@
  /*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,7 @@
  /**
   * @test
   * @bug 5054016
+ * @key intermittent
   * @run main/othervm/timeout=300 checkError
   * @summary get the failure immediately when writing individual chunks over 
socket fail
   */




Re: JEP 110: leeway for API changes?

2016-05-23 Thread Michael McMahon

Hi,

API changes are still possible. Sorry, I haven't gotten around
to replying to all feedback, but I will do this week.

Thanks
Michael

On 19/05/16 15:02, Simone Bordet wrote:

Hi,

On Thu, May 19, 2016 at 3:54 PM, Anthony Vanelverdinghe
 wrote:

Hi

With the JDK's "Feature Complete" milestone coming up next week: how much
leeway is there still for API changes? I've made API suggestions (a.o. in
[1]), ranging from changing HttpResponse.multiProcessor::onStart's return
type (from BiFunction<..., Boolean> to BiPredicate), to building on the
j.u.c.Flow API & eliminating HttpResponse.MultiProcessor. So I'm wondering
what's still on on the table for JEP 110 w.r.t. API changes?

I second that. I also made API change proposals, but no feedback.





JDK 9 RFR of JDK-8157499: Mark several tests from jdk_net as intermittently failing

2016-05-23 Thread Amy Lu
Below tests are known to fail intermittently. This patch is to mark the 
test accordingly with keyword 'intermittent’ until issue resolved.


java/net/MulticastSocket/TestInterfaces.java (JDK-8134989)
java/net/DatagramSocket/PortUnreachable.java (JDK-8085875)
java/net/InetAddress/IsReachableViaLoopbackTest.java (JDK-8139929)
sun/net/www/http/ChunkedOutputStream/checkError.java (JDK-8041924)

bug: https://bugs.openjdk.java.net/browse/JDK-8157499
webrev: http://cr.openjdk.java.net/~amlu/8157499/webrev.00/

Thanks,
Amy


--- old/test/java/net/DatagramSocket/PortUnreachable.java   2016-05-23 
14:31:49.0 +0800
+++ new/test/java/net/DatagramSocket/PortUnreachable.java   2016-05-23 
14:31:49.0 +0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,7 @@
 /**
  * @test
  * @bug 4361783
+ * @key intermittent
  * @summary  Test to see if ICMP Port Unreachable on non-connected
  *   DatagramSocket causes a SocketException "socket closed"
  *   exception on Windows 2000.
--- old/test/java/net/InetAddress/IsReachableViaLoopbackTest.java   
2016-05-23 14:31:50.0 +0800
+++ new/test/java/net/InetAddress/IsReachableViaLoopbackTest.java   
2016-05-23 14:31:50.0 +0800
@@ -5,6 +5,7 @@
 /**
  * @test
  * @bug 8135305
+ * @key intermittent
  * @summary ensure we can't ping external hosts via loopback if
  */
 
--- old/test/java/net/MulticastSocket/TestInterfaces.java	2016-05-23 14:31:50.0 +0800

+++ new/test/java/net/MulticastSocket/TestInterfaces.java   2016-05-23 
14:31:50.0 +0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,7 @@
 /*
  * @test
  * @bug 4422122
+ * @key intermittent
  * @summary Test that MulticastSocket.getInterface returns the
  *  same InetAddress set by MulticastSocket.setInterface
  */
--- old/test/sun/net/www/http/ChunkedOutputStream/checkError.java   
2016-05-23 14:31:51.0 +0800
+++ new/test/sun/net/www/http/ChunkedOutputStream/checkError.java   
2016-05-23 14:31:51.0 +0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,7 @@
 /**
  * @test
  * @bug 5054016
+ * @key intermittent
  * @run main/othervm/timeout=300 checkError
  * @summary get the failure immediately when writing individual chunks over 
socket fail
  */