use of org.apache.axiom.om.OMInformationItem in project webservices-axiom by apache.
the class TestCreateDocumentFragmentInterfaces method runTest.
@Override
protected void runTest() throws Throwable {
Document document = ((DOMMetaFactory) metaFactory).newDocumentBuilderFactory().newDocumentBuilder().newDocument();
DocumentFragment fragment = document.createDocumentFragment();
assertFalse(fragment instanceof OMInformationItem);
}
use of org.apache.axiom.om.OMInformationItem in project webservices-axiom by apache.
the class TestClone method runTest.
@Override
protected void runTest() throws Throwable {
SOAPMessage message = soapFactory.createSOAPMessage();
message.addChild(soapFactory.getDefaultEnvelope());
OMCloneOptions options = new OMCloneOptions();
options.setPreserveModel(preserveModel);
OMInformationItem clone = message.clone(options);
if (preserveModel) {
assertTrue(clone instanceof SOAPMessage);
} else {
assertTrue(clone instanceof OMDocument);
assertFalse(clone instanceof SOAPMessage);
}
OMElement envelope = ((OMDocument) clone).getOMDocumentElement();
if (preserveModel) {
assertTrue(envelope instanceof SOAPEnvelope);
} else {
assertFalse(envelope instanceof SOAPEnvelope);
}
assertEquals("Envelope", envelope.getLocalName());
assertEquals(spec.getEnvelopeNamespaceURI(), envelope.getNamespaceURI());
}
use of org.apache.axiom.om.OMInformationItem in project webservices-axiom by apache.
the class TestCloneIncomplete method runTest.
@Override
protected void runTest() throws Throwable {
SOAPMessage message = SOAPSampleSet.WSA.getMessage(spec).getAdapter(SOAPSampleAdapter.class).getSOAPMessage(metaFactory);
OMCloneOptions options = new OMCloneOptions();
options.setPreserveModel(preserveModel);
OMInformationItem clone = message.clone(options);
if (preserveModel) {
assertTrue(clone instanceof SOAPMessage);
assertSame(soapFactory, clone.getOMFactory());
} else {
assertTrue(clone instanceof OMDocument);
assertFalse(clone instanceof SOAPMessage);
}
}
use of org.apache.axiom.om.OMInformationItem in project webservices-axiom by apache.
the class DigestTestCase method runTest.
@Override
protected final void runTest() throws Throwable {
OMInformationItem node = createInformationItem();
DigestGenerator digestGenerator = new DigestGenerator();
byte[] digest;
if (node instanceof OMDocument) {
digest = digestGenerator.getDigest((OMDocument) node, algorithm);
} else if (node instanceof OMAttribute) {
digest = digestGenerator.getDigest((OMAttribute) node, algorithm);
} else {
digest = digestGenerator.getDigest((OMNode) node, algorithm);
}
assertEquals(expectedDigest, DigestUtils.toHexString(digest));
}
Aggregations