Package org.syncany.operations.daemon.messages

Examples of org.syncany.operations.daemon.messages.StatusFolderRequest


   
    // Cli Requests
    clientA.copyFile("file-1", "file-1.bak");
   
    // CLI request while running.
    StatusFolderRequest statusRequest = new StatusFolderRequest();
    StatusOperationOptions statusOperationOption = new StatusOperationOptions();
    statusOperationOption.setForceChecksum(true);
   
    statusRequest.setId(30);
    statusRequest.setRoot(clientA.getConfig().getLocalDir().getAbsolutePath());
    statusRequest.setOptions(statusOperationOption);
   
    // Create big file to trigger sync
    clientA.createNewFile("bigfileforlongsync", 5000);

    // ^^ Now sync should start and we send 'status' requests
    boolean syncRunningMessageReceived = false;
   
    for (i = 30; i < 50; i++) {
      statusRequest.setId(i);
      eventBus.post(statusRequest);
     
      response = waitForResponse(i);
     
      if (response instanceof AlreadySyncingResponse) {
        syncRunningMessageReceived = true;
        break;
      }     
     
      Thread.sleep(200);
    }
   
    assertTrue(syncRunningMessageReceived);
   
    // Allow daemon to sync
   
    Thread.sleep(10000);
    for (i = 50; i < 60; i++) {
      statusRequest.setId(i);
      eventBus.post(statusRequest);
     
      response = waitForResponse(i);
     
      if (response instanceof StatusFolderResponse) {
View Full Code Here


    // Register to event bus     
    LocalEventBus localEventBus = LocalEventBus.getInstance();
    localEventBus.register(this);
       
    // Prepare CLI request
    StatusFolderRequest cliStatusRequest = new StatusFolderRequest();
    cliStatusRequest.setId(2586);
    cliStatusRequest.setRoot(clientA.getConfig().getLocalDir().getAbsolutePath());
   
    // Create watchServer
    WatchServer watchServer = new WatchServer()
    watchServer.start(daemonConfig);   
    Thread.sleep(1000); // Settlement for watch server
View Full Code Here

TOP

Related Classes of org.syncany.operations.daemon.messages.StatusFolderRequest

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.