Package org.syncany.tests.util

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


    TestClient clientA = new TestClient("A", testConnection);

    clientA.createNewFile("file");

    clientA.up();

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

    CleanupOperationOptions cleanupOptions = new CleanupOperationOptions();
View Full Code Here


    // For peaking (does NOT affect the test)
    FileUtils.copyDirectory(clientB.getLocalFile(".syncany/db"), clientB.getLocalFile(".syncany/db_WITH_DIRTY_B1"));

    Files.setPosixFilePermissions(clientB.getLocalFile("sphinxbase-0.8").toPath(), PosixFilePermissions.fromString("rwxrwxrwx"));
    UpOperationResult upResultB2 = clientB.up(); // (B2)
    assertEquals(UpResultCode.OK_CHANGES_UPLOADED, upResultB2.getResultCode());
    assertEquals(1, upResultB2.getChangeSet().getChangedFiles().size());

    // For peaking (does NOT affect the test)
    FileUtils.copyDirectory(clientB.getLocalFile(".syncany/db"), clientB.getLocalFile(".syncany/db_DELETED_B1_WITH_B2"));
View Full Code Here

    clientA.up(forceUpOperationOptions)
   
    Thread.sleep(200); // B's timestamp must be later
   
    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());
View Full Code Here

    clientB.createNewFile("A4,B1");
    clientB.up();
   
    clientC.createNewFile("C1"); // Evil. "up" without "down"
    clientC.changeFile("C1");
    clientC.up();
    clientC.changeFile("C1");
    clientC.up();
    clientC.changeFile("C1");
    clientC.up();
   
View Full Code Here

   
    clientC.createNewFile("C1"); // Evil. "up" without "down"
    clientC.changeFile("C1");
    clientC.up();
    clientC.changeFile("C1");
    clientC.up();
    clientC.changeFile("C1");
    clientC.up();
   
    clientA.down();
    assertFileListEquals(clientA.getLocalFilesExcludeLockedAndNoRead(), clientB.getLocalFilesExcludeLockedAndNoRead());
View Full Code Here

    clientC.changeFile("C1");
    clientC.up();
    clientC.changeFile("C1");
    clientC.up();
    clientC.changeFile("C1");
    clientC.up();
   
    clientA.down();
    assertFileListEquals(clientA.getLocalFilesExcludeLockedAndNoRead(), clientB.getLocalFilesExcludeLockedAndNoRead());
   
    Map<String, File> beforeSyncDownBFileList = clientB.getLocalFilesExcludeLockedAndNoRead();
View Full Code Here

    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();
   
    clientA.down();
    clientB.down();
    clientC.down();   
   
View Full Code Here

    clientB.down();
    assertFileListEquals(clientA.getLocalFilesExcludeLockedAndNoRead(), clientB.getLocalFilesExcludeLockedAndNoRead());
    assertSqlDatabaseEquals(clientA.getDatabaseFile(), clientB.getDatabaseFile());
   
    clientB.moveFile("A-original", "B-moved");
    clientB.up();
   
    // A down/move/up
    clientA.down();
    assertFileListEquals(clientA.getLocalFilesExcludeLockedAndNoRead(), clientB.getLocalFilesExcludeLockedAndNoRead());
    assertSqlDatabaseEquals(clientA.getDatabaseFile(), clientB.getDatabaseFile());
View Full Code Here

    clientB.down();
    assertFileListEquals(clientA.getLocalFilesExcludeLockedAndNoRead(), clientB.getLocalFilesExcludeLockedAndNoRead());
    assertSqlDatabaseEquals(clientA.getDatabaseFile(), clientB.getDatabaseFile());
   
    clientB.moveFile("A-moved-again", "B-moved"); // same filename as above!
    clientB.up();
   
    // A down/move/up
    clientA.down();
    assertFileListEquals(clientA.getLocalFilesExcludeLockedAndNoRead(), clientB.getLocalFilesExcludeLockedAndNoRead());
    assertSqlDatabaseEquals(clientA.getDatabaseFile(), clientB.getDatabaseFile());
View Full Code Here

    clientA.changeFile("file.jpg");
    clientA.up(noCleanupAndForceUpOperationOptions);

    // B: Change file.jpg (second step in creating a conflict)
    clientB.changeFile("file.jpg");
    clientB.up(noCleanupAndForceUpOperationOptions); // << creates conflict

    // B: Sync down (creates a local conflict file and marks local changes as DRITY)
    clientB.down(); // << creates DIRTY database entries

    // B: Cleanup
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.