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.HttpTestBase
Test content import via the MicrojaxPostServlet
-
-
Field Summary
Fields Modifier and Type Field Description static String
TEST_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 void
assertExpectedJSON(javax.json.JsonObject expectedJson, javax.json.JsonObject actualJson)
protected String
importNodeWithExactName(String testNodeName)
protected void
tearDown()
void
testImportAutoCheckoutNodes()
SLING-2108 Test import operation which auto checks out versionable nodes.void
testImportCheckinNodes()
Test import operation which checks in versionable nodes.void
testImportJarFromFile()
void
testImportJCRXMLFromFile()
void
testImportJSONFromFile()
Test import operation for a posted json filevoid
testImportJSONFromFileWithoutOptionalName()
Test import operation for a posted json file without the optional namevoid
testImportJSONFromRequestParam()
Test import operation for a posted json stringvoid
testImportJSONFromRequestParamWithoutOptionalName()
Test import operation for a posted json string without the optional namevoid
testImportJSONWithUTF8Content()
SLING-2143: test import where json is in a UTF-8 charsetvoid
testImportNodeWithAlreadyUsedExactName()
SLING-1091: test error reporting when attempting to import a node with an already used node name.void
testImportNodeWithExactName()
SLING-1091: test create node with an exact node name (no filtering)void
testImportNodeWithInvalidExactName()
SLING-1091: test error reporting when attempting to create a node with an invalid exact node name.void
testImportReplace()
Test import operation which replaces existing contentvoid
testImportReplaceProperties()
SLING-1627: test import of content over existing content with the ':replaceProperties" parameter set and the ":replace" property not set.void
testImportXMLFromFile()
void
testImportXMLFromFileWithoutOptionalName()
void
testImportXMLFromRequestParam()
void
testImportXMLFromRequestParamWithoutOptionalName()
void
testImportZipFromFile()
-
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:
tearDown
in 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.JsonException
Test import operation which replaces existing content- Throws:
IOException
javax.json.JsonException
-
testImportReplaceProperties
public void testImportReplaceProperties() throws IOException, javax.json.JsonException
SLING-1627: test import of content over existing content with the ':replaceProperties" parameter set and the ":replace" property not set.- Throws:
IOException
javax.json.JsonException
-
testImportCheckinNodes
public void testImportCheckinNodes() throws IOException, javax.json.JsonException
Test import operation which checks in versionable nodes.- Throws:
IOException
javax.json.JsonException
-
testImportAutoCheckoutNodes
public void testImportAutoCheckoutNodes() throws IOException, javax.json.JsonException
SLING-2108 Test import operation which auto checks out versionable nodes.- Throws:
IOException
javax.json.JsonException
-
testImportJSONFromFile
public void testImportJSONFromFile() throws IOException, javax.json.JsonException
Test import operation for a posted json file- Throws:
IOException
javax.json.JsonException
-
testImportJSONFromFileWithoutOptionalName
public void testImportJSONFromFileWithoutOptionalName() throws IOException, javax.json.JsonException
Test import operation for a posted json file without the optional name- Throws:
IOException
javax.json.JsonException
-
testImportJSONFromRequestParam
public void testImportJSONFromRequestParam() throws IOException, javax.json.JsonException
Test import operation for a posted json string- Throws:
IOException
javax.json.JsonException
-
testImportJSONFromRequestParamWithoutOptionalName
public void testImportJSONFromRequestParamWithoutOptionalName() throws IOException, javax.json.JsonException
Test import operation for a posted json string without the optional name- Throws:
IOException
javax.json.JsonException
-
testImportXMLFromFile
public void testImportXMLFromFile() throws IOException, javax.json.JsonException
- Throws:
IOException
javax.json.JsonException
-
testImportXMLFromFileWithoutOptionalName
public void testImportXMLFromFileWithoutOptionalName() throws IOException, javax.json.JsonException
- Throws:
IOException
javax.json.JsonException
-
testImportXMLFromRequestParam
public void testImportXMLFromRequestParam() throws IOException, javax.json.JsonException
- Throws:
IOException
javax.json.JsonException
-
testImportXMLFromRequestParamWithoutOptionalName
public void testImportXMLFromRequestParamWithoutOptionalName() throws IOException, javax.json.JsonException
- Throws:
IOException
javax.json.JsonException
-
testImportZipFromFile
public void testImportZipFromFile() throws IOException, javax.json.JsonException
- Throws:
IOException
javax.json.JsonException
-
testImportJarFromFile
public void testImportJarFromFile() throws IOException, javax.json.JsonException
- Throws:
IOException
javax.json.JsonException
-
testImportJCRXMLFromFile
public void testImportJCRXMLFromFile() throws IOException, javax.json.JsonException
- Throws:
IOException
javax.json.JsonException
-
importNodeWithExactName
protected String importNodeWithExactName(String testNodeName) throws IOException, javax.json.JsonException
- Throws:
IOException
javax.json.JsonException
-
testImportNodeWithExactName
public void testImportNodeWithExactName() throws IOException, javax.json.JsonException
SLING-1091: test create node with an exact node name (no filtering)- Throws:
IOException
javax.json.JsonException
-
testImportNodeWithInvalidExactName
public void testImportNodeWithInvalidExactName() throws IOException
SLING-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.JsonException
SLING-1091: test error reporting when attempting to import a node with an already used node name.- Throws:
IOException
javax.json.JsonException
-
testImportJSONWithUTF8Content
public void testImportJSONWithUTF8Content() throws IOException, javax.json.JsonException
SLING-2143: test import where json is in a UTF-8 charset- Throws:
IOException
javax.json.JsonException
-
-