Package org.syncany.tests.util

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


    // A: Create some file versions
    clientA.createNewFile("file.jpg");
    for (int i = 1; i <= 16; i++) {
      clientA.changeFile("file.jpg");
      clientA.upWithForceChecksum();
    }

    // B: Cleanup
    CleanupOperationResult cleanupOperationResult = clientA.cleanup(options);
    assertEquals(CleanupResultCode.OK, cleanupOperationResult.getResultCode());
View Full Code Here


    assertEquals(0, cleanupOperationResult.getRemovedMultiChunks().size());
    assertEquals(0, cleanupOperationResult.getRemovedOldVersionsCount());

    for (int i = 1; i <= 15; i++) {
      clientA.changeFile("file.jpg");
      clientA.upWithForceChecksum();
    }

    // Because of minimum timeout, this cleanup should not do anything
    cleanupOperationResult = clientA.cleanup(options);
    assertEquals(CleanupResultCode.NOK_RECENTLY_CLEANED, cleanupOperationResult.getResultCode());
View Full Code Here

    clientA.createNewFile("A-file1", 5 * 1024);
    clientA.up();

    for (int i = 0; i < 5; i++) {
      clientA.changeFile("A-file1");
      clientA.upWithForceChecksum();
    }

    assertEquals(6, repoDatabasesDir.listFiles().length);
    assertEquals(6, repoMultiChunkDir.listFiles().length);
    assertEquals(0, repoActionsDir.listFiles().length);
View Full Code Here

    TestClient clientA = new TestClient("A", testConnection);
    java.sql.Connection databaseConnectionA = DatabaseConnectionFactory.createConnection(clientA.getDatabaseFile());
       
    // A new/up
    clientA.createNewFile("A-original");   
    clientA.upWithForceChecksum();
   
    String originalFileHistoryStr = TestSqlUtil.runSqlSelect("select filehistory_id from fileversion", databaseConnectionA);
    assertNotNull(originalFileHistoryStr);
   
    FileHistoryId originalFileHistoryId = FileHistoryId.parseFileId(originalFileHistoryStr);
View Full Code Here

       
    // A "delete"
    File deletedFile = new File(tempDir, "A-original-DELETED");
    FileUtils.moveFile(clientA.getLocalFile("A-original"), deletedFile);
           
    clientA.upWithForceChecksum();
   
    // A restore
    RestoreOperationOptions operationOptions = new RestoreOperationOptions();
   
    operationOptions.setFileHistoryId(originalFileHistoryId);
View Full Code Here

    TestClient clientA = new TestClient("A", testConnection);
    java.sql.Connection databaseConnectionA = DatabaseConnectionFactory.createConnection(clientA.getDatabaseFile());
       
    // A new/up
    clientA.createNewFile("A-original");   
    clientA.upWithForceChecksum();
   
    String originalFileHistoryStr = TestSqlUtil.runSqlSelect("select filehistory_id from fileversion", databaseConnectionA);
    assertNotNull(originalFileHistoryStr);
   
    FileHistoryId originalFileHistoryId = FileHistoryId.parseFileId(originalFileHistoryStr);
View Full Code Here

       
    // A "delete"
    File deletedFile = new File(tempDir, "A-original-DELETED");
    FileUtils.moveFile(clientA.getLocalFile("A-original"), deletedFile);
           
    clientA.upWithForceChecksum();
   
    // A restore
    RestoreOperationOptions operationOptions = new RestoreOperationOptions();
   
    operationOptions.setFileHistoryId(originalFileHistoryId);
View Full Code Here

    java.sql.Connection databaseConnectionA = DatabaseConnectionFactory.createConnection(clientA.getDatabaseFile());
       
    // A new/up
    clientA.createNewFolder("folder/subfolder");
    clientA.createNewFile("folder/subfolder/A-original");   
    clientA.upWithForceChecksum();
   
    String originalFileHistoryStr = TestSqlUtil.runSqlSelect("select filehistory_id from fileversion where path='folder/subfolder/A-original'", databaseConnectionA);
    assertNotNull(originalFileHistoryStr);
   
    FileHistoryId originalFileHistoryId = FileHistoryId.parseFileId(originalFileHistoryStr);
View Full Code Here

   
    FileHistoryId originalFileHistoryId = FileHistoryId.parseFileId(originalFileHistoryStr);
       
    // A "delete"
    FileUtils.deleteDirectory(clientA.getLocalFile("folder"));           
    clientA.upWithForceChecksum();
   
    assertFalse(clientA.getLocalFile("folder").exists());

    // A restore
    RestoreOperationOptions operationOptions = new RestoreOperationOptions();
View Full Code Here

   
    // C calls down and up, to sync its changes
    clientC.down(); // Adds dirty database
    assertSqlResultEquals(clientC.getDatabaseFile(), "select count(*) from databaseversion where status='DIRTY'", "1");
   
    clientC.upWithForceChecksum();
    assertSqlResultEquals(clientC.getDatabaseFile(), "select count(*) from databaseversion where status='DIRTY'", "0");
   
    clientA.down();
    assertFileListEquals(clientA.getLocalFilesExcludeLockedAndNoRead(), clientC.getLocalFilesExcludeLockedAndNoRead());   
   
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.