Search in sources :

Example 6 with DocumentBean

use of org.apache.axiom.ts.jaxb.beans.DocumentBean in project webservices-axiom by apache.

the class TestGetNameFromPlainObject method runTest.

@Override
protected void runTest() throws Throwable {
    OMFactory omFactory = metaFactory.getOMFactory();
    JAXBContext context = JAXBContext.newInstance(DocumentBean.class);
    OMSourcedElement element = omFactory.createOMElement(new JAXBOMDataSource(context, new DocumentBean()));
    assertEquals("http://ws.apache.org/axiom/test/jaxb", element.getNamespaceURI());
    assertEquals("document", element.getLocalName());
    assertFalse(element.isExpanded());
    // Force expansion so that OMSourcedElement compares the namespace URI and local name
    // provided by JAXBOMDataSource with the actual name of the element
    element.getFirstOMChild();
}
Also used : OMFactory(org.apache.axiom.om.OMFactory) DocumentBean(org.apache.axiom.ts.jaxb.beans.DocumentBean) JAXBContext(javax.xml.bind.JAXBContext) OMSourcedElement(org.apache.axiom.om.OMSourcedElement) JAXBOMDataSource(org.apache.axiom.om.ds.jaxb.JAXBOMDataSource)

Aggregations

JAXBContext (javax.xml.bind.JAXBContext)6 JAXBOMDataSource (org.apache.axiom.om.ds.jaxb.JAXBOMDataSource)6 DocumentBean (org.apache.axiom.ts.jaxb.beans.DocumentBean)6 DataHandler (javax.activation.DataHandler)4 OMFactory (org.apache.axiom.om.OMFactory)4 OMSourcedElement (org.apache.axiom.om.OMSourcedElement)4 OMElement (org.apache.axiom.om.OMElement)3 OMText (org.apache.axiom.om.OMText)2 SOAPEnvelope (org.apache.axiom.soap.SOAPEnvelope)2 SOAPFactory (org.apache.axiom.soap.SOAPFactory)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 OutputStream (java.io.OutputStream)1 QName (javax.xml.namespace.QName)1 XMLStreamException (javax.xml.stream.XMLStreamException)1 MemoryBlob (org.apache.axiom.blob.MemoryBlob)1 MultipartBody (org.apache.axiom.mime.MultipartBody)1 OMOutputFormat (org.apache.axiom.om.OMOutputFormat)1