8186818: Enable debug option for TcpTest.java
authorxiaofeya
Tue, 29 Aug 2017 07:16:49 -0700
changeset 47017 b19dea422270
parent 47016 49f2da5b2ea3
child 47018 7c8ff90abc22
8186818: Enable debug option for TcpTest.java Reviewed-by: rriggs
jdk/test/java/net/ipv6tests/TcpTest.java
--- a/jdk/test/java/net/ipv6tests/TcpTest.java	Tue Aug 29 12:16:22 2017 +0530
+++ b/jdk/test/java/net/ipv6tests/TcpTest.java	Tue Aug 29 07:16:49 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, 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
@@ -26,6 +26,7 @@
  * @bug 4868820
  * @key intermittent
  * @summary IPv6 support for Windows XP and 2003 server
+ * @run main TcpTest -d
  */
 
 import java.net.*;
@@ -126,6 +127,9 @@
         } catch (IOException e) { }
         server.close ();
         c1.close ();
+        if (c2 != null) {
+            c2.close();
+        }
 
         /* now try IPv6 only */
 
@@ -137,11 +141,15 @@
 
         c1 = new Socket (ia6addr, port);
         try {
+            dprintln ("connecting to " + ia4addr);
             c2 = new Socket (ia4addr, port);
             throw new RuntimeException ("connect to IPv4 address should be refused");
         } catch (IOException e) { }
         server.close ();
         c1.close ();
+        if (c2 != null) {
+            c2.close();
+        }
 
         System.out.println ("Test2: OK");
     }