1 package org.xmlhammer.cli;
2
3 import java.io.File;
4
5 import junit.framework.Test;
6 import junit.framework.TestSuite;
7
8 public class XMLParserTest extends CLITestCase {
9 protected XMLParserTest(String test) {
10 super(test);
11 }
12
13 public void testInternalXSDDOMProject() throws Exception {
14 assertOutput(
15 new File("src/test/resources/output/cli/golden-internal-xsd-dom-parser.out"),
16 run("src/test/resources/projects/validator/contact-internal-xsd-invalid-dom.xhp"));
17 }
18
19 public void testInternalInvalidXSDSAXProject() throws Exception {
20 assertOutput(
21 new File("src/test/resources/output/cli/golden-internal-invalid-xsd-sax-parser.out"),
22 run("src/test/resources/projects/validator/contact-internal-invalid-xsd-sax.xhp"));
23 }
24
25 public void testInternalFatalXSDSAXProject() throws Exception {
26 assertOutput(
27 new File("src/test/resources/output/cli/golden-internal-fatal-xsd-sax-parser.out"),
28 run("src/test/resources/projects/validator/contact-internal-fatal-xsd-sax.xhp"));
29 }
30
31 public void testInternalXSDSAXProject() throws Exception {
32 assertOutput(
33 new File("src/test/resources/output/cli/golden-internal-xsd-sax-parser.out"),
34 run("src/test/resources/projects/validator/contact-internal-xsd-invalid-sax.xhp"));
35 }
36
37 public void testXSDSAXProject() throws Exception {
38 assertOutput(
39 new File("src/test/resources/output/cli/golden-xsd-sax-parser.out"),
40 run("src/test/resources/projects/validator/contact-xsd-invalid-sax.xhp"));
41 }
42
43 public void testDTDSAXProject() throws Exception {
44 assertOutput(
45 new File("src/test/resources/output/cli/golden-dtd-sax-parser.out"),
46 run("src/test/resources/projects/validator/contact-dtd-invalid-sax.xhp"));
47 }
48
49 public void testInvalidDTDSAXProject() throws Exception {
50 assertOutput(
51 new File("src/test/resources/output/cli/golden-internal-invalid-dtd-sax-parser.out"),
52 run("src/test/resources/projects/validator/contact-internal-invalid-dtd-sax.xhp"));
53 }
54
55 public static Test suite() {
56 TestSuite suite = new TestSuite("XML Parser Command Line Test");
57
58 suite.addTest(new XMLParserTest("testInternalXSDDOMProject"));
59 suite.addTest(new XMLParserTest("testInternalXSDSAXProject"));
60 suite.addTest(new XMLParserTest("testInternalInvalidXSDSAXProject"));
61 suite.addTest(new XMLParserTest("testInternalFatalXSDSAXProject"));
62 suite.addTest(new XMLParserTest("testXSDSAXProject"));
63 suite.addTest(new XMLParserTest("testDTDSAXProject"));
64 suite.addTest(new XMLParserTest("testInvalidDTDSAXProject"));
65
66 return suite;
67 }
68 }