< prev index next >

test/javax/xml/jaxp/functional/org/xml/sax/ptests/SAXParserNSTableTest.java

Print this page




  90 
  91     /**
  92      * namespace processing is not enabled. Hence namespace-prefix is
  93      * expected to be automatically on. So it is a False-True combination.
  94      * The test is to test SAXParser with these conditions.
  95      *
  96      * @throws Exception If any errors occur.
  97      */
  98     public void testWithFalseTrue() throws Exception {
  99         String outputFile = USER_DIR + "SPNSTableFT.out";
 100         String goldFile = GOLDEN_DIR + "NSTableFTGF.out";
 101         String xmlFile = XML_DIR + "namespace1.xml";
 102         SAXParserFactory spf = SAXParserFactory.newInstance();
 103         spf.setNamespaceAware(true);
 104         try (MyNSContentHandler handler = new MyNSContentHandler(outputFile)) {
 105             spf.newSAXParser().parse(new File(xmlFile), handler);
 106         }
 107         assertTrue(compareWithGold(goldFile, outputFile));
 108     }
 109 }
 110 
 111 


  90 
  91     /**
  92      * namespace processing is not enabled. Hence namespace-prefix is
  93      * expected to be automatically on. So it is a False-True combination.
  94      * The test is to test SAXParser with these conditions.
  95      *
  96      * @throws Exception If any errors occur.
  97      */
  98     public void testWithFalseTrue() throws Exception {
  99         String outputFile = USER_DIR + "SPNSTableFT.out";
 100         String goldFile = GOLDEN_DIR + "NSTableFTGF.out";
 101         String xmlFile = XML_DIR + "namespace1.xml";
 102         SAXParserFactory spf = SAXParserFactory.newInstance();
 103         spf.setNamespaceAware(true);
 104         try (MyNSContentHandler handler = new MyNSContentHandler(outputFile)) {
 105             spf.newSAXParser().parse(new File(xmlFile), handler);
 106         }
 107         assertTrue(compareWithGold(goldFile, outputFile));
 108     }
 109 }


< prev index next >