LoadPluginCommand addToConfig();
Executable<Optional<PluginInfo>> officialFromFreenet(String pluginIdentifier);
Executable<Optional<PluginInfo>> officialFromHttps(String pluginIdentifier);
+ Executable<Optional<PluginInfo>> fromFreenet(String key);
Executable<Optional<PluginInfo>> fromFile(String filename);
Executable<Optional<PluginInfo>> fromUrl(String url);
}
@Override
+ public Executable<Optional<PluginInfo>> fromFreenet(String key) {
+ loadPlugin.setUrlType(UrlType.FREENET);
+ loadPlugin.setPluginUrl(key);
+ return this::execute;
+ }
+
+ @Override
public Executable<Optional<PluginInfo>> fromFile(String filename) {
loadPlugin.setUrlType(UrlType.FILE);
loadPlugin.setPluginUrl(filename);
}
@Test
+ public void fromFreenet() throws ExecutionException, InterruptedException, IOException {
+ Future<Optional<PluginInfo>> pluginInfo =
+ fcpClient.loadPlugin().fromFreenet("KSK@plugin.jar").execute();
+ connectNode();
+ List<String> lines = fcpServer.collectUntil(is("EndMessage"));
+ String identifier = extractIdentifier(lines);
+ assertThat(lines, matchesFcpMessage(
+ "LoadPlugin",
+ "Identifier=" + identifier,
+ "PluginURL=KSK@plugin.jar",
+ "URLType=freenet",
+ "EndMessage"
+ ));
+ replyWithPluginInfo(identifier);
+ verifyPluginInfo(pluginInfo);
+ }
+
+ @Test
public void failedLoad() throws ExecutionException, InterruptedException, IOException {
Future<Optional<PluginInfo>> pluginInfo =
fcpClient.loadPlugin().officialFromFreenet("superPlugin").execute();