use of org.nuxeo.drive.service.FileSystemItemFactory in project nuxeo-drive-server by nuxeo.
the class TestDriveVersioning method testSyncRootVersioning.
@Test
public void testSyncRootVersioning() throws Exception {
// Expect no versions initially
// Cannot use DocumentModel#getVersionLabel since it relies on the uid schema not held by the Folder type
assertTrue(session.getVersions(syncRootFolder.getRef()).isEmpty());
// Wait for the versioning delay and update the synchronization root
Thread.sleep(VERSIONING_DELAY);
FileSystemItemFactory defaultSyncRootFolderItemFactory = ((FileSystemItemAdapterServiceImpl) fileSystemItemAdapterService).getFileSystemItemFactory("defaultSyncRootFolderItemFactory");
FolderItem syncRootFolderItem = (FolderItem) defaultSyncRootFolderItemFactory.getFileSystemItem(syncRootFolder);
syncRootFolderItem.rename("syncRootRenamed");
syncRootFolder = session.getDocument(syncRootFolder.getRef());
// Expect no versions since the "versioning-delay" policy doesn't apply to folderish documents
assertTrue(session.getVersions(syncRootFolder.getRef()).isEmpty());
}
Aggregations