hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1444746 - /httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/conn/util/TestInetAddressUtils.java
Date Mon, 11 Feb 2013 11:56:53 GMT
Author: sebb
Date: Mon Feb 11 11:56:52 2013
New Revision: 1444746

URL: http://svn.apache.org/r1444746
Log:
More tests for IPV6 - show that IP with 8 zeroes is OK, but with 7 or 9 is not

Modified:
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/conn/util/TestInetAddressUtils.java

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/conn/util/TestInetAddressUtils.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/conn/util/TestInetAddressUtils.java?rev=1444746&r1=1444745&r2=1444746&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/conn/util/TestInetAddressUtils.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/conn/util/TestInetAddressUtils.java
Mon Feb 11 11:56:52 2013
@@ -54,6 +54,7 @@ public class TestInetAddressUtils {
     public void testValidIPv6Address() {
         Assert.assertTrue(InetAddressUtils.isIPv6StdAddress("2001:0db8:0000:0000:0000:0000:1428:57ab"));
         Assert.assertTrue(InetAddressUtils.isIPv6StdAddress("2001:db8:0:0:0:0:1428:57ab"));
+        Assert.assertTrue(InetAddressUtils.isIPv6StdAddress("0:0:0:0:0:0:0:0"));
         Assert.assertTrue(InetAddressUtils.isIPv6HexCompressedAddress("2001:0db8:0:0::1428:57ab"));
         Assert.assertTrue(InetAddressUtils.isIPv6HexCompressedAddress("2001:0db8::1428:57ab"));
         Assert.assertTrue(InetAddressUtils.isIPv6HexCompressedAddress("2001:db8::1428:57ab"));
@@ -64,6 +65,8 @@ public class TestInetAddressUtils {
     public void testInvalidIPv6Address() {
         Assert.assertFalse(InetAddressUtils.isIPv6Address("2001:0db8:0000:garb:age0:0000:1428:57ab"));
         Assert.assertFalse(InetAddressUtils.isIPv6Address("2001:0gb8:0000:0000:0000:0000:1428:57ab"));
+        Assert.assertFalse(InetAddressUtils.isIPv6StdAddress("0:0:0:0:0:0:0:0:0")); // Too
many
+        Assert.assertFalse(InetAddressUtils.isIPv6StdAddress("0:0:0:0:0:0:0")); // Too few
         Assert.assertFalse(InetAddressUtils.isIPv6HexCompressedAddress(":1"));
         Assert.assertFalse(InetAddressUtils.isIPv6Address("2001:0db8::0000::57ab")); // Cannot
have two contractions
     }



Mime
View raw message