Skip to content

Commit

Permalink
Updates to run build with jdk 17
Browse files Browse the repository at this point in the history
  • Loading branch information
bgoordenp committed Apr 11, 2024
1 parent da6c573 commit 45edec0
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,32 +24,6 @@
*/
package fr.opensagres.xdocreport.document.odt.styling;

import static org.junit.Assert.assertThat;

import java.io.IOException;
import java.io.InputStream;
import java.io.StringReader;
import java.io.StringWriter;
import java.io.Writer;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;

import org.junit.Assert;
import org.junit.Test;
import org.w3c.dom.Document;
import org.xml.sax.InputSource;
import org.xml.sax.XMLReader;
import org.xml.sax.helpers.XMLReaderFactory;
import org.xmlunit.matchers.CompareMatcher;

import com.sun.org.apache.xml.internal.serializer.OutputPropertiesFactory;

import fr.opensagres.xdocreport.document.odt.preprocessor.ODTBufferedDocumentContentHandler;
import fr.opensagres.xdocreport.document.odt.preprocessor.ODTStyleContentHandler;
import fr.opensagres.xdocreport.document.odt.textstyling.MockContext;
Expand All @@ -59,6 +33,28 @@
import fr.opensagres.xdocreport.document.textstyling.IDocumentHandler;
import fr.opensagres.xdocreport.document.textstyling.ITextStylingTransformer;
import fr.opensagres.xdocreport.document.textstyling.html.HTMLTextStylingTransformer;
import org.junit.Assert;
import org.junit.Test;
import org.w3c.dom.Document;
import org.xml.sax.InputSource;
import org.xml.sax.XMLReader;
import org.xml.sax.helpers.XMLReaderFactory;
import org.xmlunit.matchers.CompareMatcher;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import java.io.IOException;
import java.io.InputStream;
import java.io.StringReader;
import java.io.StringWriter;
import java.io.Writer;

import static org.junit.Assert.assertThat;

/**
* Check ODT Styling generation by comparing generated result against the expected XML
Expand Down Expand Up @@ -106,7 +102,7 @@ public String formatXML( String unformattedXml )
Transformer serializer = tfactory.newTransformer();

serializer.setOutputProperty( OutputKeys.INDENT, "yes" );
serializer.setOutputProperty( OutputPropertiesFactory.S_KEY_INDENT_AMOUNT, "2" );
serializer.setOutputProperty( "{http:// xml. apache. org/ xalan}indent-amount", "2" );
serializer.setOutputProperty( OutputKeys.STANDALONE, "no" );

Writer out = new StringWriter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,13 @@
*/
package fr.opensagres.xdocreport.document.odt.textstyling;

import static org.junit.Assert.assertThat;

import java.io.IOException;
import java.io.InputStream;
import java.io.StringReader;
import java.io.StringWriter;
import java.io.Writer;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;

import fr.opensagres.xdocreport.document.odt.preprocessor.ODTBufferedDocumentContentHandler;
import fr.opensagres.xdocreport.document.odt.preprocessor.ODTStyleContentHandler;
import fr.opensagres.xdocreport.document.preprocessor.sax.BufferedDocument;
import fr.opensagres.xdocreport.document.preprocessor.sax.BufferedDocumentContentHandler;
import fr.opensagres.xdocreport.document.textstyling.IDocumentHandler;
import fr.opensagres.xdocreport.document.textstyling.ITextStylingTransformer;
import fr.opensagres.xdocreport.document.textstyling.html.HTMLTextStylingTransformer;
import org.junit.Assert;
import org.junit.Test;
import org.w3c.dom.Document;
Expand All @@ -48,15 +39,20 @@
import org.xml.sax.helpers.XMLReaderFactory;
import org.xmlunit.matchers.CompareMatcher;

import com.sun.org.apache.xml.internal.serializer.OutputPropertiesFactory;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import java.io.IOException;
import java.io.InputStream;
import java.io.StringReader;
import java.io.StringWriter;
import java.io.Writer;

import fr.opensagres.xdocreport.document.odt.preprocessor.ODTBufferedDocumentContentHandler;
import fr.opensagres.xdocreport.document.odt.preprocessor.ODTStyleContentHandler;
import fr.opensagres.xdocreport.document.preprocessor.sax.BufferedDocument;
import fr.opensagres.xdocreport.document.preprocessor.sax.BufferedDocumentContentHandler;
import fr.opensagres.xdocreport.document.textstyling.IDocumentHandler;
import fr.opensagres.xdocreport.document.textstyling.ITextStylingTransformer;
import fr.opensagres.xdocreport.document.textstyling.html.HTMLTextStylingTransformer;
import static org.junit.Assert.assertThat;

/**
* Check ODT Styling generation by comparing generated result against the expected XML
Expand Down Expand Up @@ -104,7 +100,7 @@ public String formatXML( String unformattedXml )
Transformer serializer = tfactory.newTransformer();

serializer.setOutputProperty( OutputKeys.INDENT, "yes" );
serializer.setOutputProperty( OutputPropertiesFactory.S_KEY_INDENT_AMOUNT, "2" );
serializer.setOutputProperty( "{http:// xml. apache. org/ xalan}indent-amount", "2" );
serializer.setOutputProperty( OutputKeys.STANDALONE, "no" );

Writer out = new StringWriter();
Expand Down
14 changes: 14 additions & 0 deletions document/fr.opensagres.xdocreport.document.tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -145,5 +145,19 @@
<artifactId>logback-classic</artifactId>
<version>1.2.13</version>
</dependency>

<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-rt</artifactId>
<version>2.3.7</version>
<type>pom</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>rt</artifactId>
<version>2.3.7</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
3 changes: 3 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.14</version>
<configuration>
<argLine>--add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,20 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-rt</artifactId>
<version>2.3.7</version>
<type>pom</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>rt</artifactId>
<version>2.3.7</version>
<scope>test</scope>
</dependency>

</dependencies>

</project>

0 comments on commit 45edec0

Please sign in to comment.