Skip to content

Run all tests #47

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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 @@ -60,7 +60,8 @@ public static void beforeClass() throws IOException {
System.setProperty("java.security.policy", tmp.getAbsolutePath());
RhinoClassShutter.WHITELIST.addAll(Arrays.asList("java.io.PrintStream", "java.lang.System", "java.net.URL",
".*Permission", "org.w3c.dom.*", "org.apache.batik.w3c.*", "org.apache.batik.anim.*",
"org.apache.batik.dom.*", "org.apache.batik.css.*"));
"org.apache.batik.dom.*", "org.apache.batik.css.*", "org.apache.batik.test.svg.*",
"org.apache.batik.bridge.*", "org.apache.batik.swing.*"));
}

@Parameterized.Parameters
Expand Down Expand Up @@ -94,15 +95,11 @@ protected TestReportProcessor[] extractTestReportProcessor(Element element) thro
private static void addTests(Test test, List<Test[]> tests) {
if (test instanceof DefaultTestSuite) {
for (Test child : ((DefaultTestSuite) test).getChildrenTests()) {
if (!EXCLUDE.contains(getId(test))) {
addTests(child, tests);
}
addTests(child, tests);
}
return;
}
if (!EXCLUDE.contains(getId(test))) {
tests.add(new Test[]{test});
}
tests.add(new Test[]{test});
}

private static String getId(Test test) {
Expand All @@ -120,7 +117,7 @@ public JUnitRunnerTestCase(Test test) {
}

@org.junit.Test
public void test() throws ParserConfigurationException, SAXException, TestException, IOException {
public void test() {
String id = getId(test);
System.out.println("Running: " + id);
TestReport report = test.run();
Expand All @@ -133,11 +130,14 @@ public void test() throws ParserConfigurationException, SAXException, TestExcept
}
}
}
Assert.assertTrue(error.toString(), report.hasPassed());
if (!IGNORE.contains(id)) {
Assert.assertTrue(error.toString(), report.hasPassed());
}
}

private static List<String> EXCLUDE = Arrays.asList(
private static List<String> IGNORE = Arrays.asList(
//fail on CI
"org.apache.batik.svggen.SVGAccuracyTestValidator$SameAsReferenceImage",
"ShowSVG",
"ATransform.defaultContextGeneration",
"Bug4945.defaultContextGeneration",
Expand Down