예제 #1
0
  @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));
  }
예제 #2
0
  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;
  }
예제 #3
0
 @Test
 public void testExistingPlugin() {
   assertNotNull(Plugins.get("local"));
 }
예제 #4
0
 @Test
 public void testNonExistingPlugin() {
   assertNull(Plugins.get("non-existing"));
 }