use of org.apache.axiom.om.OMDocument in project webservices-axiom by apache.
the class TestGetOMDocumentElementAfterDetach method runTest.
@Override
protected void runTest() throws Throwable {
OMFactory factory = metaFactory.getOMFactory();
OMDocument document = factory.createOMDocument();
OMElement documentElement = factory.createOMElement("root", null, document);
assertSame(documentElement, document.getOMDocumentElement());
documentElement.detach();
assertNull(document.getOMDocumentElement());
}
use of org.apache.axiom.om.OMDocument in project webservices-axiom by apache.
the class TestSetOMDocumentElementNull method runTest.
@Override
protected void runTest() throws Throwable {
OMFactory factory = metaFactory.getOMFactory();
OMDocument document = factory.createOMDocument();
try {
document.setOMDocumentElement(null);
fail("Expected IllegalArgumentException");
} catch (IllegalArgumentException ex) {
// Expected
}
}
use of org.apache.axiom.om.OMDocument in project webservices-axiom by apache.
the class TestImportInformationItem method runTest.
@Override
protected void runTest() throws Throwable {
OMDocument original = file.getAdapter(XMLSampleAdapter.class).getDocument(metaFactory);
assertAbout(xml()).that(xml(OMDocument.class, (OMDocument) metaFactory.getOMFactory().importInformationItem(original))).hasSameContentAs(xml(OMDocument.class, original));
}
use of org.apache.axiom.om.OMDocument in project webservices-axiom by apache.
the class TestDetach method runTest.
@Override
protected void runTest(SOAPEnvelope envelope) throws Throwable {
OMDocument document = (OMDocument) envelope.getParent();
envelope.detach();
assertNull(envelope.getParent());
assertNull(envelope.getPreviousOMSibling());
assertNull(envelope.getNextOMSibling());
assertNull(document.getOMDocumentElement());
}
use of org.apache.axiom.om.OMDocument in project webservices-axiom by apache.
the class TestCreateOMDocument method runTest.
@Override
protected void runTest() throws Throwable {
OMDocument document = metaFactory.getOMFactory().createOMDocument();
assertNotNull(document);
assertNull(document.getFirstOMChild());
// OMDocument doesn't extend OMNode. Therefore, the OMDocument implementation
// should not implement OMNode either. This is a regression test for AXIOM-385.
assertFalse(document instanceof OMNode);
}
Aggregations