Class ErrorHandlingTest

  • All Implemented Interfaces:
    junit.framework.Test

    public class ErrorHandlingTest
    extends RenderingTestBase
    Test the sling error handling mechanism http://sling.apache.org/site/errorhandling.html
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.apache.sling.commons.testing.integration.HttpTestBase

        org.apache.sling.commons.testing.integration.HttpTestBase.TestNode
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String ERROR_HANDLER_PATH  
      static int RETRY_INTERVAL_MSEC  
      static int RETRY_MAX_TIME_SEC
      Need some retries as there might be some latency when installing error handler scripts
      static String TEST_ROOT  
      static String THROW_ERROR_PAGE  
      static String THROW_ERROR_PATH  
      • Fields inherited from class org.apache.sling.commons.testing.integration.HttpTestBase

        CONTENT_TYPE_CSS, CONTENT_TYPE_DONTCARE, CONTENT_TYPE_HTML, CONTENT_TYPE_JS, CONTENT_TYPE_JSON, CONTENT_TYPE_PLAIN, CONTENT_TYPE_XML, DEFAULT_EXT, DEFAULT_READINESS_MEDIA_TYPE, EXECUTE_RESOURCE_TYPE, HTTP_BASE_URL, HTTP_METHOD_GET, HTTP_METHOD_POST, HTTP_URL, httpClient, MAX_READY_URL_INDEX, PROPERTY_SKIP_STARTUP_CHECK, READINESS_MEDIA_TYPE_PROP, READY_TIMEOUT_SECONDS, READY_URL_PROP_PREFIX, SERVLET_CONTEXT, SLING_POST_SERVLET_CREATE_SUFFIX, SLING_RESOURCE_TYPE, TEST_PATH, testClient, urlsToDelete, WEBDAV_BASE_URL
    • Constructor Detail

      • ErrorHandlingTest

        public ErrorHandlingTest()
    • Method Detail

      • setUp

        protected void setUp()
                      throws Exception
        Overrides:
        setUp in class org.apache.sling.commons.testing.integration.HttpTestBase
        Throws:
        Exception
      • tearDown

        protected void tearDown()
                         throws Exception
        Overrides:
        tearDown in class org.apache.sling.commons.testing.integration.HttpTestBase
        Throws:
        Exception
      • test_404_errorhandling

        public void test_404_errorhandling()
                                    throws Throwable
        Throws:
        Throwable
      • test_500_errorhandling

        public void test_500_errorhandling()
                                    throws Throwable
        Throws:
        Throwable
      • test_401_errorhandling

        public void test_401_errorhandling()
                                    throws Throwable
        Throws:
        Throwable
      • test_421_exception

        public void test_421_exception()
                                throws Throwable
        Throws:
        Throwable
      • test_throwable_errorhandling

        public void test_throwable_errorhandling()
                                          throws Throwable
        Throws:
        Throwable
      • test_500_errorhandling_POST_operation

        public void test_500_errorhandling_POST_operation()
                                                   throws Throwable
        Throws:
        Throwable
      • test_errorhandling_POST_operation_SlingPostServlet

        public void test_errorhandling_POST_operation_SlingPostServlet()
                                                                throws Throwable
        Throws:
        Throwable
      • test_404_errorhandling_JSON_extension

        public void test_404_errorhandling_JSON_extension()
                                                   throws Throwable
        SLING-7836 - Test an error handling script registered for a json extension
        Throws:
        Throwable