public void run(Session session) throws Exception {
CmisTestResult success;
CmisTestResult failure;
// check root folder id
RepositoryInfo ri = getRepositoryInfo(session);
success = createResult(OK, "Root folder id: " + ri.getRootFolderId());
failure = createResult(FAILURE, "Root folder id is not set!");
addResult(assertStringNotEmpty(ri.getRootFolderId(), success, failure));
// get the root folder
Folder rootFolder = session.getRootFolder(SELECT_ALL_NO_CACHE_OC);
if (rootFolder == null) {
addResult(createResult(FAILURE, "Root folder is not available!"));
return;
}
String[] propertiesToCheck = new String[rootFolder.getType().getPropertyDefinitions().size()];
int i = 0;
for (String propId : rootFolder.getType().getPropertyDefinitions().keySet()) {
propertiesToCheck[i++] = propId;
}
addResult(checkObject(rootFolder, propertiesToCheck, "Root folder object spec compliance"));
// folder and path
failure = createResult(FAILURE,
"Root folder id in the repository info doesn't match the root folder object id!");
addResult(assertEquals(ri.getRootFolderId(), rootFolder.getId(), null, failure));
failure = createResult(FAILURE, "Root folder is not a cmis:folder!");
addResult(assertEquals(BaseTypeId.CMIS_FOLDER, rootFolder.getBaseTypeId(), null, failure));
failure = createResult(FAILURE, "Root folder path is not '/'!");