You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by fm...@apache.org on 2013/08/08 14:47:20 UTC
svn commit: r1511756 -
/sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/VanityPathTest.java
Author: fmeschbe
Date: Thu Aug 8 12:47:19 2013
New Revision: 1511756
URL: http://svn.apache.org/r1511756
Log:
Wait a little longer for the vanity map to be reloaded (seems to solve
failure of testRedirectOnPathWithExtension on my box ...)
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=1511756&r1=1511755&r2=1511756&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 Thu Aug 8 12:47:19 2013
@@ -5,9 +5,9 @@
* licenses this file to You under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
@@ -18,7 +18,6 @@ package org.apache.sling.launchpad.webap
import java.io.IOException;
import java.util.Arrays;
-import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -46,12 +45,12 @@ public class VanityPathTest extends Http
postUrl = HTTP_BASE_URL + "/" + getClass().getSimpleName() + "_"
+ System.currentTimeMillis()
+ SlingPostConstants.DEFAULT_CREATE_SUFFIX;
- vanityPath = "/" + getClass().getSimpleName() + "_" + System.currentTimeMillis() + "/vanity";
+ vanityPath = "/" + getClass().getSimpleName() + "_" + System.currentTimeMillis() + "/vanity";
vanityUrl = HTTP_BASE_URL + vanityPath;
-
-
+
+
}
-
+
/** test vanity path with internal redirect */
public void testInternalRedirect() throws IOException {
// create a node with a vanity path
@@ -60,7 +59,7 @@ public class VanityPathTest extends Http
props.put("sling:vanityPath", vanityPath);
String createdNodeUrl = testClient.createNode(postUrl, props);
String createdPath = createdNodeUrl.substring(HTTP_BASE_URL.length());
-
+
waitForMapReload();
// get the created node without following redirects
@@ -70,10 +69,10 @@ public class VanityPathTest extends Http
// expect a 200, not a redirect
assertEquals(200, status);
-
+
assertTrue(get.getResponseBodyAsString().contains(createdPath));
}
-
+
/** test vanity path with redirect */
public void test302Redirect() throws IOException {
// create a node with a vanity path
@@ -82,7 +81,7 @@ public class VanityPathTest extends Http
props.put("sling:vanityPath", vanityPath);
props.put("sling:redirect", "true");
String createdNodeUrl = testClient.createNode(postUrl, props);
-
+
waitForMapReload();
// get the created node's vanity path without following redirects
@@ -98,7 +97,7 @@ public class VanityPathTest extends Http
assertNotNull(location);
assertEquals(removeHttpBase(createdNodeUrl) + ".html", location);
}
-
+
/** test vanity path with 301 redirect */
public void test301Redirect() throws IOException {
// create a node with a vanity path
@@ -108,7 +107,7 @@ public class VanityPathTest extends Http
props.put("sling:redirect", "true");
props.put("sling:redirectStatus", "301");
String createdNodeUrl = testClient.createNode(postUrl, props);
-
+
waitForMapReload();
// get the created node without following redirects
@@ -124,7 +123,7 @@ public class VanityPathTest extends Http
assertNotNull(location);
assertEquals(removeHttpBase(createdNodeUrl) + ".html", location);
}
-
+
/** test vanity path with redirect using a non-html extension and a selector */
public void testRedirectKeepingExtensionAndSelector() throws IOException {
// create a node with a vanity path
@@ -133,7 +132,7 @@ public class VanityPathTest extends Http
props.put("sling:vanityPath", vanityPath);
props.put("sling:redirect", "true");
String createdNodeUrl = testClient.createNode(postUrl, props);
-
+
waitForMapReload();
// get the created node's vanity path without following redirects
@@ -158,14 +157,14 @@ public class VanityPathTest extends Http
props.put("sling:vanityPath", vanityPath);
props.put("sling:redirect", "true");
String createdNodeUrl = testClient.createNode(postUrl, props);
-
+
String pathWithExtension = removeHttpBase(createdNodeUrl) + ".ext";
List<NameValuePair> moveParams = Arrays.asList(
new NameValuePair(":dest", pathWithExtension),
new NameValuePair(":operation", "move"));
assertPostStatus(createdNodeUrl, 201, moveParams, "Could not move created node from " + createdNodeUrl);
createdNodeUrl = createdNodeUrl + ".ext";
-
+
waitForMapReload();
// get the created node's vanity path without following redirects
@@ -192,7 +191,7 @@ public class VanityPathTest extends Http
*/
private void waitForMapReload() {
try {
- Thread.sleep(500L);
+ Thread.sleep(750L);
} catch (InterruptedException e) {
}
}