{
BackupChainLog bchLog = new BackupChainLog(backLog);
backup.restore(bchLog, re.getName(), ws1back);
// check
SessionImpl back1 = null;
try
{
back1 = (SessionImpl) repository.login(credentials, ws1back.getName());
Node ws1backTestRoot = back1.getRootNode().getNode("backupTest");
for (int i = startIndex; i < stopIndex; i++)
{
assertEquals("Restored content should be same", "property-" + i, ws1backTestRoot.getNode("node_" + i)
.getProperty("exo:data").getString());
}
}
catch (Exception e)
{
e.printStackTrace();
fail(e.getMessage());
}
finally
{
if (back1 != null)
back1.logout();
}
}
else
fail("There are no backup files in " + backDir.getAbsolutePath());
}