Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2 next: 2.10.1 #1115

Merged
merged 4 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
20 changes: 16 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>fr.insee.eno</groupId>
<artifactId>eno-core</artifactId>
<version>2.10.0</version>
<version>2.10.1</version>
<packaging>jar</packaging>

<name>Eno – Questionnaire generator</name>
Expand Down Expand Up @@ -107,19 +107,21 @@
<saxon.version>12.5</saxon.version>
<eclipse.version>2.7.15</eclipse.version>
<jaxb-api.version>2.3.1</jaxb-api.version>
<jaxb.core.version>4.0.5</jaxb.core.version>
<jaxb.impl.version>4.0.5</jaxb.impl.version>
<fop.version>2.9</fop.version>
<commons-io.version>2.17.0</commons-io.version>
<guice.version>7.0.0</guice.version>
<!-- Logging API -->
<slf4j.version>2.0.16</slf4j.version>
<!-- Test dependencies -->
<junit.version>5.11.1</junit.version>
<junit.version>5.11.2</junit.version>
<xmlunit.version>2.10.0</xmlunit.version>
<apache-commons.version>3.17.0</apache-commons.version>
<log4j-slf4j2.version>2.24.1</log4j-slf4j2.version>
<!-- Build plugins -->
<source.plugin.version>3.3.1</source.plugin.version>
<javadoc.plugin.version>3.10.0</javadoc.plugin.version>
<javadoc.plugin.version>3.10.1</javadoc.plugin.version>
<!-- Sonar -->
<jacoco.version>0.8.12</jacoco.version>
<sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
Expand Down Expand Up @@ -165,6 +167,16 @@
<artifactId>jaxb-api</artifactId>
<version>${jaxb-api.version}</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>${jaxb.core.version}</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>${jaxb.impl.version}</version>
</dependency>

<!-- PDF dependency -->
<dependency>
Expand Down Expand Up @@ -252,7 +264,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.0</version>
<version>3.5.1</version>
<configuration>
<encoding>UTF-8</encoding>
<argLine>-Dfile.encoding=UTF-8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/fr/insee/eno/xsl/FodsToXSLCompiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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 +
Expand Down Expand Up @@ -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");
}

/**
Expand Down
22 changes: 11 additions & 11 deletions src/test/java/fr/insee/eno/test/TestDDI2FODT.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,28 @@
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();

private XMLDiff xmlDiff = new XMLDiff();


@Test
public void simpleDiffTest() {
void simpleDiffTest() {
try {
String basePath = "src/test/resources/ddi-to-fodt";

Expand All @@ -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();
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/test/java/fr/insee/eno/test/XMLDiff.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/log4j2-test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</Console>
</Appenders>
<Loggers>
<Root level="debug">
<Root level="warn">
<AppenderRef ref="Console" />
</Root>
</Loggers>
Expand Down