You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ss...@apache.org on 2022/08/15 13:38:39 UTC

[sling-maven-plugin] branch master updated: SLING-11542 sling-maven-plugin: GenerateAdapterMetadataMojoTest fails under Windows

This is an automated email from the ASF dual-hosted git repository.

sseifert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-maven-plugin.git


The following commit(s) were added to refs/heads/master by this push:
     new dbf3040  SLING-11542 sling-maven-plugin: GenerateAdapterMetadataMojoTest fails under Windows
dbf3040 is described below

commit dbf3040b5e0cd49089ce1a8086e4e8361375b805
Author: Stefan Seifert <st...@users.noreply.github.com>
AuthorDate: Mon Aug 15 15:38:26 2022 +0200

    SLING-11542 sling-maven-plugin: GenerateAdapterMetadataMojoTest fails under Windows
---
 .../sling/maven/bundlesupport/GenerateAdapterMetadataMojoTest.java | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/test/java/org/apache/sling/maven/bundlesupport/GenerateAdapterMetadataMojoTest.java b/src/test/java/org/apache/sling/maven/bundlesupport/GenerateAdapterMetadataMojoTest.java
index 50809b5..b4c0de6 100644
--- a/src/test/java/org/apache/sling/maven/bundlesupport/GenerateAdapterMetadataMojoTest.java
+++ b/src/test/java/org/apache/sling/maven/bundlesupport/GenerateAdapterMetadataMojoTest.java
@@ -24,6 +24,7 @@ import static org.junit.Assert.assertTrue;
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
+import java.net.URISyntaxException;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
@@ -49,11 +50,11 @@ public class GenerateAdapterMetadataMojoTest {
 
     static final Path RELATIVE_ANNOTATIONTEST_PACKAGE_PATH = Paths.get("org", "apache", "sling", "maven", "bundlesupport", "annotationtest");
     @Test
-    public void testExecute() throws MojoExecutionException, MojoFailureException, IOException {
+    public void testExecute() throws MojoExecutionException, MojoFailureException, IOException, URISyntaxException {
         GenerateAdapterMetadataMojo mojo = new GenerateAdapterMetadataMojo();
         // copy classes in package "annotationtest" to classpath?
         File classpathFolder = tmpDirectory.newFolder("test-classpath");
-        Path testClasspath = Paths.get(GenerateAdapterMetadataMojoTest.class.getProtectionDomain().getCodeSource().getLocation().getPath());
+        Path testClasspath = Paths.get(GenerateAdapterMetadataMojoTest.class.getProtectionDomain().getCodeSource().getLocation().toURI());
         // only support directory right now
         if (!Files.isDirectory(testClasspath)) {
             throw new IllegalStateException("Only supposed to be called from a directory, not a jar file");
@@ -74,7 +75,7 @@ public class GenerateAdapterMetadataMojoTest {
         expectedJsonObjectBuilder.add("java.lang.Long", Json.createObjectBuilder().add("first condition", Adapter2.class.getName()));
         expectedJsonObjectBuilder.add("java.lang.String", Json.createObjectBuilder().add("If the adaptable is a Adapter1.", Json.createArrayBuilder().add(Adapter1.class.getName()).add(Adapter2.class.getName())));
         expectedJsonObjectBuilder.add("java.lang.Integer", Json.createObjectBuilder().add("If the adaptable is a Adapter1.", Adapter1.class.getName()));
-        
+
         try (InputStream input = Files.newInputStream(outputFile);
              JsonReader jsonReader = Json.createReader(input)) {
             assertEquals(expectedJsonObjectBuilder.build(), jsonReader.readObject());