jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r1576368 - /jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/VersionHistoryTest.java
Date Tue, 11 Mar 2014 14:48:43 GMT
Author: reschke
Date: Tue Mar 11 14:48:42 2014
New Revision: 1576368

URL: http://svn.apache.org/r1576368
Log:
JCR-3744: check ordering of entries in a linear version history obtained from VersionHistory.getAllVersions().

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=1576368&r1=1576367&r2=1576368&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 Mar 11 14:48:42 2014
@@ -220,10 +220,13 @@ public class VersionHistoryTest extends 
     public void testGetAllVersionsJcr2() throws RepositoryException {
         int cnt = 5;
         Map<String, Version> versions = new HashMap<String, Version>();
+        List<String> vnames = new ArrayList<String>();
         Version v = vHistory.getRootVersion();
         versions.put(v.getIdentifier(), v);
+        vnames.add(v.getIdentifier());
         for (int i = 0; i < cnt; i++) {
             v = versionManager.checkin(versionableNode.getPath());
+            vnames.add(v.getIdentifier());
             versions.put(v.getIdentifier(), v);
             versionManager.checkout(versionableNode.getPath());
         }
@@ -235,8 +238,10 @@ public class VersionHistoryTest extends 
                 fail("VersionHistory.getAllVersions() must only contain the root version
and versions, that have been created by a Node.checkin() call.");
             }
             versions.remove(v.getIdentifier());
+            // check order of linear version history (see JCR 2.0, 15.1.1.2)
+            assertEquals("versions in a linear version history should be sorted by creation
time", vnames.remove(0), v.getIdentifier());
         }
-        assertTrue("VersionHistory.getAllVersions() must contain the root version and all
versions that have been created with a Node.checkin() call.", versions.isEmpty());
+        assertTrue("VersionHistory.getAllVersions() must only contain the root version and
all versions that have been created with a Node.checkin() call.", versions.isEmpty());
     }
 
     /**



Mime
View raw message