*/
public class ManifestPluginDescriptorFinderTest {
-
@Before
public void setUp() {
}
*/
@Test
public void testFind() throws Exception {
- ManifestPluginDescriptorFinder instance = new DefaultPluginDescriptorFinder(new PluginClasspath());
+ DefaultPluginDescriptorFinder instance = new DefaultPluginDescriptorFinder(new PluginClasspath());
URL url = getClass().getResource("/test-plugin-1");
PluginDescriptor plugin1 = instance.find(new File(url.getPath()));
url = getClass().getResource("/test-plugin-2");
/**
* Test of find method, of class ManifestPluginDescriptorFinder.
*/
- @Test(expected=PluginException.class)
+ @Test(expected = PluginException.class)
public void testFindNotFound() throws Exception {
ManifestPluginDescriptorFinder instance = new DefaultPluginDescriptorFinder(new PluginClasspath());
PluginDescriptor result = instance.find(new File(url.getPath()));
}
+ /**
+ * Test of find method, of class ManifestPluginDescriptorFinder.
+ */
+ @Test(expected = PluginException.class)
+ public void testFindMissingPluginClass() throws Exception {
+
+ ManifestPluginDescriptorFinder instance = new DefaultPluginDescriptorFinder(new PluginClasspath());
+ URL url = getClass().getResource("/test-plugin-4");
+ PluginDescriptor result = instance.find(new File(url.getPath()));
+ }
+
+ /**
+ * Test of find method, of class ManifestPluginDescriptorFinder.
+ */
+ @Test(expected = PluginException.class)
+ public void testFindMissingPluginVersion() throws Exception {
+
+ ManifestPluginDescriptorFinder instance = new DefaultPluginDescriptorFinder(new PluginClasspath());
+ URL url = getClass().getResource("/test-plugin-5");
+ PluginDescriptor result = instance.find(new File(url.getPath()));
+ }
+
}
--- /dev/null
+Manifest-Version: 1.0
+Implementation-Title: Test Plugin #2
+Implementation-Version: 0.10.0-SNAPSHOT
+Archiver-Version: Plexus Archiver
+Built-By: Mario Franco
+Specification-Title: Test Plugin #2
+Implementation-Vendor-Id: ro.fortsoft.pf4j.demo
+Plugin-Version: 0.0.1
+Plugin-Id: test-plugin-2
+Plugin-Provider: Decebal Suiu
+Created-By: Apache Maven 3.0.5
+Build-Jdk: 1.8.0_45
+Specification-Version: 0.10.0-SNAPSHOT
+
--- /dev/null
+Manifest-Version: 1.0
+Implementation-Title: Test Plugin #2
+Implementation-Version: 0.10.0-SNAPSHOT
+Archiver-Version: Plexus Archiver
+Built-By: Mario Franco
+Specification-Title: Test Plugin #2
+Implementation-Vendor-Id: ro.fortsoft.pf4j.demo
+Plugin-Id: test-plugin-2
+Plugin-Provider: Decebal Suiu
+Plugin-Class: ro.fortsoft.pf4j.plugin.TestPlugin
+Created-By: Apache Maven 3.0.5
+Build-Jdk: 1.8.0_45
+Specification-Version: 0.10.0-SNAPSHOT
+