Browse Source

Added one more fail test to DefaultPluginFactory

pull/61/head
Mário Franco 10 years ago
parent
commit
c1f799cce8
  1. 18
      pf4j/src/test/java/ro/fortsoft/pf4j/DefaultPluginFactoryTest.java

18
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.
*/

Loading…
Cancel
Save