< prev index next >

test/javax/xml/jaxp/unittest/parsers/Bug6573786.java

Print this page




  56     public void test1() {
  57         final String XML = "" + "<?xml version='1.0' standalone='bad_value' encoding='UTF-8' ?>" + "<root />";
  58         runTest(XML);
  59 
  60     }
  61 
  62     void runTest(String xmlString) {
  63         Bug6573786ErrorHandler handler = new Bug6573786ErrorHandler();
  64         try {
  65             InputStream is = new StringBufferInputStream(xmlString);
  66             SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
  67             parser.parse(is, handler);
  68         } catch (Exception e) {
  69             if (handler.fail) {
  70                 Assert.fail("The value of standalone attribute should be merged into the error message.");
  71             }
  72         }
  73 
  74     }
  75 }
  76 


  56     public void test1() {
  57         final String XML = "" + "<?xml version='1.0' standalone='bad_value' encoding='UTF-8' ?>" + "<root />";
  58         runTest(XML);
  59 
  60     }
  61 
  62     void runTest(String xmlString) {
  63         Bug6573786ErrorHandler handler = new Bug6573786ErrorHandler();
  64         try {
  65             InputStream is = new StringBufferInputStream(xmlString);
  66             SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
  67             parser.parse(is, handler);
  68         } catch (Exception e) {
  69             if (handler.fail) {
  70                 Assert.fail("The value of standalone attribute should be merged into the error message.");
  71             }
  72         }
  73 
  74     }
  75 }

< prev index next >