diff --git a/src/test/java/org/codehaus/plexus/classworlds/ClassWorldTest.java b/src/test/java/org/codehaus/plexus/classworlds/ClassWorldTest.java index 9ceb25e..9a83647 100644 --- a/src/test/java/org/codehaus/plexus/classworlds/ClassWorldTest.java +++ b/src/test/java/org/codehaus/plexus/classworlds/ClassWorldTest.java @@ -36,36 +36,36 @@ class ClassWorldTest extends AbstractClassWorldsTestCase { private ClassWorld world; @BeforeEach - public void setUp() { + void setUp() { this.world = new ClassWorld(); } @AfterEach - public void tearDown() { + void tearDown() { this.world = null; } @Test - void testEmpty() { + void empty() { assertTrue(this.world.getRealms().isEmpty()); } @Test - void testNewRealm() throws Exception { + void newRealm() throws Exception { ClassRealm realm = this.world.newRealm("foo"); assertNotNull(realm); } @Test - void testGetRealm() throws Exception { + void getRealm() throws Exception { ClassRealm realm = this.world.newRealm("foo"); assertSame(realm, this.world.getRealm("foo")); } @Test - void testNewRealm_Duplicate() { + void newRealmDuplicate() { try { this.world.newRealm("foo"); this.world.newRealm("foo"); @@ -81,7 +81,7 @@ void testNewRealm_Duplicate() { } @Test - void testGetRealm_NoSuch() { + void getRealmNoSuch() { try { this.world.getRealm("foo"); fail("throw NoSuchRealmException"); @@ -95,7 +95,7 @@ void testGetRealm_NoSuch() { } @Test - void testGetRealms() throws Exception { + void getRealms() throws Exception { assertTrue(this.world.getRealms().isEmpty()); ClassRealm foo = this.world.newRealm("foo"); @@ -112,7 +112,7 @@ void testGetRealms() throws Exception { } @Test - void testPLX334() throws Exception { + void plx334() throws Exception { ClassLoader loader = new URLClassLoader(new URL[] {getJarUrl("component1-1.0.jar")}); world.newRealm("netbeans", loader); ClassRealm plexus = world.newRealm("plexus"); diff --git a/src/test/java/org/codehaus/plexus/classworlds/UrlUtilsTest.java b/src/test/java/org/codehaus/plexus/classworlds/UrlUtilsTest.java index b8476d7..94425f2 100644 --- a/src/test/java/org/codehaus/plexus/classworlds/UrlUtilsTest.java +++ b/src/test/java/org/codehaus/plexus/classworlds/UrlUtilsTest.java @@ -23,7 +23,7 @@ class UrlUtilsTest { @Test - public void testNormalizeUrlPath() { + void normalizeUrlPath() { assertEquals("org/codehaus/Test.class", UrlUtils.normalizeUrlPath("org/codehaus/Test.class")); assertEquals("org/Test.class", UrlUtils.normalizeUrlPath("org/codehaus/../Test.class")); assertEquals("../../some.jar/org/Test.class", UrlUtils.normalizeUrlPath("../../some.jar/org/Test.class")); diff --git a/src/test/java/org/codehaus/plexus/classworlds/launcher/ConfigurationParserTest.java b/src/test/java/org/codehaus/plexus/classworlds/launcher/ConfigurationParserTest.java index 7495d70..56e2638 100644 --- a/src/test/java/org/codehaus/plexus/classworlds/launcher/ConfigurationParserTest.java +++ b/src/test/java/org/codehaus/plexus/classworlds/launcher/ConfigurationParserTest.java @@ -12,7 +12,7 @@ class ConfigurationParserTest extends AbstractClassWorldsTestCase { final ConfigurationParser configurator = new ConfigurationParser(null, System.getProperties()); @Test - void testFilter_Unterminated() { + void filterUnterminated() { try { this.configurator.filter("${cheese"); fail("throw ConfigurationException"); @@ -23,7 +23,7 @@ void testFilter_Unterminated() { } @Test - void testFilter_Solitary() throws Exception { + void filterSolitary() throws Exception { System.setProperty("classworlds.test.prop", "test prop value"); String result = this.configurator.filter("${classworlds.test.prop}"); @@ -32,7 +32,7 @@ void testFilter_Solitary() throws Exception { } @Test - void testFilter_AtStart() throws Exception { + void filterAtStart() throws Exception { System.setProperty("classworlds.test.prop", "test prop value"); String result = this.configurator.filter("${classworlds.test.prop}cheese"); @@ -41,7 +41,7 @@ void testFilter_AtStart() throws Exception { } @Test - void testFilter_AtEnd() throws Exception { + void filterAtEnd() throws Exception { System.setProperty("classworlds.test.prop", "test prop value"); String result = this.configurator.filter("cheese${classworlds.test.prop}"); @@ -50,7 +50,7 @@ void testFilter_AtEnd() throws Exception { } @Test - void testFilter_Multiple() throws Exception { + void filterMultiple() throws Exception { System.setProperty("classworlds.test.prop.one", "test prop value one"); System.setProperty("classworlds.test.prop.two", "test prop value two"); @@ -62,7 +62,7 @@ void testFilter_Multiple() throws Exception { } @Test - void testFilter_NonExistent() { + void filterNonExistent() { try { this.configurator.filter("${gollygeewillikers}"); fail("throw ConfigurationException"); @@ -73,7 +73,7 @@ void testFilter_NonExistent() { } @Test - void testFilter_InMiddle() throws Exception { + void filterInMiddle() throws Exception { System.setProperty("classworlds.test.prop", "test prop value"); String result = this.configurator.filter("cheese${classworlds.test.prop}toast"); diff --git a/src/test/java/org/codehaus/plexus/classworlds/launcher/ConfiguratorTest.java b/src/test/java/org/codehaus/plexus/classworlds/launcher/ConfiguratorTest.java index d6718f9..116f433 100644 --- a/src/test/java/org/codehaus/plexus/classworlds/launcher/ConfiguratorTest.java +++ b/src/test/java/org/codehaus/plexus/classworlds/launcher/ConfiguratorTest.java @@ -42,13 +42,13 @@ class ConfiguratorTest extends AbstractClassWorldsTestCase { private Configurator configurator; @BeforeEach - public void setUp() { + void setUp() { this.launcher = new Launcher(); this.configurator = new Configurator(this.launcher); } @AfterEach - public void tearDown() { + void tearDown() { this.launcher = null; this.configurator = null; System.getProperties().remove("set.using.existent"); @@ -60,7 +60,7 @@ public void tearDown() { } @Test - void testConfigure_Nonexistent() throws Exception { + void configureNonexistent() throws Exception { try { this.configurator.configure(getConfigPath("notfound.conf")); fail("throw FileNotFoundException"); @@ -70,7 +70,7 @@ void testConfigure_Nonexistent() throws Exception { } @Test - void testConfigure_DuplicateMain() throws Exception { + void configureDuplicateMain() throws Exception { try { this.configurator.configure(getConfigPath("dupe-main.conf")); fail("throw ConfigurationException"); @@ -81,7 +81,7 @@ void testConfigure_DuplicateMain() throws Exception { } @Test - void testConfigure_DuplicateRealm() throws Exception { + void configureDuplicateRealm() throws Exception { try { this.configurator.configure(getConfigPath("dupe-realm.conf")); fail("throw DuplicateRealmException"); @@ -92,7 +92,7 @@ void testConfigure_DuplicateRealm() throws Exception { } @Test - void testConfigure_EarlyImport() throws Exception { + void configureEarlyImport() throws Exception { try { this.configurator.configure(getConfigPath("early-import.conf")); fail("throw ConfigurationException"); @@ -103,7 +103,7 @@ void testConfigure_EarlyImport() throws Exception { } @Test - void testConfigure_RealmSyntax() throws Exception { + void configureRealmSyntax() throws Exception { try { this.configurator.configure(getConfigPath("realm-syntax.conf")); fail("throw ConfigurationException"); @@ -114,7 +114,7 @@ void testConfigure_RealmSyntax() throws Exception { } @Test - void testConfigure_Valid() throws Exception { + void configureValid() throws Exception { this.configurator.configure(getConfigPath("valid.conf")); assertEquals("org.apache.maven.app.App", this.launcher.getMainClassName()); @@ -161,7 +161,7 @@ void testConfigure_Valid() throws Exception { } @Test - void testConfigure_Optionally_NonExistent() throws Exception { + void configureOptionallyNonExistent() throws Exception { this.configurator.configure(getConfigPath("optionally-nonexistent.conf")); assertEquals("org.apache.maven.app.App", this.launcher.getMainClassName()); @@ -184,7 +184,7 @@ void testConfigure_Optionally_NonExistent() throws Exception { } @Test - void testConfigure_Optionally_Existent() throws Exception { + void configureOptionallyExistent() throws Exception { this.configurator.configure(getConfigPath("optionally-existent.conf")); assertEquals("org.apache.maven.app.App", this.launcher.getMainClassName()); @@ -209,7 +209,7 @@ void testConfigure_Optionally_Existent() throws Exception { } @Test - void testConfigure_Unhandled() throws Exception { + void configureUnhandled() throws Exception { try { this.configurator.configure(getConfigPath("unhandled.conf")); fail("throw ConfigurationException"); @@ -220,7 +220,7 @@ void testConfigure_Unhandled() throws Exception { } @Test - void testSet_Using_Existent() throws Exception { + void setUsingExistent() throws Exception { assertNull(System.getProperty("set.using.existent")); this.configurator.configure(getConfigPath("set-using-existent.conf")); @@ -229,7 +229,7 @@ void testSet_Using_Existent() throws Exception { } @Test - void testSet_Using_NonExistent() throws Exception { + void setUsingNonExistent() throws Exception { assertNull(System.getProperty("set.using.nonexistent")); this.configurator.configure(getConfigPath("set-using-nonexistent.conf")); @@ -238,7 +238,7 @@ void testSet_Using_NonExistent() throws Exception { } @Test - void testSet_Using_NonExistent_Default() throws Exception { + void setUsingNonExistentDefault() throws Exception { assertNull(System.getProperty("set.using.nonexistent.default")); this.configurator.configure(getConfigPath("set-using-nonexistent.conf")); @@ -247,7 +247,7 @@ void testSet_Using_NonExistent_Default() throws Exception { } @Test - void testSet_Using_NonExistent_Override() throws Exception { + void setUsingNonExistentOverride() throws Exception { assertNull(System.getProperty("set.using.default")); System.setProperty("set.using.default", "testSet_Using_NonExistent_Override"); @@ -257,7 +257,7 @@ void testSet_Using_NonExistent_Override() throws Exception { } @Test - void testSet_Using_Existent_Override() throws Exception { + void setUsingExistentOverride() throws Exception { assertNull(System.getProperty("set.using.existent")); System.setProperty("set.using.existent", "testSet_Using_Existent_Override"); @@ -267,7 +267,7 @@ void testSet_Using_Existent_Override() throws Exception { } @Test - void testSet_Using_Existent_Default() throws Exception { + void setUsingExistentDefault() throws Exception { assertNull(System.getProperty("set.using.default")); this.configurator.configure(getConfigPath("set-using-existent.conf")); @@ -276,7 +276,7 @@ void testSet_Using_Existent_Default() throws Exception { } @Test - void testSet_Using_Missing_Default() throws Exception { + void setUsingMissingDefault() throws Exception { assertNull(System.getProperty("set.using.missing")); this.configurator.configure(getConfigPath("set-using-missing.conf")); @@ -285,7 +285,7 @@ void testSet_Using_Missing_Default() throws Exception { } @Test - void testSet_Using_Missing_Override() throws Exception { + void setUsingMissingOverride() throws Exception { assertNull(System.getProperty("set.using.missing")); System.setProperty("set.using.missing", "testSet_Using_Missing_Override"); @@ -295,7 +295,7 @@ void testSet_Using_Missing_Override() throws Exception { } @Test - void testSet_Using_Filtered_Default() throws Exception { + void setUsingFilteredDefault() throws Exception { assertNull(System.getProperty("set.using.filtered.default")); this.configurator.configure(getConfigPath("set-using-missing.conf")); @@ -305,7 +305,7 @@ void testSet_Using_Filtered_Default() throws Exception { @SuppressWarnings("OptionalGetWithoutIsPresent") @Test - void testFromFromFrom() throws Exception { + void fromFromFrom() throws Exception { this.configurator.configure(getConfigPath("valid-from-from-from.conf")); assertEquals("com.from.from.from.Main", this.launcher.getMainClassName()); diff --git a/src/test/java/org/codehaus/plexus/classworlds/launcher/LauncherTest.java b/src/test/java/org/codehaus/plexus/classworlds/launcher/LauncherTest.java index 9127a1b..7ebfe86 100644 --- a/src/test/java/org/codehaus/plexus/classworlds/launcher/LauncherTest.java +++ b/src/test/java/org/codehaus/plexus/classworlds/launcher/LauncherTest.java @@ -32,7 +32,7 @@ class LauncherTest extends AbstractClassWorldsTestCase { private Launcher launcher; @BeforeEach - public void setUp() { + void setUp() { System.setProperty("java.protocol.handler.pkgs", "org.codehaus.classworlds.protocol"); this.launcher = new Launcher(); @@ -41,12 +41,12 @@ public void setUp() { } @AfterEach - public void tearDown() { + void tearDown() { this.launcher = null; } @Test - void testConfigure_Valid() throws Exception { + void configureValid() throws Exception { launcher.configure(getConfigPath("valid-launch.conf")); Class mainClass = launcher.getMainClass(); @@ -59,14 +59,14 @@ void testConfigure_Valid() throws Exception { } @Test - void testLaunch_ValidStandard() throws Exception { + void launchValidStandard() throws Exception { launcher.configure(getConfigPath("valid-launch.conf")); launcher.launch(new String[] {}); } @Test - void testLaunch_ValidStandardExitCode() throws Exception { + void launchValidStandardExitCode() throws Exception { launcher.configure(getConfigPath("valid-launch-exitCode.conf")); launcher.launch(new String[] {}); @@ -75,14 +75,14 @@ void testLaunch_ValidStandardExitCode() throws Exception { } @Test - void testLaunch_ValidEnhanced() throws Exception { + void launchValidEnhanced() throws Exception { launcher.configure(getConfigPath("valid-enh-launch.conf")); launcher.launch(new String[] {}); } @Test - void testLaunch_ValidEnhancedExitCode() throws Exception { + void launchValidEnhancedExitCode() throws Exception { launcher.configure(getConfigPath("valid-enh-launch-exitCode.conf")); launcher.launch(new String[] {}); @@ -91,7 +91,7 @@ void testLaunch_ValidEnhancedExitCode() throws Exception { } @Test - void testLaunch_NoSuchMethod() throws Exception { + void launchNoSuchMethod() throws Exception { launcher.configure(getConfigPath("launch-nomethod.conf")); try { @@ -103,7 +103,7 @@ void testLaunch_NoSuchMethod() throws Exception { } @Test - void testLaunch_ClassNotFound() throws Exception { + void launchClassNotFound() throws Exception { launcher.configure(getConfigPath("launch-noclass.conf")); try { diff --git a/src/test/java/org/codehaus/plexus/classworlds/realm/ClassRealmImplTest.java b/src/test/java/org/codehaus/plexus/classworlds/realm/ClassRealmImplTest.java index 8ca4ce1..6fb6184 100644 --- a/src/test/java/org/codehaus/plexus/classworlds/realm/ClassRealmImplTest.java +++ b/src/test/java/org/codehaus/plexus/classworlds/realm/ClassRealmImplTest.java @@ -33,17 +33,17 @@ class ClassRealmImplTest extends AbstractClassWorldsTestCase { private ClassWorld world; @BeforeEach - public void setUp() { + void setUp() { this.world = new ClassWorld(); } @AfterEach - public void tearDown() { + void tearDown() { this.world = null; } @Test - void testNewRealm() throws Exception { + void newRealm() throws Exception { ClassRealm realm = this.world.newRealm("foo"); assertNotNull(realm); @@ -54,14 +54,14 @@ void testNewRealm() throws Exception { } @Test - void testLocateSourceRealm_NoImports() { + void locateSourceRealmNoImports() { ClassRealm realm = new ClassRealm(this.world, "foo", null); assertSame(null, realm.getImportClassLoader("com.werken.Stuff")); } @Test - void testLocateSourceRealm_SimpleImport() throws Exception { + void locateSourceRealmSimpleImport() throws Exception { ClassRealm mainRealm = this.world.newRealm("main"); ClassRealm werkflowRealm = this.world.newRealm("werkflow"); @@ -82,7 +82,7 @@ void testLocateSourceRealm_SimpleImport() throws Exception { } @Test - void testLocateSourceRealm_MultipleImport() throws Exception { + void locateSourceRealmMultipleImport() throws Exception { ClassRealm mainRealm = this.world.newRealm("main"); ClassRealm werkflowRealm = this.world.newRealm("werkflow"); @@ -107,7 +107,7 @@ void testLocateSourceRealm_MultipleImport() throws Exception { } @Test - void testLocateSourceRealm_Hierachy() throws Exception { + void locateSourceRealmHierachy() throws Exception { ClassRealm mainRealm = this.world.newRealm("main"); ClassRealm fooRealm = this.world.newRealm("foo"); @@ -140,7 +140,7 @@ void testLocateSourceRealm_Hierachy() throws Exception { } @Test - void testLocateSourceRealm_Hierachy_Reverse() throws Exception { + void locateSourceRealmHierachyReverse() throws Exception { ClassRealm fooBarBazRealm = this.world.newRealm("fooBarBaz"); ClassRealm fooBarRealm = this.world.newRealm("fooBar"); @@ -173,7 +173,7 @@ void testLocateSourceRealm_Hierachy_Reverse() throws Exception { } @Test - void testLoadClass_SystemClass() throws Exception { + void loadClassSystemClass() throws Exception { ClassRealm mainRealm = this.world.newRealm("main"); Class cls = mainRealm.loadClass("java.lang.Object"); @@ -182,7 +182,7 @@ void testLoadClass_SystemClass() throws Exception { } @Test - void testLoadClass_NonSystemClass() throws Exception { + void loadClassNonSystemClass() throws Exception { ClassRealm mainRealm = this.world.newRealm("main"); try { @@ -197,7 +197,7 @@ void testLoadClass_NonSystemClass() throws Exception { } @Test - void testLoadClass_ClassWorldsClass() throws Exception { + void loadClassClassWorldsClass() throws Exception { ClassRealm mainRealm = this.world.newRealm("main"); Class cls = mainRealm.loadClass("org.codehaus.plexus.classworlds.ClassWorld"); @@ -208,7 +208,7 @@ void testLoadClass_ClassWorldsClass() throws Exception { } @Test - void testLoadClass_Local() throws Exception { + void loadClassLocal() throws Exception { ClassRealm mainRealm = this.world.newRealm("main"); try { @@ -233,7 +233,7 @@ void testLoadClass_Local() throws Exception { } @Test - void testLoadClass_Imported() throws Exception { + void loadClassImported() throws Exception { ClassRealm mainRealm = this.world.newRealm("main"); ClassRealm realmA = this.world.newRealm("realmA"); @@ -274,7 +274,7 @@ void testLoadClass_Imported() throws Exception { } @Test - void testLoadClass_Package() throws Exception { + void loadClassPackage() throws Exception { ClassRealm realmA = this.world.newRealm("realmA"); realmA.addURL(getJarUrl("a.jar")); @@ -288,7 +288,7 @@ void testLoadClass_Package() throws Exception { } @Test - void testLoadClass_Complex() throws Exception { + void loadClassComplex() throws Exception { ClassRealm realmA = this.world.newRealm("realmA"); ClassRealm realmB = this.world.newRealm("realmB"); ClassRealm realmC = this.world.newRealm("realmC"); @@ -370,7 +370,7 @@ void testLoadClass_Complex() throws Exception { } @Test - void testLoadClass_ClassWorldsClassRepeatedly() throws Exception { + void loadClassClassWorldsClassRepeatedly() throws Exception { ClassRealm mainRealm = this.world.newRealm("main"); for (int i = 0; i < 100; i++) { @@ -383,14 +383,14 @@ void testLoadClass_ClassWorldsClassRepeatedly() throws Exception { } @Test - void testLoadClassWithModuleName_Java9() { + void loadClassWithModuleNameJava9() { final ExtendedClassRealm mainRealm = new ExtendedClassRealm(world); mainRealm.addURL(getJarUrl("a.jar")); assertNotNull(mainRealm.simulateLoadClassFromModule("a.A")); } @Test - void testGetResources_BaseBeforeSelf() throws Exception { + void getResourcesBaseBeforeSelf() throws Exception { String resource = "common.properties"; ClassRealm base = this.world.newRealm("realmA"); @@ -417,7 +417,7 @@ void testGetResources_BaseBeforeSelf() throws Exception { } @Test - void testGetResources_SelfBeforeParent() throws Exception { + void getResourcesSelfBeforeParent() throws Exception { String resource = "common.properties"; ClassRealm parent = this.world.newRealm("realmA"); diff --git a/src/test/java/org/codehaus/plexus/classworlds/realm/DefaultClassRealmTest.java b/src/test/java/org/codehaus/plexus/classworlds/realm/DefaultClassRealmTest.java index 7751a68..3360f8b 100644 --- a/src/test/java/org/codehaus/plexus/classworlds/realm/DefaultClassRealmTest.java +++ b/src/test/java/org/codehaus/plexus/classworlds/realm/DefaultClassRealmTest.java @@ -40,7 +40,7 @@ class DefaultClassRealmTest extends AbstractClassWorldsTestCase { // ---------------------------------------------------------------------- @Test - void testLoadClassFromRealm() throws Exception { + void loadClassFromRealm() throws Exception { ClassRealm mainRealm = new ClassRealm(new ClassWorld(), "main", null); mainRealm.addURL(getJarUrl("component0-1.0.jar")); @@ -49,7 +49,7 @@ void testLoadClassFromRealm() throws Exception { } @Test - void testLoadClassFromChildRealmWhereClassIsLocatedInParentRealm() throws Exception { + void loadClassFromChildRealmWhereClassIsLocatedInParentRealm() throws Exception { ClassRealm mainRealm = new ClassRealm(new ClassWorld(), "main", null); mainRealm.addURL(getJarUrl("component0-1.0.jar")); @@ -60,7 +60,7 @@ void testLoadClassFromChildRealmWhereClassIsLocatedInParentRealm() throws Except } @Test - void testLoadClassFromChildRealmWhereClassIsLocatedInGrantParentRealm() throws Exception { + void loadClassFromChildRealmWhereClassIsLocatedInGrantParentRealm() throws Exception { ClassRealm mainRealm = new ClassRealm(new ClassWorld(), "main", null); mainRealm.addURL(getJarUrl("component0-1.0.jar")); @@ -73,7 +73,7 @@ void testLoadClassFromChildRealmWhereClassIsLocatedInGrantParentRealm() throws E } @Test - void testLoadClassFromChildRealmWhereClassIsLocatedInBothChildRealmAndParentRealm() throws Exception { + void loadClassFromChildRealmWhereClassIsLocatedInBothChildRealmAndParentRealm() throws Exception { ClassRealm mainRealm = new ClassRealm(new ClassWorld(), "parent", null); mainRealm.addURL(getJarUrl("component5-1.0.jar")); @@ -90,7 +90,7 @@ void testLoadClassFromChildRealmWhereClassIsLocatedInBothChildRealmAndParentReal } @Test - void testLoadNonExistentClass() { + void loadNonExistentClass() { ClassRealm mainRealm = new ClassRealm(new ClassWorld(), "main", null); mainRealm.addURL(getJarUrl("component0-1.0.jar")); @@ -116,7 +116,7 @@ void testImport() throws Exception { } @Test - void testParentImport() throws Exception { + void parentImport() throws Exception { try (ClassWorld world = new ClassWorld()) { ClassRealm parent = world.newRealm("parent"); @@ -140,7 +140,7 @@ void testParentImport() throws Exception { } @Test - void testLoadClassFromBaseClassLoaderBeforeSelf() throws Exception { + void loadClassFromBaseClassLoaderBeforeSelf() throws Exception { try (ClassWorld world = new ClassWorld()) { ClassRealm base = world.newRealm("base"); @@ -161,7 +161,7 @@ void testLoadClassFromBaseClassLoaderBeforeSelf() throws Exception { } @Test - void testLoadClassFromRealmWithCircularClassReferences() throws Exception { + void loadClassFromRealmWithCircularClassReferences() throws Exception { ClassRealm mainRealm = new ClassRealm(new ClassWorld(), "main", null); mainRealm.addURL(getJarUrl("circular-0.1.jar")); @@ -178,7 +178,7 @@ void testLoadClassFromRealmWithCircularClassReferences() throws Exception { // ---------------------------------------------------------------------- @Test - void testResource() throws Exception { + void resource() throws Exception { ClassRealm mainRealm = new ClassRealm(new ClassWorld(), "main", null); mainRealm.addURL(getJarUrl("component0-1.0.jar")); @@ -187,7 +187,7 @@ void testResource() throws Exception { } @Test - void testMalformedResource() throws Exception { + void malformedResource() throws Exception { URL jarUrl = getJarUrl("component0-1.0.jar"); ClassRealm mainRealm = new ClassRealm(new ClassWorld(), "main", null); @@ -222,7 +222,7 @@ void testMalformedResource() throws Exception { } @Test - void testFindResourceOnlyScansSelf() throws Exception { + void findResourceOnlyScansSelf() throws Exception { ClassRealm mainRealm = new ClassRealm(new ClassWorld(), "main", null); mainRealm.addURL(getJarUrl("a.jar")); @@ -240,7 +240,7 @@ void testFindResourceOnlyScansSelf() throws Exception { } @Test - void testFindResourcesOnlyScansSelf() throws Exception { + void findResourcesOnlyScansSelf() throws Exception { ClassRealm mainRealm = new ClassRealm(new ClassWorld(), "main", null); mainRealm.addURL(getJarUrl("a.jar")); @@ -259,7 +259,7 @@ void testFindResourcesOnlyScansSelf() throws Exception { /** Should never deadlock. Ever */ @Test - void testParallelDeadlockClassRealm() throws InterruptedException { + void parallelDeadlockClassRealm() throws Exception { for (int i = 0; i < 100; i++) { doOneDeadlockAttempt(); } diff --git a/src/test/java/org/codehaus/plexus/classworlds/realm/EntryTest.java b/src/test/java/org/codehaus/plexus/classworlds/realm/EntryTest.java index 9d03670..18a10f0 100644 --- a/src/test/java/org/codehaus/plexus/classworlds/realm/EntryTest.java +++ b/src/test/java/org/codehaus/plexus/classworlds/realm/EntryTest.java @@ -15,8 +15,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import java.io.IOException; - import org.codehaus.plexus.classworlds.AbstractClassWorldsTestCase; import org.codehaus.plexus.classworlds.ClassWorld; import org.junit.jupiter.api.Test; @@ -31,7 +29,7 @@ class EntryTest extends AbstractClassWorldsTestCase { @Test - void testCompareTo() throws Exception { + void checkCompareTo() throws Exception { try (ClassWorld cw = new ClassWorld()) { ClassRealm r = cw.newRealm("test1"); @@ -46,7 +44,7 @@ void testCompareTo() throws Exception { * Tests the equality is realm independant */ @Test - void testEquals() throws DuplicateRealmException, IOException { + void chckEquals() throws Exception { try (ClassWorld cw = new ClassWorld()) { ClassRealm r1 = cw.newRealm("test1"); ClassRealm r2 = cw.newRealm("test2"); @@ -60,7 +58,7 @@ void testEquals() throws DuplicateRealmException, IOException { } @Test - void testMatchesClassByPackageImport() throws Exception { + void matchesClassByPackageImport() throws Exception { try (ClassWorld cw = new ClassWorld()) { ClassRealm r = cw.newRealm("test1"); @@ -75,7 +73,7 @@ void testMatchesClassByPackageImport() throws Exception { } @Test - void testMatchesClassByClassImport() throws Exception { + void matchesClassByClassImport() throws Exception { try (ClassWorld cw = new ClassWorld()) { ClassRealm r = cw.newRealm("test1"); @@ -89,7 +87,7 @@ void testMatchesClassByClassImport() throws Exception { } @Test - void testMatchesResourceByPackageImport() throws Exception { + void matchesResourceByPackageImport() throws Exception { try (ClassWorld cw = new ClassWorld()) { ClassRealm r = cw.newRealm("test1"); @@ -104,7 +102,7 @@ void testMatchesResourceByPackageImport() throws Exception { } @Test - void testMatchesResourceByClassImport() throws Exception { + void matchesResourceByClassImport() throws Exception { try (ClassWorld cw = new ClassWorld()) { ClassRealm r = cw.newRealm("test1"); @@ -118,7 +116,7 @@ void testMatchesResourceByClassImport() throws Exception { } @Test - void testMatchesAllImport() throws Exception { + void matchesAllImport() throws Exception { try (ClassWorld cw = new ClassWorld()) { ClassRealm r = cw.newRealm("test1"); @@ -132,7 +130,7 @@ void testMatchesAllImport() throws Exception { } @Test - void testMatchesResourceByResourceImport() throws Exception { + void matchesResourceByResourceImport() throws Exception { try (ClassWorld cw = new ClassWorld()) { ClassRealm r = cw.newRealm("test1"); @@ -149,7 +147,7 @@ void testMatchesResourceByResourceImport() throws Exception { } @Test - void testMatchesClassByExactPackageImport() throws Exception { + void matchesClassByExactPackageImport() throws Exception { try (ClassWorld cw = new ClassWorld()) { ClassRealm r = cw.newRealm("test1"); @@ -164,7 +162,7 @@ void testMatchesClassByExactPackageImport() throws Exception { } @Test - void testMatchesResourceByExactPackageImport() throws Exception { + void matchesResourceByExactPackageImport() throws Exception { try (ClassWorld cw = new ClassWorld()) { ClassRealm r = cw.newRealm("test1"); diff --git a/src/test/java/org/codehaus/plexus/classworlds/realm/FilteredClassRealmTest.java b/src/test/java/org/codehaus/plexus/classworlds/realm/FilteredClassRealmTest.java index a93ca62..7cf1d0a 100644 --- a/src/test/java/org/codehaus/plexus/classworlds/realm/FilteredClassRealmTest.java +++ b/src/test/java/org/codehaus/plexus/classworlds/realm/FilteredClassRealmTest.java @@ -18,7 +18,6 @@ */ package org.codehaus.plexus.classworlds.realm; -import java.io.IOException; import java.util.HashSet; import java.util.Set; import java.util.function.Predicate; @@ -39,7 +38,7 @@ class FilteredClassRealmTest extends AbstractClassWorldsTestCase { private ClassRealm realmA; @BeforeEach - public void setUp() throws DuplicateRealmException { + void setUp() throws DuplicateRealmException { this.world = new ClassWorld(); // only allow loading resources whose names start with "a." Set allowedResourcePrefixes = new HashSet<>(); @@ -50,7 +49,7 @@ public void setUp() throws DuplicateRealmException { } @Test - void testLoadResources() throws Exception { + void loadResources() throws Exception { realmA.addURL(getJarUrl("a.jar")); assertNull(realmA.getResource("common.properties")); assertFalse(realmA.getResources("common.properties").hasMoreElements()); @@ -60,7 +59,7 @@ void testLoadResources() throws Exception { } @Test - void testLoadClass() throws ClassNotFoundException { + void loadClass() throws Exception { assertThrows(ClassNotFoundException.class, () -> realmA.loadClass("a.Aa")); realmA.addURL(getJarUrl("a.jar")); @@ -72,7 +71,7 @@ void testLoadClass() throws ClassNotFoundException { } @Test - void testLoadClassWithModule() throws IOException { + void loadClassWithModule() throws Exception { try (ExtendedFilteredClassRealm realmA = new ExtendedFilteredClassRealm(world, s -> s.startsWith("a/Aa"))) { realmA.addURL(getJarUrl("a.jar")); assertNotNull(realmA.simulateLoadClassFromModule("a.Aa")); diff --git a/src/test/java/org/codehaus/plexus/classworlds/strategy/StrategyTest.java b/src/test/java/org/codehaus/plexus/classworlds/strategy/StrategyTest.java index 658049d..89a9dfc 100644 --- a/src/test/java/org/codehaus/plexus/classworlds/strategy/StrategyTest.java +++ b/src/test/java/org/codehaus/plexus/classworlds/strategy/StrategyTest.java @@ -40,7 +40,7 @@ class StrategyTest extends AbstractClassWorldsTestCase { private Strategy strategy; @BeforeEach - public void setUp() throws Exception { + void setUp() throws Exception { //noinspection resource this.realm = new ClassWorld().newRealm("realm"); this.strategy = this.realm.getStrategy(); @@ -48,12 +48,12 @@ public void setUp() throws Exception { } @Test - void testLoadingOfApplicationClass() throws Exception { + void loadingOfApplicationClass() throws Exception { assertNotNull(strategy.loadClass("org.codehaus.plexus.Component0")); } @Test - void testLoadingOfApplicationClassThenDoingItAgain() throws Exception { + void loadingOfApplicationClassThenDoingItAgain() throws Exception { Class c = strategy.loadClass("org.codehaus.plexus.Component0"); assertNotNull(c); @@ -64,12 +64,12 @@ void testLoadingOfApplicationClassThenDoingItAgain() throws Exception { } @Test - void testLoadingOfSystemClass() throws Exception { + void loadingOfSystemClass() throws Exception { assertNotNull(strategy.getRealm().loadClass("java.lang.Object")); } @Test - void testLoadingOfNonExistentClass() { + void loadingOfNonExistentClass() { try { strategy.loadClass("org.codehaus.plexus.NonExistentComponent"); @@ -80,7 +80,7 @@ void testLoadingOfNonExistentClass() { } @Test - void testGetApplicationResource() throws Exception { + void getApplicationResource() throws Exception { URL resource = strategy.getResource("META-INF/plexus/components.xml"); assertNotNull(resource); @@ -91,7 +91,7 @@ void testGetApplicationResource() throws Exception { } @Test - void testGetSystemResource() { + void getSystemResource() { assumeTrue( getJavaVersion() < 9.0, "Due to strong encapsulation you cannot get the java/lang/Object.class as resource since Java 9"); @@ -102,7 +102,7 @@ void testGetSystemResource() { } @Test - void testFindResources() throws Exception { + void findResources() throws Exception { realm.addURL(getJarUrl("component1-1.0.jar")); Enumeration e = strategy.getResources("META-INF/plexus/components.xml");