From 894ac9ad946d2f2a9d3a6cd548d92259f24f801d Mon Sep 17 00:00:00 2001 From: Felix Yang Date: Tue, 29 Aug 2017 07:16:49 -0700 Subject: [PATCH] 8186818: Enable debug option for TcpTest.java Reviewed-by: rriggs --- jdk/test/java/net/ipv6tests/TcpTest.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/jdk/test/java/net/ipv6tests/TcpTest.java b/jdk/test/java/net/ipv6tests/TcpTest.java index f538831506c..815a6097c7b 100644 --- a/jdk/test/java/net/ipv6tests/TcpTest.java +++ b/jdk/test/java/net/ipv6tests/TcpTest.java @@ -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 @@ public class TcpTest extends Tests { } catch (IOException e) { } server.close (); c1.close (); + if (c2 != null) { + c2.close(); + } /* now try IPv6 only */ @@ -137,11 +141,15 @@ public class TcpTest extends Tests { 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"); }