jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tri...@apache.org
Subject svn commit: r375309 - in /incubator/jackrabbit/trunk/jackrabbit: applications/test/repositoryStubImpl.properties src/main/java/org/apache/jackrabbit/core/NodeImpl.java src/test/java/org/apache/jackrabbit/test/api/version/OnParentVersionIgnoreTest.java
Date Mon, 06 Feb 2006 16:30:55 GMT
Author: tripod
Date: Mon Feb  6 08:30:53 2006
New Revision: 375309

URL: http://svn.apache.org/viewcvs?rev=375309&view=rev
Log:
- fixed JCR-308
- added OPV=Ignore sensitive node-restore test

Modified:
    incubator/jackrabbit/trunk/jackrabbit/applications/test/repositoryStubImpl.properties
    incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
    incubator/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/version/OnParentVersionIgnoreTest.java

Modified: incubator/jackrabbit/trunk/jackrabbit/applications/test/repositoryStubImpl.properties
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/jackrabbit/applications/test/repositoryStubImpl.properties?rev=375309&r1=375308&r2=375309&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/jackrabbit/applications/test/repositoryStubImpl.properties
(original)
+++ incubator/jackrabbit/trunk/jackrabbit/applications/test/repositoryStubImpl.properties
Mon Feb  6 08:30:53 2006
@@ -430,3 +430,5 @@
 javax.jcr.tck.OnParentVersionCopyTest.nodetype=nt:unstructured
 javax.jcr.tck.OnParentVersionAbortTest.nodename4=test:abortOnParentVersion
 javax.jcr.tck.OnParentVersionAbortTest.nodetype=nt:unstructured
+javax.jcr.tck.OnParentVersionIgnoreTest.nodename4=test:ignoreOnParentVersion
+javax.jcr.tck.OnParentVersionIgnoreTest.nodetype=nt:unstructured

Modified: incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/NodeImpl.java?rev=375309&r1=375308&r2=375309&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
(original)
+++ incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
Mon Feb  6 08:30:53 2006
@@ -3616,12 +3616,16 @@
             }
         }
 
-        // first delete all non frozen version histories
+        // first delete all non frozen version histories (i.e. all OPV=Copy)
         NodeIterator iter = getNodes();
         while (iter.hasNext()) {
             NodeImpl n = (NodeImpl) iter.nextNode();
             if (!freeze.hasFrozenHistory(n.internalGetUUID())) {
-                n.internalRemove(true);
+                if (n.getDefinition().getOnParentVersion() == OnParentVersionAction.COPY
+                        || n.getDefinition().getOnParentVersion() == OnParentVersionAction.VERSION)
{
+                    // only remove OPV=Copy or OPV=Version nodes
+                    n.internalRemove(true);
+                }
             }
         }
 

Modified: incubator/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/version/OnParentVersionIgnoreTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/version/OnParentVersionIgnoreTest.java?rev=375309&r1=375308&r2=375309&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/version/OnParentVersionIgnoreTest.java
(original)
+++ incubator/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/version/OnParentVersionIgnoreTest.java
Mon Feb  6 08:30:53 2006
@@ -56,4 +56,27 @@
 
         assertEquals("On restore of a OnParentVersion-IGNORE property P, the current value
of P must be left unchanged.", p.getString(), newPropValue);
     }
+
+    /**
+     * Test the restore of a OnParentVersion-Ignore node
+     *
+     * @throws javax.jcr.RepositoryException
+     */
+    public void testRestoreNode() throws RepositoryException {
+
+        versionableNode.checkout();
+        Version v = versionableNode.checkin();
+        versionableNode.checkout();
+
+        // add 'ignore' child
+        String childName = addChildNode(OPVAction).getName();
+        versionableNode.save();
+        
+        versionableNode.restore(v, false);
+
+        if (!versionableNode.hasNode(childName)) {
+            fail("On restore of a OnParentVersion-Ignore child node, the node needs to be
untouched.");
+        }
+    }
+
 }



Mime
View raw message