@Test public void testPluginsList() { Collection<Plugin> pluginList = Plugins.list(); List<String> expectedPluginIds = Arrays.asList(new String[] {"local", "unreliable_local", "dummy"}); List<String> actualPluginIds = new ArrayList<String>(); for (Plugin plugin : pluginList) { actualPluginIds.add(plugin.getId()); } assertTrue(expectedPluginIds.containsAll(actualPluginIds)); assertTrue(actualPluginIds.containsAll(expectedPluginIds)); }
public static TransferSettings createTestLocalConnection() throws Exception { TransferPlugin plugin = Plugins.get("local", TransferPlugin.class); TransferSettings conn = plugin.createSettings(); File tempRepoDir = TestFileUtil.createTempDirectoryInSystemTemp(createUniqueName("repo", conn)); Map<String, String> pluginSettings = new HashMap<String, String>(); pluginSettings.put("path", tempRepoDir.getAbsolutePath()); conn.init(pluginSettings); plugin.createTransferManager(conn).init(true); return conn; }
@Test public void testExistingPlugin() { assertNotNull(Plugins.get("local")); }
@Test public void testNonExistingPlugin() { assertNull(Plugins.get("non-existing")); }