Package org.syncany.tests.util

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


    clientDzHome.upWithForceChecksum();

    TestFileUtil.copyFile(clientDzHome.getLocalFile("config.xml"), new File(tempDir, "config.xml")); // Make a copy (for later)   

    // work
    clientUxWork.down();

    clientUxWork.changeFile("config.xml");
    clientUxWork.upWithForceChecksum();
   
    clientUxWork.createNewFile("someotherfile1.xml");
View Full Code Here


   
    clientDzHome.changeFile("config.xml");
    clientDzHome.upWithForceChecksum();

    // work
    clientUxWork.down();

    CleanupOperationOptions cleanupOptions = new CleanupOperationOptions();
    cleanupOptions.setKeepVersionsCount(2);
   
    clientUxWork.cleanup(cleanupOptions);
View Full Code Here

    TestFileUtil.copyFile(new File(tempDir, "config.xml"), clientDzHome.getLocalFile("config.xml"));
   
    clientDzHome.upWithForceChecksum();
   
    // work
    clientUxWork.down();
   
    // Tear down
    TestFileUtil.deleteDirectory(tempDir);
   
    clientUxWork.deleteTestData();
View Full Code Here

   
    TestFileUtil.copyFile(clientA.getLocalFile("A-file1.jpg"), clientB.getLocalFile("A-file1.jpg"));
    clientB.up(forceUpOperationOptions)

    // Client B loses   
    clientB.down()// <<<<<<< This used to throw all sorts of PRIMARY KEY CONSTRAINT errors
   
    java.sql.Connection databaseConnectionA = DatabaseConnectionFactory.createConnection(clientA.getDatabaseFile());
    java.sql.Connection databaseConnectionB = DatabaseConnectionFactory.createConnection(clientB.getDatabaseFile());
   
    TestAssertUtil.assertSqlDatabaseTablesEqual(clientA.getDatabaseFile(), clientB.getDatabaseFile(), new String[] {
View Full Code Here

   
    Map<String, File> beforeSyncDownBFileList = clientB.getLocalFilesExcludeLockedAndNoRead();
    clientB.down();
    assertFileListEquals("No change in file lists expected. Nothing changed for 'B'.", beforeSyncDownBFileList, clientB.getLocalFilesExcludeLockedAndNoRead());
       
    clientC.down();
    assertEquals("Client C is expected to have one more local file (C1)", clientA.getLocalFilesExcludeLockedAndNoRead().size()+1, clientC.getLocalFilesExcludeLockedAndNoRead().size());
   
    clientA.up();
    clientB.up();
    clientC.up();
View Full Code Here

    clientB.up();
    clientC.up();
   
    clientA.down();
    clientB.down();
    clientC.down();   
   
    assertFileListEquals(clientA.getLocalFilesExcludeLockedAndNoRead(), clientB.getLocalFilesExcludeLockedAndNoRead());
    assertFileListEquals(clientB.getLocalFilesExcludeLockedAndNoRead(), clientC.getLocalFilesExcludeLockedAndNoRead());   
   
    // Tear down
View Full Code Here

    assertEquals("10", TestSqlUtil.runSqlSelect("select count(*) from multichunk", databaseConnectionA));
    assertEquals("11", TestSqlUtil.runSqlSelect("select count(*) from filecontent", databaseConnectionA));
    assertEquals("4", TestSqlUtil.runSqlSelect("select count(distinct id) from filehistory", databaseConnectionA));

    // B: Sync down by other client
    clientB.down();

    java.sql.Connection databaseConnectionB = DatabaseConnectionFactory.createConnection(clientB.getDatabaseFile());
    assertEquals("12", TestSqlUtil.runSqlSelect("select count(*) from fileversion", databaseConnectionB));
    assertEquals("11", TestSqlUtil.runSqlSelect("select count(*) from chunk", databaseConnectionB));
    assertEquals("10", TestSqlUtil.runSqlSelect("select count(*) from multichunk", databaseConnectionB));
View Full Code Here

    // Test the repo
    assertEquals(5, new File(testConnection.getPath() + "/multichunks/").list().length);
    assertEquals(12, new File(testConnection.getPath() + "/databases/").list().length);

    // B: Sync down cleanup
    clientB.down();
    TestAssertUtil.assertSqlDatabaseEquals(clientA.getDatabaseFile(), clientB.getDatabaseFile());

    // Tear down
    clientA.deleteTestData();
    clientB.deleteTestData();
View Full Code Here

      clientA.changeFile("file.jpg");
      clientA.upWithForceChecksum();
    }

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

    clientB.changeFile("file.jpg");

    CleanupOperationResult cleanupOperationResult = clientB.cleanup(cleanupOptions);
    assertEquals(CleanupResultCode.NOK_LOCAL_CHANGES, cleanupOperationResult.getResultCode());
View Full Code Here

   
    databaseClientA = clientA.loadLocalDatabase();
    assertEquals("There should be EXACTLY "+numFilesRemaining+" file histories in the database.", numFilesRemaining, databaseClientA.getFileHistoriesWithFileVersions().size());
   
    // Test 3: After that, the sync between the clients should of course still work
    clientB.down();
    assertFileListEquals("Files of both clients should be identical.", clientA.getLocalFilesExcludeLockedAndNoRead(), clientB.getLocalFilesExcludeLockedAndNoRead());
    assertSqlDatabaseEquals(clientA.getDatabaseFile(), clientB.getDatabaseFile());       
   
    // Tear down
    clientA.deleteTestData();
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.