incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r635502 - /incubator/sling/trunk/launchpad/webapp/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/HttpTestBase.java
Date Mon, 10 Mar 2008 09:50:28 GMT
Author: bdelacretaz
Date: Mon Mar 10 02:50:25 2008
New Revision: 635502

URL: http://svn.apache.org/viewvc?rev=635502&view=rev
Log:
remove ending slash in test base URLs if needed

Modified:
    incubator/sling/trunk/launchpad/webapp/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/HttpTestBase.java

Modified: incubator/sling/trunk/launchpad/webapp/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/HttpTestBase.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/launchpad/webapp/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/HttpTestBase.java?rev=635502&r1=635501&r2=635502&view=diff
==============================================================================
--- incubator/sling/trunk/launchpad/webapp/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/HttpTestBase.java
(original)
+++ incubator/sling/trunk/launchpad/webapp/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/HttpTestBase.java
Mon Mar 10 02:50:25 2008
@@ -46,8 +46,8 @@
 
 /** Base class for HTTP-based Sling Launchpad integration tests */
 public class HttpTestBase extends TestCase {
-    public static final String HTTP_BASE_URL = System.getProperty("launchpad.http.server.url",
"http://localhost:8888");
-    public static final String WEBDAV_BASE_URL = System.getProperty("launchpad.webdav.server.url",
"http://localhost:8888/dav/default");
+    public static final String HTTP_BASE_URL = removeEndingSlash(System.getProperty("launchpad.http.server.url",
"http://localhost:8888"));
+    public static final String WEBDAV_BASE_URL = removeEndingSlash(System.getProperty("launchpad.webdav.server.url",
"http://localhost:8888/dav/default"));
 
     /** base path for test files */
     public static final String TEST_PATH = "/launchpad-integration-tests";
@@ -92,6 +92,13 @@
             testClient.delete(nodeUrl);
         }
     };
+    
+    protected static String removeEndingSlash(String str) {
+        if(str != null && str.endsWith("/")) {
+            return str.substring(0, str.length() - 1);
+        }
+        return str;
+    }
 
     @Override
     protected void setUp() throws Exception {



Mime
View raw message