diff --git a/plexus-java/src/test/java/org/codehaus/plexus/languages/java/jpms/AbstractFilenameModuleNameExtractorTest.java b/plexus-java/src/test/java/org/codehaus/plexus/languages/java/jpms/AbstractFilenameModuleNameExtractorTest.java index 76c8736..356cb11 100644 --- a/plexus-java/src/test/java/org/codehaus/plexus/languages/java/jpms/AbstractFilenameModuleNameExtractorTest.java +++ b/plexus-java/src/test/java/org/codehaus/plexus/languages/java/jpms/AbstractFilenameModuleNameExtractorTest.java @@ -31,27 +31,27 @@ public abstract class AbstractFilenameModuleNameExtractorTest { @Test void testJarWithoutManifest() throws Exception { - String name = getExtractor().extract(Paths.get("src/test/resources/jar.empty/plexus-java-1.0.0-SNAPSHOT.jar")); + String name = getExtractor().extract(Paths.get("src/test/test-data/jar.empty/plexus-java-1.0.0-SNAPSHOT.jar")); assertEquals("plexus.java", name); } @Test void testJarWithManifest() throws Exception { String name = getExtractor() - .extract(Paths.get("src/test/resources/jar.manifest.with/plexus-java-1.0.0-SNAPSHOT.jar")); + .extract(Paths.get("src/test/test-data/jar.manifest.with/plexus-java-1.0.0-SNAPSHOT.jar")); assertEquals("org.codehaus.plexus.languages.java", name); } @Test void testJarUnsupported() throws Exception { - String name = getExtractor().extract(Paths.get("src/test/resources/jar.unsupported/jdom-1.0.jar")); + String name = getExtractor().extract(Paths.get("src/test/test-data/jar.unsupported/jdom-1.0.jar")); assertNull(name); } @Test void testJarWithSpacesInPath() throws Exception { String name = getExtractor() - .extract(Paths.get("src/test/resources/jar with spaces in path/plexus-java-1.0.0-SNAPSHOT.jar")); + .extract(Paths.get("src/test/test-data/jar with spaces in path/plexus-java-1.0.0-SNAPSHOT.jar")); assertEquals("org.codehaus.plexus.languages.java", name); } } diff --git a/plexus-java/src/test/java/org/codehaus/plexus/languages/java/jpms/BinaryModuleInfoParserTest.java b/plexus-java/src/test/java/org/codehaus/plexus/languages/java/jpms/BinaryModuleInfoParserTest.java index 5ed2f0d..c688b0b 100644 --- a/plexus-java/src/test/java/org/codehaus/plexus/languages/java/jpms/BinaryModuleInfoParserTest.java +++ b/plexus-java/src/test/java/org/codehaus/plexus/languages/java/jpms/BinaryModuleInfoParserTest.java @@ -49,7 +49,7 @@ class BinaryModuleInfoParserTest { @Test void testJarDescriptor() throws Exception { JavaModuleDescriptor descriptor = - parser.getModuleDescriptor(Paths.get("src/test/resources/jar.descriptor/asm-6.0_BETA.jar")); + parser.getModuleDescriptor(Paths.get("src/test/test-data/jar.descriptor/asm-6.0_BETA.jar")); assertNotNull(descriptor); assertThat(descriptor.name()).isEqualTo("org.objectweb.asm"); @@ -69,7 +69,7 @@ void testJarDescriptor() throws Exception { @Test void testMultiReleaseJarDescriptor() throws Exception { JavaModuleDescriptor descriptor = parser.getModuleDescriptor( - Paths.get("src/test/resources/jar.mr.descriptor/jloadr-1.0-SNAPSHOT.jar"), JavaVersion.parse("17")); + Paths.get("src/test/test-data/jar.mr.descriptor/jloadr-1.0-SNAPSHOT.jar"), JavaVersion.parse("17")); assertNotNull(descriptor); assertEquals("de.adito.jloadr", descriptor.name()); @@ -80,7 +80,7 @@ void testMultiReleaseJarDescriptor() throws Exception { void testIncompleteMultiReleaseJarDescriptor() throws Exception { // this jar is missing the Multi-Release: true entry in the Manifest JavaModuleDescriptor descriptor = parser.getModuleDescriptor( - Paths.get("src/test/resources/jar.mr.incomplete.descriptor/jloadr-1.0-SNAPSHOT.jar")); + Paths.get("src/test/test-data/jar.mr.incomplete.descriptor/jloadr-1.0-SNAPSHOT.jar")); assertNull(descriptor); } @@ -88,7 +88,7 @@ void testIncompleteMultiReleaseJarDescriptor() throws Exception { @Test void testClassicJar() throws Exception { JavaModuleDescriptor descriptor = - parser.getModuleDescriptor(Paths.get("src/test/resources/jar.empty/plexus-java-1.0.0-SNAPSHOT.jar")); + parser.getModuleDescriptor(Paths.get("src/test/test-data/jar.empty/plexus-java-1.0.0-SNAPSHOT.jar")); assertNull(descriptor); } @@ -96,7 +96,7 @@ void testClassicJar() throws Exception { @Test void testOutputDirectoryDescriptor() throws Exception { JavaModuleDescriptor descriptor = - parser.getModuleDescriptor(Paths.get("src/test/resources/dir.descriptor/out")); + parser.getModuleDescriptor(Paths.get("src/test/test-data/dir.descriptor/out")); assertNotNull(descriptor); assertEquals("org.codehaus.plexus.languages.java.demo", descriptor.name()); @@ -118,13 +118,13 @@ void testOutputDirectoryDescriptor() throws Exception { void testClassicOutputDirectory() { assertThrows( NoSuchFileException.class, - () -> parser.getModuleDescriptor(Paths.get("src/test/resources/dir.empty/out"))); + () -> parser.getModuleDescriptor(Paths.get("src/test/test-data/dir.empty/out"))); } @Test void testJModDescriptor() throws Exception { JavaModuleDescriptor descriptor = parser.getModuleDescriptor( - Paths.get("src/test/resources/jmod.descriptor/first-jmod-1.0-SNAPSHOT.jmod")); + Paths.get("src/test/test-data/jmod.descriptor/first-jmod-1.0-SNAPSHOT.jmod")); assertNotNull(descriptor); assertEquals("com.corporate.project", descriptor.name()); @@ -141,13 +141,13 @@ void testJModDescriptor() throws Exception { @Test void testInvalidFile() { assertThrows( - IOException.class, () -> parser.getModuleDescriptor(Paths.get("src/test/resources/nonjar/pom.xml"))); + IOException.class, () -> parser.getModuleDescriptor(Paths.get("src/test/test-data/nonjar/pom.xml"))); } @Test void testUses() throws Exception { try (InputStream is = - Files.newInputStream(Paths.get("src/test/resources/dir.descriptor.uses/out/module-info.class"))) { + Files.newInputStream(Paths.get("src/test/test-data/dir.descriptor.uses/out/module-info.class"))) { JavaModuleDescriptor descriptor = parser.parse(is); assertNotNull(descriptor); @@ -163,7 +163,7 @@ void testUses() throws Exception { @Test void testProvides() throws Exception { JavaModuleDescriptor descriptor = - parser.getModuleDescriptor(Paths.get("src/test/resources/jar.service/threeten-extra-1.4.jar")); + parser.getModuleDescriptor(Paths.get("src/test/test-data/jar.service/threeten-extra-1.4.jar")); assertNotNull(descriptor); assertEquals(1, descriptor.provides().size()); @@ -188,7 +188,7 @@ void testProvides() throws Exception { @Test void testRequires() throws Exception { try (InputStream is = - Files.newInputStream(Paths.get("src/test/resources/dir.descriptor.requires/out/module-info.class"))) { + Files.newInputStream(Paths.get("src/test/test-data/dir.descriptor.requires/out/module-info.class"))) { JavaModuleDescriptor descriptor = parser.parse(is); assertNotNull(descriptor); diff --git a/plexus-java/src/test/java/org/codehaus/plexus/languages/java/jpms/LocationManagerIT.java b/plexus-java/src/test/java/org/codehaus/plexus/languages/java/jpms/LocationManagerIT.java index 934eb2c..70c3a7f 100644 --- a/plexus-java/src/test/java/org/codehaus/plexus/languages/java/jpms/LocationManagerIT.java +++ b/plexus-java/src/test/java/org/codehaus/plexus/languages/java/jpms/LocationManagerIT.java @@ -54,7 +54,7 @@ class LocationManagerIT { private LocationManager locationManager; - final Path mockModuleInfoJava = Paths.get("src/test/resources/mock/module-info.java"); + final Path mockModuleInfoJava = Paths.get("src/test/test-data/mock/module-info.java"); @BeforeEach void onSetup() { @@ -68,7 +68,7 @@ ModuleInfoParser getBinaryModuleInfoParser(Path jdkHome) { @Test void testManifestWithoutReflectRequires() throws Exception { - Path abc = Paths.get("src/test/resources/manifest.without/out"); + Path abc = Paths.get("src/test/test-data/manifest.without/out"); JavaModuleDescriptor descriptor = JavaModuleDescriptor.newModule("base").requires("any").build(); when(qdoxParser.fromSourcePath(any(Path.class))).thenReturn(descriptor); @@ -86,7 +86,7 @@ void testManifestWithoutReflectRequires() throws Exception { @Test void testEmptyWithReflectRequires() throws Exception { - Path abc = Paths.get("src/test/resources/empty/out"); + Path abc = Paths.get("src/test/test-data/empty/out"); JavaModuleDescriptor descriptor = JavaModuleDescriptor.newModule("base").requires("a.b.c").build(); when(qdoxParser.fromSourcePath(any(Path.class))).thenReturn(descriptor); @@ -105,7 +105,7 @@ void testEmptyWithReflectRequires() throws Exception { @Test void testResolvePathWithException() { assertThrows(RuntimeException.class, () -> { - Path p = Paths.get("src/test/resources/jar.empty.invalid.name/101-1.0.0-SNAPSHOT.jar"); + Path p = Paths.get("src/test/test-data/jar.empty.invalid.name/101-1.0.0-SNAPSHOT.jar"); ResolvePathRequest request = ResolvePathRequest.ofPath(p); locationManager.resolvePath(request); @@ -114,7 +114,7 @@ void testResolvePathWithException() { @Test void testClassicJarNameStartsWithNumber() throws Exception { - Path p = Paths.get("src/test/resources/jar.empty.invalid.name/101-1.0.0-SNAPSHOT.jar"); + Path p = Paths.get("src/test/test-data/jar.empty.invalid.name/101-1.0.0-SNAPSHOT.jar"); ResolvePathsRequest request = ResolvePathsRequest.ofPaths(Arrays.asList(p)).setMainModuleDescriptor(mockModuleInfoJava); diff --git a/plexus-java/src/test/java/org/codehaus/plexus/languages/java/jpms/LocationManagerTest.java b/plexus-java/src/test/java/org/codehaus/plexus/languages/java/jpms/LocationManagerTest.java index 92444e7..274d115 100644 --- a/plexus-java/src/test/java/org/codehaus/plexus/languages/java/jpms/LocationManagerTest.java +++ b/plexus-java/src/test/java/org/codehaus/plexus/languages/java/jpms/LocationManagerTest.java @@ -42,7 +42,7 @@ class LocationManagerTest { private LocationManager locationManager; - final Path mockModuleInfoJava = Paths.get("src/test/resources/mock/module-info.java"); + final Path mockModuleInfoJava = Paths.get("src/test/test-data/mock/module-info.java"); @BeforeEach void onSetup() { @@ -88,7 +88,7 @@ void testWithUnknownRequires() throws Exception { @Test void testManifestWithReflectRequires() throws Exception { - Path abc = Paths.get("src/test/resources/dir.manifest.with/out"); + Path abc = Paths.get("src/test/test-data/dir.manifest.with/out"); JavaModuleDescriptor descriptor = JavaModuleDescriptor.newModule("base") .requires("auto.by.manifest") .build(); @@ -108,7 +108,7 @@ void testManifestWithReflectRequires() throws Exception { @Test void testDirDescriptorWithReflectRequires() throws Exception { - Path abc = Paths.get("src/test/resources/dir.descriptor/out"); + Path abc = Paths.get("src/test/test-data/dir.descriptor/out"); JavaModuleDescriptor descriptor = JavaModuleDescriptor.newModule("base") .requires("dir.descriptor") .build(); @@ -131,7 +131,7 @@ void testDirDescriptorWithReflectRequires() throws Exception { @Test void testJarWithAsmRequires() throws Exception { - Path abc = Paths.get("src/test/resources/jar.descriptor/asm-6.0_BETA.jar"); + Path abc = Paths.get("src/test/test-data/jar.descriptor/asm-6.0_BETA.jar"); JavaModuleDescriptor descriptor = JavaModuleDescriptor.newModule("base") .requires("org.objectweb.asm") .build(); @@ -153,8 +153,8 @@ void testJarWithAsmRequires() throws Exception { @Test void testIdenticalModuleNames() throws Exception { - Path pj1 = Paths.get("src/test/resources/jar.empty/plexus-java-1.0.0-SNAPSHOT.jar"); - Path pj2 = Paths.get("src/test/resources/jar.empty.2/plexus-java-2.0.0-SNAPSHOT.jar"); + Path pj1 = Paths.get("src/test/test-data/jar.empty/plexus-java-1.0.0-SNAPSHOT.jar"); + Path pj2 = Paths.get("src/test/test-data/jar.empty.2/plexus-java-2.0.0-SNAPSHOT.jar"); JavaModuleDescriptor descriptor = JavaModuleDescriptor.newModule("base").requires("plexus.java").build(); when(qdoxParser.fromSourcePath(any(Path.class))).thenReturn(descriptor); @@ -183,8 +183,8 @@ void testIdenticalModuleNames() throws Exception { @Test public void testIdenticalAutomaticModuleNames() throws Exception { - Path pj1 = Paths.get("src/test/resources/jar.empty/plexus-java-1.0.0-SNAPSHOT.jar"); - Path pj2 = Paths.get("src/test/resources/jar.empty.2/plexus-java-2.0.0-SNAPSHOT.jar"); + Path pj1 = Paths.get("src/test/test-data/jar.empty/plexus-java-1.0.0-SNAPSHOT.jar"); + Path pj2 = Paths.get("src/test/test-data/jar.empty.2/plexus-java-2.0.0-SNAPSHOT.jar"); JavaModuleDescriptor descriptor = JavaModuleDescriptor.newModule("base").requires("plexus.java").build(); when(qdoxParser.fromSourcePath(any(Path.class))).thenReturn(descriptor); @@ -213,8 +213,8 @@ public void testIdenticalAutomaticModuleNames() throws Exception { @Test public void testMainJarModuleAndTestJarAutomatic() throws Exception { - Path pj1 = Paths.get("src/test/resources/jar.tests/plexus-java-1.0.0-SNAPSHOT.jar"); - Path pj2 = Paths.get("src/test/resources/jar.tests/plexus-java-1.0.0-SNAPSHOT-tests.jar"); + Path pj1 = Paths.get("src/test/test-data/jar.tests/plexus-java-1.0.0-SNAPSHOT.jar"); + Path pj2 = Paths.get("src/test/test-data/jar.tests/plexus-java-1.0.0-SNAPSHOT-tests.jar"); JavaModuleDescriptor descriptor = JavaModuleDescriptor.newModule("base").requires("plexus.java").build(); when(qdoxParser.fromSourcePath(any(Path.class))).thenReturn(descriptor); @@ -243,7 +243,7 @@ public void testMainJarModuleAndTestJarAutomatic() throws Exception { @Test void testNonJar() throws Exception { - Path p = Paths.get("src/test/resources/nonjar/pom.xml"); + Path p = Paths.get("src/test/test-data/nonjar/pom.xml"); ResolvePathsRequest request = ResolvePathsRequest.ofPaths(Collections.singletonList(p)).setMainModuleDescriptor(mockModuleInfoJava); @@ -255,7 +255,7 @@ void testNonJar() throws Exception { @Test void testAdditionalModules() throws Exception { - Path p = Paths.get("src/test/resources/mock/jar0.jar"); + Path p = Paths.get("src/test/test-data/mock/jar0.jar"); JavaModuleDescriptor descriptor = JavaModuleDescriptor.newModule("base").build(); when(qdoxParser.fromSourcePath(any(Path.class))).thenReturn(descriptor); @@ -277,7 +277,7 @@ void testAdditionalModules() throws Exception { @Test void testResolvePath() throws Exception { - Path abc = Paths.get("src/test/resources/mock/jar0.jar"); + Path abc = Paths.get("src/test/test-data/mock/jar0.jar"); ResolvePathRequest request = ResolvePathRequest.ofPath(abc); when(asmParser.getModuleDescriptor(abc)) @@ -292,8 +292,8 @@ void testResolvePath() throws Exception { @Test void testNoMatchingProviders() throws Exception { - Path abc = Paths.get("src/test/resources/mock/module-info.java"); // some file called module-info.java - Path def = Paths.get("src/test/resources/mock/jar0.jar"); // any existing file + Path abc = Paths.get("src/test/test-data/mock/module-info.java"); // some file called module-info.java + Path def = Paths.get("src/test/test-data/mock/jar0.jar"); // any existing file ResolvePathsRequest request = ResolvePathsRequest.ofPaths(def).setMainModuleDescriptor(abc).setIncludeAllProviders(true); @@ -313,8 +313,8 @@ void testNoMatchingProviders() throws Exception { @Test void testMainModuleDescriptorWithProviders() throws Exception { - Path abc = Paths.get("src/test/resources/mock/module-info.java"); // some file called module-info.java - Path def = Paths.get("src/test/resources/mock/jar0.jar"); // any existing file + Path abc = Paths.get("src/test/test-data/mock/module-info.java"); // some file called module-info.java + Path def = Paths.get("src/test/test-data/mock/jar0.jar"); // any existing file ResolvePathsRequest request = ResolvePathsRequest.ofPaths(def).setMainModuleDescriptor(abc).setIncludeAllProviders(true); @@ -334,8 +334,8 @@ void testMainModuleDescriptorWithProviders() throws Exception { @Test void testMainModuleDescriptorWithProvidersDontIncludeProviders() throws Exception { - Path abc = Paths.get("src/test/resources/mock/module-info.java"); // some file called module-info.java - Path def = Paths.get("src/test/resources/mock/jar0.jar"); // any existing file + Path abc = Paths.get("src/test/test-data/mock/module-info.java"); // some file called module-info.java + Path def = Paths.get("src/test/test-data/mock/jar0.jar"); // any existing file ResolvePathsRequest request = ResolvePathsRequest.ofPaths(def).setMainModuleDescriptor(abc); when(qdoxParser.fromSourcePath(abc)) @@ -354,9 +354,9 @@ void testMainModuleDescriptorWithProvidersDontIncludeProviders() throws Exceptio @Test void testTransitiveProviders() throws Exception { - Path abc = Paths.get("src/test/resources/mock/module-info.java"); // some file called module-info.java - Path def = Paths.get("src/test/resources/mock/jar0.jar"); // any existing file - Path ghi = Paths.get("src/test/resources/mock/jar1.jar"); // any existing file + Path abc = Paths.get("src/test/test-data/mock/module-info.java"); // some file called module-info.java + Path def = Paths.get("src/test/test-data/mock/jar0.jar"); // any existing file + Path ghi = Paths.get("src/test/test-data/mock/jar1.jar"); // any existing file ResolvePathsRequest request = ResolvePathsRequest.ofPaths(def, ghi) .setMainModuleDescriptor(abc) .setIncludeAllProviders(true); @@ -380,9 +380,9 @@ void testTransitiveProviders() throws Exception { @Test void testDontIncludeProviders() throws Exception { - Path abc = Paths.get("src/test/resources/mock/module-info.java"); // some file called module-info.java - Path def = Paths.get("src/test/resources/mock/jar0.jar"); // any existing file - Path ghi = Paths.get("src/test/resources/mock/jar1.jar"); // any existing file + Path abc = Paths.get("src/test/test-data/mock/module-info.java"); // some file called module-info.java + Path def = Paths.get("src/test/test-data/mock/jar0.jar"); // any existing file + Path ghi = Paths.get("src/test/test-data/mock/jar1.jar"); // any existing file ResolvePathsRequest request = ResolvePathsRequest.ofPaths(def, ghi).setMainModuleDescriptor(abc); @@ -405,8 +405,8 @@ void testDontIncludeProviders() throws Exception { @Test void testAllowAdditionalModulesWithoutMainDescriptor() throws Exception { - Path def = Paths.get("src/test/resources/mock/jar0.jar"); // any existing file - Path ghi = Paths.get("src/test/resources/mock/jar1.jar"); // any existing file + Path def = Paths.get("src/test/test-data/mock/jar0.jar"); // any existing file + Path ghi = Paths.get("src/test/test-data/mock/jar1.jar"); // any existing file ResolvePathsRequest request = ResolvePathsRequest.ofPaths(def, ghi).setAdditionalModules(Collections.singleton("def")); @@ -424,7 +424,7 @@ void testAllowAdditionalModulesWithoutMainDescriptor() throws Exception { @Test void testReuseModuleDescriptor() throws Exception { - Path def = Paths.get("src/test/resources/mock/jar0.jar"); + Path def = Paths.get("src/test/test-data/mock/jar0.jar"); ResolvePathRequest request1 = ResolvePathRequest.ofPath(def); when(asmParser.getModuleDescriptor(def)) @@ -442,7 +442,7 @@ void testReuseModuleDescriptor() throws Exception { @Test void testParseModuleDescriptor() throws Exception { - Path descriptorPath = Paths.get("src/test/resources/src.dir/module-info.java"); + Path descriptorPath = Paths.get("src/test/test-data/src.dir/module-info.java"); when(qdoxParser.fromSourcePath(descriptorPath)) .thenReturn(JavaModuleDescriptor.newModule("a.b.c").build()); @@ -461,9 +461,9 @@ void testParseModuleDescriptor() throws Exception { @Test void testTransitiveStatic() throws Exception { - Path moduleA = Paths.get("src/test/resources/mock/module-info.java"); // some file called module-info.java - Path moduleB = Paths.get("src/test/resources/mock/jar0.jar"); // any existing file - Path moduleC = Paths.get("src/test/resources/mock/jar1.jar"); // any existing file + Path moduleA = Paths.get("src/test/test-data/mock/module-info.java"); // some file called module-info.java + Path moduleB = Paths.get("src/test/test-data/mock/jar0.jar"); // any existing file + Path moduleC = Paths.get("src/test/test-data/mock/jar1.jar"); // any existing file ResolvePathsRequest request = ResolvePathsRequest.ofPaths(moduleB, moduleC).setMainModuleDescriptor(moduleA); @@ -487,10 +487,10 @@ void testTransitiveStatic() throws Exception { @Test void testDirectStatic() throws Exception { - Path moduleA = Paths.get("src/test/resources/mock/module-info.java"); // some file called module-info.java - Path moduleB = Paths.get("src/test/resources/mock/jar0.jar"); // any existing file - Path moduleC = Paths.get("src/test/resources/mock/jar1.jar"); // any existing file - Path moduleD = Paths.get("src/test/resources/mock/jar2.jar"); // any existing file + Path moduleA = Paths.get("src/test/test-data/mock/module-info.java"); // some file called module-info.java + Path moduleB = Paths.get("src/test/test-data/mock/jar0.jar"); // any existing file + Path moduleC = Paths.get("src/test/test-data/mock/jar1.jar"); // any existing file + Path moduleD = Paths.get("src/test/test-data/mock/jar2.jar"); // any existing file ResolvePathsRequest request = ResolvePathsRequest.ofPaths(moduleB, moduleC, moduleD).setMainModuleDescriptor(moduleA); // .setIncludeStatic( true ); @@ -518,9 +518,9 @@ void testDirectStatic() throws Exception { @Test void testDuplicateModule() throws Exception { - Path moduleA = Paths.get("src/test/resources/mock/module-info.java"); // some file called module-info.java - Path moduleB = Paths.get("src/test/resources/mock/jar0.jar"); // any existing file - Path moduleC = Paths.get("src/test/resources/mock/jar1.jar"); // any existing file + Path moduleA = Paths.get("src/test/test-data/mock/module-info.java"); // some file called module-info.java + Path moduleB = Paths.get("src/test/test-data/mock/jar0.jar"); // any existing file + Path moduleC = Paths.get("src/test/test-data/mock/jar1.jar"); // any existing file ResolvePathsRequest request = ResolvePathsRequest.ofPaths(moduleB, moduleC).setMainModuleDescriptor(moduleA); @@ -548,10 +548,10 @@ void testDuplicateModule() throws Exception { @Test void testStaticTransitive() throws Exception { - Path moduleA = Paths.get("src/test/resources/mock/module-info.java"); // some file called module-info.java - Path moduleB = Paths.get("src/test/resources/mock/jar0.jar"); // any existing file - Path moduleC = Paths.get("src/test/resources/mock/jar1.jar"); // any existing file - Path moduleD = Paths.get("src/test/resources/mock/jar2.jar"); // any existing file + Path moduleA = Paths.get("src/test/test-data/mock/module-info.java"); // some file called module-info.java + Path moduleB = Paths.get("src/test/test-data/mock/jar0.jar"); // any existing file + Path moduleC = Paths.get("src/test/test-data/mock/jar1.jar"); // any existing file + Path moduleD = Paths.get("src/test/test-data/mock/jar2.jar"); // any existing file ResolvePathsRequest request = ResolvePathsRequest.ofPaths(moduleB, moduleC, moduleD).setMainModuleDescriptor(moduleA); @@ -582,9 +582,9 @@ void testStaticTransitive() throws Exception { */ @Test void includeDeeperRequiresStatic() throws Exception { - Path moduleA = Paths.get("src/test/resources/mock/module-info.java"); // some file called module-info.java - Path moduleB = Paths.get("src/test/resources/mock/jar0.jar"); // any existing file - Path moduleC = Paths.get("src/test/resources/mock/jar1.jar"); // any existing file + Path moduleA = Paths.get("src/test/test-data/mock/module-info.java"); // some file called module-info.java + Path moduleB = Paths.get("src/test/test-data/mock/jar0.jar"); // any existing file + Path moduleC = Paths.get("src/test/test-data/mock/jar1.jar"); // any existing file ResolvePathsRequest request = ResolvePathsRequest.ofPaths(moduleA, moduleB, moduleC) .setMainModuleDescriptor(moduleA) .setIncludeStatic(true); @@ -608,10 +608,10 @@ void includeDeeperRequiresStatic() throws Exception { */ @Test void includeDeeperRequiresStaticTransitive() throws Exception { - Path moduleA = Paths.get("src/test/resources/mock/module-info.java"); // some file called module-info.java core - Path moduleB = Paths.get("src/test/resources/mock/jar0.jar"); // any existing file - Path moduleC = Paths.get("src/test/resources/mock/jar1.jar"); // any existing file - Path moduleD = Paths.get("src/test/resources/mock/jar2.jar"); // any existing file + Path moduleA = Paths.get("src/test/test-data/mock/module-info.java"); // some file called module-info.java core + Path moduleB = Paths.get("src/test/test-data/mock/jar0.jar"); // any existing file + Path moduleC = Paths.get("src/test/test-data/mock/jar1.jar"); // any existing file + Path moduleD = Paths.get("src/test/test-data/mock/jar2.jar"); // any existing file ResolvePathsRequest request = ResolvePathsRequest.ofPaths(moduleA, moduleB, moduleC, moduleD) .setMainModuleDescriptor(moduleA) .setIncludeStatic(true); diff --git a/plexus-java/src/test/java/org/codehaus/plexus/languages/java/jpms/ManifestModuleNameExtractorTest.java b/plexus-java/src/test/java/org/codehaus/plexus/languages/java/jpms/ManifestModuleNameExtractorTest.java index 7360585..e264a47 100644 --- a/plexus-java/src/test/java/org/codehaus/plexus/languages/java/jpms/ManifestModuleNameExtractorTest.java +++ b/plexus-java/src/test/java/org/codehaus/plexus/languages/java/jpms/ManifestModuleNameExtractorTest.java @@ -30,28 +30,28 @@ class ManifestModuleNameExtractorTest { @Test void testNoManifestInJar() throws Exception { - assertNull(extractor.extract(Paths.get("src/test/resources/jar.name/plexus-java-1.0.0-SNAPSHOT.jar"))); + assertNull(extractor.extract(Paths.get("src/test/test-data/jar.name/plexus-java-1.0.0-SNAPSHOT.jar"))); } @Test void testManifestInJar() throws Exception { assertEquals( "org.codehaus.plexus.languages.java", - extractor.extract(Paths.get("src/test/resources/jar.manifest.with/plexus-java-1.0.0-SNAPSHOT.jar"))); + extractor.extract(Paths.get("src/test/test-data/jar.manifest.with/plexus-java-1.0.0-SNAPSHOT.jar"))); } @Test void testNoManifestInDir() throws Exception { - assertNull(extractor.extract(Paths.get("src/test/resources/empty/out"))); + assertNull(extractor.extract(Paths.get("src/test/test-data/empty/out"))); } @Test void testEmptyManifestInDir() throws Exception { - assertNull(extractor.extract(Paths.get("src/test/resources/manifest.without/out"))); + assertNull(extractor.extract(Paths.get("src/test/test-data/manifest.without/out"))); } @Test void testManifestInDir() throws Exception { - assertEquals("auto.by.manifest", extractor.extract(Paths.get("src/test/resources/dir.manifest.with/out"))); + assertEquals("auto.by.manifest", extractor.extract(Paths.get("src/test/test-data/dir.manifest.with/out"))); } } diff --git a/plexus-java/src/test/java/org/codehaus/plexus/languages/java/jpms/SourceModuleInfoParserTest.java b/plexus-java/src/test/java/org/codehaus/plexus/languages/java/jpms/SourceModuleInfoParserTest.java index eecd015..c29e921 100644 --- a/plexus-java/src/test/java/org/codehaus/plexus/languages/java/jpms/SourceModuleInfoParserTest.java +++ b/plexus-java/src/test/java/org/codehaus/plexus/languages/java/jpms/SourceModuleInfoParserTest.java @@ -41,7 +41,7 @@ class SourceModuleInfoParserTest { @Test void test() throws Exception { JavaModuleDescriptor moduleDescriptor = - parser.fromSourcePath(Paths.get("src/test/resources/src.dir/module-info.java")); + parser.fromSourcePath(Paths.get("src/test/test-data/src.dir/module-info.java")); assertEquals("a.b.c", moduleDescriptor.name()); Iterator requiresIter = moduleDescriptor.requires().iterator(); diff --git a/plexus-java/src/test/java/org/codehaus/plexus/languages/java/version/JavaClassVersionTest.java b/plexus-java/src/test/java/org/codehaus/plexus/languages/java/version/JavaClassVersionTest.java index eaec9c5..59b979a 100644 --- a/plexus-java/src/test/java/org/codehaus/plexus/languages/java/version/JavaClassVersionTest.java +++ b/plexus-java/src/test/java/org/codehaus/plexus/languages/java/version/JavaClassVersionTest.java @@ -36,7 +36,7 @@ void testFilesClassVersions(Path filePath) { static Stream provideClassFiles() { List paths; try (DirectoryStream directoryStream = - Files.newDirectoryStream(Paths.get("src/test/resources/classfile.version/"), "*-[0-9]?.class")) { + Files.newDirectoryStream(Paths.get("src/test/test-data/classfile.version/"), "*-[0-9]?.class")) { paths = StreamSupport.stream(directoryStream.spliterator(), false) .filter(Files::isRegularFile) .collect(Collectors.toList()); @@ -48,7 +48,7 @@ static Stream provideClassFiles() { @Test void testJavaClassPreview() { - Path previewFile = Paths.get("src/test/resources/classfile.version/helloworld-preview.class"); + Path previewFile = Paths.get("src/test/test-data/classfile.version/helloworld-preview.class"); JavaClassfileVersion previewClass = JavaClassfileVersion.of(previewFile); assertTrue(previewClass.isPreview()); assertEquals(20 + 44, previewClass.majorVersion()); diff --git a/plexus-java/src/test/resources/classfile.version/helloworld-10.class b/plexus-java/src/test/test-data/classfile.version/helloworld-10.class similarity index 100% rename from plexus-java/src/test/resources/classfile.version/helloworld-10.class rename to plexus-java/src/test/test-data/classfile.version/helloworld-10.class diff --git a/plexus-java/src/test/resources/classfile.version/helloworld-11.class b/plexus-java/src/test/test-data/classfile.version/helloworld-11.class similarity index 100% rename from plexus-java/src/test/resources/classfile.version/helloworld-11.class rename to plexus-java/src/test/test-data/classfile.version/helloworld-11.class diff --git a/plexus-java/src/test/resources/classfile.version/helloworld-12.class b/plexus-java/src/test/test-data/classfile.version/helloworld-12.class similarity index 100% rename from plexus-java/src/test/resources/classfile.version/helloworld-12.class rename to plexus-java/src/test/test-data/classfile.version/helloworld-12.class diff --git a/plexus-java/src/test/resources/classfile.version/helloworld-13.class b/plexus-java/src/test/test-data/classfile.version/helloworld-13.class similarity index 100% rename from plexus-java/src/test/resources/classfile.version/helloworld-13.class rename to plexus-java/src/test/test-data/classfile.version/helloworld-13.class diff --git a/plexus-java/src/test/resources/classfile.version/helloworld-14.class b/plexus-java/src/test/test-data/classfile.version/helloworld-14.class similarity index 100% rename from plexus-java/src/test/resources/classfile.version/helloworld-14.class rename to plexus-java/src/test/test-data/classfile.version/helloworld-14.class diff --git a/plexus-java/src/test/resources/classfile.version/helloworld-15.class b/plexus-java/src/test/test-data/classfile.version/helloworld-15.class similarity index 100% rename from plexus-java/src/test/resources/classfile.version/helloworld-15.class rename to plexus-java/src/test/test-data/classfile.version/helloworld-15.class diff --git a/plexus-java/src/test/resources/classfile.version/helloworld-16.class b/plexus-java/src/test/test-data/classfile.version/helloworld-16.class similarity index 100% rename from plexus-java/src/test/resources/classfile.version/helloworld-16.class rename to plexus-java/src/test/test-data/classfile.version/helloworld-16.class diff --git a/plexus-java/src/test/resources/classfile.version/helloworld-17.class b/plexus-java/src/test/test-data/classfile.version/helloworld-17.class similarity index 100% rename from plexus-java/src/test/resources/classfile.version/helloworld-17.class rename to plexus-java/src/test/test-data/classfile.version/helloworld-17.class diff --git a/plexus-java/src/test/resources/classfile.version/helloworld-18.class b/plexus-java/src/test/test-data/classfile.version/helloworld-18.class similarity index 100% rename from plexus-java/src/test/resources/classfile.version/helloworld-18.class rename to plexus-java/src/test/test-data/classfile.version/helloworld-18.class diff --git a/plexus-java/src/test/resources/classfile.version/helloworld-19.class b/plexus-java/src/test/test-data/classfile.version/helloworld-19.class similarity index 100% rename from plexus-java/src/test/resources/classfile.version/helloworld-19.class rename to plexus-java/src/test/test-data/classfile.version/helloworld-19.class diff --git a/plexus-java/src/test/resources/classfile.version/helloworld-20.class b/plexus-java/src/test/test-data/classfile.version/helloworld-20.class similarity index 100% rename from plexus-java/src/test/resources/classfile.version/helloworld-20.class rename to plexus-java/src/test/test-data/classfile.version/helloworld-20.class diff --git a/plexus-java/src/test/resources/classfile.version/helloworld-21.class b/plexus-java/src/test/test-data/classfile.version/helloworld-21.class similarity index 100% rename from plexus-java/src/test/resources/classfile.version/helloworld-21.class rename to plexus-java/src/test/test-data/classfile.version/helloworld-21.class diff --git a/plexus-java/src/test/resources/classfile.version/helloworld-22.class b/plexus-java/src/test/test-data/classfile.version/helloworld-22.class similarity index 100% rename from plexus-java/src/test/resources/classfile.version/helloworld-22.class rename to plexus-java/src/test/test-data/classfile.version/helloworld-22.class diff --git a/plexus-java/src/test/resources/classfile.version/helloworld-8.class b/plexus-java/src/test/test-data/classfile.version/helloworld-8.class similarity index 100% rename from plexus-java/src/test/resources/classfile.version/helloworld-8.class rename to plexus-java/src/test/test-data/classfile.version/helloworld-8.class diff --git a/plexus-java/src/test/resources/classfile.version/helloworld-9.class b/plexus-java/src/test/test-data/classfile.version/helloworld-9.class similarity index 100% rename from plexus-java/src/test/resources/classfile.version/helloworld-9.class rename to plexus-java/src/test/test-data/classfile.version/helloworld-9.class diff --git a/plexus-java/src/test/resources/classfile.version/helloworld-preview.class b/plexus-java/src/test/test-data/classfile.version/helloworld-preview.class similarity index 100% rename from plexus-java/src/test/resources/classfile.version/helloworld-preview.class rename to plexus-java/src/test/test-data/classfile.version/helloworld-preview.class diff --git a/plexus-java/src/test/resources/dir.descriptor.requires/out/module-info.class b/plexus-java/src/test/test-data/dir.descriptor.requires/out/module-info.class similarity index 100% rename from plexus-java/src/test/resources/dir.descriptor.requires/out/module-info.class rename to plexus-java/src/test/test-data/dir.descriptor.requires/out/module-info.class diff --git a/plexus-java/src/test/resources/dir.descriptor.uses/out/module-info.class b/plexus-java/src/test/test-data/dir.descriptor.uses/out/module-info.class similarity index 100% rename from plexus-java/src/test/resources/dir.descriptor.uses/out/module-info.class rename to plexus-java/src/test/test-data/dir.descriptor.uses/out/module-info.class diff --git a/plexus-java/src/test/resources/dir.descriptor/out/module-info.class b/plexus-java/src/test/test-data/dir.descriptor/out/module-info.class similarity index 100% rename from plexus-java/src/test/resources/dir.descriptor/out/module-info.class rename to plexus-java/src/test/test-data/dir.descriptor/out/module-info.class diff --git a/plexus-java/src/test/resources/dir.empty/out/README.txt b/plexus-java/src/test/test-data/dir.empty/out/README.txt similarity index 100% rename from plexus-java/src/test/resources/dir.empty/out/README.txt rename to plexus-java/src/test/test-data/dir.empty/out/README.txt diff --git a/plexus-java/src/test/resources/dir.manifest.with/out/META-INF/MANIFEST.MF b/plexus-java/src/test/test-data/dir.manifest.with/out/META-INF/MANIFEST.MF similarity index 100% rename from plexus-java/src/test/resources/dir.manifest.with/out/META-INF/MANIFEST.MF rename to plexus-java/src/test/test-data/dir.manifest.with/out/META-INF/MANIFEST.MF diff --git a/plexus-java/src/test/resources/dir.manifest.without/out/META-INF/MANIFEST.MF b/plexus-java/src/test/test-data/dir.manifest.without/out/META-INF/MANIFEST.MF similarity index 100% rename from plexus-java/src/test/resources/dir.manifest.without/out/META-INF/MANIFEST.MF rename to plexus-java/src/test/test-data/dir.manifest.without/out/META-INF/MANIFEST.MF diff --git a/plexus-java/src/test/resources/jar with spaces in path/plexus-java-1.0.0-SNAPSHOT.jar b/plexus-java/src/test/test-data/jar with spaces in path/plexus-java-1.0.0-SNAPSHOT.jar similarity index 100% rename from plexus-java/src/test/resources/jar with spaces in path/plexus-java-1.0.0-SNAPSHOT.jar rename to plexus-java/src/test/test-data/jar with spaces in path/plexus-java-1.0.0-SNAPSHOT.jar diff --git a/plexus-java/src/test/resources/jar.descriptor/asm-6.0_BETA.jar b/plexus-java/src/test/test-data/jar.descriptor/asm-6.0_BETA.jar similarity index 100% rename from plexus-java/src/test/resources/jar.descriptor/asm-6.0_BETA.jar rename to plexus-java/src/test/test-data/jar.descriptor/asm-6.0_BETA.jar diff --git a/plexus-java/src/test/resources/jar.empty.2/plexus-java-2.0.0-SNAPSHOT.jar b/plexus-java/src/test/test-data/jar.empty.2/plexus-java-2.0.0-SNAPSHOT.jar similarity index 100% rename from plexus-java/src/test/resources/jar.empty.2/plexus-java-2.0.0-SNAPSHOT.jar rename to plexus-java/src/test/test-data/jar.empty.2/plexus-java-2.0.0-SNAPSHOT.jar diff --git a/plexus-java/src/test/resources/jar.empty.invalid.name/101-1.0.0-SNAPSHOT.jar b/plexus-java/src/test/test-data/jar.empty.invalid.name/101-1.0.0-SNAPSHOT.jar similarity index 100% rename from plexus-java/src/test/resources/jar.empty.invalid.name/101-1.0.0-SNAPSHOT.jar rename to plexus-java/src/test/test-data/jar.empty.invalid.name/101-1.0.0-SNAPSHOT.jar diff --git a/plexus-java/src/test/resources/jar.empty/plexus-java-1.0.0-SNAPSHOT.jar b/plexus-java/src/test/test-data/jar.empty/plexus-java-1.0.0-SNAPSHOT.jar similarity index 100% rename from plexus-java/src/test/resources/jar.empty/plexus-java-1.0.0-SNAPSHOT.jar rename to plexus-java/src/test/test-data/jar.empty/plexus-java-1.0.0-SNAPSHOT.jar diff --git a/plexus-java/src/test/resources/jar.manifest.with/plexus-java-1.0.0-SNAPSHOT.jar b/plexus-java/src/test/test-data/jar.manifest.with/plexus-java-1.0.0-SNAPSHOT.jar similarity index 100% rename from plexus-java/src/test/resources/jar.manifest.with/plexus-java-1.0.0-SNAPSHOT.jar rename to plexus-java/src/test/test-data/jar.manifest.with/plexus-java-1.0.0-SNAPSHOT.jar diff --git a/plexus-java/src/test/resources/jar.mr.descriptor/jloadr-1.0-SNAPSHOT.jar b/plexus-java/src/test/test-data/jar.mr.descriptor/jloadr-1.0-SNAPSHOT.jar similarity index 100% rename from plexus-java/src/test/resources/jar.mr.descriptor/jloadr-1.0-SNAPSHOT.jar rename to plexus-java/src/test/test-data/jar.mr.descriptor/jloadr-1.0-SNAPSHOT.jar diff --git a/plexus-java/src/test/resources/jar.mr.incomplete.descriptor/jloadr-1.0-SNAPSHOT.jar b/plexus-java/src/test/test-data/jar.mr.incomplete.descriptor/jloadr-1.0-SNAPSHOT.jar similarity index 100% rename from plexus-java/src/test/resources/jar.mr.incomplete.descriptor/jloadr-1.0-SNAPSHOT.jar rename to plexus-java/src/test/test-data/jar.mr.incomplete.descriptor/jloadr-1.0-SNAPSHOT.jar diff --git a/plexus-java/src/test/resources/jar.service/threeten-extra-1.4.jar b/plexus-java/src/test/test-data/jar.service/threeten-extra-1.4.jar similarity index 100% rename from plexus-java/src/test/resources/jar.service/threeten-extra-1.4.jar rename to plexus-java/src/test/test-data/jar.service/threeten-extra-1.4.jar diff --git a/plexus-java/src/test/resources/jar.tests/plexus-java-1.0.0-SNAPSHOT-tests.jar b/plexus-java/src/test/test-data/jar.tests/plexus-java-1.0.0-SNAPSHOT-tests.jar similarity index 100% rename from plexus-java/src/test/resources/jar.tests/plexus-java-1.0.0-SNAPSHOT-tests.jar rename to plexus-java/src/test/test-data/jar.tests/plexus-java-1.0.0-SNAPSHOT-tests.jar diff --git a/plexus-java/src/test/resources/jar.tests/plexus-java-1.0.0-SNAPSHOT.jar b/plexus-java/src/test/test-data/jar.tests/plexus-java-1.0.0-SNAPSHOT.jar similarity index 100% rename from plexus-java/src/test/resources/jar.tests/plexus-java-1.0.0-SNAPSHOT.jar rename to plexus-java/src/test/test-data/jar.tests/plexus-java-1.0.0-SNAPSHOT.jar diff --git a/plexus-java/src/test/resources/jar.unsupported/jdom-1.0.jar b/plexus-java/src/test/test-data/jar.unsupported/jdom-1.0.jar similarity index 100% rename from plexus-java/src/test/resources/jar.unsupported/jdom-1.0.jar rename to plexus-java/src/test/test-data/jar.unsupported/jdom-1.0.jar diff --git a/plexus-java/src/test/resources/jmod.descriptor/first-jmod-1.0-SNAPSHOT.jmod b/plexus-java/src/test/test-data/jmod.descriptor/first-jmod-1.0-SNAPSHOT.jmod similarity index 100% rename from plexus-java/src/test/resources/jmod.descriptor/first-jmod-1.0-SNAPSHOT.jmod rename to plexus-java/src/test/test-data/jmod.descriptor/first-jmod-1.0-SNAPSHOT.jmod diff --git a/plexus-java/src/test/resources/mock/jar0.jar b/plexus-java/src/test/test-data/mock/jar0.jar similarity index 100% rename from plexus-java/src/test/resources/mock/jar0.jar rename to plexus-java/src/test/test-data/mock/jar0.jar diff --git a/plexus-java/src/test/resources/mock/jar1.jar b/plexus-java/src/test/test-data/mock/jar1.jar similarity index 100% rename from plexus-java/src/test/resources/mock/jar1.jar rename to plexus-java/src/test/test-data/mock/jar1.jar diff --git a/plexus-java/src/test/resources/mock/jar2.jar b/plexus-java/src/test/test-data/mock/jar2.jar similarity index 100% rename from plexus-java/src/test/resources/mock/jar2.jar rename to plexus-java/src/test/test-data/mock/jar2.jar diff --git a/plexus-java/src/test/resources/mock/module-info.class b/plexus-java/src/test/test-data/mock/module-info.class similarity index 100% rename from plexus-java/src/test/resources/mock/module-info.class rename to plexus-java/src/test/test-data/mock/module-info.class diff --git a/plexus-java/src/test/resources/mock/module-info.java b/plexus-java/src/test/test-data/mock/module-info.java similarity index 100% rename from plexus-java/src/test/resources/mock/module-info.java rename to plexus-java/src/test/test-data/mock/module-info.java diff --git a/plexus-java/src/test/resources/nonjar/pom.xml b/plexus-java/src/test/test-data/nonjar/pom.xml similarity index 100% rename from plexus-java/src/test/resources/nonjar/pom.xml rename to plexus-java/src/test/test-data/nonjar/pom.xml diff --git a/plexus-java/src/test/resources/src.dir/module-info.java b/plexus-java/src/test/test-data/src.dir/module-info.java similarity index 100% rename from plexus-java/src/test/resources/src.dir/module-info.java rename to plexus-java/src/test/test-data/src.dir/module-info.java