Skip to content

Commit c0815e4

Browse files
author
SendaoYan
committed
8367904: Test java/net/InetAddress/ptr/Lookup.java should throw SkippedException
Reviewed-by: fandreuzzi, dfuchs
1 parent 7ec3fa5 commit c0815e4

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

test/jdk/java/net/InetAddress/ptr/Lookup.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -46,6 +46,7 @@
4646

4747
import jdk.test.lib.process.OutputAnalyzer;
4848
import jdk.test.lib.process.ProcessTools;
49+
import jtreg.SkippedException;
4950

5051
public class Lookup {
5152
private static final String HOST = "icann.org";
@@ -91,8 +92,7 @@ public static void main(String args[]) throws IOException {
9192
String tmp = lookupWithIPv4Prefer();
9293
System.out.println("IPv4 lookup results: [" + tmp + "]");
9394
if (SKIP.equals(tmp)) {
94-
System.out.println(HOST + " can't be resolved - test skipped.");
95-
return;
95+
throw new SkippedException(HOST + " can't be resolved - test skipped.");
9696
}
9797

9898
String[] strs = tmp.split(":");
@@ -104,8 +104,7 @@ public static void main(String args[]) throws IOException {
104104
tmp = reverseWithIPv4Prefer(addr);
105105
System.out.println("IPv4 reverse lookup results: [" + tmp + "]");
106106
if (SKIP.equals(tmp)) {
107-
System.out.println(addr + " can't be resolved with preferIPv4 - test skipped.");
108-
return;
107+
throw new SkippedException(addr + " can't be resolved with preferIPv4 - test skipped.");
109108
}
110109

111110
strs = tmp.split(":");

0 commit comments

Comments
 (0)