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();
}
}