Permalink
Browse files

Replace internal class usage to make it compile on java9. This was mi…

…ssed in f332a00.
  • Loading branch information...
1 parent f332a00 commit ae1234c3033d81027c766c0f6d01eafd811b3a08 @normanmaurer normanmaurer committed Dec 3, 2016
@@ -19,7 +19,9 @@
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 void testCmdRequestDecoderIPv4() {
}
@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) {
@@ -20,9 +20,10 @@
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 void testCmdRequestDecoderIPv4() {
}
@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,

0 comments on commit ae1234c

Please sign in to comment.