From: Mário Franco Date: Tue, 21 Jul 2015 13:17:17 +0000 (+0100) Subject: Added one more fail test to DefaultPluginFactory X-Git-Tag: release-0.11.0~12^2~6 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c1f799cce8aa7e6ddee3385f6ff7dda8488f7553;p=pf4j.git Added one more fail test to DefaultPluginFactory --- 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 @@ -72,6 +72,24 @@ public class DefaultPluginFactoryTest { assertNull(result); } + /** + * 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. */