Package org.apache.axiom.testutils.io

Examples of org.apache.axiom.testutils.io.CloseSensorReader


    public TestCloseReader(StAXImplementation staxImpl) {
        super(staxImpl);
    }

    protected void runTest() throws Throwable {
        CloseSensorReader in = new CloseSensorReader(new StringReader("<root/>"));
        XMLStreamReader reader = staxImpl.newNormalizedXMLInputFactory().createXMLStreamReader(in);
        reader.close();
        assertFalse(in.isClosed());
    }
View Full Code Here


            in.close();
        }
    }
   
    public void testCloseWithReader() throws Exception {
        CloseSensorReader in = new CloseSensorReader(new StringReader("<root><child/></root>"));
        try {
            OMXMLParserWrapper builder = OMXMLBuilderFactory.createOMBuilder(omMetaFactory.getOMFactory(), in);
            builder.getDocument().build();
            builder.close();
            // OMXMLParserWrapper#close() does _not_ close the underlying input stream
            assertFalse(in.isClosed());
        } finally {
            in.close();
        }
    }
View Full Code Here

  public TestCloseWithReader(OMMetaFactory metaFactory) {
    super(metaFactory);
  }

  protected void runTest() throws Throwable {
        CloseSensorReader in = new CloseSensorReader(new StringReader("<root><child/></root>"));
        try {
            OMXMLParserWrapper builder = OMXMLBuilderFactory.createOMBuilder(metaFactory.getOMFactory(), in);
            builder.getDocument().build();
            builder.close();
            // OMXMLParserWrapper#close() does _not_ close the underlying input stream
            assertFalse(in.isClosed());
        } finally {
            in.close();
        }
  }
View Full Code Here

TOP

Related Classes of org.apache.axiom.testutils.io.CloseSensorReader

Copyright © 2018 www.massapicom. 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.