You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by an...@apache.org on 2013/02/05 11:06:38 UTC
svn commit: r1442524 - in /jackrabbit/oak/trunk/oak-jcr: pom.xml
src/test/java/org/apache/jackrabbit/oak/jcr/MoveTest.java
Author: angela
Date: Tue Feb 5 10:06:38 2013
New Revision: 1442524
URL: http://svn.apache.org/viewvc?rev=1442524&view=rev
Log:
OAK-606, OAK-607: add test cases
Added:
jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/MoveTest.java
Modified:
jackrabbit/oak/trunk/oak-jcr/pom.xml
Modified: jackrabbit/oak/trunk/oak-jcr/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/pom.xml?rev=1442524&r1=1442523&r2=1442524&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/pom.xml (original)
+++ jackrabbit/oak/trunk/oak-jcr/pom.xml Tue Feb 5 10:06:38 2013
@@ -237,6 +237,7 @@
org.apache.jackrabbit.oak.jcr.version.VersionHistoryTest#testGetVersionHistoryFromNode <!-- OAK-601 -->
org.apache.jackrabbit.oak.jcr.version.VersionHistoryTest#testGetVersionHistory <!-- OAK-602 -->
org.apache.jackrabbit.oak.jcr.version.VersionHistoryTest#testGetVersionHistoryAfterMove <!-- OAK-602 -->
+ org.apache.jackrabbit.oak.jcr.MoveTest <!-- OAK-606, OAK-607 -->
</known.issues>
</properties>
Added: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/MoveTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/MoveTest.java?rev=1442524&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/MoveTest.java (added)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/MoveTest.java Tue Feb 5 10:06:38 2013
@@ -0,0 +1,90 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.oak.jcr;
+
+import javax.jcr.Node;
+
+import org.apache.jackrabbit.test.AbstractJCRTest;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * MoveTest... TODO
+ */
+public class MoveTest extends AbstractJCRTest {
+
+ private void move(String src, String dest, boolean save) throws Exception {
+ superuser.move(src, dest);
+ if (save) {
+ superuser.save();
+ }
+ }
+
+ @Ignore("OAK-606")
+ @Test
+ public void testRename() throws Exception {
+ Node node1 = testRootNode.addNode(nodeName1);
+ superuser.save();
+
+ String destPath = testRoot + '/' + nodeName2;
+ move(node1.getPath(), destPath, true);
+
+ assertEquals(destPath, node1.getPath());
+ }
+
+ @Ignore("OAK-607")
+ @Test
+ public void testRenameNewNode() throws Exception {
+ Node node1 = testRootNode.addNode(nodeName1);
+
+ String destPath = testRoot + '/' + nodeName2;
+ move(node1.getPath(), destPath, false);
+
+ assertEquals(destPath, node1.getPath());
+
+ superuser.save();
+ assertEquals(destPath, node1.getPath());
+ }
+
+ @Ignore("OAK-606")
+ @Test
+ public void testMove() throws Exception {
+ Node node1 = testRootNode.addNode(nodeName1);
+ Node node2 = testRootNode.addNode(nodeName2);
+ superuser.save();
+
+ String destPath = node2.getPath() + '/' + nodeName1;
+ move(node1.getPath(), destPath, true);
+
+ assertEquals(destPath, node1.getPath());
+ }
+
+ @Ignore("OAK-607")
+ @Test
+ public void testMoveNewNode() throws Exception {
+ Node node1 = testRootNode.addNode(nodeName1);
+ Node node2 = testRootNode.addNode(nodeName2);
+
+ String destPath = node2.getPath() + '/' + nodeName1;
+ move(node1.getPath(), destPath, false);
+
+ assertEquals(destPath, node1.getPath());
+
+ superuser.save();
+ assertEquals(destPath, node1.getPath());
+ }
+}
\ No newline at end of file