Search in sources :

Example 11 with FileSystemChangeSummary

use of org.nuxeo.drive.service.FileSystemChangeSummary in project nuxeo-drive-server by nuxeo.

the class TestGetChangeSummaryMultiRepo method getChangeSummary.

protected FileSystemChangeSummary getChangeSummary() throws Exception {
    // Wait 1 second as the mock change finder relies on steps of 1 second
    Thread.sleep(1000);
    Blob docChangeSummaryJSON = (Blob) clientSession.newRequest(NuxeoDriveGetChangeSummary.ID).set("lastSyncDate", lastSyncDate).set("lastSyncActiveRootDefinitions", lastSyncActiveRoots).execute();
    assertNotNull(docChangeSummaryJSON);
    FileSystemChangeSummary changeSummary = mapper.readValue(docChangeSummaryJSON.getStream(), FileSystemChangeSummaryImpl.class);
    assertNotNull(changeSummary);
    lastSyncDate = changeSummary.getSyncDate();
    lastSyncActiveRoots = changeSummary.getActiveSynchronizationRootDefinitions();
    return changeSummary;
}
Also used : StringBlob(org.nuxeo.ecm.core.api.impl.blob.StringBlob) Blob(org.nuxeo.ecm.automation.client.model.Blob) FileSystemChangeSummary(org.nuxeo.drive.service.FileSystemChangeSummary)

Aggregations

FileSystemChangeSummary (org.nuxeo.drive.service.FileSystemChangeSummary)11 HashSet (java.util.HashSet)6 FileSystemItemChange (org.nuxeo.drive.service.FileSystemItemChange)6 StringBlob (org.nuxeo.ecm.core.api.impl.blob.StringBlob)6 Test (org.junit.Test)5 Principal (java.security.Principal)4 DocumentModel (org.nuxeo.ecm.core.api.DocumentModel)4 Set (java.util.Set)3 IdRef (org.nuxeo.ecm.core.api.IdRef)3 SimpleFileSystemItemChange (org.nuxeo.drive.fixtures.SimpleFileSystemItemChange)2 Blob (org.nuxeo.ecm.automation.client.model.Blob)2 NuxeoPrincipalImpl (org.nuxeo.ecm.platform.usermanager.NuxeoPrincipalImpl)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 LinkedHashSet (java.util.LinkedHashSet)1 Map (java.util.Map)1 TreeSet (java.util.TreeSet)1 NuxeoDriveManager (org.nuxeo.drive.service.NuxeoDriveManager)1 SynchronizationRoots (org.nuxeo.drive.service.SynchronizationRoots)1 TooManyChangesException (org.nuxeo.drive.service.TooManyChangesException)1