Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ public void handle(ParsedURL purl, JSVGViewerFrame svgViewerFrame) throws Except

// First, load the input XML document into a generic DOM tree
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
dbf.setValidating(false);
dbf.setNamespaceAware(true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ private boolean xmlEqual(byte[] data) throws ParserConfigurationException, IOExc
return false;
}
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
dbf.setNamespaceAware(true);
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc1 = db.parse(new ByteArrayInputStream(ref));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Licensed to the Apache Software Foundation (ASF) under one or more
*/
package org.apache.batik.test.xml;

import org.apache.commons.io.FileUtils;

import org.apache.batik.script.rhino.RhinoClassShutter;
import org.apache.batik.test.DefaultTestSuite;
import org.apache.batik.test.Test;
Expand Down Expand Up @@ -69,6 +71,15 @@ public static Collection<Test[]> data() throws ParserConfigurationException, SAX
}

private static Collection<Test[]> getTests() throws ParserConfigurationException, IOException, SAXException, TestException {
new File("test-references/org/apache/batik/ext/awt/geom/candidate").mkdir();
new File("test-references/org/apache/batik/ext/awt/geom/variation").mkdir();
for (File file : FileUtils.listFiles(new File("test-references"), new String[]{"png"}, true)) {
file = file.getParentFile();
if (!file.getName().contains("candidate")) {
new File(file, "candidate-variation").mkdir();
new File(file, "candidate-reference").mkdir();
}
}
File uriStr = new File("test-resources/org/apache/batik/test/regard.xml");
URL url = uriStr.toURI().toURL();
DocumentBuilder docBuilder
Expand Down Expand Up @@ -142,23 +153,8 @@ public void test() throws ParserConfigurationException, SAXException, TestExcept
}

private static List<String> EXCLUDE = Arrays.asList(
//fail on CI
"ShowSVG",
"ATransform.defaultContextGeneration",
"Bug4945.defaultContextGeneration",
"Bug6535.defaultContextGeneration",
"Bug17965.defaultContextGeneration",
"Color1.defaultContextGeneration",
"Color2.defaultContextGeneration",
"Gradient.defaultContextGeneration",
"IdentityTest.defaultContextGeneration",
"NegativeLengths.defaultContextGeneration",
"ShearTest.defaultContextGeneration",
"TextSpacePreserve.defaultContextGeneration",
"BasicShapes.defaultContextGeneration",
"TransformCollapse.defaultContextGeneration",
"BasicShapes2.defaultContextGeneration",
"BStroke.defaultContextGeneration",
"org.apache.batik.svggen.SVGAccuracyTestValidator$SameAsReferenceImage",
"Color1.renderingCheck",
"Lookup.renderingCheck",
"Rescale.renderingCheck",
Expand Down Expand Up @@ -600,19 +596,6 @@ public void test() throws ParserConfigurationException, SAXException, TestExcept
"jarCheckLoadSameAsDocument(scripts=application/java-archive)(scriptOrigin=document)(secure=true)",
"jarCheckLoadSameAsDocument(scripts=application/java-archive)(scriptOrigin=document)(secure=false)",
"jarCheckPermissionsGranted",
// exclude additional failures appearing under JDK 1.8.0_152 on MacOS
"Bug4389.renderingCheck",
"Bug4389.ContextrenderingCheck",
"Bug6535.ContextrenderingCheck",
"Bug17965.renderingCheck",
"Bug17965.ContextrenderingCheck",
"IdentityTest.renderingCheck",
"IdentityTest.ContextrenderingCheck",
"rlm.sort",
"rlm.containsall",
"rlm.removeall",
"rlm.retainall",
"rlm.merge",
"rlm.subtract"
"Bug6535.ContextrenderingCheck"
);
}