use of org.apache.axiom.om.OMAttribute in project webservices-axiom by apache.
the class TestCreateOMAttribute method runTest.
@Override
protected void runTest() throws Throwable {
OMFactory factory = metaFactory.getOMFactory();
OMAttribute attr = factory.createOMAttribute("attr", null, "value");
assertTrue(attr instanceof Attr);
Attr domAttr = (Attr) attr;
assertNull(domAttr.getOwnerElement());
assertNotNull(domAttr.getOwnerDocument());
assertEquals("attr", domAttr.getLocalName());
assertEquals("value", domAttr.getValue());
}
use of org.apache.axiom.om.OMAttribute 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.OMAttribute 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.OMAttribute in project webservices-axiom by apache.
the class TestHasNameWithoutNamespace method runTest.
@Override
protected void runTest() throws Throwable {
OMAttribute attr = metaFactory.getOMFactory().createOMAttribute("name", null, "value");
assertTrue(attr.hasName(new QName("name")));
assertFalse(attr.hasName(new QName("urn:test", "name")));
}
use of org.apache.axiom.om.OMAttribute in project webservices-axiom by apache.
the class TestSetLang method runTest.
@Override
protected void runTest() throws Throwable {
SOAPFaultText faultText = soapFactory.createSOAPFaultText();
faultText.setLang("en");
assertEquals("SOAP Fault Text Test : - After calling setLang method, Lang attribute value mismatch", "en", faultText.getLang());
OMAttribute langAttribute = faultText.getAllAttributes().next();
assertEquals("SOAP Fault Text Test : - After calling setLang method, Lang attribute local name mismaatch", SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_LOCAL_NAME, langAttribute.getLocalName());
assertEquals("SOAP Fault Text Test : - After calling setLang method, Lang attribute namespace prefix mismatch", SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_NS_PREFIX, langAttribute.getNamespace().getPrefix());
assertEquals("SOAP Fault Text Test : - After calling setLang method, Lang attribute namespace uri mismatch", SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_NS_URI, langAttribute.getNamespace().getNamespaceURI());
}
Aggregations