use of org.apache.axiom.soap.SOAPFaultReason in project webservices-axiom by apache.
the class TestAddSOAPTextMultiple method runTest.
@Override
protected void runTest() throws Throwable {
SOAPFaultReason reason = soapFactory.createSOAPFaultReason();
SOAPFaultText text1 = soapFactory.createSOAPFaultText();
text1.setLang("en");
text1.setText("System error");
reason.addSOAPText(text1);
SOAPFaultText text2 = soapFactory.createSOAPFaultText();
text2.setLang("de");
text2.setText("Systemfehler");
reason.addSOAPText(text2);
OMNode child = reason.getFirstOMChild();
assertThat(child).isSameAs(text1);
child = child.getNextOMSibling();
assertThat(child).isSameAs(text2);
}
use of org.apache.axiom.soap.SOAPFaultReason in project webservices-axiom by apache.
the class TestAddSOAPTextWithSOAPVersionMismatch method runTest.
@Override
protected void runTest() throws Throwable {
SOAPFault soap12Fault = soapFactory.createSOAPFault();
SOAPFaultReason soap12FaultReason = soapFactory.createSOAPFaultReason(soap12Fault);
SOAPFault soap11Fault = altSoapFactory.createSOAPFault();
SOAPFaultReason soap11FaultReason = altSoapFactory.createSOAPFaultReason(soap11Fault);
try {
soap12FaultReason.addSOAPText(altSoapFactory.createSOAPFaultText(soap11FaultReason));
fail("SOAP11FaultText should not be added to SOAP12FaultReason");
} catch (Exception e) {
assertTrue(true);
}
}
use of org.apache.axiom.soap.SOAPFaultReason in project webservices-axiom by apache.
the class TestGetFaultReasonTextCaseSensitivity method runTest.
@Override
protected void runTest() throws Throwable {
SOAPFaultReason reason = soapFactory.createSOAPFaultReason();
SOAPFaultText text = soapFactory.createSOAPFaultText(reason);
text.setLang("EN-US");
text.setText("Some reason");
assertThat(reason.getFaultReasonText(Locale.ENGLISH)).isEqualTo("Some reason");
}
use of org.apache.axiom.soap.SOAPFaultReason in project webservices-axiom by apache.
the class TestGetFirstSOAPText method runTest.
@Override
protected void runTest() throws Throwable {
SOAPFault fault = soapFactory.createSOAPFault();
SOAPFaultReason faultReason = soapFactory.createSOAPFaultReason(fault);
assertTrue("SOAP 1.2 FaultReason Test : - After creating SOAP12FaultReason, it has a SOAPFaultText", faultReason.getFirstSOAPText() == null);
faultReason.addSOAPText(soapFactory.createSOAPFaultText(faultReason));
assertFalse("SOAP 1.2 FaultReason Test : - After calling addSOAPText, getFirstSOAPText returns null", faultReason.getFirstSOAPText() == null);
}
use of org.apache.axiom.soap.SOAPFaultReason in project webservices-axiom by apache.
the class TestGetFirstSOAPTextWithParser method runTest.
@Override
protected void runTest(SOAPEnvelope envelope) throws Throwable {
SOAPFaultReason faultReason = envelope.getBody().getFault().getReason();
assertFalse("SOAP 1.2 FaultReason Test With Parser : - getFirstSOAPText method returns null", faultReason.getFirstSOAPText() == null);
}
Aggregations