Author: fmeschbe
Date: Wed Feb 6 06:57:20 2008
New Revision: 619008
URL: http://svn.apache.org/viewvc?rev=619008&view=rev
Log:
Modify the URls: the plain URL must not have a dot and test with appended
extensions
Modified:
incubator/sling/trunk/launchpad/launchpad-webapp/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/GetWithSuffixTest.java
Modified:
incubator/sling/trunk/launchpad/launchpad-webapp/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/GetWithSuffixTest.java
URL:
http://svn.apache.org/viewvc/incubator/sling/trunk/launchpad/launchpad-webapp/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/GetWithSuffixTest.java?rev=619008&r1=619007&r2=619008&view=diff
==============================================================================
---
incubator/sling/trunk/launchpad/launchpad-webapp/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/GetWithSuffixTest.java
(original)
+++
incubator/sling/trunk/launchpad/launchpad-webapp/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/GetWithSuffixTest.java
Wed Feb 6 06:57:20 2008
@@ -36,7 +36,7 @@
testText = "This is a test " + System.currentTimeMillis();
// create the test node, under a path that's specific to this class to
allow collisions
- final String url = HTTP_BASE_URL + "/" + getClass().getSimpleName() +
"." + System.currentTimeMillis();
+ final String url = HTTP_BASE_URL + "/" + getClass().getSimpleName() +
"_" + System.currentTimeMillis();
final Map<String,String> props = new HashMap<String,String>();
props.put("text", testText);
displayUrl = testClient.createNode(url, props);
@@ -58,9 +58,12 @@
}
public void testWithExtraPathA() throws IOException {
- final String toDelete =
uploadTestScript("rendering-test.esp","html.esp");
+ final String toDelete =
uploadTestScript("rendering-test.esp","txt.esp");
try {
- assertHttpStatus(displayUrl + "/extra.html",
HttpServletResponse.SC_NOT_FOUND);
+ // expected to be found as resource with ext .txt and suffix
+ final String content = getContent(displayUrl + ".txt/extra.html",
CONTENT_TYPE_PLAIN);
+ assertTrue("Content includes ESP marker",content.contains("ESP
template"));
+ assertTrue("Content contains formatted test
text",content.contains("<p>" + testText + "</p>"));
} finally {
testClient.delete(toDelete);
}
@@ -72,6 +75,7 @@
public void testWithExtraPathB() throws IOException {
final String toDelete =
uploadTestScript("rendering-test.esp","GET.esp");
try {
+ // expected to not be found as dispalyUrl has no dots
assertHttpStatus(displayUrl + "/extra/more.a4.html",
HttpServletResponse.SC_NOT_FOUND);
} finally {
testClient.delete(toDelete);