use of org.apache.axiom.ts.dimension.serialization.SerializeToOutputStream in project webservices-axiom by apache.
the class TestSerializeOMDataSourceWritingToOutputStream method runTest.
@Override
protected void runTest() throws Throwable {
OMDataSourceImpl ds = new OMDataSourceImpl();
OMFactory factory = metaFactory.getOMFactory();
OMSourcedElement element = factory.createOMElement(ds);
OMElement elementToSerialize;
if (serializeParent) {
OMElement parent = factory.createOMElement("root", null);
parent.addChild(element);
elementToSerialize = parent;
} else {
elementToSerialize = element;
}
assertAbout(xml()).that(serializationStrategy.serialize(elementToSerialize).getInputSource()).hasSameContentAs(serializeParent ? "<root><test xmlns='urn:test'/></root>" : "<test xmlns='urn:test'/>");
assertThat(ds.isOutputStreamUsed()).isEqualTo(serializationStrategy instanceof SerializeToOutputStream);
}
Aggregations