assertNotNull("VersionIterator is null", versionIterator);
assertTrue("Invalid number of versions found", versionIterator.getSize() == 3);
while (versionIterator.hasNext())
{
Version version = (Version) versionIterator.next();
log.info("version found : "+ version.getName() + " - " + version.getPath() + " - " + version.getCreated().getTime());
if (version.getName().equals("jcr:rootVersion"))
{
continue;
}
page = (UnstructuredPage) ocm.getObject("/page", version.getName());
assertNotNull("Page is null for version " + version.getName(), page);
if (version.getName().equals("1.0"))
{
assertEquals("Invalid title for version " + version.getName(),page.getTitle(), "Page Title 2");
}
if (version.getName().equals("1.1"))
{
assertEquals("Invalid title for version " + version.getName(),page.getTitle(), "Page Title 3");
}
}
Version baseVersion = ocm.getBaseVersion("/page");
log.info("Base version : " + baseVersion.getName());
Version rootVersion = ocm.getRootVersion("/page");
log.info("Root version : " + rootVersion.getName());
//this.exportDocument("/home/christophe/export.xml", "/jcr:system/jcr:versionStorage", true, false);
//Get the latest version
page = (UnstructuredPage) ocm.getObject( "/page");
assertNotNull("Last version is nulll", page);