Package org.apache.axiom.testutils.io

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


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

    protected void runTest() throws Throwable {
        CloseSensorInputStream in = new CloseSensorInputStream(new ByteArrayInputStream("<root/>".getBytes("UTF-8")));
        XMLStreamReader reader = staxImpl.newNormalizedXMLInputFactory().createXMLStreamReader(in);
        reader.close();
        assertFalse(in.isClosed());
    }
View Full Code Here


    public OMXMLParserWrapperTestBase(OMMetaFactory omMetaFactory) {
        this.omMetaFactory = omMetaFactory;
    }
   
    public void testCloseWithInputStream() throws Exception {
        CloseSensorInputStream in = new CloseSensorInputStream(getTestResource(TestConstants.TEST));
        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 TestCloseWithInputStream(OMMetaFactory metaFactory) {
    super(metaFactory);
  }

  protected void runTest() throws Throwable {
        CloseSensorInputStream in = new CloseSensorInputStream(AbstractTestCase.getTestResource(TestConstants.TEST));
        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.CloseSensorInputStream

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.