示例#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"));
 }