Skip to content

Commit e8b7108

Browse files
Enable more tests
1 parent ccfb34f commit e8b7108

File tree

3 files changed

+15
-30
lines changed

3 files changed

+15
-30
lines changed

batik-svgbrowser/src/main/java/org/apache/batik/apps/svgbrowser/XMLInputHandler.java

+1
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ public void handle(ParsedURL purl, JSVGViewerFrame svgViewerFrame) throws Except
165165

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

batik-test-old/src/test/java/org/apache/batik/svggen/SVGAccuracyTest.java

+1
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ private boolean xmlEqual(byte[] data) throws ParserConfigurationException, IOExc
305305
return false;
306306
}
307307
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
308+
dbf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
308309
dbf.setNamespaceAware(true);
309310
DocumentBuilder db = dbf.newDocumentBuilder();
310311
Document doc1 = db.parse(new ByteArrayInputStream(ref));

batik-test-old/src/test/java/org/apache/batik/test/xml/JUnitRunnerTestCase.java

+13-30
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Licensed to the Apache Software Foundation (ASF) under one or more
1818
*/
1919
package org.apache.batik.test.xml;
2020

21+
import org.apache.commons.io.FileUtils;
22+
2123
import org.apache.batik.script.rhino.RhinoClassShutter;
2224
import org.apache.batik.test.DefaultTestSuite;
2325
import org.apache.batik.test.Test;
@@ -69,6 +71,15 @@ public static Collection<Test[]> data() throws ParserConfigurationException, SAX
6971
}
7072

7173
private static Collection<Test[]> getTests() throws ParserConfigurationException, IOException, SAXException, TestException {
74+
new File("test-references/org/apache/batik/ext/awt/geom/candidate").mkdir();
75+
new File("test-references/org/apache/batik/ext/awt/geom/variation").mkdir();
76+
for (File file : FileUtils.listFiles(new File("test-references"), new String[]{"png"}, true)) {
77+
file = file.getParentFile();
78+
if (!file.getName().contains("candidate")) {
79+
new File(file, "candidate-variation").mkdir();
80+
new File(file, "candidate-reference").mkdir();
81+
}
82+
}
7283
File uriStr = new File("test-resources/org/apache/batik/test/regard.xml");
7384
URL url = uriStr.toURI().toURL();
7485
DocumentBuilder docBuilder
@@ -142,23 +153,8 @@ public void test() throws ParserConfigurationException, SAXException, TestExcept
142153
}
143154

144155
private static List<String> EXCLUDE = Arrays.asList(
145-
//fail on CI
146156
"ShowSVG",
147-
"ATransform.defaultContextGeneration",
148-
"Bug4945.defaultContextGeneration",
149-
"Bug6535.defaultContextGeneration",
150-
"Bug17965.defaultContextGeneration",
151-
"Color1.defaultContextGeneration",
152-
"Color2.defaultContextGeneration",
153-
"Gradient.defaultContextGeneration",
154-
"IdentityTest.defaultContextGeneration",
155-
"NegativeLengths.defaultContextGeneration",
156-
"ShearTest.defaultContextGeneration",
157-
"TextSpacePreserve.defaultContextGeneration",
158-
"BasicShapes.defaultContextGeneration",
159-
"TransformCollapse.defaultContextGeneration",
160-
"BasicShapes2.defaultContextGeneration",
161-
"BStroke.defaultContextGeneration",
157+
"org.apache.batik.svggen.SVGAccuracyTestValidator$SameAsReferenceImage",
162158
"Color1.renderingCheck",
163159
"Lookup.renderingCheck",
164160
"Rescale.renderingCheck",
@@ -600,19 +596,6 @@ public void test() throws ParserConfigurationException, SAXException, TestExcept
600596
"jarCheckLoadSameAsDocument(scripts=application/java-archive)(scriptOrigin=document)(secure=true)",
601597
"jarCheckLoadSameAsDocument(scripts=application/java-archive)(scriptOrigin=document)(secure=false)",
602598
"jarCheckPermissionsGranted",
603-
// exclude additional failures appearing under JDK 1.8.0_152 on MacOS
604-
"Bug4389.renderingCheck",
605-
"Bug4389.ContextrenderingCheck",
606-
"Bug6535.ContextrenderingCheck",
607-
"Bug17965.renderingCheck",
608-
"Bug17965.ContextrenderingCheck",
609-
"IdentityTest.renderingCheck",
610-
"IdentityTest.ContextrenderingCheck",
611-
"rlm.sort",
612-
"rlm.containsall",
613-
"rlm.removeall",
614-
"rlm.retainall",
615-
"rlm.merge",
616-
"rlm.subtract"
599+
"Bug6535.ContextrenderingCheck"
617600
);
618601
}

0 commit comments

Comments
 (0)