|
|
@ -72,6 +72,24 @@ public class DefaultPluginFactoryTest { |
|
|
|
assertNull(result); |
|
|
|
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. |
|
|
|
* Test of create method, of class DefaultPluginFactory. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|