JBossWS SVN: r17970 - common/trunk.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-10-02 04:17:51 -0400 (Wed, 02 Oct 2013)
New Revision: 17970
Modified:
common/trunk/pom.xml
Log:
Preparing for next dev cycle
Modified: common/trunk/pom.xml
===================================================================
--- common/trunk/pom.xml 2013-10-02 08:17:13 UTC (rev 17969)
+++ common/trunk/pom.xml 2013-10-02 08:17:51 UTC (rev 17970)
@@ -9,7 +9,7 @@
<packaging>jar</packaging>
<description>JBossWS Common</description>
- <version>2.2.2-SNAPSHOT</version>
+ <version>2.2.3-SNAPSHOT</version>
<!-- Parent -->
<parent>
11 years, 3 months
JBossWS SVN: r17969 - common/tags.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-10-02 04:17:13 -0400 (Wed, 02 Oct 2013)
New Revision: 17969
Added:
common/tags/jbossws-common-2.2.2.Final/
Log:
Tagging jbossws-common-2.2.2.Final
11 years, 3 months
JBossWS SVN: r17968 - stack/cxf/trunk.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-10-01 11:30:30 -0400 (Tue, 01 Oct 2013)
New Revision: 17968
Modified:
stack/cxf/trunk/pom.xml
Log:
Use latest jbossws-common snapshot
Modified: stack/cxf/trunk/pom.xml
===================================================================
--- stack/cxf/trunk/pom.xml 2013-10-01 15:30:06 UTC (rev 17967)
+++ stack/cxf/trunk/pom.xml 2013-10-01 15:30:30 UTC (rev 17968)
@@ -61,7 +61,7 @@
<properties>
<jbossws.api.version>1.0.2.Final</jbossws.api.version>
<jbossws.spi.version>2.2.2-SNAPSHOT</jbossws.spi.version>
- <jbossws.common.version>2.2.1.Final</jbossws.common.version>
+ <jbossws.common.version>2.2.2-SNAPSHOT</jbossws.common.version>
<jbossws.common.tools.version>1.2.0.Final</jbossws.common.tools.version>
<jbossws.jboss712.version>4.2.1.Final</jbossws.jboss712.version>
<jbossws.jboss713.version>4.2.1.Final</jbossws.jboss713.version>
11 years, 3 months
JBossWS SVN: r17967 - in stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws: samples/wsse/policy/trust/WEB-INF and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-10-01 11:30:06 -0400 (Tue, 01 Oct 2013)
New Revision: 17967
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/InvalidAddressEndpoint.wsdl
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/ValidAddressEndpoint.wsdl
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/picketlink-sts.xml
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/PicketLinkSTS.wsdl
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/SecurityService.wsdl
Log:
Use jboss bind address property within wsdl and conf files instead of 'localhost'
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/InvalidAddressEndpoint.wsdl
===================================================================
(Binary files differ)
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/ValidAddressEndpoint.wsdl
===================================================================
(Binary files differ)
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/picketlink-sts.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/picketlink-sts.xml 2013-10-01 15:26:13 UTC (rev 17966)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/picketlink-sts.xml 2013-10-01 15:30:06 UTC (rev 17967)
@@ -19,7 +19,7 @@
</TokenProviders>
<!-- Erroneously mandatory element below (in PLINK 2.1.8.Final / 2.5.1.Final) -->
<ServiceProviders>
- <ServiceProvider Endpoint="http://localhost:8080/jaxws-samples-wsse-policy-trust/SecurityService"
+ <ServiceProvider Endpoint="http://@jboss.bind.address@:8080/jaxws-samples-wsse-policy-trust/SecurityService"
TokenType="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0"
TruststoreAlias="myservicekey"/>
</ServiceProviders>
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/PicketLinkSTS.wsdl
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/PicketLinkSTS.wsdl 2013-10-01 15:26:13 UTC (rev 17966)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/PicketLinkSTS.wsdl 2013-10-01 15:30:06 UTC (rev 17967)
@@ -66,7 +66,7 @@
</wsdl:binding>
<wsdl:service name="PicketLinkSTS">
<wsdl:port name="PicketLinkSTSPort" binding="tns:STSBinding">
- <soap12:address location="http://localhost:8080/picketlink-sts/PicketLinkSTS"/>
+ <soap12:address location="http://@jboss.bind.address@:8080/picketlink-sts/PicketLinkSTS"/>
</wsdl:port>
</wsdl:service>
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/SecurityService.wsdl
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/SecurityService.wsdl 2013-10-01 15:26:13 UTC (rev 17966)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/SecurityService.wsdl 2013-10-01 15:30:06 UTC (rev 17967)
@@ -68,9 +68,9 @@
<sp:RequireInternalReference />
</wsp:Policy>
<sp:Issuer>
- <wsaws:Address>http://localhost:8080/jaxws-samples-wsse-policy-trust-sts/SecurityTokenSe...</wsaws:Address>
+ <wsaws:Address>http://@jboss.bind.address@:8080/jaxws-samples-wsse-policy-trust-sts/SecurityTokenService</wsaws:Address>
<wsaws:Metadata xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance"
- wsdli:wsdlLocation="http://localhost:8080/jaxws-samples-wsse-policy-trust-sts/SecurityTokenSe...">
+ wsdli:wsdlLocation="http://@jboss.bind.address@:8080/jaxws-samples-wsse-policy-trust-sts/SecurityTokenService?wsdl">
<wsaw:ServiceName xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
xmlns:stsns="http://docs.oasis-open.org/ws-sx/ws-trust/200512/"
EndpointName="UT_Port">stsns:SecurityTokenService</wsaw:ServiceName>
11 years, 3 months
JBossWS SVN: r17966 - in common/trunk/src: main/java/org/jboss/ws/common/management and 3 other directories.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-10-01 11:26:13 -0400 (Tue, 01 Oct 2013)
New Revision: 17966
Added:
common/trunk/src/main/java/org/jboss/ws/common/utils/AddressUtils.java
common/trunk/src/test/java/org/jboss/test/ws/common/management/AbstractServerConfigTestCase.java
common/trunk/src/test/java/org/jboss/test/ws/common/utils/AddressUtilsTestCase.java
Modified:
common/trunk/src/main/java/org/jboss/ws/common/Messages.java
common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java
Log:
[JBWS-3712] Redo IPv6 URL format conversion, perform validation on provided host name and add a bunch of tests
Modified: common/trunk/src/main/java/org/jboss/ws/common/Messages.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/Messages.java 2013-10-01 15:15:09 UTC (rev 17965)
+++ common/trunk/src/main/java/org/jboss/ws/common/Messages.java 2013-10-01 15:26:13 UTC (rev 17966)
@@ -261,4 +261,7 @@
@Message(id = 22109, value = "%s is not a JAX-WS Handler")
RuntimeException notJAXWSHandler(String className);
+
+ @Message(id = 22117, value = "Invalid address provided: %s")
+ IllegalArgumentException invalidAddressProvided(String address);
}
Modified: common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java 2013-10-01 15:15:09 UTC (rev 17965)
+++ common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java 2013-10-01 15:26:13 UTC (rev 17966)
@@ -22,8 +22,8 @@
package org.jboss.ws.common.management;
import static org.jboss.ws.common.Loggers.MANAGEMENT_LOGGER;
+import static org.jboss.ws.common.Messages.MESSAGES;
-import java.net.Inet6Address;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.List;
@@ -33,6 +33,7 @@
import javax.management.ObjectName;
import org.jboss.ws.common.ObjectNameFactory;
+import org.jboss.ws.common.utils.AddressUtils;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.WSFException;
import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
@@ -116,22 +117,23 @@
private String toIPv6URLFormat(final String host)
{
- boolean isIPv6Address = false;
- String resolvedAddress = null;
- try
- {
- InetAddress address = InetAddress.getByName(host);
- isIPv6Address = !UNDEFINED_HOSTNAME.equals(host) && address instanceof Inet6Address;
- resolvedAddress = isIPv6Address ? address.getHostAddress() : null;
+ String address = host;
+ boolean isIPv6URLFormatted = false;
+ //strip out IPv6 URL formatting if already provided...
+ if (host.startsWith("[") && host.endsWith("]")) {
+ isIPv6URLFormatted = true;
+ address = host.substring(1, host.length() - 1);
}
- catch (UnknownHostException e)
- {
- MANAGEMENT_LOGGER.couldNotGetAddressForHost(host, e);
- //ignore, leave isIPv6Address to false
+ //verify...
+ if (!AddressUtils.isValidAddress(address)) {
+ throw MESSAGES.invalidAddressProvided(address);
}
- final boolean isIPv6AddressHost = isIPv6Address && host.equals(resolvedAddress);
-
- return isIPv6AddressHost ? "[" + host + "]" : host;
+ //return IPv6 URL formatted address
+ if (isIPv6URLFormatted) {
+ return host;
+ } else {
+ return AddressUtils.isValidIPv6Address(host) ? "[" + host + "]" : host;
+ }
}
public void setWebServicePort(int port)
Added: common/trunk/src/main/java/org/jboss/ws/common/utils/AddressUtils.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/utils/AddressUtils.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/ws/common/utils/AddressUtils.java 2013-10-01 15:26:13 UTC (rev 17966)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common.utils;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.regex.PatternSyntaxException;
+
+
+/**
+ * IP address utils
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 01-Oct-2013
+ */
+public final class AddressUtils
+{
+ private static final Pattern VALID_IPV4_PATTERN;
+ private static final Pattern VALID_IPV6_PATTERN;
+ private static final Pattern VALID_BASIC_HOSTNAME_PATTERN;
+ private static final String ipv4Pattern = "(([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.){3}([01]?\\d\\d?|2[0-4]\\d|25[0-5])";
+ private static final String ipv6Pattern = "^([\\dA-F]{1,4}:|((?=.*(::))(?!.*\\3.+\\3))\\3?)([\\dA-F]{1,4}(\\3|:\\b)|\\2){5}(([\\dA-F]{1,4}(\\3|:\\b|$)|\\2){2}|(((2[0-4]|1\\d|[1-9])?\\d|25[0-5])\\.?\\b){4})\\z";
+ private static final String basicHostnamePattern = "^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\-]*[A-Za-z0-9])$";
+ static
+ {
+ try
+ {
+ VALID_IPV4_PATTERN = Pattern.compile(ipv4Pattern, Pattern.CASE_INSENSITIVE);
+ VALID_IPV6_PATTERN = Pattern.compile(ipv6Pattern, Pattern.CASE_INSENSITIVE);
+ VALID_BASIC_HOSTNAME_PATTERN = Pattern.compile(basicHostnamePattern, Pattern.CASE_INSENSITIVE);
+ }
+ catch (PatternSyntaxException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public static boolean isValidIPv4Address(final String ipAddress)
+ {
+ Matcher m = VALID_IPV4_PATTERN.matcher(ipAddress);
+ return m.matches();
+ }
+
+ public static boolean isValidIPv6Address(final String ipAddress)
+ {
+ Matcher m = VALID_IPV6_PATTERN.matcher(ipAddress);
+ return m.matches();
+ }
+
+ public static boolean isValidHostnameAddress(final String hostname)
+ {
+ Matcher m = VALID_BASIC_HOSTNAME_PATTERN.matcher(hostname);
+ return m.matches() ? hostname.length() <= 255 : false;
+ }
+
+ public static boolean isValidIPAddress(final String ipAddress)
+ {
+ return isValidIPv4Address(ipAddress) || isValidIPv6Address(ipAddress);
+ }
+
+ public static boolean isValidAddress(final String address)
+ {
+ return isValidIPAddress(address) || isValidHostnameAddress(address);
+ }
+}
Property changes on: common/trunk/src/main/java/org/jboss/ws/common/utils/AddressUtils.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: common/trunk/src/test/java/org/jboss/test/ws/common/management/AbstractServerConfigTestCase.java
===================================================================
--- common/trunk/src/test/java/org/jboss/test/ws/common/management/AbstractServerConfigTestCase.java (rev 0)
+++ common/trunk/src/test/java/org/jboss/test/ws/common/management/AbstractServerConfigTestCase.java 2013-10-01 15:26:13 UTC (rev 17966)
@@ -0,0 +1,131 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.common.management;
+
+import java.io.File;
+import java.net.InetAddress;
+
+import junit.framework.TestCase;
+
+import org.jboss.ws.common.management.AbstractServerConfig;
+import org.jboss.wsf.spi.management.ServerConfig;
+
+/**
+ * Test the AbstractServerConfig
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 01-Oct-2013
+ */
+public class AbstractServerConfigTestCase extends TestCase
+{
+ public void testSetWebServiceHost() throws Exception {
+ final AbstractServerConfig conf = new AbstractServerConfig()
+ {
+ @Override
+ public File getServerTempDir()
+ {
+ return null;
+ }
+
+ @Override
+ public File getServerDataDir()
+ {
+ return null;
+ }
+
+ @Override
+ public File getHomeDir()
+ {
+ return null;
+ }
+ };
+
+ //test default value
+ assertEquals(ServerConfig.UNDEFINED_HOSTNAME, conf.getWebServiceHost());
+
+ //test empty/null values
+ conf.setWebServiceHost(null);
+ assertEquals(ServerConfig.UNDEFINED_HOSTNAME, conf.getWebServiceHost());
+ conf.setWebServiceHost("");
+ assertEquals(ServerConfig.UNDEFINED_HOSTNAME, conf.getWebServiceHost());
+
+ //test 0.0.0.0
+ conf.setWebServiceHost("0.0.0.0");
+ assertEquals(InetAddress.getLocalHost().getHostName(), conf.getWebServiceHost());
+
+ //test jbossws.undefined.host
+ conf.setWebServiceHost(ServerConfig.UNDEFINED_HOSTNAME);
+ assertEquals(ServerConfig.UNDEFINED_HOSTNAME, conf.getWebServiceHost());
+
+ //test hostname
+ conf.setWebServiceHost("foo.com");
+ assertEquals("foo.com", conf.getWebServiceHost());
+
+ //test IPv4 literal
+ conf.setWebServiceHost("192.168.3.56");
+ assertEquals("192.168.3.56", conf.getWebServiceHost());
+
+ //test IPv6 literals
+ conf.setWebServiceHost("0:0:0:0:0:0:0:1");
+ assertEquals("[0:0:0:0:0:0:0:1]", conf.getWebServiceHost());
+
+ conf.setWebServiceHost("FEDC:BA98:7654:3210:FEDC:BA98:7654:3210");
+ assertEquals("[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]", conf.getWebServiceHost());
+
+ conf.setWebServiceHost("3ffe:2a00:100:7031::1");
+ assertEquals("[3ffe:2a00:100:7031::1]", conf.getWebServiceHost());
+
+ conf.setWebServiceHost("::FFFF:129.144.52.38"); //IPv6 address with embedded IPv4 address, see RFC2373 2.5.4
+ assertEquals("[::FFFF:129.144.52.38]", conf.getWebServiceHost());
+ conf.setWebServiceHost("0:0:0:0:0:0:13.1.68.3");
+ assertEquals("[0:0:0:0:0:0:13.1.68.3]", conf.getWebServiceHost());
+
+ conf.setWebServiceHost("::1"); //IPv6 loopback address
+ assertEquals("[::1]", conf.getWebServiceHost());
+
+ //test IPv6 literals already converted to URL format
+ conf.setWebServiceHost("[0:0:0:0:0:0:0:1]");
+ assertEquals("[0:0:0:0:0:0:0:1]", conf.getWebServiceHost());
+
+ conf.setWebServiceHost("[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]");
+ assertEquals("[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]", conf.getWebServiceHost());
+
+ conf.setWebServiceHost("[3ffe:2a00:100:7031::1]");
+ assertEquals("[3ffe:2a00:100:7031::1]", conf.getWebServiceHost());
+
+ conf.setWebServiceHost("[::FFFF:129.144.52.38]");
+ assertEquals("[::FFFF:129.144.52.38]", conf.getWebServiceHost());
+ conf.setWebServiceHost("[0:0:0:0:0:0:13.1.68.3]");
+ assertEquals("[0:0:0:0:0:0:13.1.68.3]", conf.getWebServiceHost());
+
+ conf.setWebServiceHost("[::1]");
+ assertEquals("[::1]", conf.getWebServiceHost());
+
+ try {
+ conf.setWebServiceHost("ff%");
+ fail("IllegalArgumentException expected!");
+ } catch (IllegalArgumentException e) {
+ //OK
+ }
+
+ }
+}
Property changes on: common/trunk/src/test/java/org/jboss/test/ws/common/management/AbstractServerConfigTestCase.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: common/trunk/src/test/java/org/jboss/test/ws/common/utils/AddressUtilsTestCase.java
===================================================================
--- common/trunk/src/test/java/org/jboss/test/ws/common/utils/AddressUtilsTestCase.java (rev 0)
+++ common/trunk/src/test/java/org/jboss/test/ws/common/utils/AddressUtilsTestCase.java 2013-10-01 15:26:13 UTC (rev 17966)
@@ -0,0 +1,395 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.common.utils;
+
+import junit.framework.TestCase;
+
+import org.jboss.ws.common.utils.AddressUtils;
+
+/**
+ * Test the AddressUtils
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 01-Oct-2013
+ */
+public class AddressUtilsTestCase extends TestCase
+{
+ public void testHostname() {
+ assertFalse(AddressUtils.isValidHostnameAddress("."));
+ assertFalse(AddressUtils.isValidHostnameAddress("-"));
+ assertTrue(AddressUtils.isValidHostnameAddress("ee.54"));
+ assertTrue(AddressUtils.isValidHostnameAddress("r4-a.6y"));
+ assertTrue(AddressUtils.isValidHostnameAddress("r4-a.6y"));
+ assertFalse(AddressUtils.isValidHostnameAddress("-aa.com"));
+ assertFalse(AddressUtils.isValidHostnameAddress("aa.-com"));
+ assertFalse(AddressUtils.isValidHostnameAddress("aa-.com"));
+ assertFalse(AddressUtils.isValidHostnameAddress("-.com"));
+ assertFalse(AddressUtils.isValidHostnameAddress("--.com"));
+ assertFalse(AddressUtils.isValidHostnameAddress("-.com"));
+ assertFalse(AddressUtils.isValidHostnameAddress("aa.--"));
+ assertFalse(AddressUtils.isValidHostnameAddress("aa.-"));
+ assertTrue(AddressUtils.isValidHostnameAddress("a-a.com"));
+ assertTrue(AddressUtils.isValidHostnameAddress("a-a.co-m"));
+ assertTrue(AddressUtils.isValidHostnameAddress("a--a.com"));
+ assertTrue(AddressUtils.isValidHostnameAddress("a-a.com.fs"));
+ assertTrue(AddressUtils.isValidHostnameAddress("a-a.co-m.it"));
+ assertFalse(AddressUtils.isValidHostnameAddress("fsd~fd"));
+ assertFalse(AddressUtils.isValidHostnameAddress("fsd%fd"));
+ assertFalse(AddressUtils.isValidHostnameAddress("fsd:fd"));
+ assertFalse(AddressUtils.isValidHostnameAddress("fsd/fd"));
+ assertFalse(AddressUtils.isValidHostnameAddress("fsd_fd"));
+ }
+
+ public void testIPv4Addresses() {
+ assertTrue(AddressUtils.isValidIPv4Address("192.168.3.45"));
+ assertTrue(AddressUtils.isValidIPv4Address("127.0.0.1"));
+ assertTrue(AddressUtils.isValidIPv4Address("10.0.0.1"));
+ assertTrue(AddressUtils.isValidIPv4Address("4.3.2.5"));
+ assertFalse(AddressUtils.isValidIPv4Address("192.256.3.45"));
+ assertFalse(AddressUtils.isValidIPv4Address("192.3.256.45"));
+ assertFalse(AddressUtils.isValidIPv4Address("256.192.3.45"));
+ assertFalse(AddressUtils.isValidIPv4Address("192.3.45.256"));
+ assertFalse(AddressUtils.isValidIPv4Address("192.34.5"));
+ assertFalse(AddressUtils.isValidIPv4Address("154.14.5."));
+ assertFalse(AddressUtils.isValidIPv4Address("154.65"));
+ assertFalse(AddressUtils.isValidIPv4Address("154.65"));
+ assertFalse(AddressUtils.isValidIPv4Address("154"));
+ assertFalse(AddressUtils.isValidIPv4Address("154."));
+ }
+
+ public void testIPv6Addresses() {
+ assertTrue(AddressUtils.isValidIPv6Address("FEDC:BA98:7654:3210:FEDC:BA98:7654:3210"));
+ assertTrue(AddressUtils.isValidIPv6Address("3ffe:2a00:100:7031::1"));
+ assertTrue(AddressUtils.isValidIPv6Address("::FFFF:129.144.52.38"));
+ assertTrue(AddressUtils.isValidIPv6Address("0:0:0:0:0:0:13.1.68.3"));
+ assertTrue(AddressUtils.isValidIPv6Address("0:0:0:0:0:0:0:1"));
+ assertTrue(AddressUtils.isValidIPv6Address("::1"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555:6666:7777:8888"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555:6666:7777::"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555:6666::"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555::"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111:2222:3333:4444::"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111:2222:3333::"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111:2222::"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111::"));
+ assertTrue(AddressUtils.isValidIPv6Address("::"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555:6666::8888"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555::8888"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111:2222:3333:4444::8888"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111:2222:3333::8888"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111:2222::8888"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111::8888"));
+ assertTrue(AddressUtils.isValidIPv6Address("::8888"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555::7777:8888"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111:2222:3333:4444::7777:8888"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111:2222:3333::7777:8888"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111:2222::7777:8888"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111::7777:8888"));
+ assertTrue(AddressUtils.isValidIPv6Address("::7777:8888"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111:2222:3333:4444::6666:7777:8888"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111:2222:3333::6666:7777:8888"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111:2222::6666:7777:8888"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111::6666:7777:8888"));
+ assertTrue(AddressUtils.isValidIPv6Address("::6666:7777:8888"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111:2222:3333::5555:6666:7777:8888"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111:2222::5555:6666:7777:8888"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111::5555:6666:7777:8888"));
+ assertTrue(AddressUtils.isValidIPv6Address("::5555:6666:7777:8888"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111:2222::4444:5555:6666:7777:8888"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111::4444:5555:6666:7777:8888"));
+ assertTrue(AddressUtils.isValidIPv6Address("::4444:5555:6666:7777:8888"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111::3333:4444:5555:6666:7777:8888"));
+ assertTrue(AddressUtils.isValidIPv6Address("::3333:4444:5555:6666:7777:8888"));
+ assertTrue(AddressUtils.isValidIPv6Address("::2222:3333:4444:5555:6666:7777:8888"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555:6666:123.123.123.123"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555::123.123.123.123"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111:2222:3333:4444::123.123.123.123"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111:2222:3333::123.123.123.123"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111:2222::123.123.123.123"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111::123.123.123.123"));
+ assertTrue(AddressUtils.isValidIPv6Address("::123.123.123.123"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111:2222:3333:4444::6666:123.123.123.123"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111:2222:3333::6666:123.123.123.123"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111:2222::6666:123.123.123.123"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111::6666:123.123.123.123"));
+ assertTrue(AddressUtils.isValidIPv6Address("::6666:123.123.123.123"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111:2222:3333::5555:6666:123.123.123.123"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111:2222::5555:6666:123.123.123.123"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111::5555:6666:123.123.123.123"));
+ assertTrue(AddressUtils.isValidIPv6Address("::5555:6666:123.123.123.123"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111:2222::4444:5555:6666:123.123.123.123"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111::4444:5555:6666:123.123.123.123"));
+ assertTrue(AddressUtils.isValidIPv6Address("::4444:5555:6666:123.123.123.123"));
+ assertTrue(AddressUtils.isValidIPv6Address("1111::3333:4444:5555:6666:123.123.123.123"));
+ assertTrue(AddressUtils.isValidIPv6Address("::3333:4444:5555:6666:123.123.123.123"));
+ assertTrue(AddressUtils.isValidIPv6Address("::2222:3333:4444:5555:6666:123.123.123.123"));
+
+ // Invalid data
+ assertFalse(AddressUtils.isValidIPv6Address("XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX"));
+ // To much components
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555:6666:7777:8888:9999"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555:6666:7777:8888::"));
+ assertFalse(AddressUtils.isValidIPv6Address("::2222:3333:4444:5555:6666:7777:8888:9999"));
+ // To less components
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555:6666:7777"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555:6666"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111"));
+ // Missing ":"
+ assertFalse(AddressUtils.isValidIPv6Address("11112222:3333:4444:5555:6666:7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:22223333:4444:5555:6666:7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:33334444:5555:6666:7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:44445555:6666:7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:55556666:7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555:66667777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555:6666:77778888"));
+ // Missing ":" intended for "::"
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555:6666:7777:8888:"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555:6666:7777:"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555:6666:"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555:"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:"));
+ assertFalse(AddressUtils.isValidIPv6Address(":"));
+ assertFalse(AddressUtils.isValidIPv6Address(":8888"));
+ assertFalse(AddressUtils.isValidIPv6Address(":7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address(":6666:7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address(":5555:6666:7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address(":4444:5555:6666:7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address(":3333:4444:5555:6666:7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address(":2222:3333:4444:5555:6666:7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111:2222:3333:4444:5555:6666:7777:8888"));
+ // :::
+ assertFalse(AddressUtils.isValidIPv6Address(":::2222:3333:4444:5555:6666:7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:::3333:4444:5555:6666:7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:::4444:5555:6666:7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:::5555:6666:7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:::6666:7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555:::7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555:6666:::8888"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555:6666:7777:::"));
+ // Double "::"
+ assertFalse(AddressUtils.isValidIPv6Address("::2222::4444:5555:6666:7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address("::2222:3333::5555:6666:7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address("::2222:3333:4444::6666:7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address("::2222:3333:4444:5555::7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address("::2222:3333:4444:5555:7777::8888"));
+ assertFalse(AddressUtils.isValidIPv6Address("::2222:3333:4444:5555:7777:8888::"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111::3333::5555:6666:7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111::3333:4444::6666:7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111::3333:4444:5555::7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111::3333:4444:5555:6666::8888"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111::3333:4444:5555:6666:7777::"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222::4444::6666:7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222::4444:5555::7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222::4444:5555:6666::8888"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222::4444:5555:6666:7777::"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333::5555::7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333::5555:6666::8888"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333::5555:6666:7777::"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444::6666::8888"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444::6666:7777::"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555::7777::"));
+ // Invalid data
+ assertFalse(AddressUtils.isValidIPv6Address("XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555:6666:00.00.00.00"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555:6666:000.000.000.000"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555:6666:256.256.256.256"));
+ // To much components
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555:6666:7777:8888:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555:6666:7777:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555:6666::1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address("::2222:3333:4444:5555:6666:7777:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555:6666:1.2.3.4.5"));
+ // To less components
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address("1.2.3.4"));
+ // Missing ":"
+ assertFalse(AddressUtils.isValidIPv6Address("11112222:3333:4444:5555:6666:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:22223333:4444:5555:6666:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:33334444:5555:6666:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:44445555:6666:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:55556666:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555:66661.2.3.4"));
+ // Missing "."
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555:6666:255255.255.255"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555:6666:255.255255.255"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555:6666:255.255.255255"));
+ // Missing ":" intended for "::"
+ assertFalse(AddressUtils.isValidIPv6Address(":1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address(":6666:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address(":5555:6666:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address(":4444:5555:6666:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address(":3333:4444:5555:6666:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address(":2222:3333:4444:5555:6666:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111:2222:3333:4444:5555:6666:1.2.3.4"));
+ // ":::"
+ assertFalse(AddressUtils.isValidIPv6Address(":::2222:3333:4444:5555:6666:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:::3333:4444:5555:6666:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:::4444:5555:6666:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:::5555:6666:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:::6666:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555:::1.2.3.4"));
+ // Double "::"
+ assertFalse(AddressUtils.isValidIPv6Address("::2222::4444:5555:6666:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address("::2222:3333::5555:6666:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address("::2222:3333:4444::6666:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address("::2222:3333:4444:5555::1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111::3333::5555:6666:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111::3333:4444::6666:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111::3333:4444:5555::1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222::4444::6666:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222::4444:5555::1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333::5555::1.2.3.4"));
+ // Missing parts
+ assertFalse(AddressUtils.isValidIPv6Address("::."));
+ assertFalse(AddressUtils.isValidIPv6Address("::.."));
+ assertFalse(AddressUtils.isValidIPv6Address("::..."));
+ assertFalse(AddressUtils.isValidIPv6Address("::1..."));
+ assertFalse(AddressUtils.isValidIPv6Address("::1.2.."));
+ assertFalse(AddressUtils.isValidIPv6Address("::1.2.3."));
+ assertFalse(AddressUtils.isValidIPv6Address("::.2.."));
+ assertFalse(AddressUtils.isValidIPv6Address("::.2.3."));
+ assertFalse(AddressUtils.isValidIPv6Address("::.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address("::..3."));
+ assertFalse(AddressUtils.isValidIPv6Address("::..3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address("::...4"));
+ // Extra ":" in front
+ assertFalse(AddressUtils.isValidIPv6Address(":1111:2222:3333:4444:5555:6666:7777::"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111:2222:3333:4444:5555:6666::"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111:2222:3333:4444:5555::"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111:2222:3333:4444::"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111:2222:3333::"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111:2222::"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111::"));
+ assertFalse(AddressUtils.isValidIPv6Address(":::"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111:2222:3333:4444:5555:6666::8888"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111:2222:3333:4444:5555::8888"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111:2222:3333:4444::8888"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111:2222:3333::8888"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111:2222::8888"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111::8888"));
+ assertFalse(AddressUtils.isValidIPv6Address(":::8888"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111:2222:3333:4444:5555::7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111:2222:3333:4444::7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111:2222:3333::7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111:2222::7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111::7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address(":::7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111:2222:3333:4444::6666:7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111:2222:3333::6666:7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111:2222::6666:7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111::6666:7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address(":::6666:7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111:2222:3333::5555:6666:7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111:2222::5555:6666:7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111::5555:6666:7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address(":::5555:6666:7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111:2222::4444:5555:6666:7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111::4444:5555:6666:7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address(":::4444:5555:6666:7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111::3333:4444:5555:6666:7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address(":::3333:4444:5555:6666:7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address(":::2222:3333:4444:5555:6666:7777:8888"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111:2222:3333:4444:5555:6666:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111:2222:3333:4444:5555::1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111:2222:3333:4444::1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111:2222:3333::1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111:2222::1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111::1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address(":::1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111:2222:3333:4444::6666:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111:2222:3333::6666:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111:2222::6666:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111::6666:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address(":::6666:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111:2222:3333::5555:6666:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111:2222::5555:6666:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111::5555:6666:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address(":::5555:6666:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111:2222::4444:5555:6666:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111::4444:5555:6666:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address(":::4444:5555:6666:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address(":1111::3333:4444:5555:6666:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address(":::3333:4444:5555:6666:1.2.3.4"));
+ assertFalse(AddressUtils.isValidIPv6Address(":::2222:3333:4444:5555:6666:1.2.3.4"));
+ // Extra ":" at end
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555:6666:7777:::"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555:6666:::"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555:::"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:::"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:::"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:::"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:::"));
+ assertFalse(AddressUtils.isValidIPv6Address(":::"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555:6666::8888:"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555::8888:"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444::8888:"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333::8888:"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222::8888:"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111::8888:"));
+ assertFalse(AddressUtils.isValidIPv6Address("::8888:"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444:5555::7777:8888:"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444::7777:8888:"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333::7777:8888:"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222::7777:8888:"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111::7777:8888:"));
+ assertFalse(AddressUtils.isValidIPv6Address("::7777:8888:"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333:4444::6666:7777:8888:"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333::6666:7777:8888:"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222::6666:7777:8888:"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111::6666:7777:8888:"));
+ assertFalse(AddressUtils.isValidIPv6Address("::6666:7777:8888:"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222:3333::5555:6666:7777:8888:"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222::5555:6666:7777:8888:"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111::5555:6666:7777:8888:"));
+ assertFalse(AddressUtils.isValidIPv6Address("::5555:6666:7777:8888:"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111:2222::4444:5555:6666:7777:8888:"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111::4444:5555:6666:7777:8888:"));
+ assertFalse(AddressUtils.isValidIPv6Address("::4444:5555:6666:7777:8888:"));
+ assertFalse(AddressUtils.isValidIPv6Address("1111::3333:4444:5555:6666:7777:8888:"));
+ assertFalse(AddressUtils.isValidIPv6Address("::3333:4444:5555:6666:7777:8888:"));
+ assertFalse(AddressUtils.isValidIPv6Address("::2222:3333:4444:5555:6666:7777:8888:"));
+ }
+
+ public void testValidAddress()
+ {
+ assertFalse(AddressUtils.isValidAddress("z<.trr"));
+ assertFalse(AddressUtils.isValidAddress("tt533!fd"));
+ assertFalse(AddressUtils.isValidAddress("fdss("));
+ assertFalse(AddressUtils.isValidAddress(".."));
+ assertFalse(AddressUtils.isValidAddress(" tetre"));
+ assertFalse(AddressUtils.isValidAddress("78.."));
+ assertFalse(AddressUtils.isValidAddress("rer..it"));
+ assertFalse(AddressUtils.isValidAddress("foo_3.it"));
+ assertFalse(AddressUtils.isValidAddress("65.654.45."));
+ }
+}
Property changes on: common/trunk/src/test/java/org/jboss/test/ws/common/utils/AddressUtilsTestCase.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
11 years, 3 months
JBossWS SVN: r17965 - common/trunk.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-10-01 11:15:09 -0400 (Tue, 01 Oct 2013)
New Revision: 17965
Modified:
common/trunk/pom.xml
Log:
Use latest released spi in common, fine for now.
Modified: common/trunk/pom.xml
===================================================================
--- common/trunk/pom.xml 2013-10-01 15:14:21 UTC (rev 17964)
+++ common/trunk/pom.xml 2013-10-01 15:15:09 UTC (rev 17965)
@@ -27,7 +27,7 @@
<!-- Properties -->
<properties>
- <jbossws.spi.version>2.2.1-SNAPSHOT</jbossws.spi.version>
+ <jbossws.spi.version>2.2.1.Final</jbossws.spi.version>
<jboss.jaxbintros.version>1.0.2.GA</jboss.jaxbintros.version>
<jboss.common.core.version>2.2.17.GA</jboss.common.core.version>
<jboss-logging.version>3.1.2.GA</jboss-logging.version>
11 years, 3 months
JBossWS SVN: r17964 - common/trunk.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-10-01 11:14:21 -0400 (Tue, 01 Oct 2013)
New Revision: 17964
Modified:
common/trunk/pom.xml
Log:
Moving to next dev cycle
Modified: common/trunk/pom.xml
===================================================================
--- common/trunk/pom.xml 2013-09-30 17:26:22 UTC (rev 17963)
+++ common/trunk/pom.xml 2013-10-01 15:14:21 UTC (rev 17964)
@@ -9,7 +9,7 @@
<packaging>jar</packaging>
<description>JBossWS Common</description>
- <version>2.2.1-SNAPSHOT</version>
+ <version>2.2.2-SNAPSHOT</version>
<!-- Parent -->
<parent>
11 years, 3 months