mirror of https://github.com/apache/poi.git
Adjust for JDK 9 ea152 and newer: certain whitespaces in XML may now be trimmed
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1781821 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
d73819d8da
commit
4dc0379d1c
|
@ -16,17 +16,6 @@
|
|||
==================================================================== */
|
||||
package org.apache.poi.hwpf.converter;
|
||||
|
||||
import static org.apache.poi.POITestCase.assertContains;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
|
||||
import java.io.StringWriter;
|
||||
|
||||
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.apache.poi.POIDataSamples;
|
||||
import org.apache.poi.hwpf.HWPFDocument;
|
||||
import org.apache.poi.hwpf.usermodel.PictureType;
|
||||
|
@ -34,20 +23,26 @@ import org.apache.poi.util.XMLHelper;
|
|||
import org.junit.Test;
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
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.StringWriter;
|
||||
|
||||
import static org.apache.poi.POITestCase.assertContains;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
|
||||
/**
|
||||
* Test cases for {@link WordToHtmlConverter}
|
||||
*/
|
||||
public class TestWordToHtmlConverter
|
||||
{
|
||||
private static String getHtmlText( final String sampleFileName )
|
||||
throws Exception
|
||||
{
|
||||
public class TestWordToHtmlConverter {
|
||||
private static String getHtmlText(final String sampleFileName) throws Exception {
|
||||
return getHtmlText(sampleFileName, false);
|
||||
}
|
||||
|
||||
private static String getHtmlText(final String sampleFileName,
|
||||
boolean emulatePictureStorage ) throws Exception
|
||||
{
|
||||
boolean emulatePictureStorage) throws Exception {
|
||||
HWPFDocument hwpfDocument = new HWPFDocument(POIDataSamples
|
||||
.getDocumentInstance().openResourceAsStream(sampleFileName));
|
||||
|
||||
|
@ -181,7 +176,8 @@ public class TestWordToHtmlConverter
|
|||
result,
|
||||
"<a class=\"a1 endnoteanchor\" href=\"#endnote_1\" name=\"endnote_back_1\">1</a>");
|
||||
assertContains(
|
||||
result,
|
||||
// starting with JDK 9 such unimportant whitespaces may be trimmed
|
||||
result.replace("</a> <span", "</a><span"),
|
||||
"<a class=\"a1 endnoteindex\" href=\"#endnote_back_1\" name=\"endnote_1\">1</a><span");
|
||||
assertContains(result, "Ending note text");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue