incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r807663 - /sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/post/PostServletMoveTest.java
Date Tue, 25 Aug 2009 15:11:36 GMT
Author: bdelacretaz
Date: Tue Aug 25 15:11:36 2009
New Revision: 807663

URL: http://svn.apache.org/viewvc?rev=807663&view=rev
Log:
SLING-1084 - testMoveAtRoot() added, passes with the changes of revision 807657

Modified:
    sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/post/PostServletMoveTest.java

Modified: sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/post/PostServletMoveTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/post/PostServletMoveTest.java?rev=807663&r1=807662&r2=807663&view=diff
==============================================================================
--- sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/post/PostServletMoveTest.java
(original)
+++ sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/post/PostServletMoveTest.java
Tue Aug 25 15:11:36 2009
@@ -473,4 +473,31 @@
         testClient.delete(testRoot);
     }
 
+    public void testMoveAtRoot() throws IOException {
+        final String pathA = "/" + getClass().getSimpleName() + "_A";
+        final String pathB = "/" + getClass().getSimpleName() + "_B";
+        
+        final String testText = "Hello." + Math.random();
+        Map<String, String> props = new HashMap<String, String>();
+        props.put("text", testText);
+        
+        // Create pathA
+        testClient.delete(HTTP_BASE_URL + pathA);
+        assertHttpStatus(HTTP_BASE_URL + pathA, HttpServletResponse.SC_NOT_FOUND);
+        testClient.createNode(HTTP_BASE_URL + pathA, props);
+        
+        // Move to pathB
+        testClient.delete(HTTP_BASE_URL + pathB);
+        assertHttpStatus(HTTP_BASE_URL + pathB, HttpServletResponse.SC_NOT_FOUND);
+        props.clear();
+        props.put(SlingPostConstants.RP_OPERATION,
+            SlingPostConstants.OPERATION_MOVE);
+        props.put(SlingPostConstants.RP_DEST, pathB);
+        props.put(SlingPostConstants.RP_REPLACE, "true");
+        testClient.createNode(HTTP_BASE_URL + pathA, props);
+        String content = getContent(HTTP_BASE_URL + pathB + ".json", CONTENT_TYPE_JSON);
+        assertJavascript(testText, content, "out.println(data.text)");
+        assertHttpStatus(HTTP_BASE_URL + pathA, HttpServletResponse.SC_NOT_FOUND);
+    }
+
 }
\ No newline at end of file



Mime
View raw message