use of org.syncany.operations.plugin.PluginOperationOptions in project syncany by syncany.
the class PluginOperationTest method testPluginListLocalOnly.
@Test
public void testPluginListLocalOnly() throws Exception {
// Setup
LocalTransferSettings testConnection = (LocalTransferSettings) TestConfigUtil.createTestLocalConnection();
TestClient client = new TestClient("A", testConnection);
PluginOperationOptions pluginOptions = new PluginOperationOptions();
pluginOptions.setAction(PluginOperationAction.LIST);
pluginOptions.setListMode(PluginListMode.LOCAL);
// Run
PluginOperationResult pluginResult = client.plugin(pluginOptions);
// for comparison only!
List<Plugin> pluginList = Plugins.list();
// Test
assertNotNull(pluginResult);
assertEquals(PluginResultCode.OK, pluginResult.getResultCode());
assertEquals(pluginList.size(), pluginResult.getPluginList().size());
// local and unreliable_local
assertEquals(EXPECTED_NUM_PLUGINS, pluginResult.getPluginList().size());
for (ExtendedPluginInfo pluginInfo : pluginResult.getPluginList()) {
assertNull(pluginInfo.getRemotePluginInfo());
assertNotNull(pluginInfo.getLocalPluginInfo());
assertNull(pluginInfo.getLocalPluginInfo().getDownloadUrl());
assertNull(pluginInfo.getLocalPluginInfo().getSha256sum());
assertNotNull(pluginInfo.getLocalPluginInfo().getPluginId());
assertNotNull(pluginInfo.getLocalPluginInfo().getPluginVersion());
// The rest is not important for processing ...
assertNotNull(Plugins.get(pluginInfo.getLocalPluginInfo().getPluginId()));
}
// Tear down
client.deleteTestData();
}
use of org.syncany.operations.plugin.PluginOperationOptions in project syncany by syncany.
the class PluginCommand method execute.
@Override
public int execute(String[] operationArgs) throws Exception {
PluginOperationOptions operationOptions = parseOptions(operationArgs);
PluginOperationResult operationResult = new PluginOperation(config, operationOptions).execute();
printResults(operationResult);
return 0;
}
Aggregations