From 5bd40245b24c6efa5f2d59de0987ac4229668555 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rio=20Franco?= Date: Tue, 21 Jul 2015 00:56:30 +0100 Subject: [PATCH 1/5] Added tests for DefaultPluginFactory and multiple improvements --- pf4j/pom.xml | 6 ++ .../java/ro/fortsoft/pf4j/PluginWrapper.java | 2 +- .../pf4j/DefaultPluginFactoryTest.java | 84 +++++++++++++++++++ .../pf4j/DefaultPluginRepositoryTest.java | 13 +-- .../pf4j/DefaultPluginStatusProviderTest.java | 51 +++++------ .../fortsoft/pf4j/plugin/FailTestPlugin.java | 24 ++++++ .../ro/fortsoft/pf4j/plugin/TestPlugin.java | 31 +++++++ pom.xml | 3 +- 8 files changed, 182 insertions(+), 32 deletions(-) create mode 100644 pf4j/src/test/java/ro/fortsoft/pf4j/DefaultPluginFactoryTest.java create mode 100644 pf4j/src/test/java/ro/fortsoft/pf4j/plugin/FailTestPlugin.java create mode 100644 pf4j/src/test/java/ro/fortsoft/pf4j/plugin/TestPlugin.java diff --git a/pf4j/pom.xml b/pf4j/pom.xml index 3c10d84..5c2cb9e 100644 --- a/pf4j/pom.xml +++ b/pf4j/pom.xml @@ -43,6 +43,12 @@ ${junit.version} test + + org.mockito + mockito-core + ${mockito.version} + test + diff --git a/pf4j/src/main/java/ro/fortsoft/pf4j/PluginWrapper.java b/pf4j/src/main/java/ro/fortsoft/pf4j/PluginWrapper.java index 3c3b6e1..45dbc1e 100644 --- a/pf4j/src/main/java/ro/fortsoft/pf4j/PluginWrapper.java +++ b/pf4j/src/main/java/ro/fortsoft/pf4j/PluginWrapper.java @@ -54,7 +54,7 @@ public class PluginWrapper { * for this plug-in. The class loader can be used to directly access * plug-in resources and classes. */ - public PluginClassLoader getPluginClassLoader() { + public ClassLoader getPluginClassLoader() { return pluginClassLoader; } diff --git a/pf4j/src/test/java/ro/fortsoft/pf4j/DefaultPluginFactoryTest.java b/pf4j/src/test/java/ro/fortsoft/pf4j/DefaultPluginFactoryTest.java new file mode 100644 index 0000000..bed82f9 --- /dev/null +++ b/pf4j/src/test/java/ro/fortsoft/pf4j/DefaultPluginFactoryTest.java @@ -0,0 +1,84 @@ +/* + * Copyright 2015 Decebal Suiu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package ro.fortsoft.pf4j; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import ro.fortsoft.pf4j.plugin.FailTestPlugin; +import ro.fortsoft.pf4j.plugin.TestPlugin; + +import static org.hamcrest.CoreMatchers.instanceOf; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertThat; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +/** + * + * @author Mario Franco + */ +public class DefaultPluginFactoryTest { + + public DefaultPluginFactoryTest() { + } + + @Before + public void setUp() { + } + + @After + public void tearDown() { + } + + /** + * Test of create method, of class DefaultPluginFactory. + */ + @Test + public void testCreate() { + PluginDescriptor pluginDescriptor = mock(PluginDescriptor.class); + when(pluginDescriptor.getPluginClass()).thenReturn(TestPlugin.class.getName()); + + 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); + assertNotNull(result); + assertThat(result, instanceOf(TestPlugin.class)); + } + + /** + * Test of create method, of class DefaultPluginFactory. + */ + @Test + public void testCreateFail() { + PluginDescriptor pluginDescriptor = mock(PluginDescriptor.class); + when(pluginDescriptor.getPluginClass()).thenReturn(FailTestPlugin.class.getName()); + + 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); + } +} diff --git a/pf4j/src/test/java/ro/fortsoft/pf4j/DefaultPluginRepositoryTest.java b/pf4j/src/test/java/ro/fortsoft/pf4j/DefaultPluginRepositoryTest.java index 7e2a6ec..3ae58af 100644 --- a/pf4j/src/test/java/ro/fortsoft/pf4j/DefaultPluginRepositoryTest.java +++ b/pf4j/src/test/java/ro/fortsoft/pf4j/DefaultPluginRepositoryTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Mario Franco. + * Copyright 2015 Decebal Suiu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,15 +19,16 @@ import java.io.File; import java.io.IOException; import java.util.List; import org.junit.After; -import org.junit.AfterClass; import org.junit.Before; -import org.junit.BeforeClass; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; import ro.fortsoft.pf4j.util.ZipFileFilter; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + /** * @@ -74,9 +75,9 @@ public class DefaultPluginRepositoryTest { public void testDeletePluginArchive() { DefaultPluginRepository instance = new DefaultPluginRepository(testFolder.getRoot(), new ZipFileFilter()); - assertEquals(true, instance.deletePluginArchive("/plugin-1")); + assertTrue(instance.deletePluginArchive("/plugin-1")); - assertEquals(false, instance.deletePluginArchive("/plugin-3")); + assertFalse(instance.deletePluginArchive("/plugin-3")); List result = instance.getPluginArchives(); diff --git a/pf4j/src/test/java/ro/fortsoft/pf4j/DefaultPluginStatusProviderTest.java b/pf4j/src/test/java/ro/fortsoft/pf4j/DefaultPluginStatusProviderTest.java index 5da32fc..85991c4 100644 --- a/pf4j/src/test/java/ro/fortsoft/pf4j/DefaultPluginStatusProviderTest.java +++ b/pf4j/src/test/java/ro/fortsoft/pf4j/DefaultPluginStatusProviderTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Mario Franco. + * Copyright 2015 Decebal Suiu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,7 +27,10 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + /** * @@ -71,9 +74,9 @@ public class DefaultPluginStatusProviderTest { setUpEnabled(); DefaultPluginStatusProvider instance = new DefaultPluginStatusProvider(testFolder.getRoot()); - assertEquals(false, instance.isPluginDisabled("plugin-1")); - assertEquals(true, instance.isPluginDisabled("plugin-2")); - assertEquals(true, instance.isPluginDisabled("plugin-3")); + assertFalse(instance.isPluginDisabled("plugin-1")); + assertTrue(instance.isPluginDisabled("plugin-2")); + assertTrue(instance.isPluginDisabled("plugin-3")); } /** @@ -83,9 +86,9 @@ public class DefaultPluginStatusProviderTest { public void testIsPluginDisabledWithEnableEmpty() { DefaultPluginStatusProvider instance = new DefaultPluginStatusProvider(testFolder.getRoot()); - assertEquals(false, instance.isPluginDisabled("plugin-1")); - assertEquals(true, instance.isPluginDisabled("plugin-2")); - assertEquals(false, instance.isPluginDisabled("plugin-3")); + assertFalse(instance.isPluginDisabled("plugin-1")); + assertTrue(instance.isPluginDisabled("plugin-2")); + assertFalse(instance.isPluginDisabled("plugin-3")); } /** @@ -96,10 +99,10 @@ public class DefaultPluginStatusProviderTest { setUpEnabled(); DefaultPluginStatusProvider instance = new DefaultPluginStatusProvider(testFolder.getRoot()); - assertEquals(true, instance.disablePlugin("plugin-1")); - assertEquals(true, instance.isPluginDisabled("plugin-1")); - assertEquals(true, instance.isPluginDisabled("plugin-2")); - assertEquals(true, instance.isPluginDisabled("plugin-3")); + assertTrue(instance.disablePlugin("plugin-1")); + assertTrue(instance.isPluginDisabled("plugin-1")); + assertTrue(instance.isPluginDisabled("plugin-2")); + assertTrue(instance.isPluginDisabled("plugin-3")); } /** @@ -109,10 +112,10 @@ public class DefaultPluginStatusProviderTest { public void testDisablePluginWithEnableEmpty() { DefaultPluginStatusProvider instance = new DefaultPluginStatusProvider(testFolder.getRoot()); - assertEquals(true, instance.disablePlugin("plugin-1")); - assertEquals(true, instance.isPluginDisabled("plugin-1")); - assertEquals(true, instance.isPluginDisabled("plugin-2")); - assertEquals(false, instance.isPluginDisabled("plugin-3")); + assertTrue(instance.disablePlugin("plugin-1")); + assertTrue(instance.isPluginDisabled("plugin-1")); + assertTrue(instance.isPluginDisabled("plugin-2")); + assertFalse(instance.isPluginDisabled("plugin-3")); } /** @@ -123,10 +126,10 @@ public class DefaultPluginStatusProviderTest { setUpEnabled(); DefaultPluginStatusProvider instance = new DefaultPluginStatusProvider(testFolder.getRoot()); - assertEquals(true, instance.enablePlugin("plugin-2")); - assertEquals(false, instance.isPluginDisabled("plugin-1")); - assertEquals(false, instance.isPluginDisabled("plugin-2")); - assertEquals(true, instance.isPluginDisabled("plugin-3")); + assertTrue(instance.enablePlugin("plugin-2")); + assertFalse(instance.isPluginDisabled("plugin-1")); + assertFalse(instance.isPluginDisabled("plugin-2")); + assertTrue(instance.isPluginDisabled("plugin-3")); } /** @@ -136,10 +139,10 @@ public class DefaultPluginStatusProviderTest { public void testEnablePluginWithEnableEmpty() { DefaultPluginStatusProvider instance = new DefaultPluginStatusProvider(testFolder.getRoot()); - assertEquals(true, instance.enablePlugin("plugin-2")); - assertEquals(false, instance.isPluginDisabled("plugin-1")); - assertEquals(false, instance.isPluginDisabled("plugin-2")); - assertEquals(false, instance.isPluginDisabled("plugin-3")); + assertTrue(instance.enablePlugin("plugin-2")); + assertFalse(instance.isPluginDisabled("plugin-1")); + assertFalse(instance.isPluginDisabled("plugin-2")); + assertFalse(instance.isPluginDisabled("plugin-3")); } } diff --git a/pf4j/src/test/java/ro/fortsoft/pf4j/plugin/FailTestPlugin.java b/pf4j/src/test/java/ro/fortsoft/pf4j/plugin/FailTestPlugin.java new file mode 100644 index 0000000..0f4ba65 --- /dev/null +++ b/pf4j/src/test/java/ro/fortsoft/pf4j/plugin/FailTestPlugin.java @@ -0,0 +1,24 @@ +/* + * Copyright 2015 Decebal Suiu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package ro.fortsoft.pf4j.plugin; + +/** + * + * @author Mario Franco + */ +public class FailTestPlugin { + +} diff --git a/pf4j/src/test/java/ro/fortsoft/pf4j/plugin/TestPlugin.java b/pf4j/src/test/java/ro/fortsoft/pf4j/plugin/TestPlugin.java new file mode 100644 index 0000000..3557a16 --- /dev/null +++ b/pf4j/src/test/java/ro/fortsoft/pf4j/plugin/TestPlugin.java @@ -0,0 +1,31 @@ +/* + * Copyright 2015 Decebal Suiu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package ro.fortsoft.pf4j.plugin; + +import ro.fortsoft.pf4j.Plugin; +import ro.fortsoft.pf4j.PluginWrapper; + +/** + * + * @author Mario Franco + */ +public class TestPlugin extends Plugin { + + public TestPlugin(PluginWrapper wrapper) { + super(wrapper); + } + +} diff --git a/pom.xml b/pom.xml index a0bd22e..19732a8 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,8 @@ 1.7 4.12 - 2.7 + 4.12 + 2.0.28-beta 3.1.0 From a8ab3ee26c8fb4bea036e92b3de5d682da2c0fb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rio=20Franco?= Date: Tue, 21 Jul 2015 01:03:38 +0100 Subject: [PATCH 2/5] Fix versions --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 19732a8..11ae27d 100644 --- a/pom.xml +++ b/pom.xml @@ -34,9 +34,9 @@ UTF-8 1.7 - 4.12 4.12 2.0.28-beta + 2.7 3.1.0 From 54c6feac673bec136e195ca11a7bd2bd23c8be92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rio=20Franco?= Date: Tue, 21 Jul 2015 01:10:26 +0100 Subject: [PATCH 3/5] Add another fail test --- .../pf4j/DefaultPluginFactoryTest.java | 20 +++++++++++++ .../pf4j/plugin/AnotherFailTestPlugin.java | 30 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 pf4j/src/test/java/ro/fortsoft/pf4j/plugin/AnotherFailTestPlugin.java diff --git a/pf4j/src/test/java/ro/fortsoft/pf4j/DefaultPluginFactoryTest.java b/pf4j/src/test/java/ro/fortsoft/pf4j/DefaultPluginFactoryTest.java index bed82f9..8ab6d50 100644 --- a/pf4j/src/test/java/ro/fortsoft/pf4j/DefaultPluginFactoryTest.java +++ b/pf4j/src/test/java/ro/fortsoft/pf4j/DefaultPluginFactoryTest.java @@ -18,6 +18,7 @@ package ro.fortsoft.pf4j; import org.junit.After; import org.junit.Before; import org.junit.Test; +import ro.fortsoft.pf4j.plugin.AnotherFailTestPlugin; import ro.fortsoft.pf4j.plugin.FailTestPlugin; import ro.fortsoft.pf4j.plugin.TestPlugin; @@ -81,4 +82,23 @@ public class DefaultPluginFactoryTest { Plugin result = instance.create(pluginWrapper); assertNull(result); } + + /** + * Test of create method, of class DefaultPluginFactory. + */ + @Test + public void testCreateFailConstructor() { + PluginDescriptor pluginDescriptor = mock(PluginDescriptor.class); + when(pluginDescriptor.getPluginClass()).thenReturn(AnotherFailTestPlugin.class.getName()); + + 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); + } + } diff --git a/pf4j/src/test/java/ro/fortsoft/pf4j/plugin/AnotherFailTestPlugin.java b/pf4j/src/test/java/ro/fortsoft/pf4j/plugin/AnotherFailTestPlugin.java new file mode 100644 index 0000000..5cfe611 --- /dev/null +++ b/pf4j/src/test/java/ro/fortsoft/pf4j/plugin/AnotherFailTestPlugin.java @@ -0,0 +1,30 @@ +/* + * Copyright 2015 Decebal Suiu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package ro.fortsoft.pf4j.plugin; + +import ro.fortsoft.pf4j.Plugin; + +/** + * + * @author Mario Franco + */ +public class AnotherFailTestPlugin extends Plugin { + + public AnotherFailTestPlugin() { + super(null); + } + +} From 10949f3257b7d7cf1c90506cf1c29cb0eebcf488 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rio=20Franco?= Date: Tue, 21 Jul 2015 01:18:39 +0100 Subject: [PATCH 4/5] Added tests for DefaultExtensionFactory --- .../pf4j/DefaultExtensionFactoryTest.java | 52 +++++++++++++++++++ .../fortsoft/pf4j/plugin/TestExtension.java | 24 +++++++++ 2 files changed, 76 insertions(+) create mode 100644 pf4j/src/test/java/ro/fortsoft/pf4j/DefaultExtensionFactoryTest.java create mode 100644 pf4j/src/test/java/ro/fortsoft/pf4j/plugin/TestExtension.java diff --git a/pf4j/src/test/java/ro/fortsoft/pf4j/DefaultExtensionFactoryTest.java b/pf4j/src/test/java/ro/fortsoft/pf4j/DefaultExtensionFactoryTest.java new file mode 100644 index 0000000..9ea8559 --- /dev/null +++ b/pf4j/src/test/java/ro/fortsoft/pf4j/DefaultExtensionFactoryTest.java @@ -0,0 +1,52 @@ +/* + * Copyright 2015 Decebal Suiu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package ro.fortsoft.pf4j; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import ro.fortsoft.pf4j.plugin.TestExtension; + +import static org.junit.Assert.*; + +/** + * + * @author Mario Franco + */ +public class DefaultExtensionFactoryTest { + + public DefaultExtensionFactoryTest() { + } + + @Before + public void setUp() { + } + + @After + public void tearDown() { + } + + /** + * Test of create method, of class DefaultExtensionFactory. + */ + @Test + public void testCreate() { + DefaultExtensionFactory instance = new DefaultExtensionFactory(); + Object result = instance.create(TestExtension.class); + assertNotNull(result); + } + +} diff --git a/pf4j/src/test/java/ro/fortsoft/pf4j/plugin/TestExtension.java b/pf4j/src/test/java/ro/fortsoft/pf4j/plugin/TestExtension.java new file mode 100644 index 0000000..f0e9667 --- /dev/null +++ b/pf4j/src/test/java/ro/fortsoft/pf4j/plugin/TestExtension.java @@ -0,0 +1,24 @@ +/* + * Copyright 2015 Decebal Suiu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package ro.fortsoft.pf4j.plugin; + +/** + * + * @author Mario Franco + */ +public class TestExtension { + +} From 8203fc7f42afc81059885233b7ffed12cd29c669 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rio=20Franco?= Date: Tue, 21 Jul 2015 14:08:51 +0100 Subject: [PATCH 5/5] Clean up the tests --- .../ro/fortsoft/pf4j/DefaultExtensionFactoryTest.java | 11 ----------- .../ro/fortsoft/pf4j/DefaultPluginFactoryTest.java | 11 ----------- .../ro/fortsoft/pf4j/DefaultPluginRepositoryTest.java | 7 ------- .../pf4j/DefaultPluginStatusProviderTest.java | 8 -------- .../java/ro/fortsoft/pf4j/plugin/TestExtension.java | 4 +++- 5 files changed, 3 insertions(+), 38 deletions(-) diff --git a/pf4j/src/test/java/ro/fortsoft/pf4j/DefaultExtensionFactoryTest.java b/pf4j/src/test/java/ro/fortsoft/pf4j/DefaultExtensionFactoryTest.java index 9ea8559..506a393 100644 --- a/pf4j/src/test/java/ro/fortsoft/pf4j/DefaultExtensionFactoryTest.java +++ b/pf4j/src/test/java/ro/fortsoft/pf4j/DefaultExtensionFactoryTest.java @@ -28,17 +28,6 @@ import static org.junit.Assert.*; */ public class DefaultExtensionFactoryTest { - public DefaultExtensionFactoryTest() { - } - - @Before - public void setUp() { - } - - @After - public void tearDown() { - } - /** * Test of create method, of class DefaultExtensionFactory. */ diff --git a/pf4j/src/test/java/ro/fortsoft/pf4j/DefaultPluginFactoryTest.java b/pf4j/src/test/java/ro/fortsoft/pf4j/DefaultPluginFactoryTest.java index 8ab6d50..203aa02 100644 --- a/pf4j/src/test/java/ro/fortsoft/pf4j/DefaultPluginFactoryTest.java +++ b/pf4j/src/test/java/ro/fortsoft/pf4j/DefaultPluginFactoryTest.java @@ -35,17 +35,6 @@ import static org.mockito.Mockito.when; */ public class DefaultPluginFactoryTest { - public DefaultPluginFactoryTest() { - } - - @Before - public void setUp() { - } - - @After - public void tearDown() { - } - /** * Test of create method, of class DefaultPluginFactory. */ diff --git a/pf4j/src/test/java/ro/fortsoft/pf4j/DefaultPluginRepositoryTest.java b/pf4j/src/test/java/ro/fortsoft/pf4j/DefaultPluginRepositoryTest.java index 3ae58af..b2ccbd0 100644 --- a/pf4j/src/test/java/ro/fortsoft/pf4j/DefaultPluginRepositoryTest.java +++ b/pf4j/src/test/java/ro/fortsoft/pf4j/DefaultPluginRepositoryTest.java @@ -39,9 +39,6 @@ public class DefaultPluginRepositoryTest { @Rule public TemporaryFolder testFolder = new TemporaryFolder(); - public DefaultPluginRepositoryTest() { - } - @Before public void setUp() throws IOException { testFolder.newFile("plugin-1.zip"); @@ -49,10 +46,6 @@ public class DefaultPluginRepositoryTest { testFolder.newFile("plugin-3.zi_"); } - @After - public void tearDown() { - } - /** * Test of getPluginArchives method, of class DefaultPluginRepository. */ diff --git a/pf4j/src/test/java/ro/fortsoft/pf4j/DefaultPluginStatusProviderTest.java b/pf4j/src/test/java/ro/fortsoft/pf4j/DefaultPluginStatusProviderTest.java index 85991c4..72ef17b 100644 --- a/pf4j/src/test/java/ro/fortsoft/pf4j/DefaultPluginStatusProviderTest.java +++ b/pf4j/src/test/java/ro/fortsoft/pf4j/DefaultPluginStatusProviderTest.java @@ -27,7 +27,6 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; -import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -41,9 +40,6 @@ public class DefaultPluginStatusProviderTest { @Rule public TemporaryFolder testFolder = new TemporaryFolder(); - public DefaultPluginStatusProviderTest() { - } - @Before public void setUp() throws IOException { File file = testFolder.newFile("disabled.txt"); @@ -62,10 +58,6 @@ public class DefaultPluginStatusProviderTest { } } - @After - public void tearDown() { - } - /** * Test of isPluginDisabled method, of class DefaultPluginStatusProvider. */ diff --git a/pf4j/src/test/java/ro/fortsoft/pf4j/plugin/TestExtension.java b/pf4j/src/test/java/ro/fortsoft/pf4j/plugin/TestExtension.java index f0e9667..3d74ffb 100644 --- a/pf4j/src/test/java/ro/fortsoft/pf4j/plugin/TestExtension.java +++ b/pf4j/src/test/java/ro/fortsoft/pf4j/plugin/TestExtension.java @@ -15,10 +15,12 @@ */ package ro.fortsoft.pf4j.plugin; +import ro.fortsoft.pf4j.ExtensionPoint; + /** * * @author Mario Franco */ -public class TestExtension { +public class TestExtension implements ExtensionPoint { }