Package javax.xml.stream

Examples of javax.xml.stream.XMLStreamReader.standaloneSet()


    protected void runTest() throws Throwable {
        XMLInputFactory factory = staxImpl.newNormalizedXMLInputFactory();
        XMLStreamReader reader = factory.createXMLStreamReader(
                new StringReader("<?xml version='1.0'?><root/>"));
        assertEquals(false, reader.standaloneSet());
        reader.next();
        try {
            reader.standaloneSet();
            fail("Expected IllegalStateException");
        } catch (IllegalStateException ex) {
View Full Code Here


        XMLStreamReader reader = factory.createXMLStreamReader(
                new StringReader("<?xml version='1.0'?><root/>"));
        assertEquals(false, reader.standaloneSet());
        reader.next();
        try {
            reader.standaloneSet();
            fail("Expected IllegalStateException");
        } catch (IllegalStateException ex) {
            // Expected
        }
        reader.close();
View Full Code Here

public class StandaloneSetTestCase extends DialectTestCase {
    protected void runTest() throws Throwable {
        XMLInputFactory factory = newNormalizedXMLInputFactory();
        XMLStreamReader reader = factory.createXMLStreamReader(
                new StringReader("<?xml version='1.0'?><root/>"));
        assertEquals(false, reader.standaloneSet());
        reader.next();
        try {
            reader.standaloneSet();
            fail("Expected IllegalStateException");
        } catch (IllegalStateException ex) {
View Full Code Here

        XMLStreamReader reader = factory.createXMLStreamReader(
                new StringReader("<?xml version='1.0'?><root/>"));
        assertEquals(false, reader.standaloneSet());
        reader.next();
        try {
            reader.standaloneSet();
            fail("Expected IllegalStateException");
        } catch (IllegalStateException ex) {
            // Expected
        }
        reader.close();
View Full Code Here

    }

    public void testStandaloneSet() throws Exception {
        XMLStreamReader reader = StAXUtils.createXMLStreamReader(
                new StringReader("<?xml version='1.0'?><root/>"));
        assertEquals(false, reader.standaloneSet());
        reader.next();
        try {
            reader.standaloneSet();
            fail("Expected IllegalStateException");
        } catch (IllegalStateException ex) {
View Full Code Here

        XMLStreamReader reader = StAXUtils.createXMLStreamReader(
                new StringReader("<?xml version='1.0'?><root/>"));
        assertEquals(false, reader.standaloneSet());
        reader.next();
        try {
            reader.standaloneSet();
            fail("Expected IllegalStateException");
        } catch (IllegalStateException ex) {
            // Expected
        }
        reader.close();
View Full Code Here

  public void testVersionEncodingStandalone() throws XMLStreamException {
    XMLStreamReader reader = new SimpleXMLStreamReader(new StringReader("<?xml?>"));
    Assert.assertNull(reader.getVersion());
    Assert.assertNull(reader.getCharacterEncodingScheme());
    Assert.assertFalse(reader.isStandalone());
    Assert.assertFalse(reader.standaloneSet());

    String input = "<?xml version=\"1.1\" encoding=\"US-ASCII\" standalone=\"yes\"?>";
    reader = new SimpleXMLStreamReader(new StringReader(input));
    Assert.assertEquals("1.1", reader.getVersion());
    Assert.assertEquals("US-ASCII", reader.getCharacterEncodingScheme());
View Full Code Here

    String input = "<?xml version=\"1.1\" encoding=\"US-ASCII\" standalone=\"yes\"?>";
    reader = new SimpleXMLStreamReader(new StringReader(input));
    Assert.assertEquals("1.1", reader.getVersion());
    Assert.assertEquals("US-ASCII", reader.getCharacterEncodingScheme());
    Assert.assertTrue(reader.isStandalone());
    Assert.assertTrue(reader.standaloneSet());
   
    reader.close();
  }

}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.