aboutsummaryrefslogtreecommitdiffstats
path: root/pf4j/src/test
diff options
context:
space:
mode:
authorDecebal Suiu <decebal.suiu@gmail.com>2019-04-20 13:50:58 +0300
committerDecebal Suiu <decebal.suiu@gmail.com>2019-04-20 13:50:58 +0300
commit8a2674c5392de62a97e4d0b33e4dd94dbaae407d (patch)
tree008863fb4459fc1f4c9d8fdad71a38034928ea4b /pf4j/src/test
parent642f6343c95ec8481a919238c15d56944b86e1b8 (diff)
downloadpf4j-8a2674c5392de62a97e4d0b33e4dd94dbaae407d.tar.gz
pf4j-8a2674c5392de62a97e4d0b33e4dd94dbaae407d.zip
Improve #292
Diffstat (limited to 'pf4j/src/test')
-rw-r--r--pf4j/src/test/java/org/pf4j/DefaultPluginRepositoryTest.java2
-rw-r--r--pf4j/src/test/java/org/pf4j/DefaultPluginStatusProviderTest.java21
-rw-r--r--pf4j/src/test/java/org/pf4j/JarPluginRepositoryTest.java3
3 files changed, 13 insertions, 13 deletions
diff --git a/pf4j/src/test/java/org/pf4j/DefaultPluginRepositoryTest.java b/pf4j/src/test/java/org/pf4j/DefaultPluginRepositoryTest.java
index 3aaba8f..3805c42 100644
--- a/pf4j/src/test/java/org/pf4j/DefaultPluginRepositoryTest.java
+++ b/pf4j/src/test/java/org/pf4j/DefaultPluginRepositoryTest.java
@@ -85,7 +85,7 @@ public class DefaultPluginRepositoryTest {
* Test of {@link DefaultPluginRepository#deletePluginPath(Path)} method.
*/
@Test
- public void testDeletePluginPath() {
+ public void testDeletePluginPath() throws PluginException {
PluginRepository repository = new DefaultPluginRepository(pluginsPath, false);
assertTrue(Files.exists(pluginsPath.resolve("plugin-1.zip")));
diff --git a/pf4j/src/test/java/org/pf4j/DefaultPluginStatusProviderTest.java b/pf4j/src/test/java/org/pf4j/DefaultPluginStatusProviderTest.java
index 635e41c..e766735 100644
--- a/pf4j/src/test/java/org/pf4j/DefaultPluginStatusProviderTest.java
+++ b/pf4j/src/test/java/org/pf4j/DefaultPluginStatusProviderTest.java
@@ -60,58 +60,59 @@ public class DefaultPluginStatusProviderTest {
}
@Test
- public void testDisablePlugin() throws IOException {
+ public void testDisablePlugin() throws Exception {
createEnabledFile();
createDisabledFile();
PluginStatusProvider statusProvider = new DefaultPluginStatusProvider(pluginsPath);
+ statusProvider.disablePlugin("plugin-1");
- assertTrue(statusProvider.disablePlugin("plugin-1"));
assertTrue(statusProvider.isPluginDisabled("plugin-1"));
assertTrue(statusProvider.isPluginDisabled("plugin-2"));
assertTrue(statusProvider.isPluginDisabled("plugin-3"));
}
@Test
- public void testDisablePluginWithEnableEmpty() throws IOException {
+ public void testDisablePluginWithEnableEmpty() throws Exception {
createDisabledFile();
PluginStatusProvider statusProvider = new DefaultPluginStatusProvider(pluginsPath);
+ statusProvider.disablePlugin("plugin-1");
- assertTrue(statusProvider.disablePlugin("plugin-1"));
assertTrue(statusProvider.isPluginDisabled("plugin-1"));
assertTrue(statusProvider.isPluginDisabled("plugin-2"));
assertFalse(statusProvider.isPluginDisabled("plugin-3"));
}
@Test
- public void testEnablePlugin() throws IOException {
+ public void testEnablePlugin() throws Exception {
createEnabledFile();
PluginStatusProvider statusProvider = new DefaultPluginStatusProvider(pluginsPath);
+ statusProvider.enablePlugin("plugin-2");
- assertTrue(statusProvider.enablePlugin("plugin-2"));
assertFalse(statusProvider.isPluginDisabled("plugin-1"));
assertFalse(statusProvider.isPluginDisabled("plugin-2"));
assertTrue(statusProvider.isPluginDisabled("plugin-3"));
}
@Test
- public void testEnablePluginWithEnableEmpty() {
+ public void testEnablePluginWithEnableEmpty() throws Exception{
PluginStatusProvider statusProvider = new DefaultPluginStatusProvider(pluginsPath);
+ statusProvider.enablePlugin("plugin-2");
- assertTrue(statusProvider.enablePlugin("plugin-2"));
assertFalse(statusProvider.isPluginDisabled("plugin-1"));
assertFalse(statusProvider.isPluginDisabled("plugin-2"));
assertFalse(statusProvider.isPluginDisabled("plugin-3"));
}
@Test
- public void testDisablePluginWithoutDisabledFile() {
+ public void testDisablePluginWithoutDisabledFile() throws Exception {
PluginStatusProvider statusProvider = new DefaultPluginStatusProvider(pluginsPath);
assertFalse(statusProvider.isPluginDisabled("plugin-1"));
- assertTrue(statusProvider.disablePlugin("plugin-1"));
+
+ statusProvider.disablePlugin("plugin-1");
assertTrue(statusProvider.isPluginDisabled("plugin-1"));
}
diff --git a/pf4j/src/test/java/org/pf4j/JarPluginRepositoryTest.java b/pf4j/src/test/java/org/pf4j/JarPluginRepositoryTest.java
index 2260680..02d2bcc 100644
--- a/pf4j/src/test/java/org/pf4j/JarPluginRepositoryTest.java
+++ b/pf4j/src/test/java/org/pf4j/JarPluginRepositoryTest.java
@@ -18,7 +18,6 @@ package org.pf4j;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
-import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
@@ -39,7 +38,7 @@ public class JarPluginRepositoryTest {
* Test of {@link JarPluginRepository#deletePluginPath(Path)} method.
*/
@Test
- public void testDeletePluginPath() throws IOException {
+ public void testDeletePluginPath() throws Exception {
PluginRepository repository = new JarPluginRepository(pluginsPath);
Path plugin1Path = Files.createDirectory(pluginsPath.resolve("plugin-1"));