From: Decebal Suiu Date: Mon, 19 Mar 2018 18:32:05 +0000 (+0200) Subject: Fix unit test X-Git-Tag: release-2.3.0~12 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e81057f72aea8c702b61261d935d3c48cc5cb9f1;p=pf4j.git Fix unit test --- 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()); }