Class PostServletImportTest
- java.lang.Object
-
- junit.framework.Assert
-
- junit.framework.TestCase
-
- org.apache.sling.commons.testing.integration.HttpTestBase
-
- org.apache.sling.launchpad.webapp.integrationtest.servlets.post.PostServletImportTest
-
- All Implemented Interfaces:
junit.framework.Test
public class PostServletImportTest extends org.apache.sling.commons.testing.integration.HttpTestBaseTest content import via the MicrojaxPostServlet
-
-
Field Summary
Fields Modifier and Type Field Description static StringTEST_BASE_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 Summary
Constructors Constructor Description PostServletImportTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidassertExpectedJSON(javax.json.JsonObject expectedJson, javax.json.JsonObject actualJson)protected StringimportNodeWithExactName(String testNodeName)protected voidtearDown()voidtestImportAutoCheckoutNodes()SLING-2108 Test import operation which auto checks out versionable nodes.voidtestImportCheckinNodes()Test import operation which checks in versionable nodes.voidtestImportJarFromFile()voidtestImportJCRXMLFromFile()voidtestImportJSONFromFile()Test import operation for a posted json filevoidtestImportJSONFromFileWithoutOptionalName()Test import operation for a posted json file without the optional namevoidtestImportJSONFromRequestParam()Test import operation for a posted json stringvoidtestImportJSONFromRequestParamWithoutOptionalName()Test import operation for a posted json string without the optional namevoidtestImportJSONWithUTF8Content()SLING-2143: test import where json is in a UTF-8 charsetvoidtestImportNodeWithAlreadyUsedExactName()SLING-1091: test error reporting when attempting to import a node with an already used node name.voidtestImportNodeWithExactName()SLING-1091: test create node with an exact node name (no filtering)voidtestImportNodeWithInvalidExactName()SLING-1091: test error reporting when attempting to create a node with an invalid exact node name.voidtestImportReplace()Test import operation which replaces existing contentvoidtestImportReplaceProperties()SLING-1627: test import of content over existing content with the ':replaceProperties" parameter set and the ":replace" property not set.voidtestImportXMLFromFile()voidtestImportXMLFromFileWithoutOptionalName()voidtestImportXMLFromRequestParam()voidtestImportXMLFromRequestParamWithoutOptionalName()voidtestImportZipFromFile()-
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, setUp, 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_BASE_PATH
public static final String TEST_BASE_PATH
- See Also:
- Constant Field Values
-
-
Method Detail
-
tearDown
protected void tearDown() throws Exception- Overrides:
tearDownin classorg.apache.sling.commons.testing.integration.HttpTestBase- Throws:
Exception
-
assertExpectedJSON
protected void assertExpectedJSON(javax.json.JsonObject expectedJson, javax.json.JsonObject actualJson) throws javax.json.JsonException- Throws:
javax.json.JsonException
-
testImportReplace
public void testImportReplace() throws IOException, javax.json.JsonExceptionTest import operation which replaces existing content- Throws:
IOExceptionjavax.json.JsonException
-
testImportReplaceProperties
public void testImportReplaceProperties() throws IOException, javax.json.JsonExceptionSLING-1627: test import of content over existing content with the ':replaceProperties" parameter set and the ":replace" property not set.- Throws:
IOExceptionjavax.json.JsonException
-
testImportCheckinNodes
public void testImportCheckinNodes() throws IOException, javax.json.JsonExceptionTest import operation which checks in versionable nodes.- Throws:
IOExceptionjavax.json.JsonException
-
testImportAutoCheckoutNodes
public void testImportAutoCheckoutNodes() throws IOException, javax.json.JsonExceptionSLING-2108 Test import operation which auto checks out versionable nodes.- Throws:
IOExceptionjavax.json.JsonException
-
testImportJSONFromFile
public void testImportJSONFromFile() throws IOException, javax.json.JsonExceptionTest import operation for a posted json file- Throws:
IOExceptionjavax.json.JsonException
-
testImportJSONFromFileWithoutOptionalName
public void testImportJSONFromFileWithoutOptionalName() throws IOException, javax.json.JsonExceptionTest import operation for a posted json file without the optional name- Throws:
IOExceptionjavax.json.JsonException
-
testImportJSONFromRequestParam
public void testImportJSONFromRequestParam() throws IOException, javax.json.JsonExceptionTest import operation for a posted json string- Throws:
IOExceptionjavax.json.JsonException
-
testImportJSONFromRequestParamWithoutOptionalName
public void testImportJSONFromRequestParamWithoutOptionalName() throws IOException, javax.json.JsonExceptionTest import operation for a posted json string without the optional name- Throws:
IOExceptionjavax.json.JsonException
-
testImportXMLFromFile
public void testImportXMLFromFile() throws IOException, javax.json.JsonException- Throws:
IOExceptionjavax.json.JsonException
-
testImportXMLFromFileWithoutOptionalName
public void testImportXMLFromFileWithoutOptionalName() throws IOException, javax.json.JsonException- Throws:
IOExceptionjavax.json.JsonException
-
testImportXMLFromRequestParam
public void testImportXMLFromRequestParam() throws IOException, javax.json.JsonException- Throws:
IOExceptionjavax.json.JsonException
-
testImportXMLFromRequestParamWithoutOptionalName
public void testImportXMLFromRequestParamWithoutOptionalName() throws IOException, javax.json.JsonException- Throws:
IOExceptionjavax.json.JsonException
-
testImportZipFromFile
public void testImportZipFromFile() throws IOException, javax.json.JsonException- Throws:
IOExceptionjavax.json.JsonException
-
testImportJarFromFile
public void testImportJarFromFile() throws IOException, javax.json.JsonException- Throws:
IOExceptionjavax.json.JsonException
-
testImportJCRXMLFromFile
public void testImportJCRXMLFromFile() throws IOException, javax.json.JsonException- Throws:
IOExceptionjavax.json.JsonException
-
importNodeWithExactName
protected String importNodeWithExactName(String testNodeName) throws IOException, javax.json.JsonException
- Throws:
IOExceptionjavax.json.JsonException
-
testImportNodeWithExactName
public void testImportNodeWithExactName() throws IOException, javax.json.JsonExceptionSLING-1091: test create node with an exact node name (no filtering)- Throws:
IOExceptionjavax.json.JsonException
-
testImportNodeWithInvalidExactName
public void testImportNodeWithInvalidExactName() throws IOExceptionSLING-1091: test error reporting when attempting to create a node with an invalid exact node name.- Throws:
IOException
-
testImportNodeWithAlreadyUsedExactName
public void testImportNodeWithAlreadyUsedExactName() throws IOException, javax.json.JsonExceptionSLING-1091: test error reporting when attempting to import a node with an already used node name.- Throws:
IOExceptionjavax.json.JsonException
-
testImportJSONWithUTF8Content
public void testImportJSONWithUTF8Content() throws IOException, javax.json.JsonExceptionSLING-2143: test import where json is in a UTF-8 charset- Throws:
IOExceptionjavax.json.JsonException
-
-