jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r410480 - in /jackrabbit/trunk/jackrabbit: applications/test/repositoryStubImpl.properties src/test/java/org/apache/jackrabbit/test/api/WorkspaceCloneTest.java src/test/java/org/apache/jackrabbit/test/api/version/RestoreTest.java
Date Wed, 31 May 2006 09:22:11 GMT
Author: mreutegg
Date: Wed May 31 02:22:10 2006
New Revision: 410480

URL: http://svn.apache.org/viewvc?rev=410480&view=rev
Log:
JCR-444 Error while restoring OPV=Version childnodes (Restore of root version not allowed)
- avoid using literals in test cases

Modified:
    jackrabbit/trunk/jackrabbit/applications/test/repositoryStubImpl.properties
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceCloneTest.java
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/version/RestoreTest.java

Modified: jackrabbit/trunk/jackrabbit/applications/test/repositoryStubImpl.properties
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/applications/test/repositoryStubImpl.properties?rev=410480&r1=410479&r2=410480&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/applications/test/repositoryStubImpl.properties (original)
+++ jackrabbit/trunk/jackrabbit/applications/test/repositoryStubImpl.properties Wed May 31
02:22:10 2006
@@ -417,6 +417,8 @@
 # Test method: testRestoreWithUUIDConflict
 # nodename4 must be the name of a child node with a OPV definition COPY or VERSION
 javax.jcr.tck.RestoreTest.testRestoreWithUUIDConflict.nodename4=test:versionOnParentVersion
+javax.jcr.tck.RestoreTest.testRestoreLabel.nodename4=test:versionOnParentVersion
+javax.jcr.tck.RestoreTest.testRestoreName.nodename4=test:versionOnParentVersion
 
 # config for nodes that show the indicated OPV behaviour:
 # nodes are added in order to test the versioning behaviour indicated by the test-class name.

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceCloneTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceCloneTest.java?rev=410480&r1=410479&r2=410480&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceCloneTest.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceCloneTest.java
Wed May 31 02:22:10 2006
@@ -57,8 +57,8 @@
         // clone referenceable node below non-referenceable node
         String dstAbsPath = node2W2.getPath() + "/" + node1.getName();
 
-        Node folder = node1.addNode("folder");
-        folder.addMixin("mix:referenceable");
+        Node folder = node1.addNode(nodeName3);
+        folder.addMixin(mixReferenceable);
         node1.save();
         workspaceW2.clone(workspace.getName(), node1.getPath(), dstAbsPath, true);
         workspaceW2.clone(workspace.getName(), node1.getPath(), dstAbsPath, true);

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/version/RestoreTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/version/RestoreTest.java?rev=410480&r1=410479&r2=410480&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/version/RestoreTest.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/version/RestoreTest.java
Wed May 31 02:22:10 2006
@@ -305,40 +305,41 @@
      */
     public void testRestoreLabel() throws RepositoryException {
         // V1.0 of versionableNode has no child
-        Node child1 = versionableNode.addNode("test:versionOnParentVersion");
-        child1.addMixin("mix:versionable");
+        Node child1 = versionableNode.addNode(nodeName4);
+        child1.addMixin(mixVersionable);
         versionableNode.save();
         // create v1.0 of child
-        child1.checkin();
+        Version v1Child = child1.checkin();
 
         // V1 of versionable node has child1
         Version v1 = versionableNode.checkin();
+        String v1Name = v1.getName();
 
         // mark V1 with label test and foo
-        versionableNode.getVersionHistory().addVersionLabel(v1.getName(), "test", true);
-        versionableNode.getVersionHistory().addVersionLabel(v1.getName(), "foo", true);
+        versionableNode.getVersionHistory().addVersionLabel(v1Name, "test", true);
+        versionableNode.getVersionHistory().addVersionLabel(v1Name, "foo", true);
 
         // create V1.1 of child
         child1.checkout();
-        child1.checkin();
-        child1.getVersionHistory().addVersionLabel("1.1", "foo", true);
+        Version v11Child = child1.checkin();
+        child1.getVersionHistory().addVersionLabel(v11Child.getName(), "foo", true);
 
         // restore 1.0 of versionable node --> no child
         versionableNode.restore(version, true);
-        assertFalse("Node.restore('1.0') must remove child node.", versionableNode.hasNode("test:versionOnParentVersion"));
+        assertFalse("Node.restore('1.0') must remove child node.", versionableNode.hasNode(nodeName4));
 
         // restore V1 via label. since child has no label, initial version should
         // be restored
         versionableNode.restoreByLabel("test", true);
-        assertTrue("Node.restore('test') must restore child node.", versionableNode.hasNode("test:versionOnParentVersion"));
-        child1 = versionableNode.getNode("test:versionOnParentVersion");
-        assertEquals("Node.restore('test') must restore child node version 1.0.", "1.0",
child1.getBaseVersion().getName());
+        assertTrue("Node.restore('test') must restore child node.", versionableNode.hasNode(nodeName4));
+        child1 = versionableNode.getNode(nodeName4);
+        assertEquals("Node.restore('test') must restore child node version 1.0.", v1Child.getName(),
child1.getBaseVersion().getName());
 
         // restore V1 via label 'foo'. since child has foo, 1.1 version should
         // be restored
         versionableNode.restoreByLabel("foo", true);
-        child1 = versionableNode.getNode("test:versionOnParentVersion");
-        assertEquals("Node.restore('foo') must restore child node version 1.1.", "1.1", child1.getBaseVersion().getName());
+        child1 = versionableNode.getNode(nodeName4);
+        assertEquals("Node.restore('foo') must restore child node version 1.1.", v11Child.getName(),
child1.getBaseVersion().getName());
     }
 
     /**
@@ -347,18 +348,18 @@
      */
     public void testRestoreName() throws RepositoryException {
         // V1.0 of versionableNode has no child
-        Node child1 = versionableNode.addNode("test:versionOnParentVersion");
-        child1.addMixin("mix:versionable");
+        Node child1 = versionableNode.addNode(nodeName4);
+        child1.addMixin(mixVersionable);
         versionableNode.save();
         // create v1.0 of child
-        child1.checkin();
+        Version v1Child = child1.checkin();
 
         // V1 of versionable node has child1
         String v1 = versionableNode.checkin().getName();
 
         // create V1.1 of child
         child1.checkout();
-        child1.checkin();
+        Version v11Child = child1.checkin();
 
         // V2 of versionable node has child1
         versionableNode.checkout();
@@ -366,17 +367,17 @@
 
         // restore 1.0 of versionable node --> no child
         versionableNode.restore(version, true);
-        assertFalse("Node.restore('1.0') must remove child node.", versionableNode.hasNode("test:versionOnParentVersion"));
+        assertFalse("Node.restore('1.0') must remove child node.", versionableNode.hasNode(nodeName4));
 
         // restore V1 via name. since child was checkin first, 1.0 should be restored
         versionableNode.restore(v1, true);
-        assertTrue("Node.restore('test') must restore child node.", versionableNode.hasNode("test:versionOnParentVersion"));
-        child1 = versionableNode.getNode("test:versionOnParentVersion");
-        assertEquals("Node.restore('test') must restore child node version 1.0.", "1.0",
child1.getBaseVersion().getName());
+        assertTrue("Node.restore('test') must restore child node.", versionableNode.hasNode(nodeName4));
+        child1 = versionableNode.getNode(nodeName4);
+        assertEquals("Node.restore('test') must restore child node version 1.0.", v1Child.getName(),
child1.getBaseVersion().getName());
 
         // restore V2 via name. child should be 1.1
         versionableNode.restore(v2, true);
-        child1 = versionableNode.getNode("test:versionOnParentVersion");
-        assertEquals("Node.restore('foo') must restore child node version 1.1.", "1.1", child1.getBaseVersion().getName());
+        child1 = versionableNode.getNode(nodeName4);
+        assertEquals("Node.restore('foo') must restore child node version 1.1.", v11Child.getName(),
child1.getBaseVersion().getName());
     }
 }



Mime
View raw message