Package org.syncany.tests.util

Examples of org.syncany.tests.util.TestClient.cleanup()


    CleanupOperationOptions cleanupOptions = new CleanupOperationOptions();
    cleanupOptions.setKeepVersionsCount(1);
    boolean cleanupFailed = false;
    try {
      clientA.cleanup(cleanupOptions);
    }
    catch (StorageException e) {
      cleanupFailed = true;
    }
View Full Code Here


    assertEquals(1, transferManager.list(TransactionRemoteFile.class).size());
    assertEquals(1, new File(testConnection.getPath(), "transactions").list().length);
    assertEquals(1, transferManager.list(ActionRemoteFile.class).size());
    assertEquals(1, new File(testConnection.getPath(), "actions").list().length);

    clientA.cleanup(cleanupOptions);
    assertEquals(1, transferManager.list(MultichunkRemoteFile.class).size());
    assertEquals(1, new File(testConnection.getPath(), "multichunks").list().length);
    assertEquals(3, transferManager.list(DatabaseRemoteFile.class).size());
    assertEquals(3, new File(testConnection.getPath(), "databases").list().length);
    assertEquals(0, transferManager.list(TransactionRemoteFile.class).size());
View Full Code Here

    CleanupOperationOptions cleanupOptions = new CleanupOperationOptions();
    cleanupOptions.setMaxDatabaseFiles(1);
    boolean cleanupFailed = false;
    try {
      clientA.cleanup(cleanupOptions);
    }
    catch (StorageException e) {
      cleanupFailed = true;
    }
View Full Code Here

      transferManager.download(remoteFile, tempFile);
      assertTrue(tempFile.exists());
      tempFile.delete();
    }

    clientA.cleanup(cleanupOptions);

    assertEquals(2, transferManager.list(MultichunkRemoteFile.class).size());
    assertEquals(2, new File(testConnection.getPath(), "multichunks").list().length);

    assertEquals(1, transferManager.list(DatabaseRemoteFile.class).size());
View Full Code Here

    CleanupOperationOptions cleanupOptions = new CleanupOperationOptions();
    cleanupOptions.setMaxDatabaseFiles(1);
    boolean cleanupFailed = false;
    try {
      clientA.cleanup(cleanupOptions);
    }
    catch (StorageException e) {
      cleanupFailed = true;
    }
View Full Code Here

    // Two temporary files left (first deletion failed)
    assertEquals(2, transferManager.list(TempRemoteFile.class).size());
    assertEquals(2, new File(testConnection.getPath(), "temporary").list().length);

    clientA.cleanup(cleanupOptions);

    // Functional cleanup results in removal of action file and unreferenced files
    assertEquals(0, transferManager.list(ActionRemoteFile.class).size());
    assertEquals(0, new File(testConnection.getPath(), "actions").list().length);
View Full Code Here

    clientUxWork.down();

    CleanupOperationOptions cleanupOptions = new CleanupOperationOptions();
    cleanupOptions.setKeepVersionsCount(2);
   
    clientUxWork.cleanup(cleanupOptions);
       
    // home
    clientDzHome.down();
   
    clientDzHome.deleteFile("config.xml"); // Recreate problematic config.xml/checksum
View Full Code Here

    // B: Sync down, add something
    clientB.down();

    clientB.changeFile("file.jpg");

    CleanupOperationResult cleanupOperationResult = clientB.cleanup(cleanupOptions);
    assertEquals(CleanupResultCode.NOK_LOCAL_CHANGES, cleanupOperationResult.getResultCode());
    assertEquals(0, cleanupOperationResult.getMergedDatabaseFilesCount());
    assertEquals(0, cleanupOperationResult.getRemovedMultiChunks().size());
    assertEquals(0, cleanupOperationResult.getRemovedOldVersionsCount());
View Full Code Here

    // A: Add something
    clientA.changeFile("file.jpg");
    clientA.upWithForceChecksum();

    // B: Cleanup
    CleanupOperationResult cleanupOperationResult = clientB.cleanup(options);
    assertEquals(CleanupResultCode.NOK_REMOTE_CHANGES, cleanupOperationResult.getResultCode());
    assertEquals(0, cleanupOperationResult.getMergedDatabaseFilesCount());
    assertEquals(0, cleanupOperationResult.getRemovedMultiChunks().size());
    assertEquals(0, cleanupOperationResult.getRemovedOldVersionsCount());
View Full Code Here

    // B: Sync down, add something
    clientB.down();

    // B: Cleanup
    CleanupOperationResult cleanupOperationResult = clientB.cleanup(options);
    assertEquals(CleanupResultCode.OK_NOTHING_DONE, cleanupOperationResult.getResultCode());
    assertEquals(0, cleanupOperationResult.getMergedDatabaseFilesCount());
    assertEquals(0, cleanupOperationResult.getRemovedMultiChunks().size());
    assertEquals(0, cleanupOperationResult.getRemovedOldVersionsCount());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.