Package org.syncany.operations.plugin

Examples of org.syncany.operations.plugin.PluginOperationResult


    PluginOperationOptions pluginOptions = new PluginOperationOptions();
    pluginOptions.setAction(PluginAction.LIST);
    pluginOptions.setListMode(PluginListMode.LOCAL);

    // Run
    PluginOperationResult pluginResult = client.plugin(pluginOptions);
    List<Plugin> pluginList = Plugins.list(); // for comparison only!

    // Test
    assertNotNull(pluginResult);
    assertEquals(PluginResultCode.OK, pluginResult.getResultCode());
    assertEquals(pluginList.size(), pluginResult.getPluginList().size());

    assertEquals(EXPECTED_NUM_PLUGINS, pluginResult.getPluginList().size()); // local and unreliable_local

    for (ExtendedPluginInfo pluginInfo : pluginResult.getPluginList()) {
      assertNull(pluginInfo.getRemotePluginInfo());

      assertNotNull(pluginInfo.getLocalPluginInfo());
      assertNull(pluginInfo.getLocalPluginInfo().getDownloadUrl());
      assertNull(pluginInfo.getLocalPluginInfo().getSha256sum());
View Full Code Here


    PluginOperationOptions pluginOptions = new PluginOperationOptions();
    pluginOptions.setAction(PluginAction.LIST);
    pluginOptions.setListMode(PluginListMode.REMOTE);
    pluginOptions.setSnapshots(false);

    PluginOperationResult pluginResult = client.plugin(pluginOptions);

    assertNotNull(pluginResult);
    assertEquals(PluginResultCode.OK, pluginResult.getResultCode());

    // Tear down
    client.deleteTestData();
  }
View Full Code Here

    PluginOperationOptions pluginOptions = new PluginOperationOptions();
    pluginOptions.setAction(PluginAction.LIST);
    pluginOptions.setListMode(PluginListMode.REMOTE);
    pluginOptions.setSnapshots(true);

    PluginOperationResult pluginResult = client.plugin(pluginOptions);

    assertNotNull(pluginResult);
    assertEquals(PluginResultCode.OK, pluginResult.getResultCode());

    // Tear down
    client.deleteTestData();
  }
View Full Code Here

    PluginOperationOptions pluginOptions = new PluginOperationOptions();
    pluginOptions.setAction(PluginAction.INSTALL);
    pluginOptions.setPluginId("ftp");

    PluginOperationResult pluginResult = client.plugin(pluginOptions);

    assertNotNull(pluginResult);
    assertEquals(PluginResultCode.OK, pluginResult.getResultCode());

    // Only one file should be in here: the jar for ftp.
    assertEquals(1, (new File(configDir, "plugins/lib/")).list().length);

    // Tear down
View Full Code Here

    PluginOperationOptions pluginOptions = new PluginOperationOptions();
    pluginOptions.setAction(PluginAction.LIST);
    pluginOptions.setListMode(PluginListMode.REMOTE);
    pluginOptions.setSnapshots(false);

    PluginOperationResult pluginResult = client.plugin(pluginOptions);

    String pluginDownloadUrl = null;
    for (ExtendedPluginInfo pluginInfo : pluginResult.getPluginList()) {
      if (pluginInfo.getRemotePluginInfo().getPluginId().equals("ftp")) {
        pluginDownloadUrl = pluginInfo.getRemotePluginInfo().getDownloadUrl();
      }
    }

    pluginOptions = new PluginOperationOptions();
    pluginOptions.setAction(PluginAction.INSTALL);
    pluginOptions.setPluginId(pluginDownloadUrl);

    pluginResult = client.plugin(pluginOptions);

    assertNotNull(pluginResult);
    assertEquals(PluginResultCode.OK, pluginResult.getResultCode());

    // Only one file should be in here: the jar for ftp.
    assertEquals(1, (new File(configDir, "plugins/lib/")).list().length);

    // Tear down
View Full Code Here

  }

  @Override
  public int execute(String[] operationArgs) throws Exception {
    PluginOperationOptions operationOptions = parseOptions(operationArgs);
    PluginOperationResult operationResult = client.plugin(operationOptions);

    printResults(operationResult);

    return 0;
  }
View Full Code Here

    }
  }

  @Override
  public void printResults(OperationResult operationResult) {
    PluginOperationResult concreteOperationResult = (PluginOperationResult) operationResult;
   
    switch (action) {
    case LIST:
      printResultList(concreteOperationResult);
      return;
View Full Code Here

TOP

Related Classes of org.syncany.operations.plugin.PluginOperationResult

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.