Author: bdelacretaz
Date: Tue Sep  2 01:43:54 2008
New Revision: 691154

URL: http://svn.apache.org/viewvc?rev=691154&view=rev
Log:
simplify tests using assertContains()

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

Modified: 
incubator/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/PathBasedResourceTypeTest.java
URL: 
http://svn.apache.org/viewvc/incubator/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/PathBasedResourceTypeTest.java?rev=691154&r1=691153&r2=691154&view=diff
==============================================================================
--- 
incubator/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/PathBasedResourceTypeTest.java
 (original)
+++ 
incubator/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/PathBasedResourceTypeTest.java
 Tue Sep  2 01:43:54 2008
@@ -20,13 +20,11 @@
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.sling.commons.testing.integration.HttpTestBase;
-
 /** Test the SLING-340 way of deriving the resource type from
  *  the content path.
  */
 
-public class PathBasedResourceTypeTest extends HttpTestBase {
+public class PathBasedResourceTypeTest extends RenderingTestBase {
 
     public static final String testPath = "sling-integration-test-" + 
System.currentTimeMillis();
     public static final String contentPath = "/sling-test-pbrt/" + testPath;
@@ -42,7 +40,7 @@
 
         // without script -> default rendering
         String content = getContent(tn.nodeUrl + ".html", CONTENT_TYPE_HTML);
-        assertTrue("Content contains default 
rendering",content.contains("Resource dumped by HtmlRendererServlet"));
+        assertContains(content, "dumped by HtmlRendererServlet");
 
         // check default resource type
         final String scriptPath = "/apps/" + testPath;
@@ -51,7 +49,7 @@
         final String urlsToDelete = uploadTestScript(scriptPath, 
"rendering-test.esp", "html.esp");
         try {
             content = getContent(tn.nodeUrl + ".html", CONTENT_TYPE_HTML);
-            assertTrue("Test script marker found in content (" + content + 
")",content.contains("ESP template"));
+            assertContains(content, "ESP template");
         } finally {
             testClient.delete(urlsToDelete);
         }
@@ -66,6 +64,6 @@
 
         urlsToDelete.add(uploadTestScript(tn.scriptPath, 
"rendering-test-2.esp", "html.esp"));
         final String content = getContent(tn.nodeUrl + ".html", 
CONTENT_TYPE_HTML);
-        assertTrue("Test script marker found in content (" + content + 
")",content.contains("Template #2 for ESP tests"));
+        assertContains(content, "Template #2 for ESP tests");
     }
 }


Reply via email to