mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 03:58:21 +00:00
8371092: NullPointerException in AltServiceUsageTest.afterClass() test
Reviewed-by: dfuchs
This commit is contained in:
parent
7d3c66f379
commit
2f455ed146
@ -123,7 +123,7 @@ public class AltServiceUsageTest implements HttpServerAdapters {
|
||||
public void afterClass() throws Exception {
|
||||
safeStop(originServer);
|
||||
safeStop(altServer);
|
||||
udpNotResponding.close();
|
||||
safeClose(udpNotResponding);
|
||||
}
|
||||
|
||||
private static void safeStop(final HttpTestServer server) {
|
||||
@ -140,6 +140,19 @@ public class AltServiceUsageTest implements HttpServerAdapters {
|
||||
}
|
||||
}
|
||||
|
||||
private static void safeClose(final DatagramChannel channel) {
|
||||
if (channel == null) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
System.out.println("Closing DatagramChannel " + channel.getLocalAddress());
|
||||
channel.close();
|
||||
} catch (Exception e) {
|
||||
System.err.println("Ignoring exception: " + e.getMessage() + " that occurred " +
|
||||
"during close of DatagramChannel: " + channel);
|
||||
}
|
||||
}
|
||||
|
||||
private static class H3AltServicePublisher implements HttpTestHandler {
|
||||
private static final String RESPONSE_CONTENT = "apple";
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user