SAXParserNSTableTest.java 文件源码

java
阅读 26 收藏 0 点赞 0 评论 0

项目:openjdk-jdk10 作者:
/**
 * namespace processing is enabled. namespace-prefix is also is enabled.
 * So it is a True-True combination.
 * The test is to test SAXParser with these conditions.
 *
 * @throws Exception If any errors occur.
 */
@Test
public void testWithTrueTrue() throws Exception {
    String outputFile = USER_DIR + "SPNSTableTT.out";
    String goldFile = GOLDEN_DIR + "NSTableTTGF.out";
    String xmlFile = XML_DIR + "namespace1.xml";
    SAXParserFactory spf = SAXParserFactory.newInstance();
    spf.setNamespaceAware(true);
    spf.setFeature("http://xml.org/sax/features/namespace-prefixes",
                                true);
    try (MyNSContentHandler handler = new MyNSContentHandler(outputFile)) {
        spf.newSAXParser().parse(new File(xmlFile), handler);
    }
    assertTrue(compareWithGold(goldFile, outputFile));

}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号