diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d8b2ead3b..c47b9fa87 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,4 +24,4 @@ jobs: - name: Build Eno with Maven run: mvn clean process-classes package install --no-transfer-progress -DskipTests=true -Dmaven.javadoc.skip=true -Djar.finalName="eno-core" -B -V --file pom.xml - name: Run test with Maven - run: mvn test + run: mvn test --no-transfer-progress diff --git a/pom.xml b/pom.xml index 663311a51..3b35899b7 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ fr.insee.eno eno-core - 2.10.0 + 2.10.1 jar Eno – Questionnaire generator @@ -107,19 +107,21 @@ 12.5 2.7.15 2.3.1 + 4.0.5 + 4.0.5 2.9 2.17.0 7.0.0 2.0.16 - 5.11.1 + 5.11.2 2.10.0 3.17.0 2.24.1 3.3.1 - 3.10.0 + 3.10.1 0.8.12 jacoco @@ -165,6 +167,16 @@ jaxb-api ${jaxb-api.version} + + com.sun.xml.bind + jaxb-core + ${jaxb.core.version} + + + com.sun.xml.bind + jaxb-impl + ${jaxb.impl.version} + @@ -252,7 +264,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.0 + 3.5.1 UTF-8 -Dfile.encoding=UTF-8 diff --git a/src/main/java/fr/insee/eno/transform/xsl/EnoErrorListener.java b/src/main/java/fr/insee/eno/transform/xsl/EnoErrorListener.java index d4c01820a..b2f5d4e4c 100644 --- a/src/main/java/fr/insee/eno/transform/xsl/EnoErrorListener.java +++ b/src/main/java/fr/insee/eno/transform/xsl/EnoErrorListener.java @@ -10,12 +10,12 @@ public class EnoErrorListener implements ErrorListener { - private final static Marker fatal = MarkerFactory.getMarker("FATAL"); - private final static Logger logger = LoggerFactory.getLogger(EnoErrorListener.class); + private static final Marker fatal = MarkerFactory.getMarker("FATAL"); + private static final Logger logger = LoggerFactory.getLogger(EnoErrorListener.class); @Override public void warning(TransformerException e) throws TransformerException { - logger.warn(e.getMessage(), e); + logger.warn(e.getMessage()); } @Override diff --git a/src/main/java/fr/insee/eno/xsl/FodsToXSLCompiler.java b/src/main/java/fr/insee/eno/xsl/FodsToXSLCompiler.java index 904c71ab2..f578df4eb 100644 --- a/src/main/java/fr/insee/eno/xsl/FodsToXSLCompiler.java +++ b/src/main/java/fr/insee/eno/xsl/FodsToXSLCompiler.java @@ -38,7 +38,7 @@ public static void main(String[] args) { try { cleaning(); - logger.info("Fods to XSL: START"); + logger.info("Fods to XSL: START"); // Fods2Xsl for /transformations/ddi/.fods files generateDDI2XFORMSDrivers(); generateDDI2FODTDrivers(); @@ -481,7 +481,7 @@ private static void generatePOGUESXMLTemplates() throws Exception, IOException { * @throws Exception : XSL related exceptions */ public static void fods2XslTarget(InputStream inputFods, OutputStream outputXsl) throws Exception { - logger.info("Entering Fods2Xsl"); + logger.debug("Entering Fods2Xsl"); // From inputfile.fods to preformate.tmp using preformatting.xsl logger.debug( FIVE_SPACES + @@ -535,7 +535,7 @@ public static void fods2XslTarget(InputStream inputFods, OutputStream outputXsl) isTEMP_XML_TMP.close(); isXML_2_XSL_XSL.close(); - logger.info("Leaving Fods2Xsl"); + logger.debug("Leaving Fods2Xsl"); } /** diff --git a/src/test/java/fr/insee/eno/test/TestDDI2FODT.java b/src/test/java/fr/insee/eno/test/TestDDI2FODT.java index eb852fd22..117eeec3c 100644 --- a/src/test/java/fr/insee/eno/test/TestDDI2FODT.java +++ b/src/test/java/fr/insee/eno/test/TestDDI2FODT.java @@ -8,13 +8,20 @@ import org.apache.commons.io.FileUtils; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.xmlunit.diff.Diff; -import java.io.*; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileOutputStream; import static fr.insee.eno.Constants.createTempEnoFile; -public class TestDDI2FODT { +class TestDDI2FODT { + + final Logger logger = LoggerFactory.getLogger(TestDDI2FODT.class); private DDI2FODTGenerator ddi2fodt = new DDI2FODTGenerator(); @@ -22,7 +29,7 @@ public class TestDDI2FODT { @Test - public void simpleDiffTest() { + void simpleDiffTest() { try { String basePath = "src/test/resources/ddi-to-fodt"; @@ -49,15 +56,8 @@ public void simpleDiffTest() { Diff diff = xmlDiff.getDiff(outputFile,expectedFile); Assertions.assertFalse(diff::hasDifferences, ()->getDiffMessage(diff, basePath)); - } catch (IOException e) { - e.printStackTrace(); - Assertions.fail(); - } catch (NullPointerException e) { - e.printStackTrace(); - Assertions.fail(); } catch (Exception e) { - e.printStackTrace(); - System.out.println(e.getMessage()); + logger.error(e.getMessage()); Assertions.fail(); } } diff --git a/src/test/java/fr/insee/eno/test/XMLDiff.java b/src/test/java/fr/insee/eno/test/XMLDiff.java index 265c64058..80b2072d2 100644 --- a/src/test/java/fr/insee/eno/test/XMLDiff.java +++ b/src/test/java/fr/insee/eno/test/XMLDiff.java @@ -1,5 +1,7 @@ package fr.insee.eno.test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.xmlunit.builder.DiffBuilder; import org.xmlunit.diff.Diff; import org.xmlunit.input.CommentLessSource; @@ -10,14 +12,12 @@ /** * Created by I6VWID on 15/01/18. */ -public class XMLDiff { +public class XMLDiff { + + final Logger logger = LoggerFactory.getLogger(XMLDiff.class); - public XMLDiff() { - - } - public Diff getDiff(File input, File expected) { - System.out.println(String.format("Diff %s with %s", input.getAbsolutePath(), expected.getAbsolutePath())); + logger.debug("Diff {} with {}", input.getAbsolutePath(), expected.getAbsolutePath()); CommentLessSource inputStream = null; CommentLessSource expectedStream = null; diff --git a/src/test/resources/log4j2-test.xml b/src/test/resources/log4j2-test.xml index 5620e006f..0502e3f95 100644 --- a/src/test/resources/log4j2-test.xml +++ b/src/test/resources/log4j2-test.xml @@ -6,7 +6,7 @@ - +