Package org.syncany.tests.util

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


   
    // Round 2
    clientA.createNewFile("file4.jpg");
    clientA.up(upOptionsWithForce);    // This creates ANOTHER dirty version remotely! 
   
    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);
View Full Code Here


    assertSqlResultEquals(clientA.getDatabaseFile(), "select count(*) from databaseversion where status='DIRTY'", "2");
   
    clientA.up();
    assertSqlResultEquals(clientA.getDatabaseFile(), "select count(*) from databaseversion where status='DIRTY'", "0");

    clientB.down();
    assertFileListEquals(clientA.getLocalFilesExcludeLockedAndNoRead(), clientB.getLocalFilesExcludeLockedAndNoRead());   
    assertSqlResultEquals(clientB.getDatabaseFile(), "select count(*) from multichunk_muddy", "0");
   
    // Tear down
    clientA.deleteTestData();
View Full Code Here

    clientA.createNewFile("filename-for-windows");
    clientA.createNewFile("Filename-For-Windows");
    clientA.upWithForceChecksum();
    assertEquals("There should be three files.", 3, clientA.getLocalFilesExcludeLockedAndNoRead().size());

    clientB.down();
    assertEquals("There should be three files.", 3, clientB.getLocalFilesExcludeLockedAndNoRead().size());
    assertFileListEquals(clientA.getLocalFilesExcludeLockedAndNoRead(), clientB.getLocalFilesExcludeLockedAndNoRead());
    assertSqlDatabaseEquals(clientA.getDatabaseFile(), clientB.getDatabaseFile());

    // Tear down
View Full Code Here

    clientA.createNewFile("這是一個測試"); // Non-ASCII
    clientA.createNewFile("One&Two"); // & is not allowed in XML
    clientA.upWithForceChecksum();
    assertEquals("There should be three files.", 3, clientA.getLocalFilesExcludeLockedAndNoRead().size());

    clientB.down();
    assertEquals("There should be three files.", 3, clientB.getLocalFilesExcludeLockedAndNoRead().size());
    assertFileListEquals(clientA.getLocalFilesExcludeLockedAndNoRead(), clientB.getLocalFilesExcludeLockedAndNoRead());
    assertSqlDatabaseEquals(clientA.getDatabaseFile(), clientB.getDatabaseFile());

    // Tear down
View Full Code Here

      // A
      for (int i=1; i<100; i++) { clientA.createNewFile("A-file-with-size-"+i+".jpg", i);
      clientA.up()
     
      // B
      clientB.down();           
      assertFileListEquals(clientA.getLocalFilesExcludeLockedAndNoRead(), clientB.getLocalFilesExcludeLockedAndNoRead());
      assertSqlDatabaseEquals(clientA.getDatabaseFile(), clientB.getDatabaseFile());
   
      for (int i=1; i<100; i++) { clientB.changeFile("A-file-with-size-"+i+".jpg"); }
      clientB.up()
View Full Code Here

    ClientActions.run(clientA, null, new CreateFileTree(), new Executable() {
      @Override
      public void execute() throws Exception {
        clientA.upWithForceChecksum();

        clientB.down();
        assertFileListEquals(clientA.getLocalFilesExcludeLockedAndNoRead(), clientB.getLocalFilesExcludeLockedAndNoRead());
        assertSqlDatabaseEquals(clientA.getDatabaseFile(), clientB.getDatabaseFile());
      }
    });
View Full Code Here

    ClientActions.run(clientA, null, new LockFile(), new Executable() {
      @Override
      public void execute() throws Exception {
        clientA.upWithForceChecksum();

        clientB.down();
        assertEquals(clientA.getLocalFilesExcludeLockedAndNoRead().size(), clientB.getLocalFilesExcludeLockedAndNoRead().size() - 1);
      }
    });

    ClientActions.run(clientA, null, new UnlockFile(), new Executable() {
View Full Code Here

    ClientActions.run(clientA, null, new UnlockFile(), new Executable() {
      @Override
      public void execute() throws Exception {
        clientA.upWithForceChecksum();

        clientB.down();
        assertFileListEquals(clientA.getLocalFilesExcludeLockedAndNoRead(), clientB.getLocalFilesExcludeLockedAndNoRead());
        assertSqlDatabaseEquals(clientA.getDatabaseFile(), clientB.getDatabaseFile());
      }
    });
View Full Code Here

   
      for (int i=1; i<100; i++) { clientA.deleteFile("A-file-with-size-"+i+".jpg"); }
      clientA.up()
     
      // B
      clientB.down();           
      assertFileListEquals(clientA.getLocalFilesExcludeLockedAndNoRead(), clientB.getLocalFilesExcludeLockedAndNoRead());
      assertSqlDatabaseEquals(clientA.getDatabaseFile(), clientB.getDatabaseFile());     
    }

    fail("No asserts yet.");
View Full Code Here

    clientA.upWithForceChecksum();
   
    FileUtils.copyFile(clientA.getLocalFile("file1.jpg"), clientB.getLocalFile("file1.jpg"));
    clientB.getLocalFile("file1.jpg").setLastModified(123456789);
   
    clientB.down();
    assertFileListEquals(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.