From b714dfe676a8c2ba90bb54a02897d8fbc02fe578 Mon Sep 17 00:00:00 2001 From: =?utf8?q?M=C3=A1rio=20Franco?= Date: Tue, 21 Jul 2015 16:00:24 +0100 Subject: [PATCH] Added fail on missing plugin id --- .../pf4j/ManifestPluginDescriptorFinderTest.java | 11 +++++++++++ .../test-plugin-6/classes/META-INF/MANIFEST.MF | 13 +++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 pf4j/src/test/resources/test-plugin-6/classes/META-INF/MANIFEST.MF 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 @@ -81,6 +81,17 @@ public class ManifestPluginDescriptorFinderTest { PluginDescriptor result = instance.find(new File(url.getPath())); } + /** + * 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. */ 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 + -- 2.39.5