use of org.apache.axiom.om.OMAttribute in project webservices-axiom by apache.
the class TestGetLangWithParser method runTest.
@Override
protected void runTest(SOAPEnvelope envelope) throws Throwable {
SOAPFaultText faultText = envelope.getBody().getFault().getReason().getFirstSOAPText();
assertTrue("SOAP 1.2 Fault Text Test With Parser : - getLang method returns incorrect string", faultText.getLang().equals("en"));
OMAttribute langAttribute = faultText.getAllAttributes().next();
assertTrue("SOAP 1.2 Fault Text Test With Parser : - Lang attribute local name mismaatch", langAttribute.getLocalName().equals(SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_LOCAL_NAME));
assertTrue("SOAP 1.2 Fault Text Test With Parser : - Lang attribute namespace prefix mismatch", langAttribute.getNamespace().getPrefix().equals(SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_NS_PREFIX));
assertTrue("SOAP 1.2 Fault Text Test With Parser : - Lang attribute namespace uri mismatch", langAttribute.getNamespace().getNamespaceURI().equals(SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_NS_URI));
}
use of org.apache.axiom.om.OMAttribute in project webservices-axiom by apache.
the class TestSetLocalName method runTest.
@Override
protected void runTest() throws Throwable {
OMFactory factory = metaFactory.getOMFactory();
OMAttribute attr = factory.createOMAttribute("test", factory.createOMNamespace("urn:test", "p"), "value");
attr.setLocalName("test2");
assertEquals("test2", attr.getLocalName());
QName qname = attr.getQName();
assertEquals("test2", qname.getLocalPart());
assertEquals("p", qname.getPrefix());
assertEquals("urn:test", qname.getNamespaceURI());
}
use of org.apache.axiom.om.OMAttribute in project webservices-axiom by apache.
the class TestGetPrefixWithoutNamespace method runTest.
@Override
protected void runTest() throws Throwable {
OMFactory factory = metaFactory.getOMFactory();
OMAttribute attr = factory.createOMAttribute("name", null, "value");
assertNull(attr.getPrefix());
}
use of org.apache.axiom.om.OMAttribute in project webservices-axiom by apache.
the class TestGetQNameWithNamespace method runTest.
@Override
protected void runTest() throws Throwable {
String localName = "attr";
String uri = "http://ns1";
OMFactory fac = metaFactory.getOMFactory();
OMNamespace ns = fac.createOMNamespace(uri, "p");
OMAttribute attr = fac.createOMAttribute(localName, ns, "value");
QName qname = attr.getQName();
assertEquals("Wrong namespace", uri, qname.getNamespaceURI());
assertEquals("Wrong localPart", localName, qname.getLocalPart());
assertEquals("Wrong prefix", "p", qname.getPrefix());
}
use of org.apache.axiom.om.OMAttribute in project webservices-axiom by apache.
the class TestGetQNameWithoutNamespace method runTest.
@Override
protected void runTest() throws Throwable {
OMAttribute attr = metaFactory.getOMFactory().createOMAttribute("name", null, "value");
QName qname = attr.getQName();
assertEquals("name", qname.getLocalPart());
assertEquals("", qname.getNamespaceURI());
assertEquals("", qname.getPrefix());
}
Aggregations