use of org.syncany.operations.plugin.PluginOperationResult 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.PluginOperationResult in project syncany by syncany.
the class PluginOperationTest method testPluginListRemoteOnlyReleasesOnly.
@Test
public void testPluginListRemoteOnlyReleasesOnly() throws Exception {
// Tests which plugin releases are available. This is difficult because
// that will change. So we can only test the bare minimum.
// Setup
LocalTransferSettings testConnection = (LocalTransferSettings) TestConfigUtil.createTestLocalConnection();
TestClient client = new TestClient("A", testConnection);
PluginOperationOptions pluginOptions = new PluginOperationOptions();
pluginOptions.setAction(PluginOperationAction.LIST);
pluginOptions.setListMode(PluginListMode.REMOTE);
pluginOptions.setSnapshots(false);
PluginOperationResult pluginResult = client.plugin(pluginOptions);
assertNotNull(pluginResult);
assertEquals(PluginResultCode.OK, pluginResult.getResultCode());
// Tear down
client.deleteTestData();
}
Aggregations