java.lang.Object
junit.framework.Assert
junit.framework.TestCase
org.apache.sling.commons.testing.integration.HttpTestBase
org.apache.sling.commons.testing.integration.HttpTest
All Implemented Interfaces:
junit.framework.Test

public class HttpTest extends HttpTestBase
Helper class for HTTP tests, extends HttpTestBase and adds a few utilities that we commonly use in our integration tests. Meant to be used as a helper class in JUnit4-style tests, as we gradually move away from JUnit3 style.
  • Field Details

    • scriptPath

      protected String scriptPath
    • testText

      protected String testText
    • displayUrl

      protected String displayUrl
  • Constructor Details

    • HttpTest

      public HttpTest()
  • Method Details

    • uploadTestScript

      public String uploadTestScript(String localFilename, String filenameOnServer) throws IOException
      Throws:
      IOException
    • assertContains

      public static void assertContains(String content, String expected)
    • assertNotContains

      public static void assertNotContains(String content, String notExpected)
    • setScriptPath

      public void setScriptPath(String scriptPath)
    • getScriptPath

      public String getScriptPath()
    • getTestClient

      public SlingIntegrationTestClient getTestClient()
    • getHttpClient

      public org.apache.commons.httpclient.HttpClient getHttpClient()
    • setUp

      public void setUp() throws Exception
      Making this public here, changing the base class to public is not convenient as many derived classes override it as protected.
      Overrides:
      setUp in class HttpTestBase
      Throws:
      Exception
    • tearDown

      public void tearDown() throws Exception
      Making this public here, changing the base class to public is not convenient as many derived classes override it as protected.
      Overrides:
      tearDown in class HttpTestBase
      Throws:
      Exception