public void testGetTextAsStreamWithOMSourcedElement() throws Exception {
OMFactory factory = OMAbstractFactory.getOMFactory();
DataSource ds = new RandomDataSource(445566, 32, 128, 20000000);
QName qname = new QName("a");
Charset cs = Charset.forName("ascii");
OMSourcedElement element = new OMSourcedElementImpl(qname, factory,
new WrappedTextNodeOMDataSourceFromDataSource(qname, ds, cs));
Reader in = ElementHelper.getTextAsStream(element, true);
assertFalse(in instanceof StringReader);
IOTestUtils.compareStreams(new InputStreamReader(ds.getInputStream(), cs), in);
}