You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by gd...@apache.org on 2007/03/27 22:55:46 UTC
svn commit: r523075 [2/2] - in
/webservices/commons/trunk/modules/axiom/modules:
axiom-api/src/main/java/org/apache/axiom/om/
axiom-api/src/main/java/org/apache/axiom/om/impl/traverse/
axiom-api/src/main/java/org/apache/axiom/om/util/ axiom-api/src/mai...
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11FaultImpl.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11FaultImpl.java?view=diff&rev=523075&r1=523074&r2=523075
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11FaultImpl.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11FaultImpl.java Tue Mar 27 13:55:44 2007
@@ -94,12 +94,7 @@
}
public void setNode(SOAPFaultNode node) throws SOAPProcessingException {
- if (!(node instanceof SOAP11FaultNodeImpl)) {
- throw new SOAPProcessingException(
- "Expecting SOAP 1.1 implementation of SOAP Fault Node. " +
- "But received some other implementation");
- }
- super.setNode(node);
+ throw new UnsupportedOperationException("SOAP 1.1 has no SOAP Fault Node");
}
public void setRole(SOAPFaultRole role) throws SOAPProcessingException {
@@ -134,12 +129,22 @@
}
public SOAPFaultCode getCode() {
- return (SOAPFaultCode) this.getChildWithName(
- SOAP11Constants.SOAP_FAULT_CODE_LOCAL_NAME);
+ return (SOAPFaultCode) getFirstChildWithName(SOAP11Constants.QNAME_FAULT_CODE);
}
public SOAPFaultReason getReason() {
- return (SOAPFaultReason) this.getChildWithName(
- SOAP11Constants.SOAP_FAULT_STRING_LOCAL_NAME);
+ return (SOAPFaultReason) getFirstChildWithName(SOAP11Constants.QNAME_FAULT_REASON);
+ }
+
+ public SOAPFaultNode getNode() {
+ return null;
+ }
+
+ public SOAPFaultRole getRole() {
+ return (SOAPFaultRole) getFirstChildWithName(SOAP11Constants.QNAME_FAULT_ROLE);
+ }
+
+ public SOAPFaultDetail getDetail() {
+ return (SOAPFaultDetail) getFirstChildWithName(SOAP11Constants.QNAME_FAULT_DETAIL);
}
}
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11FaultReasonImpl.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11FaultReasonImpl.java?view=diff&rev=523075&r1=523074&r2=523075
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11FaultReasonImpl.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11FaultReasonImpl.java Tue Mar 27 13:55:44 2007
@@ -52,12 +52,11 @@
public void addSOAPText(SOAPFaultText soapFaultText)
throws SOAPProcessingException {
- if (!(soapFaultText instanceof SOAP11FaultTextImpl)) {
- throw new SOAPProcessingException(
- "Expecting SOAP 1.1 implementation of SOAP Fault Text. " +
- "But received some other implementation");
- }
- super.addSOAPText(soapFaultText);
+ throw new UnsupportedOperationException("addSOAPText() not allowed for SOAP 1.1!");
+ }
+
+ public SOAPFaultText getFirstSOAPText() {
+ throw new UnsupportedOperationException("getFirstSOAPText() not allowed for SOAP 1.1!");
}
protected void checkParent(OMElement parent) throws SOAPProcessingException {
@@ -94,6 +93,4 @@
public String getLocalName() {
return SOAP11Constants.SOAP_FAULT_STRING_LOCAL_NAME;
}
-
-
}
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12Factory.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12Factory.java?view=diff&rev=523075&r1=523074&r2=523075
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12Factory.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12Factory.java Tue Mar 27 13:55:44 2007
@@ -37,6 +37,8 @@
import org.apache.axiom.soap.SOAPHeaderBlock;
import org.apache.axiom.soap.SOAPMessage;
import org.apache.axiom.soap.SOAPProcessingException;
+import org.apache.axiom.soap.SOAPVersion;
+import org.apache.axiom.soap.SOAP12Version;
import org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl;
import org.apache.axiom.soap.impl.llom.SOAPMessageImpl;
@@ -46,6 +48,10 @@
public String getSoapVersionURI() {
return SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI;
}
+
+ public SOAPVersion getSOAPVersion() {
+ return SOAP12Version.getSingleton();
+ }
public OMNamespace getNamespace() {
return new OMNamespaceImpl(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI,
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12FaultCodeImpl.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12FaultCodeImpl.java?view=diff&rev=523075&r1=523074&r2=523075
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12FaultCodeImpl.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12FaultCodeImpl.java Tue Mar 27 13:55:44 2007
@@ -23,8 +23,11 @@
import org.apache.axiom.soap.SOAPFaultSubCode;
import org.apache.axiom.soap.SOAPFaultValue;
import org.apache.axiom.soap.SOAPProcessingException;
+import org.apache.axiom.soap.SOAP12Constants;
import org.apache.axiom.soap.impl.llom.SOAPFaultCodeImpl;
+import javax.xml.namespace.QName;
+
public class SOAP12FaultCodeImpl extends SOAPFaultCodeImpl {
/** Eran Chinthaka (chinthaka@apache.org) */
@@ -70,5 +73,18 @@
throw new SOAPProcessingException(
"Expecting SOAP 1.2 implementation of SOAP Fault as the parent. But received some other implementation");
}
+ }
+
+ // Overridden so that we can have a single interface to reliably get the faultcode's value
+ public QName getTextAsQName() {
+ return getValue().getTextAsQName();
+ }
+
+ public SOAPFaultValue getValue() {
+ return (SOAPFaultValue)getFirstChildWithName(SOAP12Constants.QNAME_FAULT_VALUE);
+ }
+
+ public SOAPFaultSubCode getSubCode() {
+ return (SOAPFaultSubCode)getFirstChildWithName(SOAP12Constants.QNAME_FAULT_SUBCODE);
}
}
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12FaultImpl.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12FaultImpl.java?view=diff&rev=523075&r1=523074&r2=523075
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12FaultImpl.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12FaultImpl.java Tue Mar 27 13:55:44 2007
@@ -27,6 +27,7 @@
import org.apache.axiom.soap.SOAPFaultReason;
import org.apache.axiom.soap.SOAPFaultRole;
import org.apache.axiom.soap.SOAPProcessingException;
+import org.apache.axiom.soap.SOAP12Constants;
import org.apache.axiom.soap.impl.llom.SOAPFaultImpl;
import javax.xml.stream.XMLStreamException;
@@ -133,4 +134,23 @@
}
}
+ public SOAPFaultNode getNode() {
+ return (SOAPFaultNode) getFirstChildWithName(SOAP12Constants.QNAME_FAULT_NODE);
+ }
+
+ public SOAPFaultCode getCode() {
+ return (SOAPFaultCode) getFirstChildWithName(SOAP12Constants.QNAME_FAULT_CODE);
+ }
+
+ public SOAPFaultReason getReason() {
+ return (SOAPFaultReason) getFirstChildWithName(SOAP12Constants.QNAME_FAULT_REASON);
+ }
+
+ public SOAPFaultRole getRole() {
+ return (SOAPFaultRole) getFirstChildWithName(SOAP12Constants.QNAME_FAULT_ROLE);
+ }
+
+ public SOAPFaultDetail getDetail() {
+ return (SOAPFaultDetail)getFirstChildWithName(SOAP12Constants.QNAME_FAULT_DETAIL);
+ }
}
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12FaultReasonImpl.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12FaultReasonImpl.java?view=diff&rev=523075&r1=523074&r2=523075
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12FaultReasonImpl.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12FaultReasonImpl.java Tue Mar 27 13:55:44 2007
@@ -22,6 +22,7 @@
import org.apache.axiom.soap.SOAPFault;
import org.apache.axiom.soap.SOAPFaultText;
import org.apache.axiom.soap.SOAPProcessingException;
+import org.apache.axiom.soap.SOAP12Constants;
import org.apache.axiom.soap.impl.llom.SOAPFaultReasonImpl;
public class SOAP12FaultReasonImpl extends SOAPFaultReasonImpl {
@@ -48,7 +49,11 @@
"Expecting SOAP 1.2 implementation of SOAP Fault Text. " +
"But received some other implementation");
}
- super.addSOAPText(soapFaultText);
+ addChild(soapFaultText);
+ }
+
+ public SOAPFaultText getFirstSOAPText() {
+ return (SOAPFaultText)getFirstChildWithName(SOAP12Constants.QNAME_FAULT_TEXT);
}
protected void checkParent(OMElement parent) throws SOAPProcessingException {
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMTextTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMTextTest.java?view=diff&rev=523075&r1=523074&r2=523075
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMTextTest.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMTextTest.java Tue Mar 27 13:55:44 2007
@@ -57,7 +57,6 @@
String elementString = omElement.toString();
assertTrue(elementString.indexOf(":" + SOME_TEXT) == -1);
- assertTrue(!(":" + SOME_TEXT).equals(omElement.getText()));
QName textAsQName = omElement.getTextAsQName();
assertTrue(textAsQName.equals(new QName(SOME_TEXT)));
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFaultCodeTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFaultCodeTest.java?view=diff&rev=523075&r1=523074&r2=523075
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFaultCodeTest.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFaultCodeTest.java Tue Mar 27 13:55:44 2007
@@ -28,31 +28,37 @@
}
//SOAP 1.1 Fault Code Test (Programaticaly Created)
- public void testSOAP11SetValue() {
- soap11FaultCode.setValue(
- soap11Factory.createSOAPFaultValue(soap11FaultCode));
- assertFalse(
- "SOAP 1.1 Fault Code Test :- After calling setValue method, getValue method returns null",
- soap11FaultCode.getValue() == null);
- try {
- soap11FaultCode.setValue(
- soap12Factory.createSOAPFaultValue(soap12FaultCode));
- fail("SOAP12FaultValue should not be inserted to SOAP11FaultCode");
- } catch (SOAPProcessingException e) {
- assertTrue(true);
- }
-
- }
+// public void testSOAP11SetValue() {
+// soap11FaultCode.setValue(
+// soap11Factory.createSOAPFaultValue(soap11FaultCode));
+// assertFalse(
+// "SOAP 1.1 Fault Code Test :- After calling setValue method, getValue method returns null",
+// soap11FaultCode.getValue() == null);
+// try {
+// soap11FaultCode.setValue(
+// soap12Factory.createSOAPFaultValue(soap12FaultCode));
+// fail("SOAP12FaultValue should not be inserted to SOAP11FaultCode");
+// } catch (SOAPProcessingException e) {
+// assertTrue(true);
+// }
+//
+// }
public void testSOAP11GetValue() {
- assertTrue(
- "SOAP 1.1 Fault Code Test :- After creating soapfaultcode, it has a value",
- soap11FaultCode.getValue() == null);
- soap11FaultCode.setValue(
- soap11Factory.createSOAPFaultValue(soap11FaultCode));
- assertFalse(
- "SOAP 1.1 Fault Code Test :- After calling setValue method, getValue method returns null",
- soap11FaultCode.getValue() == null);
+ try {
+ soap11FaultCode.getValue();
+ } catch (UnsupportedOperationException e) {
+ return;
+ }
+ fail("Unsupported getValue operation was allowed on SOAP 1.1 FaultCode");
+// assertTrue(
+// "SOAP 1.1 Fault Code Test :- After creating soapfaultcode, it has a value",
+// soap11FaultCode.getValue() == null);
+// soap11FaultCode.setValue(
+// soap11Factory.createSOAPFaultValue(soap11FaultCode));
+// assertFalse(
+// "SOAP 1.1 Fault Code Test :- After calling setValue method, getValue method returns null",
+// soap11FaultCode.getValue() == null);
}
//SOAP 1.2 Fault Code Test (Programaticaly Created)
@@ -131,10 +137,12 @@
//SOAP 1.1 Fault Code Test (With Parser)
public void testSOAP11GetValueWithParser() {
- assertTrue(
- "SOAP 1.1 Fault Code Test with parser : - getValue method should return null",
- soap11FaultCodeWithParser.getValue() == null);
-
+ try {
+ soap11FaultCodeWithParser.getValue();
+ } catch (UnsupportedOperationException e) {
+ return;
+ }
+ fail("Unsupported getValue operation was allowed on SOAP 1.1 FaultCode");
}
//SOAP 1.2 Fault Code Test (With Parser)
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFaultNodeTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFaultNodeTest.java?view=diff&rev=523075&r1=523074&r2=523075
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFaultNodeTest.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFaultNodeTest.java Tue Mar 27 13:55:44 2007
@@ -17,7 +17,6 @@
package org.apache.axiom.soap;
public class SOAPFaultNodeTest extends SOAPFaultTestCase {
- protected SOAPFaultNode soap11FaultNode;
protected SOAPFaultNode soap12FaultNode;
protected SOAPFaultNode soap12FaultNodeWithParser;
@@ -27,27 +26,19 @@
protected void setUp() throws Exception {
super.setUp();
- soap11FaultNode = soap11Factory.createSOAPFaultNode(soap11Fault);
soap12FaultNode = soap12Factory.createSOAPFaultNode(soap12Fault);
soap12FaultNodeWithParser = soap12FaultWithParser.getNode();
}
//SOAP 1.1 Fault Node Test (Programaticaly Created)
public void testSOAP11SetNodeValue() {
- soap11FaultNode.setNodeValue("This is only a test");
- assertTrue(
- "SOAP 1.1 Fault Node Test : - After calling setNodeValue method, getNodeValue method returns incorrect value",
- soap11FaultNode.getNodeValue().equals("This is only a test"));
- }
-
- public void testSOAP11GetNodeValue() {
- assertTrue(
- "SOAP 1.1 Fault Node Test : - After creating SOAPFaultNode, it has a value",
- soap11FaultNode.getNodeValue().equals(""));
- soap11FaultNode.setNodeValue("This is only a test");
- assertTrue(
- "SOAP 1.1 Fault Node Test : - After calling setNodeValue method, getNodeValue method returns incorrect value",
- soap11FaultNode.getNodeValue().equals("This is only a test"));
+ try {
+ soap11Factory.createSOAPFaultNode(soap11Fault);
+ } catch (UnsupportedOperationException e) {
+ // Good!
+ return;
+ }
+ fail("Unsupported SOAP 1.1 node was created");
}
//SOAP 1.2 Fault Node Test (Programaticaly Created)
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFaultReasonTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFaultReasonTest.java?view=diff&rev=523075&r1=523074&r2=523075
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFaultReasonTest.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFaultReasonTest.java Tue Mar 27 13:55:44 2007
@@ -27,31 +27,23 @@
}
//SOAP 1.1 Fault Reason Test (Programaticaly Created)
- public void testSOAP11SetSOAPText() {
- soap11FaultReason.addSOAPText(
- soap11Factory.createSOAPFaultText(soap11FaultReason));
- assertFalse(
- "SOAP 1.1 FaultReason Test : - After calling addSOAPText, getFirstSOAPText returns null",
- soap11FaultReason.getFirstSOAPText() == null);
+ public void testSOAP11SOAPTextAPIs() {
+ boolean gotFault = false;
try {
- soap11FaultReason.addSOAPText(
- soap12Factory.createSOAPFaultText(soap12FaultReason));
- fail("SOAP12FaultText should not be added to SOAP11FaultReason");
-
- } catch (Exception e) {
- assertTrue(true);
+ soap11FaultReason.addSOAPText(soap11Factory.createSOAPFaultText(soap11FaultReason));
+ } catch (UnsupportedOperationException e) {
+ // Cool, continue.
+ gotFault = true;
}
- }
+ assertTrue("Didn't get expected Exception for addSOAPText()!", gotFault);
- public void testSOAP11GetSOAPText() {
- assertTrue(
- "SOAP 1.1 FaultReason Test : - After creating SOAP11FaultReason, it has a SOAPFaultText",
- soap11FaultReason.getFirstSOAPText() == null);
- soap11FaultReason.addSOAPText(
- soap11Factory.createSOAPFaultText(soap11FaultReason));
- assertFalse(
- "SOAP 1.1 FaultReason Test : - After calling addSOAPText, getFirstSOAPText returns null",
- soap11FaultReason.getFirstSOAPText() == null);
+ try {
+ soap11FaultReason.getFirstSOAPText();
+ } catch (UnsupportedOperationException e) {
+ // Cool, continue.
+ return;
+ }
+ fail("Didn't get expected Exception for getFirstSOAPText()!");
}
//SOAP 1.2 Fault Reason Test (Programaticaly Created)
@@ -79,13 +71,6 @@
assertFalse(
"SOAP 1.2 FaultReason Test : - After calling addSOAPText, getFirstSOAPText returns null",
soap12FaultReason.getFirstSOAPText() == null);
- }
-
- //SOAP 1.1 Fault Reason Test (With Parser)
- public void testSOAP11GetSOAPTextWithParser() {
- assertTrue(
- "SOAP 1.1 FaultReason Test With Parser : - getFirstSOAPText should return null",
- soap11FaultReasonWithParser.getFirstSOAPText() == null);
}
//SOAP 1.2 Fault Reason Test (With Parser)
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFaultTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFaultTest.java?view=diff&rev=523075&r1=523074&r2=523075
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFaultTest.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFaultTest.java Tue Mar 27 13:55:44 2007
@@ -77,28 +77,19 @@
}
public void testSOAP11SetNode() {
- soap11Fault.setNode(soap11Factory.createSOAPFaultNode(soap11Fault));
- assertFalse(
- "SOAP 1.1 Fault Test:- After calling setNode method, Fault has no node",
- soap11Fault.getNode() == null);
try {
- soap11Fault.setNode(soap12Factory.createSOAPFaultNode(soap12Fault));
- fail("SOAP12FaultNode should not be set in to a SOAP11Fault");
-
- } catch (Exception e) {
- assertTrue(true);
-
+ soap11Fault.setNode(soap11Factory.createSOAPFaultNode(soap11Fault));
+ } catch (UnsupportedOperationException e) {
+ // Exactly!
+ return;
}
+ fail("Didn't get UnsupportedOperationException");
}
public void testSOAP11GetNode() {
assertTrue(
"SOAP 1.1 Fault Test:- After creating a SOAP11Fault, it has a node",
soap11Fault.getNode() == null);
- soap11Fault.setNode(soap11Factory.createSOAPFaultNode(soap11Fault));
- assertFalse(
- "SOAP 1.1 Fault Test:- After calling setNode method, Fault has no node",
- soap11Fault.getNode() == null);
}
public void testSOAP11SetRole() {
@@ -313,16 +304,16 @@
}
public void testSOAP11GetDetailWithParser() {
- assertFalse(
+ assertNotNull(
"SOAP 1.1 Fault Test with parser: - getDetail method returns null",
- soap11FaultWithParser.getDetail() == null);
+ soap11FaultWithParser.getDetail());
}
//SOAP 1.2 Fault Test (With parser)
public void testSOAP12GetCodeWithParser() {
- assertFalse(
+ assertNotNull(
"SOAP 1.2 Fault Test with parser: - getCode method returns null",
- soap12FaultWithParser.getCode() == null);
+ soap12FaultWithParser.getCode());
assertTrue(
"SOAP 1.2 Fault Test with parser: - Fault code local name mismatch",
soap12FaultWithParser.getCode().getLocalName().equals(
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFaultTestCase.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFaultTestCase.java?view=diff&rev=523075&r1=523074&r2=523075
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFaultTestCase.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFaultTestCase.java Tue Mar 27 13:55:44 2007
@@ -30,12 +30,8 @@
protected void setUp() throws Exception {
super.setUp();
- soap11Fault =
- OMAbstractFactory.getSOAP11Factory().createSOAPFault(
- soap11Body);
- soap12Fault =
- OMAbstractFactory.getSOAP12Factory().createSOAPFault(
- soap12Body);
+ soap11Fault = OMAbstractFactory.getSOAP11Factory().createSOAPFault(soap11Body);
+ soap12Fault = OMAbstractFactory.getSOAP12Factory().createSOAPFault(soap12Body);
soap11FaultWithParser = soap11BodyWithParser.getFault();
soap12FaultWithParser = soap12BodyWithParser.getFault();
}
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/builder/StAXSOAPModelBuilderTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/builder/StAXSOAPModelBuilderTest.java?view=diff&rev=523075&r1=523074&r2=523075
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/builder/StAXSOAPModelBuilderTest.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/builder/StAXSOAPModelBuilderTest.java Tue Mar 27 13:55:44 2007
@@ -486,7 +486,7 @@
role = (SOAPFaultRole) iteratorInFault.next();
assertTrue("SOAP 1.1 :- Fault actor local name mismatch",
role.getLocalName().equals(
- SOAP12Constants.SOAP_FAULT_ROLE_LOCAL_NAME));
+ SOAP11Constants.SOAP_FAULT_ACTOR_LOCAL_NAME));
assertTrue("SOAP 1.1 :- Actor value mismatch",
role.getText().trim().equals(
"http://schemas.xmlsoap.org/soap/envelope/actor/ultimateReceiver"));
@@ -495,7 +495,7 @@
detail = (SOAPFaultDetail) iteratorInFault.next();
assertTrue("SOAP 1.1 :- Fault detail local name mismatch",
detail.getLocalName().equals(
- SOAP12Constants.SOAP_FAULT_DETAIL_LOCAL_NAME));
+ SOAP11Constants.SOAP_FAULT_DETAIL_LOCAL_NAME));
assertTrue("SOAP 1.2 :- Text in detail mismatch",
detail.getText().trim().equals("Details of error"));
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-tests/test-resources/soap/soap11/soap11message.xml
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/test-resources/soap/soap11/soap11message.xml?view=diff&rev=523075&r1=523074&r2=523075
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/test-resources/soap/soap11/soap11message.xml (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/test-resources/soap/soap11/soap11message.xml Tue Mar 27 13:55:44 2007
@@ -22,14 +22,14 @@
</soapenv:Header>
<soapenv:Body>
<soapenv:Fault>
- <soapenv:faultcode>
+ <faultcode>
env:Sender
- </soapenv:faultcode>
- <soapenv:faultstring>Sender Timeout</soapenv:faultstring>
- <soapenv:faultactor>
+ </faultcode>
+ <faultstring>Sender Timeout</faultstring>
+ <faultactor>
http://schemas.xmlsoap.org/soap/envelope/actor/ultimateReceiver
- </soapenv:faultactor>
- <soapenv:detail xmlns:m="http://www.sample.org">
+ </faultactor>
+ <detail xmlns:m="http://www.sample.org">
Details of error
<m:MaxTime m:detail="This is only a test">
P5M
@@ -39,7 +39,7 @@
P3M
</m:Time>
</m:AveTime>
- </soapenv:detail>
+ </detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org