Index: ejb3/pom.xml =================================================================== --- ejb3/pom.xml (revision 109571) +++ ejb3/pom.xml (revision 109712) @@ -80,13 +80,16 @@ - + + + + - - + + Index: varia/src/main/java/org/jboss/jdbc/HypersonicDatabase.java =================================================================== --- varia/src/main/java/org/jboss/jdbc/HypersonicDatabase.java (revision 109571) +++ varia/src/main/java/org/jboss/jdbc/HypersonicDatabase.java (revision 109712) @@ -31,6 +31,7 @@ import org.jboss.system.ServiceMBeanSupport; import org.jboss.system.server.ServerConfigLocator; +import org.jboss.config.ServerConfigUtil; /** * Integration with HSQLDB @@ -487,11 +488,12 @@ String[] args; if (!inProcessMode) { + // JBAS-8540 args = new String[] { "-noexit", "-driver", driver, - "-url", JDBC_URL_PREFIX + "hsql://" + connectHost + ":" + port, + "-url", JDBC_URL_PREFIX + "hsql://" + ServerConfigUtil.fixHostnameForURL(connectHost) + ":" + port, "-user", user, "-password", password, "-dir", getDatabasePath() @@ -743,7 +745,8 @@ { // If bind address is the default 0.0.0.0, use localhost String connectHost = DEFAULT_ADDRESS.equals(address) ? "localhost" : address; - String dbURL = JDBC_URL_PREFIX + "hsql://" + connectHost + ":" + port; + // JBAS-8540 + String dbURL = JDBC_URL_PREFIX + "hsql://" + ServerConfigUtil.fixHostnameForURL(connectHost) + ":" + port; Connection connection = getConnection(dbURL); Statement statement = connection.createStatement(); Index: varia/src/resources/services/invoker/http/jboss-service.xml =================================================================== --- varia/src/resources/services/invoker/http/jboss-service.xml (revision 109571) +++ varia/src/resources/services/invoker/http/jboss-service.xml (revision 109712) @@ -12,17 +12,16 @@ where is InetAddress.getHostname value on which the server is running. --> - http:// - - + + jboss.web:service=WebServer HttpConnector - :${port}/invoker/EJBInvokerServlet + http://${hostforurl}:${port}/invoker/EJBInvokerServlet - true @@ -31,17 +30,15 @@ jboss:service=NamingBeanImpl - http:// - + jboss.web:service=WebServer HttpConnector - :${port}/invoker/JMXInvokerServlet + http://${hostforurl}:${port}/invoker/JMXInvokerServlet - true org.jnp.interfaces.Naming @@ -60,17 +57,15 @@ jboss:service=NamingBeanImpl - http:// - + jboss.web:service=WebServer HttpConnector - :${port}/invoker/readonly/JMXInvokerServlet + http://${hostforurl}:${port}/invoker/readonly/JMXInvokerServlet - true org.jnp.interfaces.Naming Index: varia/src/resources/services/invoker/httpha/jboss-service.xml =================================================================== --- varia/src/resources/services/invoker/httpha/jboss-service.xml (revision 109571) +++ varia/src/resources/services/invoker/httpha/jboss-service.xml (revision 109712) @@ -12,17 +12,16 @@ where is InetAddress.getHostname value on which the server is running. --> - http:// - + + replacement operation using the HTTP connector host and port + see JBAS-8540 --> jboss.web:service=WebServer HttpConnector - :${port}/invoker/EJBInvokerServlet + http://${hostforurl}:${port}/invoker/EJBInvokerServlet - true is InetAddress.getHostname value on which the server is running. --> - http:// - + jboss.web:service=WebServer HttpConnector - :${port}/invoker/EJBInvokerHAServlet + http://${hostforurl}:${port}/invoker/EJBInvokerHAServlet - true @@ -50,17 +47,15 @@ jboss:service=NamingBeanImpl - http:// - + jboss.web:service=WebServer HttpConnector - :${port}/invoker/JMXInvokerServlet + http://${hostforurl}:${port}/invoker/JMXInvokerServlet - true org.jnp.interfaces.Naming @@ -79,17 +74,15 @@ jboss:service=NamingBeanImpl - http:// - + jboss.web:service=WebServer HttpConnector - :${port}/invoker/readonly/JMXInvokerServlet + http://${hostforurl}:${port}/invoker/readonly/JMXInvokerServlet - true org.jnp.interfaces.Naming @@ -108,17 +101,15 @@ jboss:service=HAJNDI - http:// - + jboss.web:service=WebServer HttpConnector - :${port}/invoker/JMXInvokerHAServlet + http://${hostforurl}:${port}/invoker/JMXInvokerHAServlet - true org.jnp.interfaces.Naming Index: component-matrix/pom.xml =================================================================== --- component-matrix/pom.xml (revision 109571) +++ component-matrix/pom.xml (revision 109712) @@ -314,7 +314,7 @@ commons-httpclient commons-httpclient - 3.0.1 + 3.1-SNAPSHOT test @@ -752,7 +752,7 @@ hsqldb hsqldb - 1.8.0.8-brew + 1.8.0.8.patch03-SNAPSHOT @@ -2122,7 +2122,7 @@ org.jboss.test jboss-test - 1.1.9.GA + 1.2.0.Beta1 org.jboss.logging @@ -2142,7 +2142,7 @@ org.jboss.jbossas jboss-server-manager - 1.0.3.GA + 1.0.4.Beta1 org.jboss.jbossas Index: server/src/main/java/org/jboss/config/ServerConfigUtil.java =================================================================== --- server/src/main/java/org/jboss/config/ServerConfigUtil.java (revision 109571) +++ server/src/main/java/org/jboss/config/ServerConfigUtil.java (revision 109712) @@ -36,6 +36,7 @@ * * @author Adrian Brock * @author ALR Maintain only + * @author Richard Achmatowicz * @version $Revision: $ */ public final class ServerConfigUtil @@ -128,4 +129,23 @@ return longUrl; } } + + /** + * Utility to check if a hostname is an IPv6 literal and is so, add surrounding brackets + * for use in URLs (see JBAS-8540) + * + * @param hostname + * @return hostname suitable for use in URLs + */ + public static String fixHostnameForURL(String host) + { + if (host == null) + return host ; + + // if the hostname is an IPv6 literal, enclose it in brackets + if (host.indexOf(':') != -1) + return "[" + host + "]" ; + else + return host ; + } } Index: server/src/main/java/org/jboss/invocation/http/server/HttpProxyFactory.java =================================================================== --- server/src/main/java/org/jboss/invocation/http/server/HttpProxyFactory.java (revision 109571) +++ server/src/main/java/org/jboss/invocation/http/server/HttpProxyFactory.java (revision 109712) @@ -274,7 +274,8 @@ InetAddress addr = InetAddress.getLocalHost(); host = useHostName ? addr.getHostName() : addr.getHostAddress(); } - String url = invokerURLPrefix + host + invokerURLSuffix; + // JBAS-8540 + String url = invokerURLPrefix + ServerConfigUtil.fixHostnameForURL(host) + invokerURLSuffix; setInvokerURL(url); } } Index: server/src/main/java/org/jboss/invocation/http/server/HttpInvoker.java =================================================================== --- server/src/main/java/org/jboss/invocation/http/server/HttpInvoker.java (revision 109571) +++ server/src/main/java/org/jboss/invocation/http/server/HttpInvoker.java (revision 109712) @@ -208,7 +208,7 @@ { host = useHostName ? addr.getHostName() : addr.getHostAddress(); } - String url = invokerURLPrefix + host + invokerURLSuffix; + String url = invokerURLPrefix + ServerConfigUtil.fixHostnameForURL(host) + invokerURLSuffix; setInvokerURL(url); } } Index: server/src/main/java/org/jboss/web/WebService.java =================================================================== --- server/src/main/java/org/jboss/web/WebService.java (revision 109571) +++ server/src/main/java/org/jboss/web/WebService.java (revision 109712) @@ -303,7 +303,8 @@ String codebase = getCodebase(); if (codebase == null) { - codebase = "http://" + getHost() + ":" + getPort() + "/"; + // JBAS-8540 + codebase = "http://" + ServerConfigUtil.fixHostnameForURL(getHost()) + ":" + getPort() + "/"; System.setProperty("java.rmi.server.codebase", codebase); } log.info("Using RMI server codebase: " + codebase); @@ -320,13 +321,15 @@ { // Start the WebServer running server.start(); - log.debug("Started WebServer with address: " + server.getBindAddress() + ":" + getPort()); + // JBAS-8540 + log.debug("Started WebServer with address: " + ServerConfigUtil.fixHostnameForURL(getBindAddress()) + ":" + getPort()); } protected void stopService() throws Exception { server.stop(); - log.debug("Stopped WebServer with address: " + server.getBindAddress() + ":" + getPort()); + // JBAS-8540 + log.debug("Stopped WebServer with address: " + ServerConfigUtil.fixHostnameForURL(getBindAddress()) + ":" + getPort()); } /** Index: server/src/etc/deploy/remoting-jboss-beans.xml =================================================================== --- server/src/etc/deploy/remoting-jboss-beans.xml (revision 109571) +++ server/src/etc/deploy/remoting-jboss-beans.xml (revision 109712) @@ -133,7 +133,7 @@ UnifiedInvokerConnector:bindingHome1 - ${host}:${port} + ${hostforurl}:${port} @@ -145,7 +145,7 @@ UnifiedInvokerConnector:bindingHome2 - !${host}:${port} + !${hostforurl}:${port} Index: main/src/bin/run.sh =================================================================== --- main/src/bin/run.sh (revision 109571) +++ main/src/bin/run.sh (revision 109712) @@ -55,11 +55,6 @@ . "$RUN_CONF" fi -# Force IPv4 on Linux systems since IPv6 doesn't work correctly with jdk5 and lower -if [ "$linux" = "true" ]; then - JAVA_OPTS="$JAVA_OPTS -Djava.net.preferIPv4Stack=true" -fi - # For Cygwin, ensure paths are in UNIX format before anything is touched if $cygwin ; then [ -n "$JBOSS_HOME" ] && Index: testsuite/src/main/org/jboss/test/cluster/ejb3/clusteredservice/unit/HttpUtils.java =================================================================== --- testsuite/src/main/org/jboss/test/cluster/ejb3/clusteredservice/unit/HttpUtils.java (revision 109571) +++ testsuite/src/main/org/jboss/test/cluster/ejb3/clusteredservice/unit/HttpUtils.java (revision 109712) @@ -37,6 +37,7 @@ import org.apache.commons.httpclient.methods.DeleteMethod; import org.apache.commons.httpclient.methods.TraceMethod; import org.jboss.logging.Logger; +import org.jboss.test.JBossTestUtil; /** Utilities for client http requests * @@ -46,8 +47,8 @@ public class HttpUtils { private static Logger log = Logger.getLogger(HttpUtils.class); - private static String baseURL = "http://jduke:theduke@localhost:" + Integer.getInteger("web.port", 8080) + "/"; - private static String baseURLNoAuth = "http://localhost:" + Integer.getInteger("web.port", 8080) + "/"; + private static String baseURL = "http://jduke:theduke@" + getServerHostForURL() + ":" + Integer.getInteger("web.port", 8080) + "/"; + private static String baseURLNoAuth = "http://" + getServerHostForURL() + ":" + Integer.getInteger("web.port", 8080) + "/"; public static final int GET = 1; public static final int POST = 2; @@ -57,13 +58,36 @@ public static final int DELETE = 6; public static final int TRACE = 7; + // JBAS-8540 + private static String getServerHost() { + String hostname = System.getProperty("jboss.bind.address", "localhost") ; + if (log.isDebugEnabled()) + log.debug("getServerHost(): using hostname = " + hostname) ; + return hostname; + } + + // JBAS-8540 + private static String getServerHostForURL() + { + String hostname = getServerHost() ; + + if (hostname == null) + return hostname; + + String hostnameForURL = JBossTestUtil.fixHostnameForURL(hostname) ; + if (log.isDebugEnabled()) + log.debug("getServerHostForURL(): using hostname for url = " + hostnameForURL) ; + + return hostnameForURL; + } + public static String getBaseURL() { return baseURL; } public static String getBaseURL(String username, String password) { - String url = "http://"+username+":"+password+"@"+ System.getProperty("jboss.bind.address") + ":" + String url = "http://"+username+":"+password+"@"+ getServerHostForURL() + ":" + Integer.getInteger("web.port", 8080) + "/"; return url; } Index: testsuite/src/main/org/jboss/test/cluster/ejb3/clusteredsession/ejbthree1136/unit/ClusteredCacheCleanStartUnitTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/cluster/ejb3/clusteredsession/ejbthree1136/unit/ClusteredCacheCleanStartUnitTestCase.java (revision 109571) +++ testsuite/src/main/org/jboss/test/cluster/ejb3/clusteredsession/ejbthree1136/unit/ClusteredCacheCleanStartUnitTestCase.java (revision 109712) @@ -27,7 +27,7 @@ import junit.framework.Test; import org.jboss.test.cluster.ejb3.clusteredsession.ejbthree1136.SFSBCacheManipulator; -import org.jboss.test.JBossTestCase; +import org.jboss.test.JBossClusteredTestCase; /** * Tests that StatefulTreeCache properly cleans up state when initializing. @@ -35,7 +35,7 @@ * @author Brian Stansberry * @version $Revision: 1.1 $ */ -public class ClusteredCacheCleanStartUnitTestCase extends JBossTestCase +public class ClusteredCacheCleanStartUnitTestCase extends JBossClusteredTestCase { /** * Create a new ClusteredCacheCleanupTestCase. Index: testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/DRMTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/DRMTestCase.java (revision 109571) +++ testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/DRMTestCase.java (revision 109712) @@ -523,7 +523,7 @@ log.info("DRMTestCase.testIsMasterReplica() - starting GossipRouter"); // router characteristics here must match the definition in the stack configuration - router = new GossipRouter(12001, "127.0.0.1"); + router = new GossipRouter(12001, "localhost"); router.start(); Thread.sleep(10000); log.info("router routing table = " + router.dumpRoutingTable()); @@ -713,7 +713,7 @@ MBeanServer mbeanServer = MBeanServerFactory.createMBeanServer("mockPartition"); try { - ClusterNode localAddress = factory.getClusterNode(new IpAddress("127.0.0.1", 12345)); + ClusterNode localAddress = factory.getClusterNode(new IpAddress("localhost", 12345)); MockHAPartition partition = new MockHAPartition(localAddress); DistributedReplicantManagerImpl drm = new DistributedReplicantManagerImpl(partition); @@ -724,7 +724,7 @@ Vector remoteAddresses = new Vector(); for (int i = 1; i < 5; i++) - remoteAddresses.add(factory.getClusterNode(new IpAddress("127.0.0.1", 12340 + i))); + remoteAddresses.add(factory.getClusterNode(new IpAddress("localhost", 12340 + i))); Vector allNodes = new Vector(remoteAddresses); allNodes.add(localAddress); @@ -817,7 +817,7 @@ MBeanServer mbeanServer = MBeanServerFactory.createMBeanServer("mockPartition"); try { - ClusterNode localAddress = factory.getClusterNode(new IpAddress("127.0.0.1", 12345)); + ClusterNode localAddress = factory.getClusterNode(new IpAddress("localhost", 12345)); MockHAPartition partition = new MockHAPartition(localAddress); DistributedReplicantManagerImpl drm = new DistributedReplicantManagerImpl(partition); @@ -828,7 +828,7 @@ Vector remoteAddresses = new Vector(); for (int i = 1; i < 5; i++) - remoteAddresses.add(factory.getClusterNode(new IpAddress("127.0.0.1", 12340 + i))); + remoteAddresses.add(factory.getClusterNode(new IpAddress("localhost", 12340 + i))); Vector allNodes = new Vector(remoteAddresses); allNodes.add(localAddress); @@ -936,7 +936,7 @@ MBeanServerFactory.createMBeanServer("mockPartition"); try { - ClusterNode localAddress = factory.getClusterNode(new IpAddress("127.0.0.1", 12345)); + ClusterNode localAddress = factory.getClusterNode(new IpAddress("localhost", 12345)); MockHAPartition partition = new MockHAPartition(localAddress); DistributedReplicantManagerImpl drm = new DistributedReplicantManagerImpl(partition); @@ -946,7 +946,7 @@ // Create a fake view for the MockHAPartition Vector remoteAddresses = new Vector(); - ClusterNode remote = factory.getClusterNode(new IpAddress("127.0.0.1", 12341)); + ClusterNode remote = factory.getClusterNode(new IpAddress("localhost", 12341)); remoteAddresses.add(remote); Vector allNodes = new Vector(remoteAddresses); @@ -1118,7 +1118,7 @@ Vector allNodes = new Vector(); for (int i = 0; i < nodes.length; i++) { - nodes[i] = factory.getClusterNode(new IpAddress("127.0.0.1", 12340 + i)); + nodes[i] = factory.getClusterNode(new IpAddress("localhost", 12340 + i)); allNodes.add(nodes[i]); names[i] = nodes[i].getName(); replicants[i] = new Integer(i); @@ -1195,7 +1195,7 @@ Vector allNodes = new Vector(); for (int i = 0; i < nodes.length; i++) { - nodes[i] = factory.getClusterNode(new IpAddress("127.0.0.1", 12340 + i)); + nodes[i] = factory.getClusterNode(new IpAddress("localhost", 12340 + i)); allNodes.add(nodes[i]); // names[i] = nodes[i].getName(); replicants[i] = new Integer(i); Index: testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/PreferredMasterElectionPolicyUnitTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/PreferredMasterElectionPolicyUnitTestCase.java (revision 109571) +++ testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/PreferredMasterElectionPolicyUnitTestCase.java (revision 109712) @@ -85,7 +85,13 @@ public void testUsePreferredMasterViaAddress() { - this.policy.setPreferredMaster("127.0.0.1:10002"); + // JBAS-8540 + String hostport = "[::1]:10002" ; + // check for IPv4 stack and use correct address literal + if (System.getProperty("java.net.preferIPv4Stack").equals("true")) + hostport = "127.0.0.1:10002" ; + + this.policy.setPreferredMaster(hostport); ClusterNode master = this.policy.elect(this.candidates); Index: testsuite/src/main/org/jboss/test/cluster/defaultcfg/clusteredentity/test/EmbeddedIdClassloaderTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/cluster/defaultcfg/clusteredentity/test/EmbeddedIdClassloaderTestCase.java (revision 109571) +++ testsuite/src/main/org/jboss/test/cluster/defaultcfg/clusteredentity/test/EmbeddedIdClassloaderTestCase.java (revision 109712) @@ -32,6 +32,7 @@ import org.jboss.test.cluster.clusteredentity.embeddedid.EmbeddedIdTest; import org.jboss.test.cluster.clusteredentity.embeddedid.MusicianPK; import org.jboss.test.cluster.testutil.DBSetup; +import org.jboss.test.JBossTestUtil; /** * Simple test of replication of entities and related queries with @EmbeddedId @@ -59,8 +60,10 @@ { super.setUp(); - sfsb0 = getUserTest(System.getProperty("jbosstest.cluster.node0")); - sfsb1 = getUserTest(System.getProperty("jbosstest.cluster.node1")); + String[] servers = getServers() ; + + sfsb0 = getUserTest(servers[0]); + sfsb1 = getUserTest(servers[1]); sfsb0.cleanup(); sfsb1.cleanup(); } @@ -92,7 +95,7 @@ Properties prop1 = new Properties(); prop1.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory"); prop1.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces"); - prop1.put("java.naming.provider.url", "jnp://" + nodeJNDIAddress + ":1099"); + prop1.put("java.naming.provider.url", "jnp://" + JBossTestUtil.fixHostnameForURL(nodeJNDIAddress) + ":1099"); log.info("===== Naming properties for " + nodeJNDIAddress + ": "); log.info(prop1); Index: testsuite/src/main/org/jboss/test/cluster/defaultcfg/clusteredentity/test/EntityQueryRedeployUnitTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/cluster/defaultcfg/clusteredentity/test/EntityQueryRedeployUnitTestCase.java (revision 109571) +++ testsuite/src/main/org/jboss/test/cluster/defaultcfg/clusteredentity/test/EntityQueryRedeployUnitTestCase.java (revision 109712) @@ -72,7 +72,8 @@ sleep(2000); // Get the SFSB again - sfsb1 = getEntityQueryTest(System.getProperty("jbosstest.cluster.node1")); + String[] servers = getServers() ; + sfsb1 = getEntityQueryTest(servers[1]); } Index: testsuite/src/main/org/jboss/test/cluster/defaultcfg/clusteredentity/test/EntityClassloaderTestBase.java =================================================================== --- testsuite/src/main/org/jboss/test/cluster/defaultcfg/clusteredentity/test/EntityClassloaderTestBase.java (revision 109571) +++ testsuite/src/main/org/jboss/test/cluster/defaultcfg/clusteredentity/test/EntityClassloaderTestBase.java (revision 109712) @@ -27,6 +27,7 @@ import org.jboss.test.cluster.clusteredentity.classloader.AccountHolderPK; import org.jboss.test.cluster.clusteredentity.classloader.EntityQueryTest; import org.jboss.test.JBossClusteredTestCase; +import org.jboss.test.JBossTestUtil; /** * Base class for tests involving clustered entities with a scoped classloader. @@ -72,8 +73,10 @@ { super.setUp(); - sfsb0 = getEntityQueryTest(System.getProperty("jbosstest.cluster.node0")); - sfsb1 = getEntityQueryTest(System.getProperty("jbosstest.cluster.node1")); + String[] servers = getServers() ; + + sfsb0 = getEntityQueryTest(servers[0]); + sfsb1 = getEntityQueryTest(servers[1]); sfsb0.cleanup(); sfsb1.cleanup(); } @@ -83,7 +86,8 @@ Properties prop = new Properties(); prop.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory"); prop.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces"); - prop.put("java.naming.provider.url", "jnp://" + nodeJNDIAddress + ":1099"); + // JBAS-8540 + prop.put("java.naming.provider.url", "jnp://" + JBossTestUtil.fixHostnameForURL(nodeJNDIAddress) + ":1099"); log.info("===== Naming properties for " + nodeJNDIAddress + ": "); log.info(prop); Index: testsuite/src/main/org/jboss/test/cluster/defaultcfg/clusteredentity/test/EntityUnitTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/cluster/defaultcfg/clusteredentity/test/EntityUnitTestCase.java (revision 109571) +++ testsuite/src/main/org/jboss/test/cluster/defaultcfg/clusteredentity/test/EntityUnitTestCase.java (revision 109712) @@ -89,13 +89,12 @@ public void testAll() throws Exception { System.out.println("*** testServerFound()"); - String node0 = System.getProperty("jbosstest.cluster.node0"); - String node1 = System.getProperty("jbosstest.cluster.node1"); + String[] namingURLs = getNamingURLs(); Properties prop0 = new Properties(); prop0.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory"); prop0.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces"); - prop0.put("java.naming.provider.url", "jnp://" + node0 + ":1099"); + prop0.put("java.naming.provider.url", namingURLs[0]); System.out.println("===== Node0 properties: "); System.out.println(prop0); @@ -103,7 +102,7 @@ Properties prop1 = new Properties(); prop1.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory"); prop1.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces"); - prop1.put("java.naming.provider.url", "jnp://" + node1 + ":1099"); + prop1.put("java.naming.provider.url", namingURLs[1]); System.out.println("===== Node1 properties: "); System.out.println(prop1); Index: testsuite/src/main/org/jboss/test/cluster/defaultcfg/clusteredentity/test/BulkOperationsUnitTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/cluster/defaultcfg/clusteredentity/test/BulkOperationsUnitTestCase.java (revision 109571) +++ testsuite/src/main/org/jboss/test/cluster/defaultcfg/clusteredentity/test/BulkOperationsUnitTestCase.java (revision 109712) @@ -49,12 +49,13 @@ public void testBulkOperations() throws Exception { System.out.println("*** testBulkOperations()"); - String node0 = System.getProperty("jbosstest.cluster.node0"); + + String[] namingURLs = getNamingURLs() ; Properties prop0 = new Properties(); prop0.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory"); prop0.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces"); - prop0.put("java.naming.provider.url", "jnp://" + node0 + ":1099"); + prop0.put("java.naming.provider.url", namingURLs[0]); System.out.println("===== Node0 properties: "); System.out.println(prop0); Index: testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/DriverManagerPersistentStoreUnitTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/DriverManagerPersistentStoreUnitTestCase.java (revision 109571) +++ testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/DriverManagerPersistentStoreUnitTestCase.java (revision 109712) @@ -20,6 +20,8 @@ import org.jboss.web.tomcat.service.session.persistent.DriverManagerPersistentStore; import org.jboss.web.tomcat.service.session.persistent.RDBMSStoreBase; +import org.jboss.test.JBossTestUtil; + /** * Unit tests for {@link DriverManagerPersistentStore}, although really more of * a test of its abstract superclass RDBMSStoreBase where we use the @@ -32,9 +34,9 @@ public class DriverManagerPersistentStoreUnitTestCase extends TestCase { private static final String DB_ADDRESS = System.getProperty(DBSetupDelegate.DBADDRESS_PROPERTY, DBSetupDelegate.DEFAULT_ADDRESS); + // JBAS-8540 + private static final String CONNECTION_URL = "jdbc:hsqldb:hsql://" + JBossTestUtil.fixHostnameForURL(DB_ADDRESS) + ":" + DBSetupDelegate.DEFAULT_PORT; - private static final String CONNECTION_URL = "jdbc:hsqldb:hsql://" + DB_ADDRESS + ":" + DBSetupDelegate.DEFAULT_PORT; - private static final String CONTEXT_PATH = "localhost/test"; private static AtomicInteger id = new AtomicInteger(); Index: testsuite/src/main/org/jboss/test/cluster/defaultcfg/web/test/PersistentManagerFormAuthTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/cluster/defaultcfg/web/test/PersistentManagerFormAuthTestCase.java (revision 109571) +++ testsuite/src/main/org/jboss/test/cluster/defaultcfg/web/test/PersistentManagerFormAuthTestCase.java (revision 109712) @@ -31,6 +31,7 @@ import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.methods.GetMethod; import org.apache.commons.httpclient.methods.PostMethod; +import org.jboss.test.JBossTestUtil; import org.jboss.test.cluster.testutil.DBSetupDelegate; import org.jboss.test.cluster.testutil.DelegatingClusteredTestCase; import org.jboss.test.cluster.testutil.TestSetupDelegate; @@ -55,7 +56,10 @@ protected void setUp() throws Exception { super.setUp(); - baseURLNoAuth = "http://" + getServerHost() + ":" + Integer.getInteger("web.port", 8080); + // JBAS-8540 + getServerHost() is really for non-clustered test cases + // baseURLNoAuth = "http://" + getServerHost + ":" + Integer.getInteger("web.port", 8080); + baseURLNoAuth = "http://" + JBossTestUtil.fixHostnameForURL(getServers()[0]) + ":" + Integer.getInteger("web.port", 8080); + } protected String getContextPath() Index: testsuite/src/main/org/jboss/test/cluster/testutil/DBSetupDelegate.java =================================================================== --- testsuite/src/main/org/jboss/test/cluster/testutil/DBSetupDelegate.java (revision 109571) +++ testsuite/src/main/org/jboss/test/cluster/testutil/DBSetupDelegate.java (revision 109712) @@ -28,6 +28,7 @@ import java.sql.Statement; import org.jboss.test.JBossTestServices; +import org.jboss.test.JBossTestUtil; /** A TestSetup that starts hypersonic before the testcase with a tcp * listening port at 1701. @@ -110,7 +111,8 @@ public void tearDown() throws Exception { Class.forName("org.hsqldb.jdbcDriver"); - String dbURL = "jdbc:hsqldb:hsql://" + address + ":" + port; + // JBAS-8540 + String dbURL = "jdbc:hsqldb:hsql://" + JBossTestUtil.fixHostnameForURL(address) + ":" + port; Connection conn = DriverManager.getConnection(dbURL, "sa", ""); Statement statement = conn.createStatement(); statement.executeQuery("SHUTDOWN COMPACT"); @@ -153,8 +155,15 @@ "-no_system_exit", "true", }; - System.out.println("Starting hsqldb"); + // JBAS-8540 + System.out.println("Starting hsqldb with command:"); + System.out.print("org.hsqldb.Server.main ") ; + for (int i = 0; i < args.length; i++) + System.out.print(args[i] + " ") ; + System.out.println("") ; + org.hsqldb.Server.main(args); + System.out.println("Done"); } catch (Exception e) Index: testsuite/src/main/org/jboss/test/cluster/web/persistent/PersistentSessionTestUtil.java =================================================================== --- testsuite/src/main/org/jboss/test/cluster/web/persistent/PersistentSessionTestUtil.java (revision 109571) +++ testsuite/src/main/org/jboss/test/cluster/web/persistent/PersistentSessionTestUtil.java (revision 109712) @@ -41,6 +41,8 @@ import org.jboss.web.tomcat.service.session.persistent.DataSourcePersistentManager; import org.jboss.web.tomcat.service.session.persistent.RDBMSStoreBase; +import org.jboss.test.JBossTestUtil ; + /** * Utilities for session testing. * @@ -60,7 +62,8 @@ { Driver driver = org.hsqldb.jdbcDriver.class.newInstance(); String host = System.getProperty(DBSetupDelegate.DBADDRESS_PROPERTY, DBSetupDelegate.DEFAULT_ADDRESS); - String jdbcURL = "jdbc:hsqldb:hsql://" + host + ":" + DBSetupDelegate.DEFAULT_PORT; + // JBAS-8540 + String jdbcURL = "jdbc:hsqldb:hsql://" + JBossTestUtil.fixHostnameForURL(host) + ":" + DBSetupDelegate.DEFAULT_PORT; datasource = new MockDataSource(driver, jdbcURL, "sa", null); } catch (InstantiationException e) Index: testsuite/src/main/org/jboss/test/cluster/web/persistent/PersistentStoreSetupDelegate.java =================================================================== --- testsuite/src/main/org/jboss/test/cluster/web/persistent/PersistentStoreSetupDelegate.java (revision 109571) +++ testsuite/src/main/org/jboss/test/cluster/web/persistent/PersistentStoreSetupDelegate.java (revision 109712) @@ -4,6 +4,7 @@ package org.jboss.test.cluster.web.persistent; import org.jboss.test.JBossTestServices; +import org.jboss.test.JBossTestUtil; import org.jboss.test.cluster.testutil.DBSetupDelegate; import org.jboss.test.cluster.testutil.TestSetupDelegate; import org.jboss.web.tomcat.service.session.persistent.PersistentStore; @@ -46,7 +47,8 @@ { PersistentStoreTableSetup tableSetup = new PersistentStoreTableSetup(); - tableSetup.setJdbcURL("jdbc:hsqldb:hsql://" + address + ":" + port); + // JBAS-8540 + tableSetup.setJdbcURL("jdbc:hsqldb:hsql://" + JBossTestUtil.fixHostnameForURL(address) + ":" + port); tableSetup.start(); } Index: testsuite/src/main/org/jboss/test/ejb3/jbas7526/unit/ServletAndEJBUnitTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/ejb3/jbas7526/unit/ServletAndEJBUnitTestCase.java (revision 109571) +++ testsuite/src/main/org/jboss/test/ejb3/jbas7526/unit/ServletAndEJBUnitTestCase.java (revision 109712) @@ -38,13 +38,14 @@ */ public class ServletAndEJBUnitTestCase extends JBossTestCase { - private String baseURL = "http://" + System.getProperty("jbosstest.server.host", "localhost") + ":" + Integer.getInteger("web.port", 8080) + "/jbas7526/calculator"; + // JBAS-8540 + private String baseURL = "http://" + System.getProperty("jbosstest.server.host.url","localhost") + ":" + Integer.getInteger("web.port", 8080) + "/jbas7526/calculator";; public ServletAndEJBUnitTestCase(String name) { super(name); } - + private String accessURL(String url) throws Exception { HttpClient httpConn = new HttpClient(); Index: testsuite/src/main/org/jboss/test/webservice/admindevel/ExampleTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/webservice/admindevel/ExampleTestCase.java (revision 109571) +++ testsuite/src/main/org/jboss/test/webservice/admindevel/ExampleTestCase.java (revision 109712) @@ -24,6 +24,10 @@ import javax.naming.InitialContext; import javax.xml.rpc.Service; +import java.net.URL; +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.io.IOException; import junit.framework.Test; import org.jboss.test.webservice.WebserviceTestBase; @@ -55,9 +59,35 @@ { InitialContext iniCtx = getClientContext(); Service service = (Service)iniCtx.lookup("java:comp/env/service/HelloService"); + + // JBAS-8540 debugging + URL wsdl = service.getWSDLDocumentLocation() ; + printURLContents(wsdl) ; + helloPort = (Hello)service.getPort(Hello.class); } } + + private void printURLContents(URL url) { + BufferedReader in = null ; + String inputLine = null ; + + // the WSDL URL is correct + // the WSDL contents are incorrect, carrying an invalid soap:address location= + log.debug("URL = " + url + ": contents: START") ; + + try { + in = new BufferedReader(new InputStreamReader(url.openStream())) ; + + while ((inputLine = in.readLine()) != null) + log.debug(inputLine); + + in.close(); + } catch(IOException e) { + e.printStackTrace() ; + } + log.debug("URL contents: END") ; + } public void testHelloString() throws Exception { Index: testsuite/src/main/org/jboss/test/naming/test/SecurityUnitTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/naming/test/SecurityUnitTestCase.java (revision 109571) +++ testsuite/src/main/org/jboss/test/naming/test/SecurityUnitTestCase.java (revision 109712) @@ -72,8 +72,9 @@ protected void setUp() throws Exception { super.setUp(); - JNDI_URL = "jnp://" + getServerHost() + ":1099/"; - INVOKER_BASE = "http://"+ getServerHost() + ":8080/invoker/"; + // JBAS-8540 + JNDI_URL = "jnp://" + getServerHostForURL() + ":1099/"; + INVOKER_BASE = "http://"+ getServerHostForURL() + ":8080/invoker/"; } /** Index: testsuite/src/main/org/jboss/test/naming/test/SimpleUnitTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/naming/test/SimpleUnitTestCase.java (revision 109571) +++ testsuite/src/main/org/jboss/test/naming/test/SimpleUnitTestCase.java (revision 109712) @@ -113,7 +113,8 @@ { getLog().debug("+++ testNameChanges"); InitialContext ctx = getInitialContext(); - Name name = ctx.getNameParser("").parse("jnp://" + getServerHost() + "/jmx"); + // JBAS-8540 + Name name = ctx.getNameParser("").parse("jnp://" + getServerHostForURL() + "/jmx"); Name copy = (Name) name.clone(); Object obj = ctx.lookup(name); getLog().debug("lookup("+name+") = "+obj); @@ -142,7 +143,7 @@ // Do a lookup on a server port that does not exist env.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); - env.setProperty(Context.PROVIDER_URL, "jnp://" + getServerHost() + ":65535/"); + env.setProperty(Context.PROVIDER_URL, "jnp://" + getServerHostForURL() + ":65535/"); env.setProperty("jnp.disableDiscovery", "true"); getLog().debug("Creating InitialContext with env="+env); try @@ -161,7 +162,7 @@ { getLog().debug("+++ testHaInvoker"); Properties env = new Properties(); - env.setProperty(Context.PROVIDER_URL, "jnp://" + getServerHost() + ":1100/"); + env.setProperty(Context.PROVIDER_URL, "jnp://" + getServerHostForURL() + ":1100/"); getLog().debug("Creating InitialContext with env="+env); InitialContext ctx = new InitialContext(env); getLog().debug("Created InitialContext"); @@ -188,7 +189,7 @@ // Lookup a name that does not exist java.util.Properties env = new java.util.Properties(); env.setProperty(javax.naming.Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); - env.setProperty(javax.naming.Context.PROVIDER_URL, "jnp://" + getServerHost() + ":1100/"); + env.setProperty(javax.naming.Context.PROVIDER_URL, "jnp://" + getServerHostForURL() + ":1100/"); getLog().debug("Creating InitialContext with env="+env); InitialContext ctx = new javax.naming.InitialContext(env); @@ -234,9 +235,9 @@ { getLog().debug("+++ testHaPartitionName"); Properties env = new Properties(); - String serverHost = getServerHost(); - env.setProperty(Context.PROVIDER_URL, "jnp://" + serverHost + ":65535/"); - env.setProperty("jnp.localAddress", serverHost); + // JBAS-8540 + env.setProperty(Context.PROVIDER_URL, "jnp://" + getServerHostForURL() + ":65535/"); + env.setProperty("jnp.localAddress", getServerHost()); env.setProperty("jnp.partitionName", "DefaultPartition"); // Don't let the discovery packet off the test server so we don't // get spurious responses from other servers on the network @@ -262,7 +263,7 @@ ctx.close(); // Now test discovery with a non-existent partition name - env.setProperty(Context.PROVIDER_URL, "jnp://" + getServerHost() + ":65535/"); + env.setProperty(Context.PROVIDER_URL, "jnp://" + getServerHostForURL() + ":65535/"); env.setProperty("jnp.partitionName", "__NotTheDefaultPartition__"); try { @@ -285,9 +286,9 @@ { getLog().debug("+++ testDiscoveryPort"); Properties env = new Properties(); - String serverHost = getServerHost(); - env.setProperty(Context.PROVIDER_URL, "jnp://" + serverHost + ":65535/"); - env.setProperty("jnp.localAddress", serverHost); + // JBAS-8540 + env.setProperty(Context.PROVIDER_URL, "jnp://" + getServerHostForURL() + ":65535/"); + env.setProperty("jnp.localAddress", getServerHost()); env.setProperty("jnp.discoveryPort", "1102"); // Don't let the discovery packet off the test server so we don't // get spurious responses from other servers on the network @@ -318,7 +319,7 @@ getLog().debug("+++ testHttpInvoker"); Properties env = new Properties(); env.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.HttpNamingContextFactory"); - env.setProperty(Context.PROVIDER_URL, "http://" + getServerHost() + ":8080/invoker/JNDIFactory"); + env.setProperty(Context.PROVIDER_URL, "http://" + getServerHostForURL() + ":8080/invoker/JNDIFactory"); getLog().debug("Creating InitialContext with env="+env); InitialContext ctx = new InitialContext(env); getLog().debug("Created InitialContext"); Index: testsuite/src/main/org/jboss/test/naming/test/NamingRestartUnitTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/naming/test/NamingRestartUnitTestCase.java (revision 109571) +++ testsuite/src/main/org/jboss/test/naming/test/NamingRestartUnitTestCase.java (revision 109712) @@ -426,7 +426,8 @@ private Properties createNamingEnvironment(String port) { - String namingURL = getServerHost() + ":" + port; + // JBAS-8540 + String namingURL = getServerHostForURL() + ":" + port; Properties env = new Properties(); env.setProperty(Context.PROVIDER_URL, namingURL); env.setProperty(NamingContext.JNP_DISABLE_DISCOVERY, "true"); Index: testsuite/src/main/org/jboss/test/web/test/WebProgrammaticLoginTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/web/test/WebProgrammaticLoginTestCase.java (revision 109571) +++ testsuite/src/main/org/jboss/test/web/test/WebProgrammaticLoginTestCase.java (revision 109712) @@ -59,7 +59,7 @@ */ public void testUnsuccessfulLogin() throws Exception { - String baseURLNoAuth = "http://" + getServerHost() + String baseURLNoAuth = "http://" + getServerHostForURL() + ":" + Integer.getInteger("web.port", 8080) + "/"; String path = "war1/TestServlet"; // try to perform programmatic auth without supplying login information. @@ -108,7 +108,7 @@ */ public void testSuccessfulLogin() throws Exception { - String baseURLNoAuth = "http://" + getServerHost() + String baseURLNoAuth = "http://" + getServerHostForURL() + ":" + Integer.getInteger("web.port", 8080) + "/"; String path1 = "war1/TestServlet?operation=login&username=jduke&pass=theduke"; HttpMethod indexGet = null; Index: testsuite/src/main/org/jboss/test/web/test/WebIntegrationUnitTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/web/test/WebIntegrationUnitTestCase.java (revision 109571) +++ testsuite/src/main/org/jboss/test/web/test/WebIntegrationUnitTestCase.java (revision 109712) @@ -227,7 +227,7 @@ URL url = new URL(baseURL+"jbosstest/restricted/SecureServlet"); getLog().info("Accessing SecureServlet with valid login"); HttpUtils.accessURL(url); - String baseURL2 = "http://" + getServerHost() + ":" + Integer.getInteger("web.port", 8080) + '/'; + String baseURL2 = "http://" + getServerHostForURL() + ":" + Integer.getInteger("web.port", 8080) + '/'; URL url2 = new URL(baseURL2+"jbosstest/restricted/UnsecureEJBServlet"); getLog().info("Accessing SecureServlet with no login"); HttpUtils.accessURL(url2, REALM, HttpURLConnection.HTTP_UNAUTHORIZED); @@ -236,7 +236,7 @@ */ public void testSecureServletWithBadPass() throws Exception { - String baseURL = "http://jduke:badpass@" + getServerHost() + ":" + Integer.getInteger("web.port", 8080) + '/'; + String baseURL = "http://jduke:badpass@" + getServerHostForURL() + ":" + Integer.getInteger("web.port", 8080) + '/'; URL url = new URL(baseURL+"jbosstest/restricted/SecureServlet"); HttpUtils.accessURL(url, REALM, HttpURLConnection.HTTP_UNAUTHORIZED); } @@ -244,7 +244,7 @@ */ public void testSecureServletWithNoLogin() throws Exception { - String baseURL = "http://" + getServerHost() + ":" + Integer.getInteger("web.port", 8080) + '/'; + String baseURL = "http://" + getServerHostForURL() + ":" + Integer.getInteger("web.port", 8080) + '/'; URL url = new URL(baseURL+"jbosstest/restricted/SecureServlet"); HttpUtils.accessURL(url, REALM, HttpURLConnection.HTTP_UNAUTHORIZED); } @@ -252,7 +252,7 @@ */ public void testNotJbosstest() throws Exception { - String baseURL = "http://" + getServerHost() + ":" + Integer.getInteger("web.port", 8080) + '/'; + String baseURL = "http://" + getServerHostForURL() + ":" + Integer.getInteger("web.port", 8080) + '/'; URL url = new URL(baseURL+"jbosstest-not/unrestricted/SecureServlet"); HttpUtils.accessURL(url, REALM, HttpURLConnection.HTTP_OK); } @@ -351,7 +351,7 @@ try { deploy("jbosstest-web2.ear"); - String baseURL = "http://" + getServerHost() + ":" + Integer.getInteger("web.port", 8080) + '/'; + String baseURL = "http://" + getServerHostForURL() + ":" + Integer.getInteger("web.port", 8080) + '/'; URL url = new URL(baseURL+"jbosstest-not2/unrestricted/SecureServlet"); HttpUtils.accessURL(url, REALM, HttpURLConnection.HTTP_OK); } @@ -383,7 +383,7 @@ try { deploy("good-web.war"); - String baseURL = "http://" + getServerHost() + ":" + Integer.getInteger("web.port", 8080) + '/'; + String baseURL = "http://" + getServerHostForURL() + ":" + Integer.getInteger("web.port", 8080) + '/'; URL url = new URL(baseURL+"redeploy/index.html"); HttpUtils.accessURL(url, REALM, HttpURLConnection.HTTP_OK); } @@ -401,7 +401,7 @@ deploy("manifest-web.ear"); try { - String baseURL = "http://" + getServerHost() + ":" + Integer.getInteger("web.port", 8080) + '/'; + String baseURL = "http://" + getServerHostForURL() + ":" + Integer.getInteger("web.port", 8080) + '/'; URL url = new URL(baseURL+"manifest/classpath.jsp"); HttpMethodBase request = HttpUtils.accessURL(url); Header errors = request.getResponseHeader("X-Exception"); @@ -432,7 +432,7 @@ try { deploy("jbosstest-good.ear"); - String baseURL = "http://" + getServerHost() + ":" + Integer.getInteger("web.port", 8080) + '/'; + String baseURL = "http://" + getServerHostForURL() + ":" + Integer.getInteger("web.port", 8080) + '/'; URL url = new URL(baseURL+"redeploy/index.html"); HttpUtils.accessURL(url, REALM, HttpURLConnection.HTTP_OK); } @@ -455,7 +455,7 @@ deploy("class-loading.war"); try { - String baseURL = "http://" + getServerHost() + ":" + Integer.getInteger("web.port", 8080) + '/'; + String baseURL = "http://" + getServerHostForURL() + ":" + Integer.getInteger("web.port", 8080) + '/'; // Load a log4j class URL url = new URL(baseURL+"class-loading/ClasspathServlet2?class=org.apache.log4j.net.SocketAppender"); HttpMethodBase request = HttpUtils.accessURL(url, REALM, HttpURLConnection.HTTP_OK); @@ -478,7 +478,7 @@ deploy("servlet-classes.war"); try { - String baseURL = "http://" + getServerHost() + ":" + Integer.getInteger("web.port", 8080) + '/'; + String baseURL = "http://" + getServerHostForURL() + ":" + Integer.getInteger("web.port", 8080) + '/'; // Load a servlet class URL url = new URL(baseURL+"servlet-classes/ClasspathServlet2?class=javax.servlet.http.HttpServletResponse"); HttpMethodBase request = HttpUtils.accessURL(url, REALM, HttpURLConnection.HTTP_OK); Index: testsuite/src/main/org/jboss/test/web/test/FormAuthUnitTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/web/test/FormAuthUnitTestCase.java (revision 109571) +++ testsuite/src/main/org/jboss/test/web/test/FormAuthUnitTestCase.java (revision 109712) @@ -58,7 +58,8 @@ protected void setUp() throws Exception { super.setUp(); - baseURLNoAuth = "http://" + getServerHost() + ":" + Integer.getInteger("web.port", 8080) + "/"; + // JBAS-8540 + baseURLNoAuth = "http://" + getServerHostForURL() + ":" + Integer.getInteger("web.port", 8080) + "/"; } /** Test form authentication of a secured servlet Index: testsuite/src/main/org/jboss/test/web/test/ssl/ClientCertJaspiWebUnitTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/web/test/ssl/ClientCertJaspiWebUnitTestCase.java (revision 109571) +++ testsuite/src/main/org/jboss/test/web/test/ssl/ClientCertJaspiWebUnitTestCase.java (revision 109712) @@ -54,7 +54,7 @@ protected void setUp() throws Exception { super.setUp(); - baseHttpsNoAuth = "https://" + getServerHost() + ":" + Integer.getInteger("secureweb.port", 8443) + "/"; + baseHttpsNoAuth = "https://" + getServerHostForURL() + ":" + Integer.getInteger("secureweb.port", 8443) + "/"; } /** Test CLIENT-CERT Index: testsuite/src/main/org/jboss/test/web/test/ssl/SSLUnitTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/web/test/ssl/SSLUnitTestCase.java (revision 109571) +++ testsuite/src/main/org/jboss/test/web/test/ssl/SSLUnitTestCase.java (revision 109712) @@ -49,8 +49,9 @@ protected void setUp() throws Exception { super.setUp(); - baseHttpNoAuth = "http://" + getServerHost() + ":" + Integer.getInteger("web.port", 8080) + "/"; - baseHttpsNoAuth = "https://" + getServerHost() + ":" + Integer.getInteger("secureweb.port", 8443) + "/"; + // JBAS-8540 + baseHttpNoAuth = "http://" + getServerHostForURL() + ":" + Integer.getInteger("web.port", 8080) + "/"; + baseHttpsNoAuth = "https://" + getServerHostForURL() + ":" + Integer.getInteger("secureweb.port", 8443) + "/"; } /** Test that access of the transport constrained redirects to the ssl connector @@ -72,7 +73,8 @@ log.info("+++ testHttpRedirectSecurityDomain"); int port = Integer.getInteger("web.port", 8080).intValue(); port += 1000; - String httpNoAuth = "http://" + getServerHost() + ":" + port + "/"; + // JBAS-8540 + String httpNoAuth = "http://" + getServerHostForURL() + ":" + port + "/"; doHttpRedirect(httpNoAuth); } @@ -91,7 +93,7 @@ log.info("+++ testHttps"); int port = Integer.getInteger("secureweb.port", 8443).intValue(); port += 1000; - String httpsNoAuth = "https://" + getServerHost() + ":" + port + "/"; + String httpsNoAuth = "https://" + getServerHostForURL() + ":" + port + "/"; doHttps(httpsNoAuth); } @@ -104,7 +106,7 @@ log.info("+++ testHttps"); int port = Integer.getInteger("secureweb.port", 8443).intValue(); port += 1500; - String httpsNoAuth = "https://" + getServerHost() + ":" + port + "/"; + String httpsNoAuth = "https://" + getServerHostForURL() + ":" + port + "/"; doHttps(httpsNoAuth); } Index: testsuite/src/main/org/jboss/test/web/test/SSOBaseCase.java =================================================================== --- testsuite/src/main/org/jboss/test/web/test/SSOBaseCase.java (revision 109571) +++ testsuite/src/main/org/jboss/test/web/test/SSOBaseCase.java (revision 109712) @@ -234,7 +234,11 @@ { targetServer = targetServer.substring(index + 3); } - index = targetServer.indexOf(":"); + // JBAS-8540 + // need to be able to parse IPv6 URLs which have enclosing brackets + // HttpClient 3.1 creates cookies which oinclude the square brackets + // index = targetServer.indexOf(":"); + index = targetServer.lastIndexOf(":"); if (index > -1) { targetServer = targetServer.substring(0, index); Index: testsuite/src/main/org/jboss/test/web/test/SingleSignOnUnitTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/web/test/SingleSignOnUnitTestCase.java (revision 109571) +++ testsuite/src/main/org/jboss/test/web/test/SingleSignOnUnitTestCase.java (revision 109712) @@ -43,7 +43,8 @@ protected void setUp() throws Exception { super.setUp(); - baseURLNoAuth = "http://" + getServerHost() + ":" + Integer.getInteger("web.port", 8080); + // JBAS-8540 + baseURLNoAuth = "http://" + getServerHostForURL() + ":" + Integer.getInteger("web.port", 8080); } /** Test single sign-on across two web apps using form based auth Index: testsuite/src/main/org/jboss/test/web/test/RemoteClassloadingServiceUnitTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/web/test/RemoteClassloadingServiceUnitTestCase.java (revision 109571) +++ testsuite/src/main/org/jboss/test/web/test/RemoteClassloadingServiceUnitTestCase.java (revision 109712) @@ -37,13 +37,14 @@ */ public class RemoteClassloadingServiceUnitTestCase extends JBossTestCase { - static final String baseURL = "http://" + System.getProperty("jbosstest.server.host", "localhost") + ":8083/"; + //JBAS-8540 + String baseURL = "http://" + System.getProperty("jbosstest.server.host.url", "localhost") + ":8083/"; public RemoteClassloadingServiceUnitTestCase(String name) { super(name); } - + /** * JBAS-4540, don't leak installation directory info * through the classloading service. Index: testsuite/src/main/org/jboss/test/web/security/CustomHeaderAuthTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/web/security/CustomHeaderAuthTestCase.java (revision 109571) +++ testsuite/src/main/org/jboss/test/web/security/CustomHeaderAuthTestCase.java (revision 109712) @@ -58,7 +58,8 @@ protected void setUp() throws Exception { super.setUp(); - baseURLNoAuth = "http://" + getServerHost() + ":" + Integer.getInteger("web.port", 8080) + "/"; + // JBAS-8540 + baseURLNoAuth = "http://" + getServerHostForURL() + ":" + Integer.getInteger("web.port", 8080) + "/"; } /** Index: testsuite/src/main/org/jboss/test/web/security/GenericHeaderAuthUnitTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/web/security/GenericHeaderAuthUnitTestCase.java (revision 109571) +++ testsuite/src/main/org/jboss/test/web/security/GenericHeaderAuthUnitTestCase.java (revision 109712) @@ -84,7 +84,8 @@ protected void setUp() throws Exception { super.setUp(); - this.testAppBaseURL = "http://" + super.getServerHost() + ":" + Integer.getInteger("web.port", 8080) + // JBAS-8540 + this.testAppBaseURL = "http://" + getServerHostForURL() + ":" + Integer.getInteger("web.port", 8080) + "/generic-header-auth/"; } Index: testsuite/src/main/org/jboss/test/web/security/AuthenticatorsExternalizationTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/web/security/AuthenticatorsExternalizationTestCase.java (revision 109571) +++ testsuite/src/main/org/jboss/test/web/security/AuthenticatorsExternalizationTestCase.java (revision 109712) @@ -50,7 +50,7 @@ public void setUp() throws Exception { super.setUp(); - baseURLNoAuth = "http://" + getServerHost() + ":" + Integer.getInteger("web.port", 8080) + "/"; + baseURLNoAuth = "http://" + getServerHostForURL() + ":" + Integer.getInteger("web.port", 8080) + "/"; this.serverFound(); this.deploy("auth-ext-header-web.ear"); server = getServer(); Index: testsuite/src/main/org/jboss/test/classloader/test/ScopingUnitTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/classloader/test/ScopingUnitTestCase.java (revision 109571) +++ testsuite/src/main/org/jboss/test/classloader/test/ScopingUnitTestCase.java (revision 109712) @@ -116,14 +116,14 @@ try { deploy("log4j113.war"); - URL log4jServletURL = new URL("http://" + getServerHost() + ":8080/log4j113/Log4jServlet/"); + URL log4jServletURL = new URL("http://" + getServerHostForURL() + ":8080/log4j113/Log4jServlet/"); InputStream reply = (InputStream) log4jServletURL.getContent(); - getLog().debug("Accessed http://" + getServerHost() + ":8080/log4j113/Log4jServlet/"); + getLog().debug("Accessed http://" + getServerHostForURL() + ":8080/log4j113/Log4jServlet/"); logReply(reply); - URL encServletURL = new URL("http://" + getServerHost() + ":8080/log4j113/ENCServlet/"); + URL encServletURL = new URL("http://" + getServerHostForURL() + ":8080/log4j113/ENCServlet/"); reply = (InputStream) encServletURL.getContent(); - getLog().debug("Accessed http://" + getServerHost() + ":8080/log4j113/ENCServlet/"); + getLog().debug("Accessed http://" + getServerHostForURL() + ":8080/log4j113/ENCServlet/"); logReply(reply); } catch(Exception e) @@ -146,9 +146,9 @@ try { deploy("common-logging.war"); - URL log4jServletURL = new URL("http://" + getServerHost() + ":8080/common-logging/Log4jServlet/"); + URL log4jServletURL = new URL("http://" + getServerHostForURL() + ":8080/common-logging/Log4jServlet/"); InputStream reply = (InputStream) log4jServletURL.getContent(); - getLog().debug("Accessed http://" + getServerHost() + ":8080/common-logging/Log4jServlet/"); + getLog().debug("Accessed http://" + getServerHostForURL() + ":8080/common-logging/Log4jServlet/"); logReply(reply); } catch(Exception e) @@ -173,9 +173,9 @@ try { deploy("oldxerces.war"); - URL servletURL = new URL("http://" + getServerHost() + ":8080/oldxerces/"); + URL servletURL = new URL("http://" + getServerHostForURL() + ":8080/oldxerces/"); InputStream reply = (InputStream) servletURL.getContent(); - getLog().debug("Accessed http://" + getServerHost() + ":8080/oldxerces/"); + getLog().debug("Accessed http://" + getServerHostForURL() + ":8080/oldxerces/"); logReply(reply); } catch(Exception e) @@ -332,7 +332,7 @@ { deploy("shared-jndi1.sar"); deploy("shared-jndi2.war"); - URL servletURL = new URL("http://" + getServerHost() + ":8080/shared-jndi2/LookupServlet"); + URL servletURL = new URL("http://" + getServerHostForURL() + ":8080/shared-jndi2/LookupServlet"); InputStream reply = (InputStream) servletURL.getContent(); getLog().debug("Accessed: "+servletURL); logReply(reply); Index: testsuite/src/main/org/jboss/test/classloader/leak/test/ClassloaderLeakTestBase.java =================================================================== --- testsuite/src/main/org/jboss/test/classloader/leak/test/ClassloaderLeakTestBase.java (revision 109571) +++ testsuite/src/main/org/jboss/test/classloader/leak/test/ClassloaderLeakTestBase.java (revision 109712) @@ -81,7 +81,7 @@ for (int i = 0; i < ejbs.length; i++) removeClassLoader(ejbs[i]); - baseURL = "http://" + getServerHost() + ":8080/" + getWarContextPath() + "/"; + baseURL = "http://" + getServerHostForURL() + ":8080/" + getWarContextPath() + "/"; } protected void tearDown() throws Exception Index: testsuite/src/main/org/jboss/test/jaxr/scout/basic/JaxrJNDIConnectionTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/jaxr/scout/basic/JaxrJNDIConnectionTestCase.java (revision 109571) +++ testsuite/src/main/org/jboss/test/jaxr/scout/basic/JaxrJNDIConnectionTestCase.java (revision 109712) @@ -53,11 +53,14 @@ protected InitialContext getClientContext() throws NamingException { - String hostname = System.getProperty("host.name"); + // JBAS-8540 + String hostnameForURL = System.getProperty("host.name.url", "localhost"); + if (hostnameForURL == null) + throw new IllegalStateException("host.name.url system property not present"); Properties env = new Properties(); env.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); env.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces"); - env.setProperty(Context.PROVIDER_URL, "jnp://" + hostname + ":1099"); + env.setProperty(Context.PROVIDER_URL, "jnp://" + hostnameForURL + ":1099"); return new InitialContext(env); } } Index: testsuite/src/main/org/jboss/test/jaxr/scout/JaxrBaseTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/jaxr/scout/JaxrBaseTestCase.java (revision 109571) +++ testsuite/src/main/org/jboss/test/jaxr/scout/JaxrBaseTestCase.java (revision 109712) @@ -504,13 +504,14 @@ protected InitialContext getClientContext() throws NamingException { - String hostname = System.getProperty("host.name", "localhost"); - if (hostname == null) - throw new IllegalStateException("host.name system property not present"); + // JBAS-8540 + String hostnameForURL = System.getProperty("host.name.url", "localhost"); + if (hostnameForURL == null) + throw new IllegalStateException("host.name.url system property not present"); Properties env = new Properties(); env.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); env.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces"); - env.setProperty(Context.PROVIDER_URL, "jnp://" + hostname + ":1099"); + env.setProperty(Context.PROVIDER_URL, "jnp://" + hostnameForURL + ":1099"); return new InitialContext(env); } Index: testsuite/src/main/org/jboss/test/security/test/mapping/RoleMappingWebTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/security/test/mapping/RoleMappingWebTestCase.java (revision 109571) +++ testsuite/src/main/org/jboss/test/security/test/mapping/RoleMappingWebTestCase.java (revision 109712) @@ -57,7 +57,7 @@ */ public void testWebAccess() throws Exception { - baseURLNoAuth = "http://" + getServerHost() + baseURLNoAuth = "http://" + getServerHostForURL() + ":" + Integer.getInteger("web.port", 8080) + "/"; GetMethod indexGet = new GetMethod(baseURLNoAuth+"web-role-map/Secured.jsp"); int responseCode = httpConn.executeMethod(indexGet); Index: testsuite/src/main/org/jboss/test/security/test/CustomPrincipalPropagationUnitTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/security/test/CustomPrincipalPropagationUnitTestCase.java (revision 109571) +++ testsuite/src/main/org/jboss/test/security/test/CustomPrincipalPropagationUnitTestCase.java (revision 109712) @@ -97,7 +97,8 @@ */ public void testCustomPrincipalTransmissionInVM() throws Exception { - String baseURLNoAuth = "http://" + getServerHost() + ":" + Integer.getInteger("web.port", 8080) + "/"; + // JBAS-8540 + String baseURLNoAuth = "http://" + getServerHostForURL() + ":" + Integer.getInteger("web.port", 8080) + "/"; HttpClient httpConn = new HttpClient(); GetMethod indexGet = new GetMethod(baseURLNoAuth + "custom-principal/"); int responseCode = httpConn.executeMethod(indexGet); Index: testsuite/src/main/org/jboss/test/security/test/SecurityDomainTolerateUnitTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/security/test/SecurityDomainTolerateUnitTestCase.java (revision 109571) +++ testsuite/src/main/org/jboss/test/security/test/SecurityDomainTolerateUnitTestCase.java (revision 109712) @@ -104,7 +104,7 @@ public void testWeb() throws Exception { - String baseURLNoAuth = "http://" + getServerHost() + + String baseURLNoAuth = "http://" + getServerHostForURL() + ":" + Integer.getInteger("web.port", 8080) + "/"; HttpClient httpConn = new HttpClient(); GetMethod indexGet = new GetMethod(baseURLNoAuth + "sdtolerate/"); Index: testsuite/src/main/org/jboss/test/security/test/WebJASPIFormUnitTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/security/test/WebJASPIFormUnitTestCase.java (revision 109571) +++ testsuite/src/main/org/jboss/test/security/test/WebJASPIFormUnitTestCase.java (revision 109712) @@ -58,7 +58,7 @@ protected void setUp() throws Exception { super.setUp(); - baseURLNoAuth = "http://" + getServerHost() + ":" + Integer.getInteger("web.port", 8080) + "/"; + baseURLNoAuth = "http://" + getServerHostForURL() + ":" + Integer.getInteger("web.port", 8080) + "/"; } public void testFormAuthSuccess() throws Exception Index: testsuite/src/main/org/jboss/test/jpa/test/AbstractWebJPATest.java =================================================================== --- testsuite/src/main/org/jboss/test/jpa/test/AbstractWebJPATest.java (revision 109571) +++ testsuite/src/main/org/jboss/test/jpa/test/AbstractWebJPATest.java (revision 109712) @@ -36,13 +36,14 @@ */ public abstract class AbstractWebJPATest extends JBossTestCase { - private String baseURL = "http://" + System.getProperty("jbosstest.server.host", "localhost") + ":" + Integer.getInteger("web.port", 8080) + "/jpa-test/Test?mode="; + // JBAS-8540 + private String baseURL = "http://" + System.getProperty("jbosstest.server.host.url","localhost") + ":" + Integer.getInteger("web.port", 8080) + "/jpa-test/Test?mode=";; public AbstractWebJPATest(String name) { super(name); } - + public void testWebJPA() throws Exception { accessURL("Write"); Index: testsuite/src/main/org/jboss/test/hellojrmpiiop/test/HelloTimingStressTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/hellojrmpiiop/test/HelloTimingStressTestCase.java (revision 109571) +++ testsuite/src/main/org/jboss/test/hellojrmpiiop/test/HelloTimingStressTestCase.java (revision 109712) @@ -59,18 +59,19 @@ { super(name); URL url; - String host = System.getProperty("jbosstest.server.host", "localhost"); + // JBAS-8540 + String hostForURL = System.getProperty("jbosstest.server.host.url","localhost"); url = ClassLoader.getSystemResource("iiop.jndi.properties"); iiopJndiProps = new java.util.Properties(); iiopJndiProps.load(url.openStream()); - String jnp = "jnp://"+host+":1099/iiop"; + String jnp = "jnp://"+hostForURL+":1099/iiop"; iiopJndiProps.setProperty("java.naming.provider.url", jnp); url = ClassLoader.getSystemResource("cosnaming.jndi.properties"); cosnamingJndiProps = new java.util.Properties(); cosnamingJndiProps.load(url.openStream()); - String corbaloc = "corbaloc::"+host+":3528/JBoss/Naming/root"; + String corbaloc = "corbaloc::"+hostForURL+":3528/JBoss/Naming/root"; cosnamingJndiProps.setProperty("java.naming.provider.url", corbaloc); } Index: testsuite/src/main/org/jboss/test/util/web/HttpUtils.java =================================================================== --- testsuite/src/main/org/jboss/test/util/web/HttpUtils.java (revision 109571) +++ testsuite/src/main/org/jboss/test/util/web/HttpUtils.java (revision 109712) @@ -36,6 +36,7 @@ import org.apache.commons.httpclient.methods.DeleteMethod; import org.apache.commons.httpclient.methods.TraceMethod; import org.jboss.logging.Logger; +import org.jboss.test.JBossTestUtil; /** Utilities for client http requests * @@ -45,8 +46,8 @@ public class HttpUtils { private static Logger log = Logger.getLogger(HttpUtils.class); - private static String baseURL = "http://jduke:theduke@" + System.getProperty("jbosstest.server.host", "localhost") + ":" + Integer.getInteger("web.port", 8080) + "/"; - private static String baseURLNoAuth = "http://" + System.getProperty("jbosstest.server.host", "localhost") + ":" + Integer.getInteger("web.port", 8080) + "/"; + private static String baseURL = "http://jduke:theduke@" + getServerHostForURL() + ":" + Integer.getInteger("web.port", 8080) + "/"; + private static String baseURLNoAuth = "http://" + getServerHostForURL() + ":" + Integer.getInteger("web.port", 8080) + "/"; public static final int GET = 1; public static final int POST = 2; @@ -56,13 +57,36 @@ public static final int DELETE = 6; public static final int TRACE = 7; + // JBAS-8540 + private static String getServerHost() { + String hostname = System.getProperty("jbosstest.server.host", "localhost") ; + if (log.isDebugEnabled()) + log.debug("getServerHost(): using hostname = " + hostname) ; + return hostname; + } + + // JBAS-8540 + private static String getServerHostForURL() + { + String hostname = getServerHost() ; + + if (hostname == null) + return hostname; + + String hostnameForURL = JBossTestUtil.fixHostnameForURL(hostname) ; + if (log.isDebugEnabled()) + log.debug("getServerHostForURL(): using hostname for url = " + hostnameForURL) ; + + return hostnameForURL; + } + public static String getBaseURL() { return baseURL; } public static String getBaseURL(String username, String password) { - String url = "http://"+username+":"+password+"@" + System.getProperty("jbosstest.server.host", "localhost") + ":" + String url = "http://"+username+":"+password+"@" + getServerHostForURL() + ":" + Integer.getInteger("web.port", 8080) + "/"; return url; } Index: testsuite/src/main/org/jboss/test/profileservice/test/JMXMappingUnitTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/profileservice/test/JMXMappingUnitTestCase.java (revision 109571) +++ testsuite/src/main/org/jboss/test/profileservice/test/JMXMappingUnitTestCase.java (revision 109712) @@ -145,7 +145,8 @@ // Statistic int requests = (Integer)((SimpleValue)comp.getProperty("requestCount").getValue()).getValue(); - new URL("http://" + getServerHost() + ":8080/jmx-console/HtmlAdaptor").openStream().close(); + // JBAS-8540 + new URL("http://" + getServerHostForURL() + ":8080/jmx-console/HtmlAdaptor").openStream().close(); assertEquals(requests + 1, ((SimpleValue)comp.getProperty("requestCount").getValue()).getValue()); return; } @@ -201,7 +202,8 @@ { // Statistic int requests = (Integer)((SimpleValue)comp.getProperty("requestCount").getValue()).getValue(); - new URL("http://" + getServerHost() + ":8080/").openStream().close(); + // JBAS-8540 + new URL("http://" + getServerHostForURL() + ":8080/").openStream().close(); assertEquals(requests + 1, ((SimpleValue)comp.getProperty("requestCount").getValue()).getValue()); return; } Index: testsuite/src/main/org/jboss/test/ws/JBossWSTest.java =================================================================== --- testsuite/src/main/org/jboss/test/ws/JBossWSTest.java (revision 109571) +++ testsuite/src/main/org/jboss/test/ws/JBossWSTest.java (revision 109712) @@ -153,6 +153,25 @@ String hostName = System.getProperty("jbosstest.server.host", "localhost"); return hostName; } + + /** + * Returns the JBoss server host from system property "jbosstest.server.host" + * in a form suitable for inclusion in URLs (see RFC 2732). + * JBAS-8540 + */ + public String getServerHostForURL() + { + String hostName = getServerHost() ; + + if (hostName == null) + return hostName; + + // check for IPv6 literal + if (hostName.indexOf(":") != -1) + return "[" + hostName + "]" ; + else + return hostName ; + } public static void assertEquals(Element expElement, Element wasElement, boolean ignoreWhitespace) { Index: testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/WebServiceTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/WebServiceTestCase.java (revision 109571) +++ testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/WebServiceTestCase.java (revision 109712) @@ -62,8 +62,9 @@ */ public void testWebService() throws Exception { + // JBAS-8540 Service service = Service.create( - new URL("http://"+getServerHost()+":8080/webservices-ejb3/SimpleEndpoint?wsdl"), + new URL("http://"+getServerHostForURL()+":8080/webservices-ejb3/SimpleEndpoint?wsdl"), new QName("http://ejb3Integration.jaxws.ws.test.jboss.org/","SimpleEndpointService") ); @@ -79,8 +80,9 @@ */ public void testWebServiceContext() throws Exception { + // JBAS-8540 Service service = Service.create( - new URL("http://"+getServerHost()+":8080/webservices-ejb3/WebServiceContextEndpoint?wsdl"), + new URL("http://"+getServerHostForURL()+":8080/webservices-ejb3/WebServiceContextEndpoint?wsdl"), new QName("http://ejb3Integration.jaxws.ws.test.jboss.org/","WebServiceContextEndpointService") ); @@ -93,6 +95,7 @@ public void testWebServiceRef() throws Exception { InitialContext iniCtx = getInitialContext(); + // JBAS-8540 FIX-ME if ("localhost".equals(getServerHost())) //requires AS bound to localhost, as this uses @WebServiceRef(wsdlLocation = "http://localhost..") { BusinessInterface ejb3Remote = (BusinessInterface)iniCtx.lookup("/test-webservices/WebServiceRefBean"); @@ -109,8 +112,9 @@ */ public void testHandlerContext() throws Exception { + // JBAS-8540 Service service = Service.create( - new URL("http://"+getServerHost()+":8080/webservices-ejb3/HandlerContextEndpoint?wsdl"), + new URL("http://"+getServerHostForURL()+":8080/webservices-ejb3/HandlerContextEndpoint?wsdl"), new QName("http://ejb3Integration.jaxws.ws.test.jboss.org/","HandlerContextEndpointService") ); Index: testsuite/src/main/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefClientTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefClientTestCase.java (revision 109571) +++ testsuite/src/main/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefClientTestCase.java (revision 109712) @@ -40,7 +40,8 @@ */ public class WebServiceRefClientTestCase extends JBossWSTest { - public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-webserviceref"; + // JBAS-8540 + public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHostForURL() + ":8080/jaxws-webserviceref"; public static Test suite() { Index: testsuite/src/main/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefEJB3TestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefEJB3TestCase.java (revision 109571) +++ testsuite/src/main/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefEJB3TestCase.java (revision 109712) @@ -40,7 +40,8 @@ */ public class WebServiceRefEJB3TestCase extends JBossWSTest { - public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-webserviceref"; + // JBAS-8540 + public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHostForURL() + ":8080/jaxws-webserviceref"; public static Test suite() { Index: testsuite/src/main/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefServletTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefServletTestCase.java (revision 109571) +++ testsuite/src/main/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefServletTestCase.java (revision 109712) @@ -41,7 +41,8 @@ */ public class WebServiceRefServletTestCase extends JBossWSTest { - public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-webserviceref"; + // JBAS-8540 + public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHostForURL() + ":8080/jaxws-webserviceref"; public static Test suite() { Index: testsuite/src/main/org/jboss/test/jmx/test/SecureJMXInvokerUnitTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/jmx/test/SecureJMXInvokerUnitTestCase.java (revision 109571) +++ testsuite/src/main/org/jboss/test/jmx/test/SecureJMXInvokerUnitTestCase.java (revision 109712) @@ -76,8 +76,8 @@ { return new ObjectName("jboss.test:service=InvokerTest,secured=true"); } - - static final String TARGET_SERVER = System.getProperty("jbosstest.server.host", "localhost"); + // JBAS-8540 + static final String TARGET_SERVER_FOR_URL = System.getProperty("jbosstest.server.host.url", "localhost"); private MBeanServerConnection getJMXServer() throws Exception { HashMap env = new HashMap(); @@ -92,7 +92,7 @@ env.put(JMXConnector.CREDENTIALS, creds); } - JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://"+TARGET_SERVER+":1090/jmxrmi"); + JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://"+TARGET_SERVER_FOR_URL+":1090/jmxrmi"); JMXConnector jmxc = JMXConnectorFactory.connect(url, env); MBeanServerConnection adaptor = jmxc.getMBeanServerConnection(); return adaptor; Index: testsuite/src/main/org/jboss/test/jmx/test/JMXConnectorUnitTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/jmx/test/JMXConnectorUnitTestCase.java (revision 109571) +++ testsuite/src/main/org/jboss/test/jmx/test/JMXConnectorUnitTestCase.java (revision 109712) @@ -79,7 +79,8 @@ public void setUp() throws Exception { super.setUp(); - String surl = "service:jmx:rmi://" + getServerHost() + "/jndi/rmi://" + getServerHost() + ":1090/jmxrmi"; + // JBAS-8540 + String surl = "service:jmx:rmi://" + getServerHostForURL() + "/jndi/rmi://" + getServerHostForURL() + ":1090/jmxrmi"; log.info("setup for JMXServiceURL = " + surl); JMXServiceURL url = new JMXServiceURL(surl); connector = JMXConnectorFactory.connect(url); Index: testsuite/src/resources/cluster/ejb2/passexp/META-INF/partition-passexp-jboss-beans.xml =================================================================== --- testsuite/src/resources/cluster/ejb2/passexp/META-INF/partition-passexp-jboss-beans.xml (revision 109571) +++ testsuite/src/resources/cluster/ejb2/passexp/META-INF/partition-passexp-jboss-beans.xml (revision 109712) @@ -128,9 +128,40 @@ @org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.remoting:service=PassExpConnector,transport=socket", exposedInterface=org.jboss.remoting.transport.ConnectorMBean.class, registerDirectly=true) - - + + + + PassExpConnector + + + ${jboss.bind.address} + 24446 + + + dataTypeinvocation marshallerorg.jboss.invocation.unified.marshall.InvocationMarshaller @@ -142,6 +173,8 @@ + + Index: testsuite/src/resources/cluster/drm/drm-test-stacks.xml =================================================================== --- testsuite/src/resources/cluster/drm/drm-test-stacks.xml (revision 109571) +++ testsuite/src/resources/cluster/drm/drm-test-stacks.xml (revision 109712) @@ -7,11 +7,11 @@ - + @@ -38,11 +38,11 @@ - + Index: testsuite/src/resources/cluster/persistent/httpsession-ds.xml =================================================================== --- testsuite/src/resources/cluster/persistent/httpsession-ds.xml (revision 109571) +++ testsuite/src/resources/cluster/persistent/httpsession-ds.xml (revision 109712) @@ -14,7 +14,9 @@ - jdbc:hsqldb:hsql://${node0.bind.address:localhost}:1701 + + + jdbc:hsqldb:hsql://${node0.bind.address.url:localhost}:1701 - + + + RestartConnector + + + ${jboss.bind.address} + 14446 + + + dataTypeinvocation marshallerorg.jboss.invocation.unified.marshall.InvocationMarshaller Index: testsuite/src/resources/cluster/hasingleton/electionpolicy/ha-electionpolicy-jboss-beans.xml =================================================================== --- testsuite/src/resources/cluster/hasingleton/electionpolicy/ha-electionpolicy-jboss-beans.xml (revision 109571) +++ testsuite/src/resources/cluster/hasingleton/electionpolicy/ha-electionpolicy-jboss-beans.xml (revision 109712) @@ -105,7 +105,8 @@ 0 - ${node0.bind.address:127.0.0.1}:1099 + + ${node0.bind.address.url:localhost}:1099 -1 - ${node0.bind.address:127.0.0.1}:1099 + + ${node0.bind.address.url:localhost}:1099 jboss.test:service=Naming,test=readonly - http:// - :8080/invoker/readonly/JMXInvokerServlet - true + + + + + + jboss:test=invoker,type=http,target=Naming,readonly=true + anynamehere + http://${hostforurl}:${port}/invoker/readonly/JMXInvokerServlet + ${jboss.bind.address} + 8080 + + org.jnp.interfaces.Naming naming/ReadOnlyNaming Index: testsuite/src/resources/security-srp/service-inf/jboss-service.xml =================================================================== --- testsuite/src/resources/security-srp/service-inf/jboss-service.xml (revision 109571) +++ testsuite/src/resources/security-srp/service-inf/jboss-service.xml (revision 109712) @@ -30,7 +30,39 @@ - http://${jboss.bind.address}:8080/invoker/JMXInvokerServlet + + + + + jboss.security.tests:service=SRP/HTTP + anynamehere + http://${hostforurl}:${port}/invoker/JMXInvokerServlet + ${jboss.bind.address} + 8080 + + jboss.security.tests:service=SRPService org.jboss.security.srp.SRPRemoteServerInterface srp-test-http/SRPServerInterface @@ -44,8 +76,16 @@ org.jboss.security.srp.SRPRemoteServerInterface srp-test-http/SRPServerInterfaceHA org.jboss.ha.framework.interfaces.FirstAvailable - http:// - :8080/invoker/JMXInvokerHAServlet + + + jboss.security.tests:service=SRP/HA-HTTP + anynamehere + http://${hostforurl}:${port}/invoker/JMXInvokerHAServlet + ${jboss.bind.address} + 8080 + + + org.jboss.invocation.http.interfaces.ClientMethodInterceptorHA Index: testsuite/imports/config/tests-clustering.xml =================================================================== --- testsuite/imports/config/tests-clustering.xml (revision 109571) +++ testsuite/imports/config/tests-clustering.xml (revision 109712) @@ -389,21 +389,23 @@ timeout="${junit.timeout}" jvm="${junit.jvm}" failureProperty="tests.failure"> - - + + + + @@ -451,6 +453,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -458,7 +534,7 @@ - + @@ -479,7 +555,7 @@ - + @@ -502,7 +578,7 @@ - + Index: testsuite/imports/server-config.xml =================================================================== --- testsuite/imports/server-config.xml (revision 109571) +++ testsuite/imports/server-config.xml (revision 109712) @@ -112,7 +112,8 @@ --> - + + @@ -124,7 +125,8 @@ - + + @@ -134,7 +136,8 @@ - + + @@ -149,7 +152,7 @@ - + @@ -158,8 +161,8 @@ - - + + @@ -171,7 +174,8 @@ - + + @@ -183,7 +187,8 @@ - + + @@ -199,9 +204,10 @@ - + + - + @@ -209,7 +215,8 @@ - + + @@ -218,7 +225,8 @@ - + + @@ -228,7 +236,8 @@ - + + @@ -237,7 +246,8 @@ - + + @@ -245,7 +255,8 @@ - + + @@ -255,7 +266,8 @@ - + + @@ -264,7 +276,8 @@ - + + @@ -273,7 +286,8 @@ - + + @@ -282,7 +296,8 @@ - + + @@ -290,7 +305,8 @@ - + + @@ -301,7 +317,8 @@ - + + @@ -312,7 +329,8 @@ - + + @@ -323,7 +341,8 @@ - + + @@ -334,7 +353,8 @@ - + + @@ -346,7 +366,8 @@ - + + @@ -359,11 +380,13 @@ - + + + @@ -373,11 +396,13 @@ - + + + @@ -387,13 +412,15 @@ - + + + @@ -401,13 +428,15 @@ - + + + @@ -415,13 +444,15 @@ - + + + @@ -429,13 +460,15 @@ - + + + @@ -443,12 +476,14 @@ - + + + @@ -458,12 +493,14 @@ - + + + @@ -473,7 +510,8 @@ - + + @@ -486,7 +524,8 @@ - + + @@ -499,7 +538,8 @@ - + + @@ -512,7 +552,8 @@ - + + @@ -525,7 +566,8 @@ - + + @@ -538,7 +580,8 @@ - + + @@ -550,7 +593,8 @@ - + + @@ -562,7 +606,8 @@ - + + @@ -575,8 +620,9 @@ + + - @@ -586,8 +632,9 @@ + + - @@ -595,34 +642,40 @@ - - + + + + + - - + + + - + + - + - - - + + + + @@ -636,11 +689,13 @@ "-agentlib:jbossAgent -d64" to use JBoss Profiler to analyze heap The default value is "" turning the following into a no-op --> - + + + @@ -651,11 +706,13 @@ - + + + @@ -665,7 +722,8 @@ - + + @@ -675,7 +733,8 @@ - + + @@ -688,7 +747,8 @@ - + + @@ -701,7 +761,8 @@ - + + @@ -713,7 +774,8 @@ - + + @@ -725,7 +787,8 @@ - + + @@ -736,31 +799,34 @@ - + + - - - - - - - - + + + + + + + + + - - - + + + - - - - - + + + + + + @@ -769,7 +835,8 @@ - + + @@ -780,10 +847,11 @@ - + + - - + + @@ -792,8 +860,9 @@ + + - @@ -853,7 +922,7 @@ + description="Path to the java executable" /> - + + @@ -1152,6 +1222,8 @@ + + Index: testsuite/build.xml =================================================================== --- testsuite/build.xml (revision 109571) +++ testsuite/build.xml (revision 109712) @@ -136,18 +136,28 @@ - - - - + + + + + + + + - - - - + + + + + + + + + + @@ -164,6 +174,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -888,11 +922,12 @@ + - + @@ -1591,8 +1626,10 @@ + - + + @@ -1674,6 +1711,7 @@ + @@ -1736,6 +1774,7 @@ + @@ -1781,6 +1820,7 @@ + @@ -1835,6 +1875,7 @@ + @@ -1925,6 +1966,7 @@ + @@ -2531,6 +2573,7 @@ + @@ -2679,6 +2722,7 @@ + @@ -2739,6 +2783,7 @@ + @@ -2803,14 +2848,16 @@ + - - + + + @@ -2976,6 +3023,7 @@ + @@ -3058,6 +3106,7 @@ + @@ -3127,6 +3176,7 @@ + @@ -3355,6 +3405,7 @@ + @@ -3453,9 +3504,9 @@ - + - + @@ -3568,11 +3621,10 @@ + - - @@ -3651,6 +3703,7 @@ + @@ -3970,6 +4023,7 @@ + Index: connector/src/etc/example-config/hsqldb-ds.xml =================================================================== --- connector/src/etc/example-config/hsqldb-ds.xml (revision 109571) +++ connector/src/etc/example-config/hsqldb-ds.xml (revision 109712) @@ -14,7 +14,12 @@