Package org.syncany.operations.up

Examples of org.syncany.operations.up.UpOperation


    List<File> originalFiles = TestFileUtil.createRandomFilesInDirectory(testConfig.getLocalDir(), fileSize,
        fileAmount);

    // Run!
    UpOperation op = new UpOperation(testConfig);
    op.execute();

    // Get databases (for comparison)
    LocalTransferSettings localConnection = (LocalTransferSettings) testConfig.getConnection();

    File localDatabaseDir = testConfig.getDatabaseDir();
View Full Code Here


   
    // Add new files on A and upload it
    TestFileUtil.createRandomFilesInDirectory(configA.getLocalDir(), 5000*1024, 3);
   
    long timeSyncUpStart = System.currentTimeMillis();
    new UpOperation(configA).execute();   
    long timeSyncUpEnd = System.currentTimeMillis();   
    long timeSyncUpTotal = timeSyncUpEnd - timeSyncUpStart;
   
    if (timeSyncUpTotal > 3000) {
      fail("Sync up took: "+timeSyncUpTotal+" ms");
View Full Code Here

        if (downResult.getResultCode() == DownResultCode.OK_WITH_REMOTE_CHANGES) {
          // TODO [low] Do something?
        }
       
        // Run up
        UpOperationResult upOperationResult = new UpOperation(config, options.getUpOptions()).execute();

        if (upOperationResult.getResultCode() == UpResultCode.OK_CHANGES_UPLOADED && upOperationResult.getChangeSet().hasChanges()) {
          upCount.incrementAndGet();
          notifyChanges = true;
        }   
View Full Code Here

  public UpOperationResult up() throws Exception {
    return up(new UpOperationOptions());
  }

  public UpOperationResult up(UpOperationOptions options) throws Exception {
    return new UpOperation(config, options).execute();
  }
View Full Code Here

    assertEquals(changeSet.getNewFiles().size(), originalFiles.size());
    assertEquals(changeSet.getChangedFiles().size(), 0);
    assertEquals(changeSet.getDeletedFiles().size(), 0);
       
    // Up
    new UpOperation(config).execute();   
       
    // Status
    changeSet = (new StatusOperation(config).execute()).getChangeSet();   
   
    assertEquals(changeSet.getNewFiles().size(), 0);
    assertEquals(changeSet.getChangedFiles().size(), 0);
    assertEquals(changeSet.getDeletedFiles().size(), 0);

    // Change all files, run 'status'
    Thread.sleep(2000); // TODO [low] StatusOperation relies on file modified time and size, any other methods?

    for (File file : originalFiles) {
      TestFileUtil.changeRandomPartOfBinaryFile(file);
    }   
   
    changeSet = (new StatusOperation(config).execute()).getChangeSet();
   
    assertEquals(changeSet.getNewFiles().size(), 0);
    assertEquals(changeSet.getChangedFiles().size(), originalFiles.size());
    assertEquals(changeSet.getDeletedFiles().size(), 0);
   
    // Up
    new UpOperation(config).execute();
       
    // Delete all files, run 'status' again
    for (File file : originalFiles) {
      TestFileUtil.deleteFile(file);
    }
View Full Code Here

    UpOperationOptions syncUpOptions = new UpOperationOptions();
    syncUpOptions.setStatusOptions(statusOptions);     
   
    // Perform 'up' and immediately change test file
    // IMPORTANT: Do NOT sleep to enforce checksum-based comparison in 'status'
    new UpOperation(config, syncUpOptions).execute();   
    TestFileUtil.changeRandomPartOfBinaryFile(testFile);
   
    // Run 'status', this should run a checksum-based file comparison
    ChangeSet changeSet = (new StatusOperation(config, statusOptions).execute()).getChangeSet();           
    assertEquals(changeSet.getChangedFiles().size(), 1);
View Full Code Here

    Config config = TestConfigUtil.createTestLocalConfig();
    File testFile = TestFileUtil.createRandomFileInDirectory(config.getLocalDir(), 40);
   
    // Perform 'up', wait a second and then change test file
    // IMPORTANT: Sleep to prevent detailed checksum-based update check in 'status' operation
    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();           
View Full Code Here

    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);
View Full Code Here

TOP

Related Classes of org.syncany.operations.up.UpOperation

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.