Package org.syncany.tests.util

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


    clientA.createNewFile("folder/file");
    clientA.up();
   
    clientB.down();
    clientB.moveFile("folder", "moved");
    clientB.up();
     
    clientA.down();
    assertFalse("Deleted folder should not exist.", clientA.getLocalFile("folder").exists());
    assertFalse("Deleted file should not exist.", clientA.getLocalFile("folder/file").exists());
    assertFileEquals(clientA.getLocalFile("moved"), clientB.getLocalFile("moved"));
View Full Code Here


    clientA.createNewFile("A-original", 10);

    boolean upFailed = false;

    try {
      clientA.up();
    }
    catch (StorageException e) {
      upFailed = true;
      logger.log(Level.INFO, e.getMessage());
    }
View Full Code Here

    clientA.createNewFile("folder/folder2/file2");
    clientA.up();
   
    clientB.down();
    clientB.moveFile("folder", "moved");
    clientB.up();
     
    clientA.down();
    assertFalse("Deleted folder should not exist.", clientA.getLocalFile("folder").exists());
    assertFalse("Deleted file should not exist.", clientA.getLocalFile("folder/file").exists());
    assertFileEquals(clientA.getLocalFile("moved"), clientB.getLocalFile("moved"));
View Full Code Here

    clientA.createNewFile("A-original", 10);

    boolean upFailed = false;

    try {
      clientA.up();
    }
    catch (StorageException e) {
      upFailed = true;
      logger.log(Level.INFO, e.getMessage());
    }
View Full Code Here

    assertEquals(2, transactionTO.getActions().size());
    assertTrue(transactionTO.getActions().get(0).getRemoteFile().getName().contains("multichunk-"));
    assertTrue(transactionTO.getActions().get(1).getRemoteFile().getName().contains("database-"));

    // 2. Second try succeeds and must clean up the transactions
    clientA.up();

    assertEquals(1, new File(testConnection.getPath() + "/databases/").listFiles().length);
    assertEquals(1, new File(testConnection.getPath() + "/multichunks/").listFiles().length);
    assertEquals(0, new File(testConnection.getPath() + "/actions/").listFiles().length);
    assertEquals(0, new File(testConnection.getPath() + "/transactions/").listFiles().length);
View Full Code Here

    clientA.createNewFile("A-original", 5 * 1024 * 1024); // << larger than one multichunk!

    boolean upFailed = false;

    try {
      clientA.up();
    }
    catch (StorageException e) {
      upFailed = true;
      logger.log(Level.INFO, e.getMessage());
    }
View Full Code Here

    assertTrue(transactionTO.getActions().get(0).getRemoteFile().getName().contains("multichunk-"));
    assertTrue(transactionTO.getActions().get(1).getRemoteFile().getName().contains("multichunk-"));
    assertTrue(transactionTO.getActions().get(2).getRemoteFile().getName().contains("database-"));

    // 2. Second try succeeds and must clean up the transactions
    clientA.up();

    assertEquals(1, new File(testConnection.getPath() + "/databases/").listFiles().length);
    assertEquals(2, new File(testConnection.getPath() + "/multichunks/").listFiles().length);
    assertEquals(0, new File(testConnection.getPath() + "/actions/").listFiles().length);
    assertEquals(0, new File(testConnection.getPath() + "/transactions/").listFiles().length);
View Full Code Here

   
    clientA.createNewFile("A-file1.jpg", 50*1024);
    clientA.up(upOptionsForceEnabled);
       
    clientB.createNewFile("A-file1.jpg", 51*1024);
    clientB.up(upOptionsForceEnabled);
   
    clientB.down(); // This creates a dirty database       
   
    // Test (for dirty database existence)
    Config configB = clientB.getConfig();
View Full Code Here

       
    assertFileEquals(clientA.getLocalFile("A-file1.jpg"), clientB.getLocalFile("A-file1.jpg"));
    assertConflictingFileExists("A-file1.jpg", clientB.getLocalFilesExcludeLockedAndNoRead());   
   
    // Run (part 2)
    clientB.up(); // This deletes the dirty database file
   
    Iterator<DatabaseVersion> databaseVersionsDirtyB2 = databaseVersionDao.getDirtyDatabaseVersions();
    List<DatabaseVersion> databaseVersionsDirtyListB2 = TestCollectionUtil.toList(databaseVersionsDirtyB2);
   
    assertEquals(0, databaseVersionsDirtyListB2.size());
View Full Code Here

    assertFileListEquals(clientA.getLocalFilesExcludeLockedAndNoRead(), clientB.getLocalFilesExcludeLockedAndNoRead());
    assertSqlDatabaseEquals(clientA.getDatabaseFile(), clientB.getDatabaseFile());
   
    clientB.createNewFolder("B-folder4");
    clientB.createNewFolder("B-folder5");
    clientB.up();
   
    SqlDatabase databaseB = clientB.loadLocalDatabase();
    DatabaseVersionHeader beforeDatabaseVersionHeader = databaseB.getLastDatabaseVersionHeader();
   
    clientB.up(); // double-up, has caused problems
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.