diff options
author | Decebal Suiu <decebal.suiu@gmail.com> | 2019-04-12 21:52:52 +0300 |
---|---|---|
committer | Decebal Suiu <decebal.suiu@gmail.com> | 2019-04-12 21:52:52 +0300 |
commit | 4907d01093b447044d24b158daaaded0f4757948 (patch) | |
tree | e60c58c9440d0a5ea5015b804b7889d0571fe228 /pf4j/src/test | |
parent | 76e8acce91fa11a3492191168be746d75022be10 (diff) | |
download | pf4j-4907d01093b447044d24b158daaaded0f4757948.tar.gz pf4j-4907d01093b447044d24b158daaaded0f4757948.zip |
Clean tests
Diffstat (limited to 'pf4j/src/test')
-rw-r--r-- | pf4j/src/test/java/org/pf4j/CompoundPluginDescriptorFinderTest.java | 9 | ||||
-rw-r--r-- | pf4j/src/test/java/org/pf4j/PropertiesPluginDescriptorFinderTest.java | 17 |
2 files changed, 5 insertions, 21 deletions
diff --git a/pf4j/src/test/java/org/pf4j/CompoundPluginDescriptorFinderTest.java b/pf4j/src/test/java/org/pf4j/CompoundPluginDescriptorFinderTest.java index 518ba1e..a24ff44 100644 --- a/pf4j/src/test/java/org/pf4j/CompoundPluginDescriptorFinderTest.java +++ b/pf4j/src/test/java/org/pf4j/CompoundPluginDescriptorFinderTest.java @@ -17,6 +17,7 @@ package org.pf4j; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; +import org.pf4j.plugin.PluginJar; import org.pf4j.plugin.PluginZip; import java.nio.charset.StandardCharsets; @@ -64,9 +65,9 @@ public class CompoundPluginDescriptorFinderTest { @Test public void findInJar() throws Exception { PluginDescriptorFinder descriptorFinder = new CompoundPluginDescriptorFinder() - .add(new PropertiesPluginDescriptorFinder()); + .add(new ManifestPluginDescriptorFinder()); - PluginZip pluginJar = new PluginZip.Builder(pluginsPath.resolve("my-plugin-1.2.3.jar"), "myPlugin") + PluginJar pluginJar = new PluginJar.Builder(pluginsPath.resolve("my-plugin-1.2.3.jar"), "myPlugin") .pluginVersion("1.2.3") .build(); @@ -86,11 +87,11 @@ public class CompoundPluginDescriptorFinderTest { public void testSpaceCharacterInFileName() throws Exception { PluginDescriptorFinder descriptorFinder = new PropertiesPluginDescriptorFinder(); - PluginZip pluginJar = new PluginZip.Builder(pluginsPath.resolve("my plugin-1.2.3.jar"), "myPlugin") + PluginZip pluginZip = new PluginZip.Builder(pluginsPath.resolve("my plugin-1.2.3.jar"), "myPlugin") .pluginVersion("1.2.3") .build(); - PluginDescriptor pluginDescriptor = descriptorFinder.find(pluginJar.path()); + PluginDescriptor pluginDescriptor = descriptorFinder.find(pluginZip.path()); assertNotNull(pluginDescriptor); } diff --git a/pf4j/src/test/java/org/pf4j/PropertiesPluginDescriptorFinderTest.java b/pf4j/src/test/java/org/pf4j/PropertiesPluginDescriptorFinderTest.java index 7845952..8b484b4 100644 --- a/pf4j/src/test/java/org/pf4j/PropertiesPluginDescriptorFinderTest.java +++ b/pf4j/src/test/java/org/pf4j/PropertiesPluginDescriptorFinderTest.java @@ -18,7 +18,6 @@ package org.pf4j; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; -import org.pf4j.plugin.PluginZip; import java.io.IOException; import java.nio.charset.Charset; @@ -29,7 +28,6 @@ import java.util.List; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -105,21 +103,6 @@ public class PropertiesPluginDescriptorFinderTest { assertThrows(PluginException.class, () -> descriptorFinder.find(pluginsPath.resolve("test-plugin-3"))); } - @Test - public void findInJar() throws Exception { - PluginZip pluginJar = new PluginZip.Builder(pluginsPath.resolve("my-plugin-1.2.3.jar"), "myPlugin") - .pluginVersion("1.2.3") - .build(); - - assertTrue(Files.exists(pluginJar.path())); - - PluginDescriptorFinder descriptorFinder = new PropertiesPluginDescriptorFinder(); - PluginDescriptor pluginDescriptor = descriptorFinder.find(pluginJar.path()); - assertNotNull(pluginDescriptor); - assertEquals("myPlugin", pluginJar.pluginId()); - assertEquals("1.2.3", pluginJar.pluginVersion()); - } - private List<String> getPlugin1Properties() { String[] lines = new String[] { "plugin.id=test-plugin-1\n" |