in src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/post/PostServletVersionableTest.java [676:719]
public void testMovingAChildNodeOfACheckedInNodeToACheckedInNodeByOp() throws IOException {
params.put(":checkinNewVersionableNodes", "true");
final String testPath = TEST_BASE_PATH + "/abs/" + System.currentTimeMillis();
testClient.createNode(HTTP_BASE_URL + testPath + "/src", params);
params.clear();
params.put(":autoCheckout", "true");
params.put("text", "Hello");
testClient.createNode(HTTP_BASE_URL + testPath + "/src/child", params);
// assert content at source location
String oldContent = getContent(HTTP_BASE_URL + testPath + "/src.-1.json", CONTENT_TYPE_JSON);
assertJavascript("false", oldContent, "out.println(data['jcr:isCheckedOut'])");
assertJavascript("Hello", oldContent, "out.println(data.child.text)");
// create dest
params.clear();
params.put("jcr:mixinTypes", "mix:versionable");
params.put(":checkinNewVersionableNodes", "true");
testClient.createNode(HTTP_BASE_URL + testPath + "/dest", params);
String content = getContent(HTTP_BASE_URL + testPath + "/dest.json", CONTENT_TYPE_JSON);
assertJavascript("false", content, "out.println(data['jcr:isCheckedOut'])");
// move src child
params.clear();
params.put(":autoCheckout", "true");
params.put(SlingPostConstants.RP_OPERATION, SlingPostConstants.OPERATION_MOVE);
params.put(":dest", testPath + "/dest/src");
testClient.createNode(HTTP_BASE_URL + testPath + "/src/child", params);
// assert content at new location
content = getContent(HTTP_BASE_URL + testPath + "/dest.-1.json", CONTENT_TYPE_JSON);
assertJavascript("Hello", content, "out.println(data.src.text)");
assertJavascript("false", content, "out.println(data['jcr:isCheckedOut'])");
// assert no content at old location
assertHttpStatus(
HTTP_BASE_URL + testPath + "/src/child.json",
HttpServletResponse.SC_NOT_FOUND,
"Expected Not_Found for old content");
oldContent = getContent(HTTP_BASE_URL + testPath + "/src.-1.json", CONTENT_TYPE_JSON);
assertJavascript("false", oldContent, "out.println(data['jcr:isCheckedOut'])");
}