Skip to content

Commit a9cadcd

Browse files
author
SendaoYan
committed
8362855: Test java/net/ipv6tests/TcpTest.java should report SkippedException when there no ia4addr or ia6addr
Backport-of: 0f49f65af3ac85b93ccf140dcfad823fb03b5ce1
1 parent 5d55655 commit a9cadcd

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

test/jdk/java/net/ipv6tests/TcpTest.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
* @library /test/lib
3232
* @build jdk.test.lib.NetworkConfiguration
3333
* jdk.test.lib.Platform
34+
* jtreg.SkippedException
3435
* @run main TcpTest -d
3536
* @run main/othervm -Djdk.net.usePlainSocketImpl TcpTest -d
3637
*/
@@ -39,6 +40,8 @@
3940
import java.io.*;
4041
import java.util.concurrent.TimeUnit;
4142

43+
import jtreg.SkippedException;
44+
4245
public class TcpTest extends Tests {
4346
static ServerSocket server, server1, server2;
4447
static Socket c1, c2, c3, s1, s2, s3;
@@ -63,12 +66,10 @@ public class TcpTest extends Tests {
6366
public static void main (String[] args) throws Exception {
6467
checkDebug(args);
6568
if (ia4addr == null) {
66-
System.out.println ("No IPV4 addresses: exiting test");
67-
return;
69+
throw new SkippedException("No IPV4 addresses: exiting test");
6870
}
6971
if (ia6addr == null) {
70-
System.out.println ("No IPV6 addresses: exiting test");
71-
return;
72+
throw new SkippedException("No IPV6 addresses: exiting test");
7273
}
7374
dprintln ("Local Addresses");
7475
dprintln (ia4addr.toString());

0 commit comments

Comments
 (0)