projects
/
jFCPlib.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d0fb310
)
Add method to request detailed plugin info
author
David ‘Bombe’ Roden
<bombe@freenetproject.org>
Fri, 21 Aug 2015 22:45:47 +0000
(
00:45
+0200)
committer
David ‘Bombe’ Roden
<bombe@freenetproject.org>
Fri, 21 Aug 2015 22:45:47 +0000
(
00:45
+0200)
src/main/java/net/pterodactylus/fcp/quelaton/GetPluginInfoCommand.java
patch
|
blob
|
history
src/main/java/net/pterodactylus/fcp/quelaton/GetPluginInfoCommandImpl.java
patch
|
blob
|
history
src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java
patch
|
blob
|
history
diff --git
a/src/main/java/net/pterodactylus/fcp/quelaton/GetPluginInfoCommand.java
b/src/main/java/net/pterodactylus/fcp/quelaton/GetPluginInfoCommand.java
index
047024b
..
03e887c
100644
(file)
--- a/
src/main/java/net/pterodactylus/fcp/quelaton/GetPluginInfoCommand.java
+++ b/
src/main/java/net/pterodactylus/fcp/quelaton/GetPluginInfoCommand.java
@@
-11,6
+11,7
@@
import net.pterodactylus.fcp.PluginInfo;
*/
public interface GetPluginInfoCommand {
*/
public interface GetPluginInfoCommand {
+ GetPluginInfoCommand detailed();
Executable<Optional<PluginInfo>> plugin(String pluginName);
}
Executable<Optional<PluginInfo>> plugin(String pluginName);
}
diff --git
a/src/main/java/net/pterodactylus/fcp/quelaton/GetPluginInfoCommandImpl.java
b/src/main/java/net/pterodactylus/fcp/quelaton/GetPluginInfoCommandImpl.java
index
8063bc7
..
67c3e30
100644
(file)
--- a/
src/main/java/net/pterodactylus/fcp/quelaton/GetPluginInfoCommandImpl.java
+++ b/
src/main/java/net/pterodactylus/fcp/quelaton/GetPluginInfoCommandImpl.java
@@
-33,6
+33,12
@@
public class GetPluginInfoCommandImpl implements GetPluginInfoCommand {
}
@Override
}
@Override
+ public GetPluginInfoCommand detailed() {
+ getPluginInfo.setDetailed(true);
+ return this;
+ }
+
+ @Override
public Executable<Optional<PluginInfo>> plugin(String pluginName) {
getPluginInfo.setPluginName(pluginName);
return this::execute;
public Executable<Optional<PluginInfo>> plugin(String pluginName) {
getPluginInfo.setPluginName(pluginName);
return this::execute;
diff --git
a/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java
b/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java
index
002086d
..
78aa52a
100644
(file)
--- a/
src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java
+++ b/
src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java
@@
-2250,6
+2250,16
@@
public class DefaultFcpClientTest {
verifyPluginInfo(pluginInfo);
}
verifyPluginInfo(pluginInfo);
}
+ @Test
+ public void gettingPluginInfoWithDetailsWorks()
+ throws InterruptedException, ExecutionException, IOException {
+ Future<Optional<PluginInfo>> pluginInfo =
+ fcpClient.getPluginInfo().detailed().plugin(CLASS_NAME).execute();
+ connectAndAssert(() -> allOf(matchGetPluginInfoMessage(), hasItem("Detailed=true")));
+ replyWithPluginInfo();
+ verifyPluginInfo(pluginInfo);
+ }
+
private Matcher<List<String>> matchGetPluginInfoMessage() {
return matchesFcpMessage(
"GetPluginInfo",
private Matcher<List<String>> matchGetPluginInfoMessage() {
return matchesFcpMessage(
"GetPluginInfo",