Search in sources :

Example 11 with OMComment

use of org.apache.axiom.om.OMComment in project webservices-axiom by apache.

the class TestCreateOMCommentWithoutParent method runTest.

@Override
protected void runTest() throws Throwable {
    OMComment comment = metaFactory.getOMFactory().createOMComment(null, "my comment");
    assertNull(comment.getParent());
    assertEquals("my comment", comment.getValue());
}
Also used : OMComment(org.apache.axiom.om.OMComment)

Example 12 with OMComment

use of org.apache.axiom.om.OMComment in project webservices-axiom by apache.

the class TestCommentInEpilog method runTest.

@Override
protected void runTest() throws Throwable {
    SOAPEnvelope envelope = OMXMLBuilderFactory.createSOAPModelBuilder(metaFactory, new StringReader(soapFactory.getDefaultEnvelope() + "<!--comment-->")).getSOAPEnvelope();
    OMNode sibling = envelope.getNextOMSibling();
    assertTrue(sibling instanceof OMComment);
}
Also used : OMNode(org.apache.axiom.om.OMNode) OMComment(org.apache.axiom.om.OMComment) StringReader(java.io.StringReader) SOAPEnvelope(org.apache.axiom.soap.SOAPEnvelope)

Example 13 with OMComment

use of org.apache.axiom.om.OMComment in project webservices-axiom by apache.

the class TestCommentInProlog method runTest.

@Override
protected void runTest() throws Throwable {
    SOAPMessage message = SOAPSampleSet.COMMENT_IN_PROLOG.getMessage(spec).getAdapter(SOAPSampleAdapter.class).getSOAPMessage(metaFactory);
    OMNode firstChild = message.getFirstOMChild();
    assertTrue(firstChild instanceof OMComment);
}
Also used : OMNode(org.apache.axiom.om.OMNode) OMComment(org.apache.axiom.om.OMComment) SOAPSampleAdapter(org.apache.axiom.ts.soap.SOAPSampleAdapter) SOAPMessage(org.apache.axiom.soap.SOAPMessage)

Aggregations

OMComment (org.apache.axiom.om.OMComment)13 OMElement (org.apache.axiom.om.OMElement)8 OMFactory (org.apache.axiom.om.OMFactory)6 OMNode (org.apache.axiom.om.OMNode)6 StringReader (java.io.StringReader)4 OMText (org.apache.axiom.om.OMText)4 OMContainer (org.apache.axiom.om.OMContainer)2 OMDocument (org.apache.axiom.om.OMDocument)2 OMProcessingInstruction (org.apache.axiom.om.OMProcessingInstruction)2 Iterator (java.util.Iterator)1 XMLStreamWriter (javax.xml.stream.XMLStreamWriter)1 OMDocType (org.apache.axiom.om.OMDocType)1 OMNamespace (org.apache.axiom.om.OMNamespace)1 OMXMLParserWrapper (org.apache.axiom.om.OMXMLParserWrapper)1 AxiomComment (org.apache.axiom.om.impl.intf.AxiomComment)1 AxiomDocType (org.apache.axiom.om.impl.intf.AxiomDocType)1 AxiomElement (org.apache.axiom.om.impl.intf.AxiomElement)1 AxiomEntityReference (org.apache.axiom.om.impl.intf.AxiomEntityReference)1 AxiomNamespaceDeclaration (org.apache.axiom.om.impl.intf.AxiomNamespaceDeclaration)1 AxiomProcessingInstruction (org.apache.axiom.om.impl.intf.AxiomProcessingInstruction)1