diff --git a/pom.xml b/pom.xml index 219c5fe4..90e61884 100644 --- a/pom.xml +++ b/pom.xml @@ -148,12 +148,6 @@ ${jaxb.version} - - se.jguru.shared.algorithms.api - jguru-shared-algorithms-api - 0.12.0 - - org.jvnet.staxex stax-ex @@ -258,8 +252,9 @@ test - se.jguru.shared.algorithms.api - jguru-shared-algorithms-api + commons-io + commons-io + 2.16.1 test diff --git a/src/test/java/org/codehaus/mojo/jaxb2/PropertyResources.java b/src/test/java/org/codehaus/mojo/jaxb2/PropertyResources.java new file mode 100644 index 00000000..55e5c0ca --- /dev/null +++ b/src/test/java/org/codehaus/mojo/jaxb2/PropertyResources.java @@ -0,0 +1,36 @@ +package org.codehaus.mojo.jaxb2; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + +import java.io.File; +import java.io.IOException; + +import org.apache.commons.io.FileUtils; + +import static java.nio.charset.StandardCharsets.UTF_8; + +public class PropertyResources { + + public static String readFully(String s) throws IOException { + File file = + new File(PropertyResources.class.getClassLoader().getResource(s).getFile()); + return FileUtils.readFileToString(file, UTF_8); + } +} diff --git a/src/test/java/org/codehaus/mojo/jaxb2/schemageneration/postprocessing/AbstractJavadocExtractorTest.java b/src/test/java/org/codehaus/mojo/jaxb2/schemageneration/postprocessing/AbstractJavadocExtractorTest.java index c32e9f4f..3b512c1c 100644 --- a/src/test/java/org/codehaus/mojo/jaxb2/schemageneration/postprocessing/AbstractJavadocExtractorTest.java +++ b/src/test/java/org/codehaus/mojo/jaxb2/schemageneration/postprocessing/AbstractJavadocExtractorTest.java @@ -1,6 +1,7 @@ package org.codehaus.mojo.jaxb2.schemageneration.postprocessing; import java.io.File; +import java.io.IOException; import java.io.StringReader; import java.net.URL; import java.util.ArrayList; @@ -8,6 +9,7 @@ import java.util.List; import org.codehaus.mojo.jaxb2.BufferingLog; +import org.codehaus.mojo.jaxb2.PropertyResources; import org.codehaus.mojo.jaxb2.schemageneration.XsdGeneratorHelper; import org.codehaus.mojo.jaxb2.schemageneration.postprocessing.javadoc.JavaDocExtractor; import org.codehaus.mojo.jaxb2.schemageneration.postprocessing.javadoc.SearchableDocumentation; @@ -17,7 +19,6 @@ import org.codehaus.mojo.jaxb2.shared.filters.pattern.PatternFileFilter; import org.junit.jupiter.api.BeforeEach; import org.w3c.dom.Document; -import se.jguru.shared.algorithms.api.resources.PropertyResources; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -84,7 +85,7 @@ protected SearchableDocumentation processSources() { return extractor.process(); } - protected Document createDocumentFrom(final String resource) { + protected Document createDocumentFrom(final String resource) throws IOException { // Check sanity Validate.notEmpty(resource, "resource"); diff --git a/src/test/java/org/codehaus/mojo/jaxb2/schemageneration/postprocessing/XsdGeneratorHelperTest.java b/src/test/java/org/codehaus/mojo/jaxb2/schemageneration/postprocessing/XsdGeneratorHelperTest.java index bcea1510..543dcd7a 100644 --- a/src/test/java/org/codehaus/mojo/jaxb2/schemageneration/postprocessing/XsdGeneratorHelperTest.java +++ b/src/test/java/org/codehaus/mojo/jaxb2/schemageneration/postprocessing/XsdGeneratorHelperTest.java @@ -17,6 +17,7 @@ import org.apache.maven.plugin.MojoExecutionException; import org.codehaus.mojo.jaxb2.BufferingLog; +import org.codehaus.mojo.jaxb2.PropertyResources; import org.codehaus.mojo.jaxb2.schemageneration.XsdGeneratorHelper; import org.codehaus.mojo.jaxb2.schemageneration.postprocessing.javadoc.AbstractSourceCodeAwareNodeProcessingTest; import org.codehaus.mojo.jaxb2.schemageneration.postprocessing.javadoc.JavaDocExtractor; @@ -39,7 +40,6 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.w3c.dom.Document; -import se.jguru.shared.algorithms.api.resources.PropertyResources; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; diff --git a/src/test/java/org/codehaus/mojo/jaxb2/schemageneration/postprocessing/javadoc/DomHelperTest.java b/src/test/java/org/codehaus/mojo/jaxb2/schemageneration/postprocessing/javadoc/DomHelperTest.java index fda1ee2e..0297a48e 100644 --- a/src/test/java/org/codehaus/mojo/jaxb2/schemageneration/postprocessing/javadoc/DomHelperTest.java +++ b/src/test/java/org/codehaus/mojo/jaxb2/schemageneration/postprocessing/javadoc/DomHelperTest.java @@ -6,13 +6,13 @@ import java.util.Map; import java.util.TreeMap; +import org.codehaus.mojo.jaxb2.PropertyResources; import org.codehaus.mojo.jaxb2.schemageneration.XsdGeneratorHelper; import org.junit.jupiter.api.Test; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; -import se.jguru.shared.algorithms.api.resources.PropertyResources; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; diff --git a/src/test/java/org/codehaus/mojo/jaxb2/schemageneration/postprocessing/javadoc/enums/XsdAnnotationProcessorAndEnumsTest.java b/src/test/java/org/codehaus/mojo/jaxb2/schemageneration/postprocessing/javadoc/enums/XsdAnnotationProcessorAndEnumsTest.java index 974afbdd..61ca20fc 100644 --- a/src/test/java/org/codehaus/mojo/jaxb2/schemageneration/postprocessing/javadoc/enums/XsdAnnotationProcessorAndEnumsTest.java +++ b/src/test/java/org/codehaus/mojo/jaxb2/schemageneration/postprocessing/javadoc/enums/XsdAnnotationProcessorAndEnumsTest.java @@ -7,6 +7,7 @@ import jakarta.xml.bind.JAXBContext; import jakarta.xml.bind.Marshaller; +import org.codehaus.mojo.jaxb2.PropertyResources; import org.codehaus.mojo.jaxb2.schemageneration.postprocessing.javadoc.AbstractSourceCodeAwareNodeProcessingTest; import org.codehaus.mojo.jaxb2.schemageneration.postprocessing.javadoc.JavaDocRenderer; import org.codehaus.mojo.jaxb2.schemageneration.postprocessing.javadoc.NoAuthorJavaDocRenderer; @@ -17,7 +18,6 @@ import org.w3c.dom.Node; import org.xmlunit.builder.DiffBuilder; import org.xmlunit.diff.Diff; -import se.jguru.shared.algorithms.api.resources.PropertyResources; import static org.junit.jupiter.api.Assertions.assertFalse; diff --git a/src/test/java/org/codehaus/mojo/jaxb2/shared/FileSystemUtilitiesTest.java b/src/test/java/org/codehaus/mojo/jaxb2/shared/FileSystemUtilitiesTest.java index 24d7a861..bf6c5f8f 100644 --- a/src/test/java/org/codehaus/mojo/jaxb2/shared/FileSystemUtilitiesTest.java +++ b/src/test/java/org/codehaus/mojo/jaxb2/shared/FileSystemUtilitiesTest.java @@ -13,12 +13,12 @@ import org.codehaus.mojo.jaxb2.AbstractJaxbMojo; import org.codehaus.mojo.jaxb2.BufferingLog; +import org.codehaus.mojo.jaxb2.PropertyResources; import org.codehaus.mojo.jaxb2.shared.filters.Filter; import org.codehaus.mojo.jaxb2.shared.filters.Filters; import org.codehaus.mojo.jaxb2.shared.filters.pattern.PatternFileFilter; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import se.jguru.shared.algorithms.api.resources.PropertyResources; import static org.junit.jupiter.api.Assertions.*; @@ -381,7 +381,7 @@ void validateGettingFileForClassURL() { // Assemble final URL streamingDhURL = - PropertyResources.class.getProtectionDomain().getCodeSource().getLocation(); + Test.class.getProtectionDomain().getCodeSource().getLocation(); assertNotNull(streamingDhURL); // Act