incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r1079859 - in /sling/trunk/testing: samples/integration-tests/pom.xml tools/src/main/java/org/apache/sling/testing/tools/sling/SlingTestBase.java
Date Wed, 09 Mar 2011 15:56:49 GMT
Author: bdelacretaz
Date: Wed Mar  9 15:56:49 2011
New Revision: 1079859

URL: http://svn.apache.org/viewvc?rev=1079859&view=rev
Log:
Do not hardcode localhost name

Modified:
    sling/trunk/testing/samples/integration-tests/pom.xml
    sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/sling/SlingTestBase.java

Modified: sling/trunk/testing/samples/integration-tests/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/testing/samples/integration-tests/pom.xml?rev=1079859&r1=1079858&r2=1079859&view=diff
==============================================================================
--- sling/trunk/testing/samples/integration-tests/pom.xml (original)
+++ sling/trunk/testing/samples/integration-tests/pom.xml Wed Mar  9 15:56:49 2011
@@ -55,13 +55,16 @@
         <!-- Set this to run the server on a specific port
         <http.port></http.port>
          -->
-        
+         
         <!-- Set this to run tests against an existing server instance -->
         <keepJarRunning>false</keepJarRunning>
         
         <!-- URL of a server against which to run tests -->
         <test.server.url></test.server.url>
         
+         <!-- Set this to run tests against a specific hostname, if test.server.url is
not set-->
+         <test.server.hostname></test.server.hostname>
+        
         <!-- Options for the VM that executes our runnable jar -->
         <jar.executor.vm.options>-Xmx512m</jar.executor.vm.options>
         
@@ -194,6 +197,7 @@
                     </includes>
                     <systemPropertyVariables>
                         <test.server.url>${test.server.url}</test.server.url>
+                        <test.server.hostname>${test.server.hostname}</test.server.hostname>
                         <jar.executor.server.port>${http.port}</jar.executor.server.port>
                         <jar.executor.vm.options>${jar.executor.vm.options}</jar.executor.vm.options>
                         <jar.executor.jar.folder>${project.basedir}/target/dependency</jar.executor.jar.folder>

Modified: sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/sling/SlingTestBase.java
URL: http://svn.apache.org/viewvc/sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/sling/SlingTestBase.java?rev=1079859&r1=1079858&r2=1079859&view=diff
==============================================================================
--- sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/sling/SlingTestBase.java
(original)
+++ sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/sling/SlingTestBase.java
Wed Mar  9 15:56:49 2011
@@ -41,6 +41,7 @@ public class SlingTestBase {
     public static final String SERVER_READY_TIMEOUT_PROP = "server.ready.timeout.seconds";
     public static final String SERVER_READY_PROP_PREFIX = "server.ready.path";
     public static final String KEEP_JAR_RUNNING_PROP = "keepJarRunning";
+    public static final String SERVER_HOSTNAME_PROP = "test.server.hostname";
     public static final String ADDITONAL_BUNDLES_PATH = "additional.bundles.path";
     public static final String BUNDLE_TO_INSTALL_PREFIX = "sling.additional.bundle";
     public static final String ADMIN = "admin";
@@ -79,9 +80,14 @@ public class SlingTestBase {
             serverBaseUrl = configuredUrl;
             serverStarted = true;
         } else {
-            serverBaseUrl = "http://localhost:" + jarExecutor.getServerPort();
+            String serverHost = System.getProperty(SERVER_HOSTNAME_PROP);
+            if(serverHost == null || serverHost.trim().length() == 0) {
+                serverHost = "localhost";
+            }
+            serverBaseUrl = "http://" + serverHost + ":" + jarExecutor.getServerPort();
         }
-        
+
+        log.info("Server base URL={}", serverBaseUrl);
         builder = new RequestBuilder(serverBaseUrl);
         webconsoleClient = new WebconsoleClient(serverBaseUrl, ADMIN, ADMIN);
         builder = new RequestBuilder(serverBaseUrl);



Mime
View raw message