use of org.apache.axiom.testutils.io.CharacterStreamComparator in project webservices-axiom by apache.
the class TestWriteTextToWithNonDestructiveOMDataSource method runTest.
@Override
protected void runTest() throws Throwable {
OMFactory factory = metaFactory.getOMFactory();
DataSource ds = new RandomDataSource(665544, 32, 128, 20000000);
QName qname = new QName("a");
OMSourcedElement element = factory.createOMElement(new WrappedTextNodeOMDataSourceFromDataSource(qname, ds, Charset.forName("ascii")), qname);
Reader in = new InputStreamReader(ds.getInputStream(), "ascii");
Writer out = new CharacterStreamComparator(in);
// cache doesn't matter here
element.writeTextTo(out, true);
out.close();
assertFalse(element.isExpanded());
}
Aggregations