diff options
author | Mário Franco <mario.ffranco@gmail.com> | 2015-07-21 16:00:24 +0100 |
---|---|---|
committer | Mário Franco <mario.ffranco@gmail.com> | 2015-09-09 12:02:26 +0100 |
commit | b714dfe676a8c2ba90bb54a02897d8fbc02fe578 (patch) | |
tree | 5846d4450fbcd9a25752e0a2bac48e68622d8692 /pf4j | |
parent | 13ace71e16d865d620177dc176cafa5ced28e67b (diff) | |
download | pf4j-b714dfe676a8c2ba90bb54a02897d8fbc02fe578.tar.gz pf4j-b714dfe676a8c2ba90bb54a02897d8fbc02fe578.zip |
Added fail on missing plugin id
Diffstat (limited to 'pf4j')
-rw-r--r-- | pf4j/src/test/java/ro/fortsoft/pf4j/ManifestPluginDescriptorFinderTest.java | 11 | ||||
-rw-r--r-- | pf4j/src/test/resources/test-plugin-6/classes/META-INF/MANIFEST.MF | 13 |
2 files changed, 24 insertions, 0 deletions
diff --git a/pf4j/src/test/java/ro/fortsoft/pf4j/ManifestPluginDescriptorFinderTest.java b/pf4j/src/test/java/ro/fortsoft/pf4j/ManifestPluginDescriptorFinderTest.java index 10109d4..5038f66 100644 --- a/pf4j/src/test/java/ro/fortsoft/pf4j/ManifestPluginDescriptorFinderTest.java +++ b/pf4j/src/test/java/ro/fortsoft/pf4j/ManifestPluginDescriptorFinderTest.java @@ -85,6 +85,17 @@ public class ManifestPluginDescriptorFinderTest { * Test of find method, of class ManifestPluginDescriptorFinder. */ @Test(expected = PluginException.class) + public void testFindMissingPluginId() throws Exception { + + ManifestPluginDescriptorFinder instance = new DefaultPluginDescriptorFinder(new PluginClasspath()); + URL url = getClass().getResource("/test-plugin-6"); + 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()); diff --git a/pf4j/src/test/resources/test-plugin-6/classes/META-INF/MANIFEST.MF b/pf4j/src/test/resources/test-plugin-6/classes/META-INF/MANIFEST.MF new file mode 100644 index 0000000..b271753 --- /dev/null +++ b/pf4j/src/test/resources/test-plugin-6/classes/META-INF/MANIFEST.MF @@ -0,0 +1,13 @@ +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-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 + |