From e81057f72aea8c702b61261d935d3c48cc5cb9f1 Mon Sep 17 00:00:00 2001 From: Decebal Suiu Date: Mon, 19 Mar 2018 20:32:05 +0200 Subject: [PATCH] Fix unit test --- .../java/org/pf4j/DefaultPluginManagerTest.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/pf4j/src/test/java/org/pf4j/DefaultPluginManagerTest.java b/pf4j/src/test/java/org/pf4j/DefaultPluginManagerTest.java index a474f57..c9b55fb 100644 --- a/pf4j/src/test/java/org/pf4j/DefaultPluginManagerTest.java +++ b/pf4j/src/test/java/org/pf4j/DefaultPluginManagerTest.java @@ -36,7 +36,6 @@ public class DefaultPluginManagerTest { pd1 = new DefaultPluginDescriptor(); pd1.setPluginId("myPlugin"); pd1.setPluginVersion("1.2.3"); - pd1.setPluginClass("foo"); pd1.setPluginDescription("My plugin"); pd1.setDependencies("bar, baz"); pd1.setProvider("Me"); @@ -62,14 +61,14 @@ public class DefaultPluginManagerTest { pluginManager.validatePluginDescriptor(pd1); } - @Test(expected = PluginException.class) - public void validateFailsOnClass() throws PluginException { - pd1.setPluginClass(null); + @Test + public void validateNoPluginClass() throws PluginException { pluginManager.validatePluginDescriptor(pd1); + assertEquals(Plugin.class.getName(), pd1.getPluginClass()); } @Test - public void isPluginValid() throws Exception { + public void isPluginValid() { // By default accept all since system version not given assertTrue(pluginManager.isPluginValid(pw1)); @@ -84,7 +83,7 @@ public class DefaultPluginManagerTest { } @Test - public void isPluginValidAllowExact() throws Exception { + public void isPluginValidAllowExact() { pluginManager.setExactVersionAllowed(true); // By default accept all since system version not given @@ -101,7 +100,7 @@ public class DefaultPluginManagerTest { } @Test - public void testDefaultExactVersionAllowed() throws Exception { + public void testDefaultExactVersionAllowed() { assertEquals(false, pluginManager.isExactVersionAllowed()); } -- 2.39.5