jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r825063 - in /jackrabbit/commons/jcr-tests/trunk: ./ src/main/java/org/apache/jackrabbit/test/api/version/RestoreTest.java
Date Wed, 14 Oct 2009 09:02:25 GMT
Author: jukka
Date: Wed Oct 14 09:02:25 2009
New Revision: 825063

URL: http://svn.apache.org/viewvc?rev=825063&view=rev
Log:
JCRTCK-18: Merge new RestoreTest cases from JCR-2270

Modified:
    jackrabbit/commons/jcr-tests/trunk/   (props changed)
    jackrabbit/commons/jcr-tests/trunk/src/main/java/org/apache/jackrabbit/test/api/version/RestoreTest.java

Propchange: jackrabbit/commons/jcr-tests/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Oct 14 09:02:25 2009
@@ -1,2 +1,3 @@
 /jackrabbit/branches/1.5/jackrabbit-jcr-tests:794012,794100,794102
 /jackrabbit/sandbox/tripod-JCR-2209/jackrabbit-jcr-tests:795441-795863
+/jackrabbit/trunk/jackrabbit-jcr-tests:806531

Modified: jackrabbit/commons/jcr-tests/trunk/src/main/java/org/apache/jackrabbit/test/api/version/RestoreTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/jcr-tests/trunk/src/main/java/org/apache/jackrabbit/test/api/version/RestoreTest.java?rev=825063&r1=825062&r2=825063&view=diff
==============================================================================
--- jackrabbit/commons/jcr-tests/trunk/src/main/java/org/apache/jackrabbit/test/api/version/RestoreTest.java
(original)
+++ jackrabbit/commons/jcr-tests/trunk/src/main/java/org/apache/jackrabbit/test/api/version/RestoreTest.java
Wed Oct 14 09:02:25 2009
@@ -30,6 +30,7 @@
 import javax.jcr.UnsupportedRepositoryOperationException;
 import javax.jcr.ItemExistsException;
 import javax.jcr.NodeIterator;
+import javax.jcr.Session;
 
 /**
  * <code>RestoreTest</code> covers tests related to the restore methods available
@@ -801,6 +802,37 @@
         }
     }
 
+    public void testRestoreRemoved() throws RepositoryException {
+        Node parent = versionableNode.getParent();
+        String oldName = versionableNode.getName();
+        Version v1 = versionableNode.checkin();
+        versionableNode.remove();
+        versionableNode = null;
+        parent.getSession().save();
+
+        parent.restore(v1, oldName, true);
+
+        versionableNode = parent.getNode(oldName);
+
+        String value = versionableNode.getProperty(propertyName1).getString();
+        assertEquals("Restoring a node must set the correct property.", propertyValue2, value);
+    }
+
+    public void testRestoreRemovedJcr2() throws RepositoryException {
+        String path = versionableNode.getPath();
+        Version v1 = versionManager.checkin(path);
+        versionableNode.remove();
+        versionableNode = null;
+        superuser.save();
+
+        versionManager.restore(path, v1, true);
+
+        versionableNode = superuser.getNode(path);
+
+        String value = versionableNode.getProperty(propertyName1).getString();
+        assertEquals("Restoring a node must set the correct property.", propertyValue2, value);
+    }
+
     public void testRestoreChild1Jcr2() throws RepositoryException {
         versionableNode.addNode("child1");
         versionableNode.getSession().save();



Mime
View raw message