1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package io.netty.testsuite.transport.socket;
17
18 import io.netty.channel.socket.SocketProtocolFamily;
19 import org.junit.jupiter.api.BeforeAll;
20 import org.opentest4j.TestAbortedException;
21
22 import java.io.IOException;
23 import java.net.StandardProtocolFamily;
24 import java.nio.channels.Channel;
25 import java.nio.channels.spi.SelectorProvider;
26
27 public class DatagramUnicastIPv6Test extends DatagramUnicastInetTest {
28
29 @BeforeAll
30 public static void assumeIpv6Supported() {
31 try {
32 Channel channel = SelectorProvider.provider().openDatagramChannel(StandardProtocolFamily.INET6);
33 channel.close();
34 } catch (UnsupportedOperationException e) {
35 throw new TestAbortedException("IPv6 not supported", e);
36 } catch (IOException ignore) {
37
38 }
39 }
40 @Override
41 protected SocketProtocolFamily socketProtocolFamily() {
42 return SocketProtocolFamily.INET6;
43 }
44 }