incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jus...@apache.org
Subject svn commit: r1213782 - /sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/VanityPathTest.java
Date Tue, 13 Dec 2011 16:59:07 GMT
Author: justin
Date: Tue Dec 13 16:59:07 2011
New Revision: 1213782

URL: http://svn.apache.org/viewvc?rev=1213782&view=rev
Log:
SLING-2251 - fixing IT (thanks to Troy Caldwell for the patch!)

Modified:
    sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/VanityPathTest.java

Modified: sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/VanityPathTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/VanityPathTest.java?rev=1213782&r1=1213781&r2=1213782&view=diff
==============================================================================
--- sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/VanityPathTest.java
(original)
+++ sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/VanityPathTest.java
Tue Dec 13 16:59:07 2011
@@ -92,7 +92,7 @@ public class VanityPathTest extends Http
         // ... to the created node
         String location = get.getResponseHeader("Location").getValue();
         assertNotNull(location);
-        assertEquals(createdNodeUrl + ".html", location);
+        assertEquals(removeHttpBase(createdNodeUrl) + ".html", location);
     }
     
     /** test vanity path with 301 redirect */
@@ -118,7 +118,7 @@ public class VanityPathTest extends Http
         // ... to the created node
         String location = get.getResponseHeader("Location").getValue();
         assertNotNull(location);
-        assertEquals(createdNodeUrl + ".html", location);
+        assertEquals(removeHttpBase(createdNodeUrl) + ".html", location);
     }
     
     /** test vanity path with redirect using a non-html extension and a selector */
@@ -143,7 +143,11 @@ public class VanityPathTest extends Http
         // ... to the created node
         String location = get.getResponseHeader("Location").getValue();
         assertNotNull(location);
-        assertEquals(createdNodeUrl + ".test.json", location);
+        assertEquals(removeHttpBase(createdNodeUrl) + ".test.json", location);
+    }
+    
+    private String removeHttpBase(String url) {
+        return url.startsWith(HTTP_BASE_URL) ? url.substring(HTTP_BASE_URL.length()) : url;
     }
 
     /**



Mime
View raw message