jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dpfis...@apache.org
Subject svn commit: r647765 - in /jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api: ReferencesTest.java version/VersionHistoryTest.java
Date Mon, 14 Apr 2008 12:33:05 GMT
Author: dpfister
Date: Mon Apr 14 05:32:58 2008
New Revision: 647765

URL: http://svn.apache.org/viewvc?rev=647765&view=rev
Log:
JCR-1535 - Some tests assume that an implementation of javax.jcr.Item overrides equals()

Modified:
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/ReferencesTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/VersionHistoryTest.java

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/ReferencesTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/ReferencesTest.java?rev=647765&r1=647764&r2=647765&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/ReferencesTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/ReferencesTest.java
Mon Apr 14 05:32:58 2008
@@ -132,7 +132,7 @@
 
         n2.setProperty(propertyName1, n1);
         testRootNode.save();
-        assertEquals("Wrong reference target.", n2.getProperty(propertyName1).getNode(),
n1);
+        assertEquals("Wrong reference target.", n2.getProperty(propertyName1).getNode().getUUID(),
n1.getUUID());
         n2.remove();
         testRootNode.save();
     }
@@ -166,7 +166,7 @@
 
         n3.setProperty(propertyName1, n1);
         testRootNode.save();
-        assertEquals("Wrong reference target.", n3.getProperty(propertyName1).getNode(),
n1);
+        assertEquals("Wrong reference target.", n3.getProperty(propertyName1).getNode().getUUID(),
n1.getUUID());
         PropertyIterator iter = n1.getReferences();
         if (iter.hasNext()) {
             assertEquals("Wrong referer", iter.nextProperty().getParent().getPath(), n3.getPath());
@@ -179,7 +179,7 @@
         // change reference: n3.p1 -> n2
         n3.setProperty(propertyName1, n2);
         n3.save();
-        assertEquals("Wrong reference target.", n3.getProperty(propertyName1).getNode(),
n2);
+        assertEquals("Wrong reference target.", n3.getProperty(propertyName1).getNode().getUUID(),
n2.getUUID());
         iter = n1.getReferences();
         if (iter.hasNext()) {
             fail("too many referers: " + iter.nextProperty().getPath());

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/VersionHistoryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/VersionHistoryTest.java?rev=647765&r1=647764&r2=647765&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/VersionHistoryTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/VersionHistoryTest.java
Mon Apr 14 05:32:58 2008
@@ -33,6 +33,7 @@
 import javax.jcr.version.VersionHistory;
 import javax.jcr.version.VersionIterator;
 
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.GregorianCalendar;
 import java.util.Calendar;
@@ -138,20 +139,22 @@
      */
     public void testGetAllVersions() throws RepositoryException {
         int cnt = 5;
-        HashSet versions = new HashSet();
-        versions.add(vHistory.getRootVersion());
+        HashMap versions = new HashMap();
+        Version v = vHistory.getRootVersion();
+        versions.put(v.getUUID(), v);
         for (int i = 0; i < cnt; i++) {
-            versions.add(versionableNode.checkin());
+            v = versionableNode.checkin();
+            versions.put(v.getUUID(), v);
             versionableNode.checkout();
         }
 
         VersionIterator it = vHistory.getAllVersions();
         while (it.hasNext()) {
-            Version v = it.nextVersion();
-            if (!versions.contains(v)) {
+            v = it.nextVersion();
+            if (!versions.containsKey(v.getUUID())) {
                 fail("VersionHistory.getAllVersions() must only contain the root version
and versions, that have been created by a Node.checkin() call.");
             }
-            versions.remove(v);
+            versions.remove(v.getUUID());
         }
         assertTrue("VersionHistory.getAllVersions() must contain the root version and all
versions that have been created with a Node.checkin() call.", versions.isEmpty());
     }



Mime
View raw message