ValidatingSAXParser { public void parse(File file, ContentHandler handler) throws FileNotFoundException, SAXException, IOException { parse(new FileInputStream(file), file.getCanonicalPath(), handler); } ValidatingSAXParser(LSResourceResolver resolver); void parse(File file, ContentHandler handler); void parse(InputStream input, String systemId, ContentHandler handler); void parse(InputSource input, ContentHandler handler);  }
@Test public void test_parse_valid_file() throws Exception { CLSResourceResolver schemas = new CLSResourceResolver(CompositeResolverTest.newTestInstance()); TestHandler handler = new TestHandler(); File f = new File("src/test/resources/valid-menu.xml"); new ValidatingSAXParser(schemas).parse(f, handler); assertThat(handler.code1, is("1")); assertThat(handler.code2, is("2")); }
@Test public void test_parse_valid_file2() throws Exception { CLSResourceResolver schemas = new CLSResourceResolver(CompositeResolverTest.newTestInstance()); TestHandler handler = new TestHandler(); File f = new File("src/test/resources/a.xml"); new ValidatingSAXParser(schemas).parse(f, handler); }
@Test public void test_parse_valid_file3() throws Exception { CLSResourceResolver schemas = new CLSResourceResolver(CompositeResolverTest.newTestInstance()); TestHandler handler = new TestHandler(); File f = new File("src/test/resources/schema/a.xsd"); new ValidatingSAXParser(schemas).parse(f, handler); }