Class ErrorHandlingTest
- java.lang.Object
-
- junit.framework.Assert
-
- junit.framework.TestCase
-
- org.apache.sling.commons.testing.integration.HttpTestBase
-
- org.apache.sling.launchpad.webapp.integrationtest.RenderingTestBase
-
- org.apache.sling.launchpad.webapp.integrationtest.servlets.resolver.errorhandler.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
-
-
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 scriptsstatic String
TEST_ROOT
static String
THROW_ERROR_PAGE
static String
THROW_ERROR_PATH
-
Fields inherited from class org.apache.sling.launchpad.webapp.integrationtest.RenderingTestBase
displayUrl, scriptPath, testText
-
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 Summary
Constructors Constructor Description ErrorHandlingTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
setUp()
protected void
tearDown()
void
test_401_errorhandling()
void
test_404_errorhandling()
void
test_404_errorhandling_JSON_extension()
SLING-7836 - Test an error handling script registered for a json extensionvoid
test_421_312()
void
test_421_error()
void
test_421_exception()
void
test_421_plain()
void
test_500_errorhandling()
void
test_500_errorhandling_POST_operation()
void
test_errorhandling_POST_operation_SlingPostServlet()
void
test_throwable_errorhandling()
-
Methods inherited from class org.apache.sling.launchpad.webapp.integrationtest.RenderingTestBase
assertContains, assertNotContains, uploadTestScript
-
Methods inherited from class org.apache.sling.commons.testing.integration.HttpTestBase
assertHttpStatus, assertHttpStatus, assertJavascript, assertJavascript, assertPostStatus, executeScript, executeScript, getContent, getContent, getContent, getContent, getDefaultCredentials, getResponseBodyAsStream, isBundleVersionAtLeast, removeEndingSlash, setReadinessContentType, slingServerReady, uploadTestScript, waitForSlingStartup
-
Methods inherited from class junit.framework.TestCase
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, toString
-
-
-
-
Field Detail
-
TEST_ROOT
public static final String TEST_ROOT
- See Also:
- Constant Field Values
-
THROW_ERROR_PATH
public static final String THROW_ERROR_PATH
- See Also:
- Constant Field Values
-
THROW_ERROR_PAGE
public static final String THROW_ERROR_PAGE
- See Also:
- Constant Field Values
-
ERROR_HANDLER_PATH
public static final String ERROR_HANDLER_PATH
- See Also:
- Constant Field Values
-
RETRY_MAX_TIME_SEC
public static final int RETRY_MAX_TIME_SEC
Need some retries as there might be some latency when installing error handler scripts- See Also:
- Constant Field Values
-
RETRY_INTERVAL_MSEC
public static final int RETRY_INTERVAL_MSEC
- See Also:
- Constant Field Values
-
-
Method Detail
-
setUp
protected void setUp() throws Exception
- Overrides:
setUp
in classorg.apache.sling.commons.testing.integration.HttpTestBase
- Throws:
Exception
-
tearDown
protected void tearDown() throws Exception
- Overrides:
tearDown
in classorg.apache.sling.commons.testing.integration.HttpTestBase
- Throws:
Exception
-
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
-
-