jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r581183 - in /jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api: ./ version/
Date Tue, 02 Oct 2007 10:20:21 GMT
Author: jukka
Date: Tue Oct  2 03:20:19 2007
New Revision: 581183

URL: http://svn.apache.org/viewvc?rev=581183&view=rev
Log:
1.3: Merged revisions 580758 and 580766 (JCR-1137)

Modified:
    jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeTest.java
    jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/CheckinTest.java
    jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/RemoveVersionTest.java
    jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/VersionGraphTest.java
    jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/VersionHistoryTest.java
    jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/VersionLabelTest.java

Modified: jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeTest.java?rev=581183&r1=581182&r2=581183&view=diff
==============================================================================
--- jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeTest.java
(original)
+++ jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeTest.java
Tue Oct  2 03:20:19 2007
@@ -744,13 +744,13 @@
         // save the new node
         defaultRootNode.save();
 
-        // accuire the same node with session 2
+        // acquire the same node with session 2
         Node testNode2 = (Node) superuser.getItem(testNode1.getPath());
 
         // check if they have the same property
-        assertEquals("Two references of same node have different properties", testNode1.getProperty(propertyName1),
testNode2.getProperty(propertyName1));
+        assertTrue("Two references of same node have different properties", testNode1.getProperty(propertyName1).isSame(testNode2.getProperty(propertyName1)));
         // check if they have the same child
-        assertEquals("Two references of same node have different children", testNode1.getNode(nodeName1),
testNode2.getNode(nodeName1));
+        assertTrue("Two references of same node have different children", testNode1.getNode(nodeName1).isSame(testNode2.getNode(nodeName1)));
         // check state methods
         assertEquals("Two references of same node have different State for Node.isCheckedOut()",
testNode1.isCheckedOut(), testNode2.isCheckedOut());
         assertEquals("Two references of same node have different State for Node.isLocked()",
testNode1.isLocked(), testNode2.isLocked());
@@ -759,7 +759,7 @@
         assertEquals("Two references of same node have different State for Node.isNode()",
testNode1.isNode(), testNode2.isNode());
         assertEquals("Two references of same node have different State for Node.isNodeType()",
testNode1.isNodeType(testNodeType), testNode2.isNodeType(testNodeType));
         assertTrue("Two references of same node should return true for Node1.isSame(Node2)",
testNode1.isSame(testNode2));
-        assertEquals("Two references of same node have different Definitions", testNode1.getDefinition(),
testNode2.getDefinition());
+        assertEquals("Two references of same node have different Definitions", testNode1.getDefinition().getName(),
testNode2.getDefinition().getName());
     }
 
     /**

Modified: jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/CheckinTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/CheckinTest.java?rev=581183&r1=581182&r2=581183&view=diff
==============================================================================
--- jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/CheckinTest.java
(original)
+++ jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/CheckinTest.java
Tue Oct  2 03:20:19 2007
@@ -90,7 +90,7 @@
         try {
             Version v2 = versionableNode.checkin();
 
-            assertTrue("Calling checkin() on a node that is already checked-in must not have
an effect.", v.equals(v2));
+            assertTrue("Calling checkin() on a node that is already checked-in must not have
an effect.", v.isSame(v2));
         } catch (RepositoryException e) {
             fail("Calling checkin() on a node that is already checked-in must not throw an
exception.");
         }

Modified: jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/RemoveVersionTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/RemoveVersionTest.java?rev=581183&r1=581182&r2=581183&view=diff
==============================================================================
--- jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/RemoveVersionTest.java
(original)
+++ jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/RemoveVersionTest.java
Tue Oct  2 03:20:19 2007
@@ -27,7 +27,6 @@
 import javax.jcr.version.VersionException;
 import javax.jcr.version.VersionHistory;
 import javax.jcr.version.VersionIterator;
-import java.util.Arrays;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -111,18 +110,22 @@
     public void testRemoveVersionAdjustPredecessorSet() throws RepositoryException {
 
         // retrieve predecessors to test and remove the version
-        List predecList = new ArrayList(Arrays.asList(version.getPredecessors()));
+        List predecPaths = new ArrayList();
+        Version[] predec = version.getPredecessors();
+        for (int i = 0; i < predec.length; i++) {
+            predecPaths.add(predec[i].getPath());
+        }
         vHistory.removeVersion(version.getName());
 
         // new predecessors of the additional version
         Version[] predec2 = version2.getPredecessors();
         for (int i = 0; i < predec2.length; i++) {
-            if (!predecList.remove(predec2[i])) {
+            if (!predecPaths.remove(predec2[i].getPath())) {
                 fail("All predecessors of the removed version must be made predecessors of
it's original successor version.");
             }
         }
 
-        if (!predecList.isEmpty()) {
+        if (!predecPaths.isEmpty()) {
             fail("All predecessors of the removed version must be made predecessors of it's
original successor version.");
         }
     }
@@ -140,8 +143,12 @@
         vHistory.removeVersion(version.getName());
 
         for (int i = 0; i < predec.length; i++) {
-            List successorList = Arrays.asList(predec[i].getSuccessors());
-            if (!successorList.contains(version2)) {
+            boolean isContained = false;
+            Version[] succ = predec[i].getSuccessors();
+            for (int j = 0; j < succ.length; j++) {
+                isContained |= succ[j].isSame(version2);
+            }
+            if (!isContained) {
                 fail("Removing a version must make all it's successor version to successors
of the removed version's predecessors.");
             }
         }

Modified: jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/VersionGraphTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/VersionGraphTest.java?rev=581183&r1=581182&r2=581183&view=diff
==============================================================================
--- jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/VersionGraphTest.java
(original)
+++ jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/VersionGraphTest.java
Tue Oct  2 03:20:19 2007
@@ -44,7 +44,7 @@
         Version rV = versionableNode.getVersionHistory().getRootVersion();
         Version bV = versionableNode.getBaseVersion();
 
-        assertEquals("After creation of a versionable node the node's baseVersion must point
to the rootVersion in the version history.", rV, bV);
+        assertTrue("After creation of a versionable node the node's baseVersion must point
to the rootVersion in the version history.", rV.isSame(bV));
     }
 
     /**

Modified: jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/VersionHistoryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/VersionHistoryTest.java?rev=581183&r1=581182&r2=581183&view=diff
==============================================================================
--- jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/VersionHistoryTest.java
(original)
+++ jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/VersionHistoryTest.java
Tue Oct  2 03:20:19 2007
@@ -123,7 +123,7 @@
             v = it.nextVersion();
             break;
         }
-        assertEquals("The version that is autocreated on version history creation must be
the root version", rootVersion, v);
+        assertTrue("The version that is autocreated on version history creation must be the
root version", rootVersion.isSame(v));
     }
 
     /**
@@ -177,7 +177,7 @@
         Version v = versionableNode.checkin();
         Version v2 = vHistory.getVersion(v.getName());
 
-        assertEquals("VersionHistory.getVersion(String versionName) must return the version
that is identified by the versionName specified, if versionName is the name of a version created
by Node.checkin().", v, v2);
+        assertTrue("VersionHistory.getVersion(String versionName) must return the version
that is identified by the versionName specified, if versionName is the name of a version created
by Node.checkin().", v.isSame(v2));
     }
 
     /**

Modified: jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/VersionLabelTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/VersionLabelTest.java?rev=581183&r1=581182&r2=581183&view=diff
==============================================================================
--- jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/VersionLabelTest.java
(original)
+++ jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/VersionLabelTest.java
Tue Oct  2 03:20:19 2007
@@ -260,7 +260,7 @@
         vHistory.addVersionLabel(rootVersion.getName(), versionLabel, true);
         Version v = vHistory.getVersionByLabel(versionLabel);
 
-        assertEquals("VersionHistory.getVersionByLabel(String) must retrieve the particular
version that was specified in addVersionLabel call.", v, rootVersion);
+        assertTrue("VersionHistory.getVersionByLabel(String) must retrieve the particular
version that was specified in addVersionLabel call.", v.isSame(rootVersion));
     }
 
     /**



Mime
View raw message