use of org.apache.axiom.om.OMException in project webservices-axiom by apache.
the class TestAddHeaderBlockWithoutNamespace1 method runTest.
@Override
protected void runTest() throws Throwable {
SOAPEnvelope envelope = soapFactory.createSOAPEnvelope();
SOAPHeader header = soapFactory.createSOAPHeader(envelope);
try {
header.addHeaderBlock("test", null);
fail("Expected OMException");
} catch (OMException ex) {
// Expected
}
}
use of org.apache.axiom.om.OMException in project webservices-axiom by apache.
the class TestGetDocumentElementWithIllFormedDocument method runTest.
@Override
protected void runTest() throws Throwable {
OMXMLParserWrapper builder = OMXMLBuilderFactory.createOMBuilder(metaFactory.getOMFactory(), new StringReader("<!--comment1-->"));
try {
builder.getDocumentElement();
fail("Expected OMException");
} catch (OMException ex) {
// Expected
}
}
use of org.apache.axiom.om.OMException in project webservices-axiom by apache.
the class TestRemoveAttributeNotOwner method runTest.
@Override
protected void runTest() throws Throwable {
OMFactory factory = metaFactory.getOMFactory();
OMElement element1 = factory.createOMElement("test", null);
element1.addAttribute("attr", "value", null);
OMElement element2 = factory.createOMElement("test", null);
OMAttribute attr = element2.addAttribute("attr", "value", null);
try {
element1.removeAttribute(attr);
fail("Expected OMException");
} catch (OMException ex) {
// Expected
}
}
use of org.apache.axiom.om.OMException in project webservices-axiom by apache.
the class TestAddHeaderBlockWithoutNamespace2 method runTest.
@Override
protected void runTest() throws Throwable {
SOAPEnvelope envelope = soapFactory.createSOAPEnvelope();
SOAPHeader header = soapFactory.createSOAPHeader(envelope);
OMNamespace ns = soapFactory.createOMNamespace("", "");
try {
header.addHeaderBlock("test", ns);
fail("Expected OMException");
} catch (OMException ex) {
// Expected
}
}
use of org.apache.axiom.om.OMException in project webservices-axiom by apache.
the class BlobOMDataSourceCustomBuilder method create.
@Override
public OMDataSource create(OMElement element) throws OMException {
try {
WritableBlob blob = blobFactory.createBlob();
OutputStream out = blob.getOutputStream();
try {
element.serializeAndConsume(out);
} finally {
out.close();
}
return new BlobOMDataSource(blob, encoding);
} catch (XMLStreamException ex) {
throw new OMException(ex);
} catch (IOException ex) {
throw new OMException(ex);
}
}
Aggregations