use of org.apache.axiom.om.OMAttribute in project webservices-axiom by apache.
the class TestHasNameWithNamespace method runTest.
@Override
protected void runTest() throws Throwable {
String localName = "attr";
String uri = "urn:test";
OMFactory fac = metaFactory.getOMFactory();
OMNamespace ns = fac.createOMNamespace(uri, "p");
OMAttribute attr = fac.createOMAttribute(localName, ns, "value");
assertTrue(attr.hasName(new QName(uri, localName, "p")));
assertTrue(attr.hasName(new QName(uri, localName, "q")));
assertFalse(attr.hasName(new QName("http://example.org", localName, "p")));
assertFalse(attr.hasName(new QName(uri, "otherName", "p")));
}
use of org.apache.axiom.om.OMAttribute in project webservices-axiom by apache.
the class TestGetNamespaceNormalized method runTest.
@Override
protected void runTest() throws Throwable {
OMFactory factory = metaFactory.getOMFactory();
OMNamespace ns = factory.createOMNamespace("", "");
OMAttribute attr = factory.createOMAttribute("parent", ns, "value");
assertNull(attr.getNamespace());
}
use of org.apache.axiom.om.OMAttribute in project webservices-axiom by apache.
the class TestGetNamespaceURIWithNamespace method runTest.
@Override
protected void runTest() throws Throwable {
OMFactory factory = metaFactory.getOMFactory();
OMAttribute attr = factory.createOMAttribute("name", factory.createOMNamespace("urn:ns", "p"), "value");
assertEquals("urn:ns", attr.getNamespaceURI());
}
use of org.apache.axiom.om.OMAttribute in project webservices-axiom by apache.
the class TestGetPrefixWithNamespace method runTest.
@Override
protected void runTest() throws Throwable {
OMFactory factory = metaFactory.getOMFactory();
OMAttribute attr = factory.createOMAttribute("name", factory.createOMNamespace("urn:ns", "p"), "value");
assertEquals("p", attr.getPrefix());
}
use of org.apache.axiom.om.OMAttribute in project webservices-axiom by apache.
the class TestCreateOMAttributeInterfaces method runTest.
@Override
protected void runTest() throws Throwable {
OMFactory factory = metaFactory.getOMFactory();
OMNamespace ns = factory.createOMNamespace("urn:test", "p");
OMAttribute attr = factory.createOMAttribute("attr", ns, "value");
assertFalse(attr instanceof OMSerializable);
}
Aggregations