aboutsummaryrefslogtreecommitdiffstats
path: root/pf4j
diff options
context:
space:
mode:
authorMário Franco <mario.ffranco@gmail.com>2015-07-21 14:17:17 +0100
committerMário Franco <mario.ffranco@gmail.com>2015-09-09 12:02:24 +0100
commitc1f799cce8aa7e6ddee3385f6ff7dda8488f7553 (patch)
tree13486d9b361f27ba4a67e1e6adde1521e35f1c13 /pf4j
parent062a2c068d3a9926a24e64a2fa82e41319d8a9dd (diff)
downloadpf4j-c1f799cce8aa7e6ddee3385f6ff7dda8488f7553.tar.gz
pf4j-c1f799cce8aa7e6ddee3385f6ff7dda8488f7553.zip
Added one more fail test to DefaultPluginFactory
Diffstat (limited to 'pf4j')
-rw-r--r--pf4j/src/test/java/ro/fortsoft/pf4j/DefaultPluginFactoryTest.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/pf4j/src/test/java/ro/fortsoft/pf4j/DefaultPluginFactoryTest.java b/pf4j/src/test/java/ro/fortsoft/pf4j/DefaultPluginFactoryTest.java
index 203aa02..e32b4dc 100644
--- a/pf4j/src/test/java/ro/fortsoft/pf4j/DefaultPluginFactoryTest.java
+++ b/pf4j/src/test/java/ro/fortsoft/pf4j/DefaultPluginFactoryTest.java
@@ -76,6 +76,24 @@ public class DefaultPluginFactoryTest {
* Test of create method, of class DefaultPluginFactory.
*/
@Test
+ public void testCreateFailNotFound() {
+ PluginDescriptor pluginDescriptor = mock(PluginDescriptor.class);
+ when(pluginDescriptor.getPluginClass()).thenReturn("ro.fortsoft.pf4j.plugin.NotFoundTestPlugin");
+
+ PluginWrapper pluginWrapper = mock(PluginWrapper.class);
+ when(pluginWrapper.getDescriptor()).thenReturn(pluginDescriptor);
+ when(pluginWrapper.getPluginClassLoader()).thenReturn(getClass().getClassLoader());
+
+ DefaultPluginFactory instance = new DefaultPluginFactory();
+
+ Plugin result = instance.create(pluginWrapper);
+ assertNull(result);
+ }
+
+ /**
+ * Test of create method, of class DefaultPluginFactory.
+ */
+ @Test
public void testCreateFailConstructor() {
PluginDescriptor pluginDescriptor = mock(PluginDescriptor.class);
when(pluginDescriptor.getPluginClass()).thenReturn(AnotherFailTestPlugin.class.getName());