Package org.syncany.tests.util

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


   
    CleanupOperationOptions options = new CleanupOperationOptions();
   
    options.setForce(true);
   
    clientA.cleanup(options); // Force cleanup

    for (int i=1; i<=30; i++) {
      DatabaseRemoteFile expectedDatabaseRemoteFile = new DatabaseRemoteFile("A", i);
      File expectedDatabaseFile = new File(testConnection.getPath()+"/databases/"+expectedDatabaseRemoteFile.getName());
     
View Full Code Here


   
    FileUtils.copyDirectory(testConnection.getPath(), new File(testConnection.getPath()+"_2_after_down_before_cleanup"));
    FileUtils.copyDirectory(clientB.getConfig().getLocalDir(), new File(clientB.getConfig().getLocalDir()+"_2_after_down_before_cleanup"));
   
    assertEquals(3, new File(testConnection.getPath(), "multichunks").listFiles().length);
    clientB.cleanup(); // <<< This should NOT delete any lost multichunks of DIRTY database versions!
    assertEquals(3, new File(testConnection.getPath(), "multichunks").listFiles().length);
   
    FileUtils.copyDirectory(testConnection.getPath(), new File(testConnection.getPath()+"_3_after_cleanup"));
    FileUtils.copyDirectory(clientB.getConfig().getLocalDir(), new File(clientB.getConfig().getLocalDir()+"_3_after_cleanup"));
   
View Full Code Here

   
    clientB.down(); // Download A's version, realize it's muddy (= dirty by other client)
    assertSqlResultEquals(clientB.getDatabaseFile(), "select count(*) from multichunk_muddy", "1");

    assertEquals(3, new File(testConnection.getPath(), "multichunks").listFiles().length);
    clientB.cleanup(); // <<< This should NOT delete any lost multichunks of DIRTY database versions!
    assertEquals(3, new File(testConnection.getPath(), "multichunks").listFiles().length);
   
    // Round 2
    clientA.createNewFile("file4.jpg");
    clientA.up(upOptionsWithForce);    // This creates ANOTHER dirty version remotely! 
View Full Code Here

   
    clientB.down(); // Download A's version, realize it's muddy (= dirty by other client)
    assertSqlResultEquals(clientB.getDatabaseFile(), "select count(*) from multichunk_muddy", "2");
   
    assertEquals(4, new File(testConnection.getPath(), "multichunks").listFiles().length);
    clientB.cleanup(); // <<< This should NOT delete any lost multichunks of DIRTY database versions!
    assertEquals(4, new File(testConnection.getPath(), "multichunks").listFiles().length);

    clientA.down(); // Adds dirty databases
    assertSqlResultEquals(clientA.getDatabaseFile(), "select count(*) from databaseversion where status='DIRTY'", "2");
   
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.