use of org.apache.axiom.om.OMEntityReference in project webservices-axiom by apache.
the class TestSerialize method runTest.
@Override
protected void runTest() throws Throwable {
OMEntityReference entref = metaFactory.getOMFactory().createOMEntityReference(null, "testref");
XMLStreamWriter writer = mock(XMLStreamWriter.class);
entref.serialize(writer);
verify(writer).writeEntityRef(entref.getName());
verify(writer, atMost(1)).flush();
verifyNoMoreInteractions(writer);
}
use of org.apache.axiom.om.OMEntityReference in project webservices-axiom by apache.
the class TestCreateOMEntityReferenceWithNullParent method runTest.
@Override
protected void runTest() throws Throwable {
OMFactory factory = metaFactory.getOMFactory();
OMEntityReference entref = factory.createOMEntityReference(null, "testref");
assertNull(entref.getParent());
assertEquals("testref", entref.getName());
assertNull(entref.getReplacementText());
}
use of org.apache.axiom.om.OMEntityReference in project webservices-axiom by apache.
the class TestCreateOMEntityReference method runTest.
@Override
protected void runTest() throws Throwable {
OMFactory factory = metaFactory.getOMFactory();
OMElement parent = factory.createOMElement("test", null);
OMEntityReference entref = factory.createOMEntityReference(parent, "testref");
assertSame(parent, entref.getParent());
assertEquals("testref", entref.getName());
assertNull(entref.getReplacementText());
}
use of org.apache.axiom.om.OMEntityReference in project webservices-axiom by apache.
the class WriteEntityRefScenario method validate.
@Override
public void validate(OMElement element, boolean dataHandlersPreserved) {
OMNode child = element.getFirstOMChild();
Assert.assertTrue(child instanceof OMEntityReference);
OMEntityReference entref = (OMEntityReference) child;
Assert.assertEquals("test", entref.getName());
Assert.assertNull(entref.getReplacementText());
}
Aggregations