use of org.apache.axiom.om.dom.DOMMetaFactory in project webservices-axiom by apache.
the class EclipseTest method testDOOM.
@Test
public void testDOOM() throws Exception {
DOMMetaFactory metaFactory = (DOMMetaFactory) OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM);
Document document = metaFactory.newDocumentBuilderFactory().newDocumentBuilder().newDocument();
Element element = document.createElementNS("urn:test", "p:root");
assertEquals(new QName("urn:test", "root"), ((OMElement) element).getQName());
}
use of org.apache.axiom.om.dom.DOMMetaFactory 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.dom.DOMMetaFactory in project webservices-axiom by apache.
the class TestGetOMFactory1 method runTest.
@Override
protected void runTest() throws Throwable {
Document document = ((DOMMetaFactory) metaFactory).newDocumentBuilderFactory().newDocumentBuilder().newDocument();
assertSame(metaFactory.getOMFactory(), ((OMDocument) document).getOMFactory());
}
use of org.apache.axiom.om.dom.DOMMetaFactory in project webservices-axiom by apache.
the class TestSetValueOnNamespaceDeclaration method runTest.
@Override
protected void runTest() throws Throwable {
Document doc = ((DOMMetaFactory) metaFactory).newDocumentBuilderFactory().newDocumentBuilder().newDocument();
Element element = doc.createElementNS("", "test");
Attr attr = doc.createAttributeNS(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, "xmlns:attr");
element.setAttributeNodeNS(attr);
attr.setValue("urn:test");
Iterator<OMNamespace> it = ((OMElement) element).getAllDeclaredNamespaces();
assertThat(it.hasNext()).isTrue();
OMNamespace ns = it.next();
assertThat(ns.getNamespaceURI()).isEqualTo("urn:test");
assertThat(it.hasNext()).isFalse();
}
use of org.apache.axiom.om.dom.DOMMetaFactory in project webservices-axiom by apache.
the class TestGetNamespaceNormalized method runTest.
@Override
protected void runTest() throws Throwable {
Document doc = ((DOMMetaFactory) metaFactory).newDocumentBuilderFactory().newDocumentBuilder().newDocument();
Attr attr = doc.createAttributeNS(null, "attr");
assertNull(((OMAttribute) attr).getNamespace());
}
Aggregations