jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r587574 - /jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/VersionHistoryTest.java
Date Tue, 23 Oct 2007 18:00:12 GMT
Author: reschke
Date: Tue Oct 23 11:00:12 2007
New Revision: 587574

URL: http://svn.apache.org/viewvc?rev=587574&view=rev
Log:
JCR-1134: fix test case name, do not assume node ordering in version history iterator

Modified:
    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/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=587574&r1=587573&r2=587574&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
Tue Oct 23 11:00:12 2007
@@ -114,16 +114,13 @@
      *
      * @see javax.jcr.version.VersionHistory#getRootVersion()
      */
-    public void testInitallyGetAllVersionsContainsTheRootVersion() throws RepositoryException
{
+    public void testInitiallyGetAllVersionsContainsTheRootVersion() throws RepositoryException
{
         Version rootVersion = vHistory.getRootVersion();
-        Version v = null;
-        VersionIterator it = vHistory.getAllVersions();
-        while (it.hasNext()) {
-            // break after the first version, that MUST be the root version
-            v = it.nextVersion();
-            break;
+        boolean isContained = false;
+        for (VersionIterator it = vHistory.getAllVersions(); it.hasNext(); ) {
+            isContained |= it.nextVersion().isSame(rootVersion);
         }
-        assertTrue("The version that is autocreated on version history creation must be the
root version", rootVersion.isSame(v));
+        assertTrue("root version must be part of the version history", isContained);
     }
 
     /**



Mime
View raw message