Replace internal class usage to make it compile on java9. This was missed in f332a00.

This commit is contained in:
Norman Maurer 2016-12-03 21:01:36 +01:00
parent f332a00e1a
commit ae1234c303
2 changed files with 9 additions and 6 deletions

View File

@ -19,7 +19,9 @@ import io.netty.channel.embedded.EmbeddedChannel;
import io.netty.util.internal.logging.InternalLogger;
import io.netty.util.internal.logging.InternalLoggerFactory;
import org.junit.Test;
import sun.net.util.IPAddressUtil;
import java.net.InetAddress;
import java.net.UnknownHostException;
import static org.junit.Assert.*;
@ -62,8 +64,8 @@ public class SocksCmdRequestDecoderTest {
}
@Test
public void testCmdRequestDecoderIPv6() {
String[] hosts = {SocksCommonUtils.ipv6toStr(IPAddressUtil.textToNumericFormatV6("::1"))};
public void testCmdRequestDecoderIPv6() throws UnknownHostException {
String[] hosts = {SocksCommonUtils.ipv6toStr(InetAddress.getByName("::1").getAddress())};
int[] ports = {1, 32769, 65535};
for (SocksCmdType cmdType : SocksCmdType.values()) {
for (String host : hosts) {

View File

@ -20,9 +20,10 @@ import io.netty.util.NetUtil;
import io.netty.util.internal.logging.InternalLogger;
import io.netty.util.internal.logging.InternalLoggerFactory;
import org.junit.Test;
import sun.net.util.IPAddressUtil;
import java.net.IDN;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Arrays;
import static org.junit.Assert.*;
@ -65,9 +66,9 @@ public class Socks5CommandRequestDecoderTest {
}
@Test
public void testCmdRequestDecoderIPv6() {
public void testCmdRequestDecoderIPv6() throws UnknownHostException {
String[] hosts = {
NetUtil.bytesToIpAddress(IPAddressUtil.textToNumericFormatV6("::1")) };
NetUtil.bytesToIpAddress(InetAddress.getByName("::1").getAddress()) };
int[] ports = {1, 32769, 65535};
for (Socks5CommandType cmdType: Arrays.asList(Socks5CommandType.BIND,
Socks5CommandType.CONNECT,