in src/main/java/org/apache/sling/launchpad/webapp/integrationtest/ForwardTest.java [46:92]
protected void setUp() throws Exception {
super.setUp();
// Create the test nodes under a path that's specific to this class to
// allow collisions
final String url = HTTP_BASE_URL + "/" + getClass().getSimpleName() + "/" + System.currentTimeMillis() + SlingPostConstants.DEFAULT_CREATE_SUFFIX;
final Map<String,String> props = new HashMap<String,String>();
// Create two test nodes and store their paths
testTextA = "Text A " + System.currentTimeMillis();
props.put("text", testTextA);
nodeUrlA = testClient.createNode(url, props);
String pathToInclude = nodeUrlA.substring(HTTP_BASE_URL.length());
// Node B stores the path of A, so that the test script can
// forward A when rendering B
testTextB = "Text B " + System.currentTimeMillis();
props.put("text", testTextB);
props.put("pathToInclude", pathToInclude);
nodeUrlB = testClient.createNode(url, props);
// Node E is like B but with an extension on the forward path
props.put("pathToInclude", pathToInclude + ".html");
nodeUrlE = testClient.createNode(url, props);
// Node C is used for the infinite loop detection test
props.remove("pathToInclude");
props.put("testInfiniteLoop","true");
nodeUrlC = testClient.createNode(url, props);
// Node D is used for the "force resource type" test
forcedResourceType = getClass().getSimpleName() + "/" + System.currentTimeMillis();
props.remove("testInfiniteLoop");
props.put("forceResourceType", forcedResourceType);
props.put("pathToInclude", pathToInclude);
nodeUrlD = testClient.createNode(url, props);
// Script for forced resource type
scriptPath = "/apps/" + forcedResourceType;
testClient.mkdirs(WEBDAV_BASE_URL, scriptPath);
toDelete.add(uploadTestScript(scriptPath,"forward-forced.esp","html.esp"));
// The main rendering script goes under /apps in the repository
scriptPath = "/apps/nt/unstructured";
testClient.mkdirs(WEBDAV_BASE_URL, scriptPath);
toDelete.add(uploadTestScript(scriptPath,"forward-test.esp","html.esp"));
}