* Tests if restore on simple versioning creates a new version that is
* in the correct linear order.
*/
public void testLinearVersionsJcr2() throws Exception {
// first get all linear versions
VersionIterator iter = versionManager.getVersionHistory(versionableNode.getPath()).getAllLinearVersions();
StringBuffer expected = new StringBuffer();
while (iter.hasNext()) {
expected.append(iter.nextVersion().getName()).append(",");
}
// restore version
versionManager.restore(version, true);
// append new base version
expected.append(versionManager.getBaseVersion(versionableNode.getPath()).getName()).append(",");
// get the version names again
iter = versionManager.getVersionHistory(versionableNode.getPath()).getAllLinearVersions();
StringBuffer actual = new StringBuffer();
while (iter.hasNext()) {
actual.append(iter.nextVersion().getName()).append(",");
}
assertEquals("Node.restore() on simple versioning must create a new version.",
expected.toString(), actual.toString());
}