Package org.syncany.operations

Examples of org.syncany.operations.ChangeSet


    new UpOperation(config).execute();       
    Thread.sleep(2000);
    TestFileUtil.changeRandomPartOfBinaryFile(testFile);
   
    // Run 'status', this should NOT run a checksum-based file comparison
    ChangeSet changeSet = (new StatusOperation(config).execute()).getChangeSet();           
    assertEquals(changeSet.getChangedFiles().size(), 1);
       
    // Cleanup
    TestConfigUtil.deleteTestLocalConfigAndData(config);
  }
View Full Code Here


    // Setup
    Config config = TestConfigUtil.createTestLocalConfig();
    new File(config.getLocalDir()+"/somefolder").mkdir();
       
    // Run 'status', this SHOULD list the folder
    ChangeSet changeSet = (new StatusOperation(config).execute()).getChangeSet();           
    assertEquals(changeSet.getNewFiles().size(), 1);
    assertEquals(changeSet.getChangedFiles().size(), 0);
    assertEquals(changeSet.getDeletedFiles().size(), 0);
    assertEquals(changeSet.getUnchangedFiles().size(), 0)
   
    // Run 'up' to check in the folder
    new UpOperation(config).execute();
   
    // Run 'status', this SHOULD NOT list the folder in the changed/new files
    changeSet = (new StatusOperation(config).execute()).getChangeSet();           
    assertEquals(changeSet.getNewFiles().size(), 0);
    assertEquals(changeSet.getChangedFiles().size(), 0);
    assertEquals(changeSet.getDeletedFiles().size(), 0);
    assertEquals(changeSet.getUnchangedFiles().size(), 1);   
       
    // Cleanup
    TestConfigUtil.deleteTestLocalConfigAndData(config);
  }
View Full Code Here

    assertEquals("(A1)\n(A1,B1)\n(A2,B1)\n(A3,B1)", TestSqlUtil.runSqlSelect("select vectorclock_serialized from databaseversion where status<>'DIRTY' order by id", databaseConnectionB));
   
    StatusOperationResult statusResultBAfterDirty = clientB.status();
    assertNotNull(statusResultBAfterDirty);
   
    ChangeSet changeSetBAfterDirty = statusResultBAfterDirty.getChangeSet();   
    assertEquals(2, changeSetBAfterDirty.getNewFiles().size());
    TestAssertUtil.assertConflictingFileExists("A-file1.jpg", clientB.getLocalFiles());
   
    clientB.up(upOptionsForceEnabled); // (A3,B2)
    assertEquals("0", TestSqlUtil.runSqlSelect("select count(*) from databaseversion where status='DIRTY'", databaseConnectionB));
   
View Full Code Here

  @Override
  public void printResults(OperationResult operationResult) {
    DownOperationResult concreteOperationResult = (DownOperationResult) operationResult;
   
    if (concreteOperationResult.getResultCode() == DownResultCode.OK_WITH_REMOTE_CHANGES) {
      ChangeSet changeSet = concreteOperationResult.getChangeSet();
     
      if (changeSet.hasChanges()) {
        List<String> newFiles = new ArrayList<String>(changeSet.getNewFiles());
        List<String> changedFiles = new ArrayList<String>(changeSet.getChangedFiles());
        List<String> deletedFiles = new ArrayList<String>(changeSet.getDeletedFiles());
       
        Collections.sort(newFiles);
        Collections.sort(changedFiles);
        Collections.sort(deletedFiles);
       
View Full Code Here

   
    if (concreteOperationResult.getResultCode() == UpResultCode.NOK_UNKNOWN_DATABASES) {
      out.println("Sync up skipped, because there are remote changes.");
    }
    else if (concreteOperationResult.getResultCode() == UpResultCode.OK_CHANGES_UPLOADED) {
      ChangeSet changeSet = concreteOperationResult.getChangeSet();

      for (String newFile : changeSet.getNewFiles()) {
        out.println("A " + newFile);
      }

      for (String changedFile : changeSet.getChangedFiles()) {
        out.println("M " + changedFile);
      }

      for (String deletedFile : changeSet.getDeletedFiles()) {
        out.println("D " + deletedFile);
      }

      out.println("Sync up finished.");
    }
View Full Code Here

TOP

Related Classes of org.syncany.operations.ChangeSet

Copyright © 2018 www.massapicom. 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.