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());
}
use of org.apache.axiom.om.OMAttribute in project webservices-axiom by apache.
the class OMOutputTest method setUp.
/*
* @see TestCase#setUp()
*/
protected void setUp() throws Exception {
super.setUp();
DataHandler dataHandler;
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace soap = fac.createOMNamespace("http://schemas.xmlsoap.org/soap/envelope/", "soap");
envelope = fac.createOMElement("Envelope", soap);
OMElement body = fac.createOMElement("Body", soap);
OMNamespace dataName = fac.createOMNamespace("http://www.example.org/stuff", "m");
OMElement data = fac.createOMElement("data", dataName);
OMNamespace mime = fac.createOMNamespace("http://www.w3.org/2003/06/xmlmime", "mime");
OMElement text = fac.createOMElement("name", dataName);
OMAttribute cType1 = fac.createOMAttribute("contentType", mime, "text/plain");
text.addAttribute(cType1);
byte[] byteArray = new byte[] { 13, 56, 65, 32, 12, 12, 7, -3, -2, -1, 98 };
dataHandler = new DataHandler(new ByteArrayDataSource(byteArray));
OMText textData = fac.createOMText(dataHandler, false);
envelope.addChild(body);
body.addChild(data);
data.addChild(text);
text.addChild(textData);
}
Aggregations