aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordecebals <decebal.suiu@gmail.com>2019-05-30 22:02:38 +0300
committerdecebals <decebal.suiu@gmail.com>2019-05-30 22:02:38 +0300
commit0ad926448eae71ff720174dd940468eac942161d (patch)
tree65c766f836cbaa8103498887eefd2eef0ba822f7
parenta8f00177d9306b949c60f5549c6b374557b750ef (diff)
downloadpf4j-0ad926448eae71ff720174dd940468eac942161d.tar.gz
pf4j-0ad926448eae71ff720174dd940468eac942161d.zip
Improve PluginZip
-rw-r--r--pf4j/src/test/java/org/pf4j/plugin/PluginZip.java20
1 files changed, 18 insertions, 2 deletions
diff --git a/pf4j/src/test/java/org/pf4j/plugin/PluginZip.java b/pf4j/src/test/java/org/pf4j/plugin/PluginZip.java
index 5f705e1..f34d84a 100644
--- a/pf4j/src/test/java/org/pf4j/plugin/PluginZip.java
+++ b/pf4j/src/test/java/org/pf4j/plugin/PluginZip.java
@@ -17,6 +17,7 @@ package org.pf4j.plugin;
import org.pf4j.PropertiesPluginDescriptorFinder;
+import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.file.Path;
@@ -50,6 +51,10 @@ public class PluginZip {
return path;
}
+ public File file() {
+ return path.toFile();
+ }
+
public String pluginId() {
return pluginId;
}
@@ -83,7 +88,7 @@ public class PluginZip {
private String pluginClass;
private String pluginVersion;
- private Map<String, String> properties;
+ private Map<String, String> properties = new LinkedHashMap<>();
public Builder(Path path, String pluginId) {
this.path = path;
@@ -104,9 +109,20 @@ public class PluginZip {
/**
* Add extra properties to the {@code properties} file.
+ * As possible attribute name please see {@link PropertiesPluginDescriptorFinder}.
*/
public Builder properties(Map<String, String> properties) {
- this.properties = properties;
+ this.properties.putAll(properties);
+
+ return this;
+ }
+
+ /**
+ * Add extra property to the {@code properties} file.
+ * As possible property name please see {@link PropertiesPluginDescriptorFinder}.
+ */
+ public Builder property(String name, String value) {
+ properties.put(name, value);
return this;
}