use of org.apache.axiom.om.OMFactory in project webservices-axiom by apache.
the class TestGetAttributeTypeDefault method runTest.
@Override
protected void runTest() throws Throwable {
OMFactory factory = metaFactory.getOMFactory();
OMNamespace ns = factory.createOMNamespace("http://www.me.com", "axiom");
OMAttribute at = factory.createOMAttribute("id", ns, "value");
assertEquals("CDATA", at.getAttributeType());
}
use of org.apache.axiom.om.OMFactory in project webservices-axiom by apache.
the class TestGetNamespaceURIWithoutNamespace method runTest.
@Override
protected void runTest() throws Throwable {
OMFactory factory = metaFactory.getOMFactory();
OMAttribute attr = factory.createOMAttribute("name", null, "value");
assertNull(attr.getNamespaceURI());
}
use of org.apache.axiom.om.OMFactory in project webservices-axiom by apache.
the class OMElementTest method testAddLLOMTextChildToDOOM.
public void testAddLLOMTextChildToDOOM() throws XMLStreamException {
OMFactory doomFactory = OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM).getOMFactory();
OMFactory llomFactory = OMAbstractFactory.getOMFactory();
String text = "This was a DOOM Text";
OMElement doomRoot = doomFactory.createOMElement("root", null);
OMText llomText = llomFactory.createOMText(text);
OMComment comment = llomFactory.createOMComment(null, "comment");
doomRoot.addChild(llomText);
doomRoot.addChild(comment);
OMElement newElement = (OMXMLBuilderFactory.createStAXOMBuilder(this.factory, doomRoot.getXMLStreamReader())).getDocumentElement();
newElement.build();
assertEquals(newElement.getText(), text);
}
use of org.apache.axiom.om.OMFactory in project webservices-axiom by apache.
the class RegisterCustomBuilderForPayloadJAXBTestCase method createTestDocument.
protected final OMElement createTestDocument(DataHandler dh) {
OMFactory factory = metaFactory.getOMFactory();
OMElement document = factory.createOMElement(new QName("urn:test", "document"));
OMElement name = factory.createOMElement(new QName("name"));
name.setText("some name");
document.addChild(name);
OMElement content = factory.createOMElement(new QName("content"));
content.addChild(factory.createOMText(dh, true));
document.addChild(content);
return document;
}
use of org.apache.axiom.om.OMFactory in project webservices-axiom by apache.
the class TestGetOMDocumentElementWithParser method runTest.
@Override
protected void runTest() throws Throwable {
OMFactory factory = metaFactory.getOMFactory();
OMDocument document = OMXMLBuilderFactory.createOMBuilder(factory, new StringReader("<!-- comment --><root/><!-- comment -->")).getDocument();
OMElement documentElement = document.getOMDocumentElement();
assertNotNull(documentElement);
assertEquals("root", documentElement.getLocalName());
}
Aggregations