You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bd...@apache.org on 2019/01/07 15:09:02 UTC
[sling-org-apache-sling-launchpad-integration-tests] branch master
updated: SLING-8186 - demonstrate the @Delete / @MoveFrom interaction
This is an automated email from the ASF dual-hosted git repository.
bdelacretaz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-launchpad-integration-tests.git
The following commit(s) were added to refs/heads/master by this push:
new 3da37cc SLING-8186 - demonstrate the @Delete / @MoveFrom interaction
3da37cc is described below
commit 3da37cc963fa1367d07eb1ed2d37cb3296d6b270
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Mon Jan 7 16:08:49 2019 +0100
SLING-8186 - demonstrate the @Delete / @MoveFrom interaction
---
.../servlets/post/PostServletAtMoveTest.java | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/post/PostServletAtMoveTest.java b/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/post/PostServletAtMoveTest.java
index 07bb35a..669df03 100644
--- a/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/post/PostServletAtMoveTest.java
+++ b/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/post/PostServletAtMoveTest.java
@@ -206,4 +206,25 @@ public class PostServletAtMoveTest extends HttpTestBase {
assertJavascript("Hello", content, "out.println(data.text)");
}
+ public void testMoveWithSameNameProperty() throws IOException {
+ final String testPath = TEST_BASE_PATH + "/same_name_property/" + System.currentTimeMillis();
+ Map<String, String> props = new HashMap<String, String>();
+ props.put("text", testPath.toUpperCase());
+ testClient.createNode(HTTP_BASE_URL + testPath + "/src", props);
+
+ // SLING-8186: if @Delete points to the name of a child
+ // node of the parent after the move, that child node is deleted.
+ // In this case it's the moved source node that's deleted
+ final String [] toDelete = { "NOTHING", "./dest" };
+ final int [] status = { 200, 404 };
+
+ for(int i=0; i < toDelete.length; i++) {
+ props.clear();
+ props.put(toDelete[i] + "@Delete", "true");
+ props.put(testPath + "/dest@MoveFrom", testPath + "/src");
+ testClient.createNode(HTTP_BASE_URL + testPath, props);
+ assertHttpStatus(HTTP_BASE_URL + testPath + "/dest.json", status[i], "for toDelete=" + toDelete[i]);
+ }
+ }
+
}
\ No newline at end of file