You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ch...@apache.org on 2005/06/26 11:59:41 UTC
svn commit: r201831 [2/3] - in /webservices/axis/trunk/java/modules:
core/src/org/apache/axis/clientapi/ core/src/org/apache/axis/engine/
xml/src/org/apache/axis/om/impl/llom/ xml/src/org/apache/axis/soap/
xml/src/org/apache/axis/soap/impl/llom/ xml/sr...
Added: webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultNodeTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultNodeTest.java?rev=201831&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultNodeTest.java (added)
+++ webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultNodeTest.java Sun Jun 26 01:24:38 2005
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.axis.soap;
+
+public class SOAPFaultNodeTest extends SOAPFaultTestCase {
+ protected SOAPFaultNode soap11FaultNode;
+ protected SOAPFaultNode soap12FaultNode;
+ protected SOAPFaultNode soap12FaultNodeWithParser;
+
+ public SOAPFaultNodeTest(String testName) {
+ super(testName);
+ }
+
+ 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"));
+ }
+
+ //SOAP 1.2 Fault Node Test (Programaticaly Created)
+ public void testSOAP12SetNodeValue() {
+ soap12FaultNode.setNodeValue("This is only a test");
+ assertTrue("SOAP 1.2 Fault Node Test : - After calling setNodeValue method, getNodeValue method returns incorrect value",soap12FaultNode.getNodeValue().equals("This is only a test"));
+ }
+
+ public void testSOAP12GetNodeValue() {
+ assertTrue("SOAP 1.2 Fault Node Test : - After creating SOAPFaultNode, it has a value",soap12FaultNode.getNodeValue().equals(""));
+ soap12FaultNode.setNodeValue("This is only a test");
+ assertTrue("SOAP 1.2 Fault Node Test : - After calling setNodeValue method, getNodeValue method returns incorrect value",soap12FaultNode.getNodeValue().equals("This is only a test"));
+ }
+
+ //SOAP 1.2 Fault Node Test (With Parser)
+ public void testSOAP12GetNodeValueWithParser() {
+ assertTrue("SOAP 1.2 Fault Node Test With Parser : - getNodeValue method returns incorrect value",soap12FaultNodeWithParser.getNodeValue().equals("http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver"));
+ }
+}
Added: webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultReasonTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultReasonTest.java?rev=201831&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultReasonTest.java (added)
+++ webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultReasonTest.java Sun Jun 26 01:24:38 2005
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.axis.soap;
+
+public class SOAPFaultReasonTest extends SOAPFaultReasonTestCase {
+
+ public SOAPFaultReasonTest(String testName) {
+ super(testName);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ //SOAP 1.1 Fault Reason Test (Programaticaly Created)
+ public void testSOAP11SetSOAPText() {
+ soap11FaultReason.setSOAPText(soap11Factory.createSOAPFaultText(soap11FaultReason));
+ assertFalse("SOAP 1.1 FaultReason Test : - After calling setSOAPText, getSOAPText returns null",soap11FaultReason.getSOAPText() == null);
+ try {
+ soap11FaultReason.setSOAPText(soap12Factory.createSOAPFaultText(soap12FaultReason));
+ fail("SOAP12FaultText should not be added to SOAP11FaultReason");
+
+ } catch (Exception e) {
+ assertTrue(true);
+ }
+ }
+
+ public void testSOAP11GetSOAPText() {
+ assertTrue("SOAP 1.1 FaultReason Test : - After creating SOAP11FaultReason, it has a SOAPFaultText",soap11FaultReason.getSOAPText()==null);
+ soap11FaultReason.setSOAPText(soap11Factory.createSOAPFaultText(soap11FaultReason));
+ assertFalse("SOAP 1.1 FaultReason Test : - After calling setSOAPText, getSOAPText returns null",soap11FaultReason.getSOAPText()==null);
+ }
+
+ //SOAP 1.2 Fault Reason Test (Programaticaly Created)
+ public void testSOAP12SetSOAPText() {
+ soap12FaultReason.setSOAPText(soap12Factory.createSOAPFaultText(soap12FaultReason));
+ assertFalse("SOAP 1.2 FaultReason Test : - After calling setSOAPText, getSOAPText returns null",soap12FaultReason.getSOAPText() == null);
+ try {
+ soap12FaultReason.setSOAPText(soap11Factory.createSOAPFaultText(soap11FaultReason));
+ fail("SOAP11FaultText should not be added to SOAP12FaultReason");
+ } catch (Exception e) {
+ assertTrue(true);
+ }
+ }
+
+ public void testSOAP12GetSOAPText() {
+ assertTrue("SOAP 1.2 FaultReason Test : - After creating SOAP12FaultReason, it has a SOAPFaultText",soap12FaultReason.getSOAPText()==null);
+ soap12FaultReason.setSOAPText(soap12Factory.createSOAPFaultText(soap12FaultReason));
+ assertFalse("SOAP 1.2 FaultReason Test : - After calling setSOAPText, getSOAPText returns null",soap12FaultReason.getSOAPText()==null);
+ }
+
+ //SOAP 1.1 Fault Reason Test (With Parser)
+ public void testSOAP11GetSOAPTextWithParser() {
+ assertFalse("SOAP 1.1 FaultReason Test With Parser : - getSOAPText method returns null",soap11FaultReasonWithParser.getSOAPText()==null);
+ }
+
+ //SOAP 1.2 Fault Reason Test (With Parser)
+ public void testSOAP12GetSOAPTextWithParser() {
+ assertFalse("SOAP 1.2 FaultReason Test With Parser : - getSOAPText method returns null",soap12FaultReasonWithParser.getSOAPText()==null);
+ }
+}
Added: webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultReasonTestCase.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultReasonTestCase.java?rev=201831&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultReasonTestCase.java (added)
+++ webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultReasonTestCase.java Sun Jun 26 01:24:38 2005
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.axis.soap;
+
+public class SOAPFaultReasonTestCase extends SOAPFaultTestCase{
+
+ protected SOAPFaultReason soap11FaultReason;
+ protected SOAPFaultReason soap12FaultReason;
+ protected SOAPFaultReason soap11FaultReasonWithParser;
+ protected SOAPFaultReason soap12FaultReasonWithParser;
+
+ public SOAPFaultReasonTestCase(String testName) {
+ super(testName);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ soap11FaultReason = soap11Factory.createSOAPFaultReason(soap11Fault);
+ soap12FaultReason = soap12Factory.createSOAPFaultReason(soap12Fault);
+ soap11FaultReasonWithParser = soap11FaultWithParser.getReason();
+ soap12FaultReasonWithParser = soap12FaultWithParser.getReason();
+ }
+
+}
Added: webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultRoleTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultRoleTest.java?rev=201831&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultRoleTest.java (added)
+++ webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultRoleTest.java Sun Jun 26 01:24:38 2005
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.axis.soap;
+
+public class SOAPFaultRoleTest extends SOAPFaultTestCase {
+
+ protected SOAPFaultRole soap11FaultRole;
+ protected SOAPFaultRole soap12FaultRole;
+ protected SOAPFaultRole soap11FaultRoleWithParser;
+ protected SOAPFaultRole soap12FaultRoleWithParser;
+
+ public SOAPFaultRoleTest(String testName) {
+ super(testName);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ soap11FaultRole = soap11Factory.createSOAPFaultRole(soap11Fault);
+ soap12FaultRole = soap12Factory.createSOAPFaultRole(soap12Fault);
+ soap11FaultRoleWithParser = soap11FaultWithParser.getRole();
+ soap12FaultRoleWithParser = soap12FaultWithParser.getRole();
+ }
+
+ //SOAP 1.1 Fault Role Test (Programaticaly Created)
+ public void testSOAP11SetRoleValue() {
+ soap11FaultRole.setRoleValue("This is only a test");
+ assertTrue("SOAP 1.1 Fault Role Test : - After calling setRoleValue method, getRoleValue method returns incorrect value",soap11FaultRole.getRoleValue().equals("This is only a test"));
+ }
+
+ public void testSOAP11GetRoleValue() {
+ assertTrue("SOAP 1.1 Fault Role Test : - After creating SOAPFaultRole, it has a value",soap11FaultRole.getRoleValue().equals(""));
+ soap11FaultRole.setRoleValue("This is only a test");
+ assertTrue("SOAP 1.1 Fault Role Test : - After calling setRoleValue method, getRoleValue method returns incorrect value",soap11FaultRole.getRoleValue().equals("This is only a test"));
+ }
+
+ //SOAP 1.2 Fault Role Test (Programaticaly Created)
+ public void testSOAP12SetRoleValue() {
+ soap12FaultRole.setRoleValue("This is only a test");
+ assertTrue("SOAP 1.2 Fault Role Test : - After calling setRoleValue method, getRoleValue method returns incorrect value",soap12FaultRole.getRoleValue().equals("This is only a test"));
+ }
+
+ public void testSOAP12GetRoleValue() {
+ assertTrue("SOAP 1.2 Fault Role Test : - After creating SOAPFaultRole, it has a value",soap12FaultRole.getRoleValue().equals(""));
+ soap12FaultRole.setRoleValue("This is only a test");
+ assertTrue("SOAP 1.2 Fault Role Test : - After calling setRoleValue method, getRoleValue method returns incorrect value",soap12FaultRole.getRoleValue().equals("This is only a test"));
+ }
+
+ //SOAP 1.1 Fault Role Test (With Parser)
+ public void testSOAP11GetRoleValueWithParser() {
+ assertTrue("SOAP 1.1 Fault Role Test With Parser : - getRoleValue method returns incorrect value",soap11FaultRoleWithParser.getRoleValue().equals("http://schemas.xmlsoap.org/soap/envelope/actor/ultimateReceiver"));
+ }
+
+ //SOAP 1.2 Fault Role Test (With Parser)
+ public void testSOAP12GetRoleValueWithParser() {
+ assertTrue("SOAP 1.2 Fault Role Test With Parser : - getRoleValue method returns incorrect value",soap12FaultRoleWithParser.getRoleValue().equals("ultimateReceiver"));
+ }
+}
Added: webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultSubCodeTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultSubCodeTest.java?rev=201831&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultSubCodeTest.java (added)
+++ webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultSubCodeTest.java Sun Jun 26 01:24:38 2005
@@ -0,0 +1,120 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.axis.soap;
+
+import org.apache.axis.soap.impl.llom.SOAPProcessingException;
+import org.apache.axis.soap.impl.llom.soap12.SOAP12Constants;
+
+public class SOAPFaultSubCodeTest extends SOAPFaultSubCodeTestCase {
+
+ public SOAPFaultSubCodeTest(String testName) {
+ super(testName);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ //SOAP Fault SubCode(In Fault Code) Test (Programaticaly Created)
+ public void testSetValueInFaultCode() {
+ soap12FaultSubCodeInCode.setValue(soap12Factory.createSOAPFaultValue(soap12FaultSubCodeInCode));
+ assertFalse("SOAP 1.2 Subcode Test In Fault Code : - After calling setValue method, getValue method returns null", soap12FaultSubCodeInCode.getValue() == null);
+ try {
+ soap12FaultSubCodeInCode.setValue(soap12Factory.createSOAPFaultValue(soap12FaultCode));
+ } catch (SOAPProcessingException e) {
+ fail("SOAP 1.2 SOAPFaultSubCode Test In FaultCode : - FaultValue whose parent is FaultCode should not be set in to FaultSubCode, as a child");
+ }
+ }
+
+ public void testGetValueInFaultCode() {
+ assertTrue("After creating SOAP12FaultSubCode In Fault Code, it has a FaultValue", soap12FaultSubCodeInCode.getValue() == null);
+ soap12FaultSubCodeInCode.setValue(soap12Factory.createSOAPFaultValue(soap12FaultSubCodeInCode));
+ assertFalse("SOAP 1.2 SOAPFaultSubCode Test In FaultCode : - After calling setValue method, getValue method returns null", soap12FaultSubCodeInCode.getValue() == null);
+ }
+
+ public void testsetSubCodeInFaultCode() {
+ soap12FaultSubCodeInCode.setSubCode(soap12Factory.createSOAPFaultSubCode(soap12FaultSubCodeInCode));
+ assertFalse("SOAP 1.2 Subcode Test In Fault Code : - After calling setSubCode method, getSubCode method returns null", soap12FaultSubCodeInCode.getSubCode() == null);
+ try {
+ soap12FaultSubCodeInCode.setSubCode(soap12Factory.createSOAPFaultSubCode(soap12FaultCode));
+ } catch (SOAPProcessingException e) {
+ fail("SOAP 1.2 SOAPFaultSubCode Test In FaultCode : - FaultSubCode whose parent is FaultCode should not be set in to FaultSubCode, as a child");
+ }
+ }
+
+ public void testGetSubCodeInFaultCode() {
+ //soap12FaultSubCodeInCode has a SubCode because a SubCode was created in setUp method of super class
+// assertTrue("After creating SOAP12FaultSubCode In Fault Code, it has a FaultSubCode",soap12FaultSubCodeInCode.getSubCode() == null);
+ soap12FaultSubCodeInCode.setSubCode(soap12Factory.createSOAPFaultSubCode(soap12FaultSubCodeInCode));
+ assertFalse("SOAP 1.2 SOAPFaultSubCode Test In FaultCode : - After calling setSubCode method, getSubCode method returns null", soap12FaultSubCodeInCode.getSubCode() == null);
+ }
+
+ //SOAP Fault SubCode(In Fault SubCode) Test (Programaticaly Created)
+ public void testSetValueInFaultSubCode() {
+ soap12FaultSubCodeInSubCode.setValue(soap12Factory.createSOAPFaultValue(soap12FaultSubCodeInSubCode));
+ assertFalse("SOAP 1.2 Subcode Test In Fault SubCode : - After calling setValue method, getValue method returns null", soap12FaultSubCodeInSubCode.getValue() == null);
+ try {
+ soap12FaultSubCodeInSubCode.setValue(soap12Factory.createSOAPFaultValue(soap12FaultCode));
+ } catch (SOAPProcessingException e) {
+ fail("SOAP 1.2 SOAPFaultSubCode Test In FaultCode : - FaultValue whose parent is FaultCode should not be set in to FaultSubCode, as a child");
+ }
+ }
+
+ public void testGetValueInFaultSubCode() {
+ assertTrue("After creating SOAP12FaultSubCode In Fault SubCode, it has a Fault Value", soap12FaultSubCodeInSubCode.getValue() == null);
+ soap12FaultSubCodeInSubCode.setValue(soap12Factory.createSOAPFaultValue(soap12FaultSubCodeInSubCode));
+ assertFalse("SOAP 1.2 SOAPFaultSubCode Test In FaultSubCode : - After calling setValue method, getValue method returns null", soap12FaultSubCodeInSubCode.getValue() == null);
+ }
+
+ public void testsetSubCodeInFaultSubCode() {
+ soap12FaultSubCodeInSubCode.setSubCode(soap12Factory.createSOAPFaultSubCode(soap12FaultSubCodeInSubCode));
+ assertFalse("SOAP 1.2 Subcode Test In Fault SubCode : - After calling setSubCode method, getSubCode method returns null", soap12FaultSubCodeInSubCode.getSubCode() == null);
+ try {
+ soap12FaultSubCodeInSubCode.setSubCode(soap12Factory.createSOAPFaultSubCode(soap12FaultCode));
+ } catch (SOAPProcessingException e) {
+ fail("SOAP 1.2 SOAPFaultSubCode Test In FaultSubCode : - FaultSubCode whose parent is FaultCode should not be set in to FaultSubCode, as a child");
+ }
+ }
+
+ public void testGetSubCodeInFaultSubCode() {
+ assertTrue("After creating SOAP12FaultSubCode In Fault SubCode, it has a FaultSubCode", soap12FaultSubCodeInSubCode.getSubCode() == null);
+ soap12FaultSubCodeInSubCode.setSubCode(soap12Factory.createSOAPFaultSubCode(soap12FaultSubCodeInSubCode));
+ assertFalse("SOAP 1.2 SOAPFaultSubCode Test In FaultSubCode : - After calling setSubCode method, getSubCode method returns null", soap12FaultSubCodeInSubCode.getSubCode() == null);
+ }
+
+ //SOAP Fault SubCode(In Fault Code) Test (With Parser)
+ public void testGetValueInFaultCodeWithParser() {
+ assertFalse("SOAP 1.2 SOAPFaultSubCode Test In FaultCode With Parser : - getValue method returns null", soap12FaultSubCodeInFaultCodeWithParser.getValue() == null);
+ assertTrue("SOAP 1.2 SOAPFaultSubCode Test In FaultCode With Parser : - Value text mismatch", soap12FaultSubCodeInFaultCodeWithParser.getValue().getText().equals("m:MessageTimeout In First SubCode"));
+ }
+
+ public void testGetSubCodeInFaultCodeWithParser() {
+ assertFalse("SOAP 1.2 SOAPFaultSubCode Test In FaultCode With Parser : - getSubCode method returns null", soap12FaultSubCodeInFaultCodeWithParser.getSubCode() == null);
+ assertTrue("SOAP 1.2 SOAPFaultSubCode Test In FaultCode With Parser : - SubCode local name mismatch", soap12FaultSubCodeInFaultCodeWithParser.getSubCode().getLocalName().equals(SOAP12Constants.SOAP_FAULT_SUB_CODE_LOCAL_NAME));
+ }
+
+ //SOAP Fault SubCode(In Fault SubCode) Test (With Parser)
+ public void testGetValueInFaultSubCodeWithParser() {
+ assertFalse("SOAP 1.2 SOAPFaultSubCode Test In FaultSubCode With Parser : - getValue method returns null", soap12FaultSubCodeInSubCodeWithParser.getValue() == null);
+ assertTrue("SOAP 1.2 SOAPFaultSubCode Test In FaultSubCode With Parser : - Value text mismatch", soap12FaultSubCodeInSubCodeWithParser.getValue().getText().equals("m:MessageTimeout In Second SubCode"));
+ }
+
+ public void testGetSubCodeInFaultSubCodeWithParser() {
+ assertFalse("SOAP 1.2 SOAPFaultSubCode Test In FaultSubCode With Parser : - getSubCode method returns null", soap12FaultSubCodeInSubCodeWithParser.getSubCode() == null);
+ assertTrue("SOAP 1.2 SOAPFaultSubCode Test In FaultSubCode With Parser : - SubCode local name mismatch", soap12FaultSubCodeInSubCodeWithParser.getSubCode().getLocalName().equals(SOAP12Constants.SOAP_FAULT_SUB_CODE_LOCAL_NAME));
+ }
+}
Added: webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultSubCodeTestCase.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultSubCodeTestCase.java?rev=201831&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultSubCodeTestCase.java (added)
+++ webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultSubCodeTestCase.java Sun Jun 26 01:24:38 2005
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.axis.soap;
+
+public class SOAPFaultSubCodeTestCase extends SOAPFaultCodeTestCase {
+ protected SOAPFaultValue soap11FaultValue;
+ protected SOAPFaultValue soap12FaultValueInFaultCode;
+ protected SOAPFaultSubCode soap12FaultSubCodeInCode;
+
+ protected SOAPFaultValue soap12FaultValueInFaultSubCode;
+ protected SOAPFaultSubCode soap12FaultSubCodeInSubCode;
+
+ protected SOAPFaultValue soap11FaultValueWithParser;
+ protected SOAPFaultValue soap12FaultValueInFaultCodeWithParser;
+ protected SOAPFaultSubCode soap12FaultSubCodeInFaultCodeWithParser;
+
+ protected SOAPFaultValue soap12FaultValueInFaultSubCodeWithParser;
+ protected SOAPFaultSubCode soap12FaultSubCodeInSubCodeWithParser;
+
+ public SOAPFaultSubCodeTestCase(String testName) {
+ super(testName);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ soap11FaultValue = soap11Factory.createSOAPFaultValue(soap11FaultCode);
+
+ soap12FaultValueInFaultCode = soap12Factory.createSOAPFaultValue(soap12FaultCode);
+ soap12FaultSubCodeInCode = soap12Factory.createSOAPFaultSubCode(soap12FaultCode);
+
+
+ soap12FaultSubCodeInSubCode = soap12Factory.createSOAPFaultSubCode(soap12FaultSubCodeInCode);
+
+ soap11FaultValueWithParser = soap11FaultCodeWithParser.getValue();
+ soap12FaultValueInFaultCodeWithParser = soap12FaultCodeWithParser.getValue();
+ soap12FaultSubCodeInFaultCodeWithParser = soap12FaultCodeWithParser.getSubCode();
+
+ soap12FaultValueInFaultSubCodeWithParser = soap12FaultSubCodeInFaultCodeWithParser.getValue();
+ soap12FaultSubCodeInSubCodeWithParser = soap12FaultSubCodeInFaultCodeWithParser.getSubCode();
+ }
+}
Added: webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultTest.java?rev=201831&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultTest.java (added)
+++ webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultTest.java Sun Jun 26 01:24:38 2005
@@ -0,0 +1,259 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.axis.soap;
+
+import junit.framework.TestCase;
+import org.apache.axis.om.OMAbstractFactory;
+import org.apache.axis.soap.impl.llom.soap11.SOAP11Constants;
+import org.apache.axis.soap.impl.llom.soap12.SOAP12Constants;
+
+public class SOAPFaultTest extends SOAPFaultTestCase {
+
+ public SOAPFaultTest(String testName) {
+ super(testName);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ //SOAP 1.1 Fault Test (Programaticaly created)-----------------------------------------------------------------------------------
+ public void testSOAP11SetCode() {
+ soap11Fault.setCode(soap11Factory.createSOAPFaultCode(soap11Fault));
+ assertNotNull("SOAP 1.1 Fault Test:- After calling setCode method, Fault has no code", soap11Fault.getCode());
+ try {
+ soap11Fault.setCode(soap12Factory.createSOAPFaultCode(soap12Fault));
+ fail("SOAP12FaultCode should not not be set in to a SOAP11Fault");
+ } catch (Exception e) {
+ }
+ }
+
+ public void testSOAP11GetCode() {
+ assertTrue("SOAP 1.1 Fault Test:- After creating a SOAP11Fault, it has a code", soap11Fault.getCode() == null);
+ soap11Fault.setCode(soap11Factory.createSOAPFaultCode(soap11Fault));
+ assertFalse("SOAP 1.1 Fault Test:- After calling setCode method, Fault has no code", soap11Fault.getCode() == null);
+ }
+
+ public void testSOAP11SetReason() {
+ soap11Fault.setReason(soap11Factory.createSOAPFaultReason(soap11Fault));
+ assertFalse("SOAP 1.1 Fault Test:- After calling setReason method, Fault has no reason", soap11Fault.getReason() == null);
+ try {
+ soap11Fault.setReason(soap12Factory.createSOAPFaultReason(soap12Fault));
+ fail("SOAP12FaultReason should not be set in to a SOAP11Fault");
+
+ } catch (Exception e) {
+ assertTrue(true);
+ }
+ }
+
+ public void testSOAP11GetReason() {
+ assertTrue("SOAP 1.1 Fault Test:- After creating a SOAP11Fault, it has a reason", soap11Fault.getReason() == null);
+ soap11Fault.setReason(soap11Factory.createSOAPFaultReason(soap11Fault));
+ assertFalse("SOAP 1.1 Fault Test:- After calling setReason method, Fault has no reason", soap11Fault.getReason() == null);
+ }
+
+ 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);
+
+ }
+ }
+
+ 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() {
+ soap11Fault.setRole(soap11Factory.createSOAPFaultRole(soap11Fault));
+ assertFalse("SOAP 1.1 Fault Test:- After calling setRole method, Fault has no role", soap11Fault.getRole() == null);
+ try {
+ soap11Fault.setRole(soap12Factory.createSOAPFaultRole(soap12Fault));
+ fail("SOAP12FaultRole should not be set in to a SOAP11Fault");
+ } catch (Exception e) {
+ assertTrue(true);
+ }
+ }
+
+ public void testSOAP11GetRole() {
+ assertTrue("SOAP 1.1 Fault Test:- After creating a SOAP11Fault, it has a role", soap11Fault.getRole() == null);
+ soap11Fault.setRole(soap11Factory.createSOAPFaultRole(soap11Fault));
+ assertFalse("SOAP 1.1 Fault Test:- After calling setRole method, Fault has no role", soap11Fault.getRole() == null);
+ }
+
+ public void testSOAP11SetDetail() {
+ soap11Fault.setDetail(soap11Factory.createSOAPFaultDetail(soap11Fault));
+ assertFalse("SOAP 1.1 Fault Test:- After calling setDetail method, Fault has no detail", soap11Fault.getDetail() == null);
+ try {
+ soap11Fault.setDetail(soap12Factory.createSOAPFaultDetail(soap12Fault));
+ fail("SOAP12FaultDetail should not be set in to a SOAP11Fault");
+ } catch (Exception e) {
+ assertTrue(true);
+ }
+ }
+
+ public void testSOAP11GetDetail() {
+ assertTrue("SOAP 1.1 Fault Test:- After creating a SOAP11Fault, it has a detail", soap11Fault.getDetail() == null);
+ soap11Fault.setDetail(soap11Factory.createSOAPFaultDetail(soap11Fault));
+ assertFalse("SOAP 1.1 Fault Test:- After calling setDetail method, Fault has no detail", soap11Fault.getDetail() == null);
+ }
+
+ //SOAP 1.2 Fault Test ((Programaticaly created)--------------------------------------------------------------------------------
+ public void testSOAP12SetCode() {
+ soap12Fault.setCode(soap12Factory.createSOAPFaultCode(soap12Fault));
+ assertFalse("SOAP 1.2 Fault Test:- After calling setCode method, Fault has no code", soap12Fault.getCode() == null);
+ assertTrue("SOAP 1.2 Fault Test:- Code local name mismatch", soap12Fault.getCode().getLocalName().equals(SOAP12Constants.SOAP_FAULT_CODE_LOCAL_NAME));
+ try {
+ soap12Fault.setCode(soap11Factory.createSOAPFaultCode(soap11Fault));
+ fail("SOAP11FaultCode should not be set in to a SOAP12Fault");
+ } catch (Exception e) {
+ assertTrue(true);
+ }
+ }
+
+ public void testSOAP12GetCode() {
+ assertTrue("SOAP 1.2 Fault Test:- After creating a SOAP12Fault, it has a code", soap12Fault.getCode() == null);
+ soap12Fault.setCode(soap12Factory.createSOAPFaultCode(soap12Fault));
+ assertFalse("SOAP 1.2 Fault Test:- After calling setCode method, Fault has no code", soap12Fault.getCode() == null);
+ assertTrue("SOAP 1.2 Fault Test:- Fault code local name mismatch", soap12Fault.getCode().getLocalName().equals(SOAP12Constants.SOAP_FAULT_CODE_LOCAL_NAME));
+ }
+
+ public void testSOAP12SetReason() {
+ soap12Fault.setReason(soap12Factory.createSOAPFaultReason(soap12Fault));
+ assertFalse("SOAP 1.2 Fault Test:- After calling setReason method, Fault has no reason", soap12Fault.getReason() == null);
+ assertTrue("SOAP 1.2 Fault Test:- Fault reason local name mismatch", soap12Fault.getReason().getLocalName().equals(SOAP12Constants.SOAP_FAULT_REASON_LOCAL_NAME));
+ try {
+ soap12Fault.setReason(soap11Factory.createSOAPFaultReason(soap11Fault));
+ fail("SOAP11FaultReason should not be set in to a SOAP12Fault");
+
+ } catch (Exception e) {
+ assertTrue(true);
+ }
+ }
+
+ public void testSOAP12GetReason() {
+ assertTrue("SOAP 1.2 Fault Test:- After creating a SOAP12Fault, it has a reason", soap12Fault.getReason() == null);
+ soap12Fault.setReason(soap12Factory.createSOAPFaultReason(soap12Fault));
+ assertFalse("SOAP 1.2 Fault Test:- After calling setReason method, Fault has no reason", soap12Fault.getReason() == null);
+ assertTrue("SOAP 1.2 Fault Test:- Fault reason local name mismatch", soap12Fault.getReason().getLocalName().equals(SOAP12Constants.SOAP_FAULT_REASON_LOCAL_NAME));
+ }
+
+ public void testSOAP12SetNode() {
+ soap12Fault.setNode(soap12Factory.createSOAPFaultNode(soap12Fault));
+ assertFalse("SOAP 1.2 Fault Test:- After calling setNode method, Fault has no node", soap12Fault.getNode() == null);
+ assertTrue("SOAP 1.2 Fault Test:- Fault node local name mismatch", soap12Fault.getNode().getLocalName().equals(SOAP12Constants.SOAP_FAULT_NODE_LOCAL_NAME));
+ try {
+ soap12Fault.setNode(soap11Factory.createSOAPFaultNode(soap11Fault));
+ fail("SOAP11FaultNode should nott be set in to a SOAP12Fault");
+
+ } catch (Exception e) {
+ assertTrue(true);
+ }
+ }
+
+ public void testSOAP12GetNode() {
+ assertTrue("SOAP 1.2 Fault Test:- After creating a SOAP12Fault, it has a node", soap12Fault.getNode() == null);
+ soap12Fault.setNode(soap12Factory.createSOAPFaultNode(soap12Fault));
+ assertFalse("SOAP 1.2 Fault Test:- After calling setNode method, Fault has no node", soap12Fault.getNode() == null);
+ assertTrue("SOAP 1.2 Fault Test:- Fault node local name mismatch", soap12Fault.getNode().getLocalName().equals(SOAP12Constants.SOAP_FAULT_NODE_LOCAL_NAME));
+ }
+
+ public void testSOAP12SetRole() {
+ soap12Fault.setRole(soap12Factory.createSOAPFaultRole(soap12Fault));
+ assertFalse("SOAP 1.2 :- After calling setRole method, Fault has no role", soap12Fault.getRole() == null);
+ assertTrue("SOAP 1.2 Fault Test:- Fault role local name mismatch", soap12Fault.getRole().getLocalName().equals(SOAP12Constants.SOAP_FAULT_ROLE_LOCAL_NAME));
+ try {
+ soap12Fault.setRole(soap11Factory.createSOAPFaultRole(soap11Fault));
+ fail("SOAP11FaultRole should not be set in to a SOAP12Fault");
+ } catch (Exception e) {
+ assertTrue(true);
+ }
+ }
+
+ public void testSOAP12GetRole() {
+ assertTrue("SOAP 1.2 Fault Test:- After creating a SOAP11Fault, it has a role", soap12Fault.getRole() == null);
+ soap12Fault.setRole(soap12Factory.createSOAPFaultRole(soap12Fault));
+ assertFalse("SOAP 1.2 Fault Test:- After calling setRole method, Fault has no role", soap12Fault.getRole() == null);
+ assertTrue("SOAP 1.2 Fault Test:- Fault role local name mismatch", soap12Fault.getRole().getLocalName().equals(SOAP12Constants.SOAP_FAULT_ROLE_LOCAL_NAME));
+ }
+
+ public void testSOAP12SetDetail() {
+ soap12Fault.setDetail(soap12Factory.createSOAPFaultDetail(soap12Fault));
+ assertFalse("SOAP 1.2 Fault Test:- After calling setDetaile method, Fault has no detail", soap12Fault.getDetail() == null);
+ assertTrue("SOAP 1.2 Fault Test:- Fault detail local name mismatch", soap12Fault.getDetail().getLocalName().equals(SOAP12Constants.SOAP_FAULT_DETAIL_LOCAL_NAME));
+ try {
+ soap12Fault.setDetail(soap11Factory.createSOAPFaultDetail(soap11Fault));
+ fail("SOAP11FaultDetail should not be set in to a SOAP12Fault");
+
+ } catch (Exception e) {
+ assertTrue(true);
+ }
+ }
+
+ public void testSOAP12GetDetail() {
+ assertTrue("SOAP 1.2 Fault Test:- After creating a SOAP12Fault, it has a detail", soap12Fault.getDetail() == null);
+ soap12Fault.setDetail(soap12Factory.createSOAPFaultDetail(soap12Fault));
+ assertFalse("SOAP 1.2 Fault Test:- After calling setDetail method, Fault has no detail", soap12Fault.getDetail() == null);
+ assertTrue("SOAP 1.2 Fault Test:- Fault detail local name mismatch", soap12Fault.getDetail().getLocalName().equals(SOAP12Constants.SOAP_FAULT_DETAIL_LOCAL_NAME));
+ }
+
+ //SOAP 1.1 Fault Test (With parser)
+ public void testSOAP11GetCodeWithParser() {
+ assertFalse("SOAP 1.1 Fault Test with parser: - getCode method returns null", soap11FaultWithParser.getCode() == null);
+ }
+
+ public void testSOAP11GetRoleWithParser() {
+ assertFalse("SOAP 1.1 Fault Test with parser: - getRole method returns null", soap11FaultWithParser.getRole() == null);
+ }
+
+ public void testSOAP11GetDetailWithParser() {
+ assertFalse("SOAP 1.1 Fault Test with parser: - getDetail method returns null", soap11FaultWithParser.getDetail() == null);
+ }
+
+ //SOAP 1.2 Fault Test (With parser)
+ public void testSOAP12GetCodeWithParser() {
+ assertFalse("SOAP 1.2 Fault Test with parser: - getCode method returns null", soap12FaultWithParser.getCode() == null);
+ assertTrue("SOAP 1.2 Fault Test with parser: - Fault code local name mismatch", soap12FaultWithParser.getCode().getLocalName().equals(SOAP12Constants.SOAP_FAULT_CODE_LOCAL_NAME));
+ }
+
+ public void testSOAP12GetReasonWithParser() {
+ assertFalse("SOAP 1.2 Fault Test with parser: - getReason method returns null", soap12FaultWithParser.getReason() == null);
+ assertTrue("SOAP 1.2 Fault Test with parser: - Fault reason local name mismatch", soap12FaultWithParser.getReason().getLocalName().equals(SOAP12Constants.SOAP_FAULT_REASON_LOCAL_NAME));
+ }
+
+ public void testSOAP12GetNodeWithParser() {
+ assertFalse("SOAP 1.2 Fault Test with parser: - getNode method returns null", soap12FaultWithParser.getNode() == null);
+ assertTrue("SOAP 1.2 Fault Test with parser: - Fault node local name mismatch", soap12FaultWithParser.getNode().getLocalName().equals(SOAP12Constants.SOAP_FAULT_NODE_LOCAL_NAME));
+ }
+
+ public void testSOAP12GetRoleWithParser() {
+ assertFalse("SOAP 1.2 Fault Test with parser: - getRole method returns null", soap12FaultWithParser.getRole() == null);
+ assertTrue("SOAP 1.2 Fault Test with parser: - Fault role local name mismatch", soap12FaultWithParser.getRole().getLocalName().equals(SOAP12Constants.SOAP_FAULT_ROLE_LOCAL_NAME));
+ }
+
+ public void testSOAP12GetDetailWithParser() {
+ assertFalse("SOAP 1.2 Fault Test with parser: - getDetail method returns null", soap12FaultWithParser.getDetail() == null);
+ assertTrue("SOAP 1.2 Fault Test with parser: - Fault detail local name mismatch", soap12FaultWithParser.getDetail().getLocalName().equals(SOAP12Constants.SOAP_FAULT_DETAIL_LOCAL_NAME));
+ }
+}
\ No newline at end of file
Added: webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultTestCase.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultTestCase.java?rev=201831&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultTestCase.java (added)
+++ webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultTestCase.java Sun Jun 26 01:24:38 2005
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.axis.soap;
+
+import org.apache.axis.om.OMAbstractFactory;
+
+public class SOAPFaultTestCase extends SOAPBodyTestCase {
+ protected SOAPFault soap11Fault;
+ protected SOAPFault soap12Fault;
+ protected SOAPFault soap11FaultWithParser;
+ protected SOAPFault soap12FaultWithParser;
+
+ public SOAPFaultTestCase(String testName) {
+ super(testName);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ soap11Fault = OMAbstractFactory.getSOAP11Factory().createSOAPFault(soap11Body);
+ soap12Fault = OMAbstractFactory.getSOAP12Factory().createSOAPFault(soap12Body);
+ soap11FaultWithParser = soap11BodyWithParser.getFault();
+ soap12FaultWithParser = soap12BodyWithParser.getFault();
+ }
+}
Added: webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultTextTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultTextTest.java?rev=201831&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultTextTest.java (added)
+++ webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultTextTest.java Sun Jun 26 01:24:38 2005
@@ -0,0 +1,116 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.axis.soap;
+
+import org.apache.axis.om.OMAttribute;
+import org.apache.axis.soap.impl.llom.soap12.SOAP12Constants;
+
+public class SOAPFaultTextTest extends SOAPFaultReasonTestCase {
+ protected SOAPFaultText soap11FaultText;
+ protected SOAPFaultText soap12FaultText;
+ protected SOAPFaultText soap11FaultTextWithParser;
+ protected SOAPFaultText soap12FaultTextWithParser;
+
+ public SOAPFaultTextTest(String testName) {
+ super(testName);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ soap11FaultText = soap11Factory.createSOAPFaultText(soap11FaultReason);
+ soap12FaultText = soap12Factory.createSOAPFaultText(soap12FaultReason);
+ soap11FaultTextWithParser = soap11FaultReasonWithParser.getSOAPText();
+ soap12FaultTextWithParser = soap12FaultReasonWithParser.getSOAPText();
+ }
+
+ //SOAP 1.1 Fault Text Test (Programaticaly Created)
+ public void testSOAP11SetLang() {
+ soap11FaultText.setLang("en");
+ assertTrue("SOAP 1.1 Fault Text Test : - After calling setLang method, Lang attribute value mismatch", soap11FaultText.getLang().equals("en"));
+ OMAttribute langAttribute = (OMAttribute) soap11FaultText.getAttributes().next();
+ assertTrue("SOAP 1.1 Fault Text Test : - After calling setLang method, Lang attribute local name mismaatch", langAttribute.getLocalName().equals(SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_LOCAL_NAME));
+ assertTrue("SOAP 1.1 Fault Text Test : - After calling setLang method, Lang attribute namespace prefix mismatch", langAttribute.getNamespace().getPrefix().equals(SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_NS_PREFIX));
+ assertTrue("SOAP 1.1 Fault Text Test : - After calling setLang method, Lang attribute namespace uri mismatch", langAttribute.getNamespace().getName().equals(SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_NS_URI));
+ }
+
+ public void testSOAP11GetLang() {
+
+
+ assertNull("SOAP 1.1 Fault Text Test : - After creating SOAPFaultText, it has a Lnag attribute", soap11FaultText.getLang());
+
+ soap11FaultText.setLang("en");
+ assertTrue("SOAP 1.1 Fault Text Test : - After calling setLang method, Lang attribute value mismatch", soap11FaultText.getLang().equals("en"));
+ }
+
+ public void testSOAP11SetText() {
+ soap11FaultText.setText("This is only a test");
+ assertTrue("SOAP 1.1 Fault Text Test : - After calling setText method, getText method return incorrect string", soap11FaultText.getText().equals("This is only a test"));
+ }
+
+ public void testSOAP11GetText() {
+ assertTrue("SOAP 1.1 Fault Text Test : - After creating SOAPFaultText, it has a text", soap11FaultText.getText().equals(""));
+ soap11FaultText.setText("This is only a test");
+ assertTrue("SOAP 1.1 Fault Text Test : - After calling setText method, getText method return incorrect string", soap11FaultText.getText().equals("This is only a test"));
+ }
+
+ //SOAP 1.2 Fault Text Test (Programaticaly Created)
+ public void testSOAP12SetLang() {
+ soap12FaultText.setLang("en");
+ assertTrue("SOAP 1.2 Fault Text Test : - After calling setLang method, Lang attribute value mismatch", soap12FaultText.getLang().equals("en"));
+ OMAttribute langAttribute = (OMAttribute) soap12FaultText.getAttributes().next();
+ assertTrue("SOAP 1.2 Fault Text Test : - After calling setLang method, Lang attribute local name mismaatch", langAttribute.getLocalName().equals(SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_LOCAL_NAME));
+ assertTrue("SOAP 1.2 Fault Text Test : - After calling setLang method, Lang attribute namespace prefix mismatch", langAttribute.getNamespace().getPrefix().equals(SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_NS_PREFIX));
+ assertTrue("SOAP 1.2 Fault Text Test : - After calling setLang method, Lang attribute namespace uri mismatch", langAttribute.getNamespace().getName().equals(SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_NS_URI));
+ }
+
+ public void testSOAP12GetLang() {
+
+ assertNull("SOAP 1.2 Fault Text Test : - After creating SOAPFaultText, it has a Lnag attribute", soap12FaultText.getLang());
+
+ soap12FaultText.setLang("en");
+ assertTrue("SOAP 1.2 Fault Text Test : - After calling setLang method, Lang attribute value mismatch", soap12FaultText.getLang().equals("en"));
+ }
+
+ public void testSOAP12SetText() {
+ soap12FaultText.setText("This is only a test");
+ assertTrue("SOAP 1.2 Fault Text Test : - After calling setText method, getText method return incorrect string", soap12FaultText.getText().equals("This is only a test"));
+ }
+
+ public void testSOAP12GetText() {
+ assertTrue("SOAP 1.2 Fault Text Test : - After creating SOAPFaultText, it has a text", soap12FaultText.getText().equals(""));
+ soap12FaultText.setText("This is only a test");
+ assertTrue("SOAP 1.2 Fault Text Test : - After calling setText method, getText method return incorrect string", soap12FaultText.getText().equals("This is only a test"));
+ }
+
+ //SOAP 1.1 Fault Text Test (With Parser)
+ public void testSOAP11GetTextWithParser() {
+ assertTrue("SOAP 1.1 Fault Text Test With Parser : - getText method returns incorrect string", soap11FaultTextWithParser.getText().equals("Sender Timeout"));
+ }
+
+ //SOAP 1.2 Fault Text Test (With Parser)
+ public void testSOAP12GetLangWithParser() {
+ assertTrue("SOAP 1.2 Fault Text Test With Parser : - getLang method returns incorrect string", soap12FaultTextWithParser.getLang().equals("en"));
+ OMAttribute langAttribute = (OMAttribute) soap12FaultTextWithParser.getAttributes().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().getName().equals(SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_NS_URI));
+ }
+
+ public void testSOAP12GetTextWithParser() {
+ assertTrue("SOAP 1.2 Fault Text Test With Parser : - getText method returns incorrect string", soap12FaultTextWithParser.getText().equals("Sender Timeout"));
+ }
+}
Added: webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultValueTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultValueTest.java?rev=201831&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultValueTest.java (added)
+++ webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultValueTest.java Sun Jun 26 01:24:38 2005
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.axis.soap;
+
+public class SOAPFaultValueTest extends SOAPFaultSubCodeTestCase {
+
+ public SOAPFaultValueTest(String testName) {
+ super(testName);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ soap12FaultValueInFaultSubCode = soap12Factory.createSOAPFaultValue(soap12FaultSubCodeInCode);
+ }
+
+ //SOAP 1.1 Fault Value Test (Programaticaly Created)
+ public void testSOAP11setText() {
+ soap11FaultValue.setText("This is only Test");
+ assertTrue("SOAP 1.1 Fault Value Test : - value text mismatch",soap11FaultValue.getText().equals("This is only Test"));
+ }
+
+ public void testSOAP11GetText() {
+ assertTrue("SOAP 1.1 Fault Value Test : - After creating Fault Value, it has a text",soap11FaultValue.getText().equals(""));
+ soap11FaultValue.setText("This is only Test");
+ assertFalse("SOAP 1.1 Fault Value Test : - After calling setText method, getText method returns null",soap11FaultValue.getText().equals(""));
+ assertTrue("SOAP 1.1 Fault Value Test : - value text mismatch",soap11FaultValue.getText().equals("This is only Test"));
+ }
+
+ //SOAP 1.2 Fault Value(In Fault Code) Test (Programaticaly Created)
+ public void testSOAP12setTextInFaultCode() {
+ soap12FaultValueInFaultCode.setText("This is only Test");
+ assertTrue("SOAP 1.2 Fault Value Test in Fault Code : - value text mismatch",soap12FaultValueInFaultCode.getText().equals("This is only Test"));
+ }
+
+ public void testSOAP12GetTextInFaultCode() {
+ assertTrue("SOAP 1.2 Fault Value Test in Fault Code : - After creating Fault Value, it has a text",soap12FaultValueInFaultCode.getText().equals(""));
+ soap12FaultValueInFaultCode.setText("This is only Test");
+ assertFalse("SOAP 1.2 Fault Value Test in Fault Code : - After calling setText method, getText method returns null",soap12FaultValueInFaultCode.getText().equals(""));
+ assertTrue("SOAP 1.2 Fault Value Test in Fault Code : - value text mismatch",soap12FaultValueInFaultCode.getText().equals("This is only Test"));
+ }
+
+ //SOAP 1.2 Fault Value(In Fault SubCode) Test (Programaticaly Created)
+ public void testSOAP12setTextInFaultSubCode() {
+ soap12FaultValueInFaultSubCode.setText("This is only Test");
+ assertTrue("SOAP 1.2 Fault Value Test in Fault SubCode : - value text mismatch",soap12FaultValueInFaultSubCode.getText().equals("This is only Test"));
+ }
+
+ public void testSOAP12GetTextInFaultSubCode() {
+ assertTrue("SOAP 1.2 Fault Value Test in Fault SubCode : - After creating Fault Value, it has a text",soap12FaultValueInFaultSubCode.getText().equals(""));
+ soap12FaultValueInFaultSubCode.setText("This is only Test");
+ assertFalse("SOAP 1.2 Fault Value Test in Fault SubCode : - After calling setText method, getText method returns null",soap12FaultValueInFaultSubCode.getText().equals(""));
+ assertTrue("SOAP 1.2 Fault Value Test in Fault SubCode : - value text mismatch",soap12FaultValueInFaultSubCode.getText().equals("This is only Test"));
+ }
+
+ //SOAP 1.1 Fault Value Test (With Parser)
+ public void testSOAP11GetTextWithParser() {
+ assertTrue("SOAP 1.1 Fault Value Test with parser : - value text mismatch",soap11FaultValueWithParser.getText().equals("env:Sender"));
+ }
+
+ //SOAP 1.2 Fault Value(In Fault Code) Test (With Parser)
+ public void testSOAP12setTextWithParserInFaultCode() {
+ assertTrue("SOAP 1.2 Fault Value Test with parser in Fault Code : - value text mismatch",soap12FaultValueInFaultCodeWithParser.getText().equals("env:Sender"));
+ }
+
+ //SOAP 1.2 Fault Value(In Fault SubCode) Test (With Parser)
+ public void testSOAP12setTextWithParserInFaultSubCode() {
+ assertTrue("SOAP 1.2 Fault Value Test with parser in Fault SubCode : - value text mismatch",soap12FaultValueInFaultSubCodeWithParser.getText().equals("m:MessageTimeout In First SubCode"));
+ }
+}
Added: webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPHeaderBlockTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPHeaderBlockTest.java?rev=201831&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPHeaderBlockTest.java (added)
+++ webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPHeaderBlockTest.java Sun Jun 26 01:24:38 2005
@@ -0,0 +1,165 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.axis.soap;
+
+import java.util.Iterator;
+
+public class SOAPHeaderBlockTest extends SOAPHeaderTestCase {
+ protected SOAPHeaderBlock soap11HeaderBlock;
+ protected SOAPHeaderBlock soap12HeaderBlock;
+ protected SOAPHeaderBlock soap11HeaderBlock1WithParser;
+ protected SOAPHeaderBlock soap12HeaderBlock1WithParser;
+ protected SOAPHeaderBlock soap11HeaderBlock2WithParser;
+ protected SOAPHeaderBlock soap12HeaderBlock2WithParser;
+ protected SOAPHeaderBlock soap11HeaderBlock3WithParser;
+ protected SOAPHeaderBlock soap12HeaderBlock3WithParser;
+
+ public SOAPHeaderBlockTest(String testName) {
+ super(testName);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ soap11HeaderBlock = soap11Factory.createSOAPHeaderBlock("testHeaderBlock", namespace, soap11Header);
+ soap12HeaderBlock = soap12Factory.createSOAPHeaderBlock("testHeaderBlock", namespace, soap12Header);
+ Iterator iterator = soap11HeaderWithParser.examineAllHeaderBlocks();
+ iterator.next();
+ soap11HeaderBlock1WithParser = (SOAPHeaderBlock) iterator.next();
+ iterator.next();
+ soap11HeaderBlock2WithParser = (SOAPHeaderBlock) iterator.next();
+ iterator.next();
+ soap11HeaderBlock3WithParser = (SOAPHeaderBlock) iterator.next();
+
+ iterator = soap12HeaderWithParser.examineAllHeaderBlocks();
+ iterator.next();
+ soap12HeaderBlock1WithParser = (SOAPHeaderBlock) iterator.next();
+ iterator.next();
+ soap12HeaderBlock2WithParser = (SOAPHeaderBlock) iterator.next();
+ iterator.next();
+ soap12HeaderBlock3WithParser = (SOAPHeaderBlock) iterator.next();
+ }
+
+ //SOAP 1.1 SOAPHeaderBlock Test (Programaticaly Created)
+ public void testSOAP11SetRole() {
+ soap11HeaderBlock.setRole("http://schemas.xmlsoap.org/soap/envelope/actor/next");
+ assertTrue("SOAP 1.1 HeaderBlock Test : - After calling setRole method, getRole method returns incorrect role value", soap11HeaderBlock.getRole().equals("http://schemas.xmlsoap.org/soap/envelope/actor/next"));
+ try {
+ soap11HeaderBlock.setRole("Any Value");
+ } catch (Exception e) {
+ fail("SOAP 1.1 HeaderBlock Test : - role value can not be set to any value");
+ }
+ }
+
+ public void testSOAP11GetRole() {
+ assertTrue("SOAP 1.1 HeaderBlock Test : - After creating SOAPHeaderBlock, it has a role", soap11HeaderBlock.getRole() == null);
+ soap11HeaderBlock.setRole("http://schemas.xmlsoap.org/soap/envelope/actor/next");
+ assertTrue("SOAP 1.1 HeaderBlock Test : - After calling setRole method, getRole method returns incorrect role value", soap11HeaderBlock.getRole().equals("http://schemas.xmlsoap.org/soap/envelope/actor/next"));
+ }
+
+ public void testSOAP11SetMustUnderstand() {
+ soap11HeaderBlock.setMustUnderstand(true);
+ assertTrue("SOAP 1.1 HeaderBlock Test : - After setting MustUnderstand true calling setMustUnderstand method , getMustUnderstand method returns false", soap11HeaderBlock.getMustUnderstand());
+ soap11HeaderBlock.setMustUnderstand(false);
+ assertFalse("SOAP 1.1 HeaderBlock Test : - After setting MustUnderstand false calling setMustUnderstand method , getMustUnderstand method returns true", soap11HeaderBlock.getMustUnderstand());
+ soap11HeaderBlock.setMustUnderstand("1");
+ assertTrue("SOAP 1.1 HeaderBlock Test : - After setting MustUnderstand \"1\" calling setMustUnderstand method , getMustUnderstand method returns false", soap11HeaderBlock.getMustUnderstand());
+ soap11HeaderBlock.setMustUnderstand("0");
+ assertFalse("SOAP 1.1 HeaderBlock Test : - After setting MustUnderstand \"0\" calling setMustUnderstand method , getMustUnderstand method returns true", soap11HeaderBlock.getMustUnderstand());
+ try {
+ soap11HeaderBlock.setMustUnderstand("true");
+ } catch (Exception e) {
+ fail("SOAP 1.1 HeaderBlock Test : - MustUnderstatnd value can not be set to any value rather than 1 or 0");
+ }
+ }
+
+ public void testSOAP11GetMustUnderstand() {
+ assertFalse("SOAP 1.1 HeaderBlock Test : - After creating SOAPHeaderBlock, default MustUnderstand value true", soap11HeaderBlock.getMustUnderstand());
+ soap11HeaderBlock.setMustUnderstand(true);
+ assertTrue("SOAP 1.1 HeaderBlock Test : - After setting MustUnderstand true calling setMustUnderstand method , getMustUnderstand method returns false", soap11HeaderBlock.getMustUnderstand());
+ }
+
+ //SOAP 1.2 SOAPHeaderBlock Test (Programaticaly Created)
+ public void testSOAP12SetRole() {
+ soap12HeaderBlock.setRole("http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver");
+ assertTrue("SOAP 1.2 HeaderBlock Test : - After calling setRole method, getRole method returns incorrect role value", soap12HeaderBlock.getRole().equals("http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver"));
+ try {
+ soap12HeaderBlock.setRole("Any Value");
+ } catch (Exception e) {
+ fail("SOAP 1.2 HeaderBlock Test : - role value can not be set to any value");
+ }
+ }
+
+ public void testSOAP12GetRole() {
+ assertTrue("SOAP 1.2 HeaderBlock Test : - After creating SOAPHeaderBlock, it has a role", soap12HeaderBlock.getRole() == null);
+ soap12HeaderBlock.setRole("http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver");
+ assertTrue("SOAP 1.2 HeaderBlock Test : - After calling setRole method, getRole method returns incorrect role value", soap12HeaderBlock.getRole().equals("http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver"));
+ }
+
+ public void testSOAP12SetMustUnderstand() {
+ soap12HeaderBlock.setMustUnderstand(true);
+ assertTrue("SOAP 1.2 HeaderBlock Test : - After setting MustUnderstand true calling setMustUnderstand method , getMustUnderstand method returns false", soap12HeaderBlock.getMustUnderstand());
+ soap12HeaderBlock.setMustUnderstand(false);
+ assertFalse("SOAP 1.2 HeaderBlock Test : - After setting MustUnderstand false calling setMustUnderstand method , getMustUnderstand method returns true", soap12HeaderBlock.getMustUnderstand());
+ soap12HeaderBlock.setMustUnderstand("true");
+ assertTrue("SOAP 1.2 HeaderBlock Test : - After setting MustUnderstand \"true\" calling setMustUnderstand method , getMustUnderstand method returns false", soap12HeaderBlock.getMustUnderstand());
+ soap12HeaderBlock.setMustUnderstand("false");
+ assertFalse("SOAP 1.2 HeaderBlock Test : - After setting MustUnderstand \"false\" calling setMustUnderstand method , getMustUnderstand method returns true", soap12HeaderBlock.getMustUnderstand());
+ soap12HeaderBlock.setMustUnderstand("1");
+ assertTrue("SOAP 1.2 HeaderBlock Test : - After setting MustUnderstand \"1\" calling setMustUnderstand method , getMustUnderstand method returns false", soap12HeaderBlock.getMustUnderstand());
+ soap12HeaderBlock.setMustUnderstand("0");
+ assertFalse("SOAP 1.2 HeaderBlock Test : - After setting MustUnderstand \"0\" calling setMustUnderstand method , getMustUnderstand method returns true", soap12HeaderBlock.getMustUnderstand());
+ try {
+ soap12HeaderBlock.setMustUnderstand("otherValue");
+ fail("SOAP 1.2 HeaderBlock Test : - MustUnderstatnd value can not be set to any value rather than 1 , 0 , true , false");
+
+ } catch (Exception e) {
+ assertTrue(true);
+ }
+ }
+
+ public void testSOAP12GetMustUnderstand() {
+ assertFalse("SOAP 1.2 HeaderBlock Test : - After creating SOAPHeaderBlock, default MustUnderstand value true", soap12HeaderBlock.getMustUnderstand());
+ soap12HeaderBlock.setMustUnderstand(true);
+ assertTrue("SOAP 1.2 HeaderBlock Test : - After setting MustUnderstand true calling setMustUnderstand method , getMustUnderstand method returns false", soap12HeaderBlock.getMustUnderstand());
+ }
+
+ //SOAP 1.1 SOAPHeaderBlock Test (With Parser)
+ public void testSOAP11GetRoleWithParser() {
+ assertTrue("SOAP 1.1 HeaderBlock Test Wiht Parser : - getRole method returns incorrect role value", soap11HeaderBlock1WithParser.getRole().equals("http://schemas.xmlsoap.org/soap/actor/next"));
+ }
+
+ public void testSOAP11GetMustUnderstandWithParser() {
+ assertTrue("SOAP 1.1 HeaderBlock Test Wiht Parser : - getMustUnderstatnd method returns incorrect value", soap11HeaderBlock2WithParser.getMustUnderstand());
+ assertFalse("SOAP 1.1 HeaderBlock Test Wiht Parser : - getMustUnderstatnd method returns incorrect value", soap11HeaderBlock3WithParser.getMustUnderstand());
+
+ }
+
+ //SOAP 1.2 SOAPHeaderBlock Test (With Parser)
+ public void testSOAP12GetRoleWithParser() {
+ assertTrue("SOAP 1.2 HeaderBlock Test Wiht Parser : - getRole method returns incorrect role value", soap12HeaderBlock1WithParser.getRole().equals("http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver"));
+ }
+
+ public void testSOAP12GetMustUnderstandWithParser() {
+ assertTrue("SOAP 1.2 HeaderBlock Test Wiht Parser : - getMustUnderstatnd method returns incorrect value", soap12HeaderBlock1WithParser.getMustUnderstand());
+ assertFalse("SOAP 1.2 HeaderBlock Test Wiht Parser : - getMustUnderstatnd method returns incorrect value", soap12HeaderBlock2WithParser.getMustUnderstand());
+ try {
+ soap12HeaderBlock3WithParser.getMustUnderstand();
+ } catch (Exception e) {
+ fail("SOAP 1.2 HeaderBlock Test Wiht Parser : - getMustUnderstatnd method should returns exception when mustunderstand value is incorrect");
+ }
+ }
+}
Added: webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPHeaderTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPHeaderTest.java?rev=201831&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPHeaderTest.java (added)
+++ webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPHeaderTest.java Sun Jun 26 01:24:38 2005
@@ -0,0 +1,285 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.axis.soap;
+
+import org.apache.axis.om.OMNamespace;
+import org.apache.axis.om.impl.llom.traverse.OMChildrenWithSpecificAttributeIterator;
+
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+import java.util.ArrayList;
+
+public class SOAPHeaderTest extends SOAPHeaderTestCase {
+ protected boolean isThereException;
+
+ public SOAPHeaderTest(String testName) {
+ super(testName);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ //SOAP 1.1 Header Test (Programaticaly Created)--------------------------------------------------------------------------------
+ public void testSOAP11AddHeadearBlock() {
+ soap11Header.addHeaderBlock("echoOk1", namespace);
+ soap11Header.addHeaderBlock("echoOk2", namespace);
+ Iterator iterator = soap11Header.getChildren();
+ SOAPHeaderBlock headerBlock1 = (SOAPHeaderBlock) iterator.next();
+ assertFalse("SOAP 1.1 Header Test : - After calling addHeaderBlock method twice, getChildren method returns empty iterator", headerBlock1 == null);
+ assertTrue("SOAP 1.1 Header Test : - HeaderBlock1 local name mismatch", headerBlock1.getLocalName().equals("echoOk1"));
+ assertTrue("SOAP 1.1 Header Test : - HeaderBlock1 namespace uri mismatch", headerBlock1.getNamespace().getName().equals("http://www.example.org"));
+
+ SOAPHeaderBlock headerBlock2 = (SOAPHeaderBlock) iterator.next();
+ assertFalse("SOAP 1.1 Header Test : - After calling addHeaderBlock method twice, getChildren method returns an iterator with only one object", headerBlock2 == null);
+ assertTrue("SOAP 1.1 Header Test : - HeaderBlock2 local name mismatch", headerBlock2.getLocalName().equals("echoOk2"));
+ assertTrue("SOAP 1.1 Header Test : - HeaderBlock2 namespace uri mismatch", headerBlock2.getNamespace().getName().equals("http://www.example.org"));
+
+ assertTrue("SOAP 1.1 Header Test : - After calling addHeaderBlock method twice, getChildren method returns an iterator with more than two object", iterator.next() == null);
+ }
+
+ public void testSOAP11ExamineHeaderBlocks() {
+ soap11Header.addHeaderBlock("echoOk1", namespace).setRole("http://schemas.xmlsoap.org/soap/envelope/actor/ultimateReceiver");
+ ;
+ soap11Header.addHeaderBlock("echoOk2", namespace).setRole("http://schemas.xmlsoap.org/soap/envelope/actor/next");
+ Iterator iterator = soap11Header.examineHeaderBlocks("http://schemas.xmlsoap.org/soap/envelope/actor/next");
+ iterator.hasNext();
+ SOAPHeaderBlock headerBlockWithRole1 = (SOAPHeaderBlock) iterator.next();
+ assertTrue("SOAP 1.1 Header Test : - headerBlockWithRole local name mismatch", headerBlockWithRole1.getLocalName().equals("echoOk2"));
+ assertTrue("SOAP 1.1 Header Test : - headerBlockWithRole role value mismatch", headerBlockWithRole1.getRole().equals("http://schemas.xmlsoap.org/soap/envelope/actor/next"));
+
+
+ assertFalse("SOAP 1.1 Header Test : - header has three headerBlocks with the given role, but examineHeaderBlocks(String role) method returns an iterator with more than three objects", iterator.hasNext());
+ }
+
+// public void testSOAP11ExtractHeaderBlocks() {
+
+// }
+
+
+
+ public void testSOAP11ExamineAllHeaderBlocks() {
+ soap11Header.addHeaderBlock("echoOk1", namespace);
+ soap11Header.addHeaderBlock("echoOk2", namespace);
+ Iterator iterator = soap11Header.examineAllHeaderBlocks();
+ iterator.hasNext();
+ SOAPHeaderBlock headerBlock1 = (SOAPHeaderBlock) iterator.next();
+ assertFalse("SOAP 1.1 Header Test : - After calling addHeaderBlock method twice, examineAllHeaderBlocks method returns empty iterator", headerBlock1 == null);
+ assertTrue("SOAP 1.1 Header Test : - HeaderBlock1 local name mismatch", headerBlock1.getLocalName().equals("echoOk1"));
+ assertTrue("SOAP 1.1 Header Test : - HeaderBlock1 namespace uri mismatch", headerBlock1.getNamespace().getName().equals("http://www.example.org"));
+
+ iterator.hasNext();
+ SOAPHeaderBlock headerBlock2 = (SOAPHeaderBlock) iterator.next();
+ assertFalse("SOAP 1.1 Header Test : - After calling addHeaderBlock method twice, examineAllHeaderBlocks method returns an iterator with only one object", headerBlock2 == null);
+ assertTrue("SOAP 1.1 Header Test : - HeaderBlock2 local name mismatch", headerBlock2.getLocalName().equals("echoOk2"));
+ assertTrue("SOAP 1.1 Header Test : - HeaderBlock2 namespace uri mismatch", headerBlock2.getNamespace().getName().equals("http://www.example.org"));
+
+ assertFalse("SOAP 1.1 Header Test : - After calling addHeaderBlock method twice, examineAllHeaderBlocks method returns an iterator with more than two object", iterator.hasNext());
+
+ }
+
+// public void testSOAP11ExtractAllHeaderBlocks() {
+//
+// }
+
+
+ public void testSOAP11GetHeaderBolcksWithNSURI() {
+ soap11Header.addHeaderBlock("echoOk1", namespace);
+ soap11Header.addHeaderBlock("echoOk2", omFactory.createOMNamespace("http://www.test1.org", "test1"));
+ ArrayList arrayList = soap11Header.getHeaderBolcksWithNSURI("http://www.test1.org");
+ assertTrue("SOAP 1.1 Header Test : - getHeaderBolcksWithNSURI returns an arrayList of incorrect size", arrayList.size() == 1);
+ assertTrue("SOAP 1.1 Header Test : - headerBlock of given namespace uri mismatch", ((SOAPHeaderBlock) arrayList.get(0)).getNamespace().getName().equals("http://www.test1.org"));
+ }
+
+ //SOAP 1.2 Header Test (Programaticaly Created)----------------------------------------------------------------------------------
+ public void testSOAP12AddHeadearBlock() {
+ soap12Header.addHeaderBlock("echoOk1", namespace);
+ soap12Header.addHeaderBlock("echoOk2", namespace);
+ Iterator iterator = soap12Header.getChildren();
+ SOAPHeaderBlock headerBlock1 = (SOAPHeaderBlock) iterator.next();
+ assertFalse("SOAP 1.2 Header Test : - After calling addHeaderBlock method, getChildren method returns empty iterator", headerBlock1 == null);
+ assertTrue("SOAP 1.2 Header Test : - HeaderBlock1 local name mismatch", headerBlock1.getLocalName().equals("echoOk1"));
+ assertTrue("SOAP 1.2 Header Test : - HeaderBlock1 namespace uri mismatch", headerBlock1.getNamespace().getName().equals("http://www.example.org"));
+
+ SOAPHeaderBlock headerBlock2 = (SOAPHeaderBlock) iterator.next();
+ assertFalse("SOAP 1.2 Header Test : - After calling addHeaderBlock method, getChildren method returns an iterator with only one object", headerBlock2 == null);
+ assertTrue("SOAP 1.2 Header Test : - HeaderBlock2 local name mismatch", headerBlock2.getLocalName().equals("echoOk2"));
+ assertTrue("SOAP 1.2 Header Test : - HeaderBlock2 namespace uri mismatch", headerBlock2.getNamespace().getName().equals("http://www.example.org"));
+
+ assertTrue("SOAP 1.2 Header Test : - After calling addHeaderBlock method twice, getChildren method returns an iterator with more than two elements", iterator.next() == null);
+ }
+
+ public void testSOAP12ExamineHeaderBlocks() {
+ soap12Header.addHeaderBlock("echoOk1", namespace);
+ soap12Header.addHeaderBlock("echoOk2", namespace).setRole("http://schemas.xmlsoap.org/soap/envelope/actor/ultimateReceiver");
+ Iterator iterator = soap12Header.examineHeaderBlocks("http://schemas.xmlsoap.org/soap/envelope/actor/ultimateReceiver");
+ iterator.hasNext();
+ SOAPHeaderBlock headerBlockWithRole = (SOAPHeaderBlock) iterator.next();
+ assertTrue("SOAP 1.2 Header Test : - headerBlockWithRole local name mismatch", headerBlockWithRole.getLocalName().equals("echoOk2"));
+ assertTrue("SOAP 1.2 Header Test : - headerBlockWithRole role value mismatch", headerBlockWithRole.getRole().equals("http://schemas.xmlsoap.org/soap/envelope/actor/ultimateReceiver"));
+
+ assertFalse("SOAP 1.2 Header Test : - header has one headerBlock with role, but examineHeaderBlocks(String role) method returns an iterator with more than one object", iterator.hasNext());
+
+ }
+
+
+ public void testSOAP12ExamineMustUnderstandHeaderBlocks() {
+ soap12Header.addHeaderBlock("echoOk1", namespace).setRole("http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver");
+
+ SOAPHeaderBlock headerBlock1 = soap12Header.addHeaderBlock("echoOk2", namespace);
+ headerBlock1.setRole("http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver");
+ headerBlock1.setMustUnderstand(true);
+
+ soap12Header.addHeaderBlock("echoOk3", namespace).setMustUnderstand(true);
+
+ Iterator iterator = soap12Header.examineMustUnderstandHeaderBlocks("http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver");
+ iterator.hasNext();
+ SOAPHeaderBlock headerBlock = (SOAPHeaderBlock) iterator.next();
+ assertFalse("SOAP 1.2 Header Test : - examineMustUnderstandHeaderBlocks method returns empty iterator", headerBlock == null);
+ assertTrue("SOAP 1.2 Header Test : - HeaderBlock local name mismatch", headerBlock.getLocalName().equals("echoOk2"));
+ assertTrue("SOAP 1.2 Header Test : - HeaderBlock role value mismatch", headerBlock.getRole().equals("http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver"));
+ assertFalse("SOAP 1.2 Header Test : - examineMustUnderstandHeaderBlocks method returns an iterator with more than one object", iterator.hasNext());
+ }
+
+ public void testSOAP12ExamineAllHeaderBlocks() {
+ soap12Header.addHeaderBlock("echoOk1", namespace);
+ soap12Header.addHeaderBlock("echoOk2", namespace);
+ Iterator iterator = soap12Header.examineAllHeaderBlocks();
+ iterator.hasNext();
+ SOAPHeaderBlock headerBlock1 = (SOAPHeaderBlock) iterator.next();
+ assertFalse("SOAP 1.2 Header Test : - After calling addHeaderBlock method twice, examineAllHeaderBlocks method returns empty iterator", headerBlock1 == null);
+ assertTrue("SOAP 1.2 Header Test : - HeaderBlock1 local name mismatch", headerBlock1.getLocalName().equals("echoOk1"));
+ assertTrue("SOAP 1.2 Header Test : - HeaderBlock1 namespace uri mismatch", headerBlock1.getNamespace().getName().equals("http://www.example.org"));
+
+ SOAPHeaderBlock headerBlock2 = (SOAPHeaderBlock) iterator.next();
+ assertFalse("SOAP 1.2 Header Test : - After calling addHeaderBlock method twice, examineAllHeaderBlocks method returns an iterator with only one object", headerBlock2 == null);
+ assertTrue("SOAP 1.2 Header Test : - HeaderBlock2 local name mismatch", headerBlock2.getLocalName().equals("echoOk2"));
+ assertTrue("SOAP 1.2 Header Test : - HeaderBlock2 namespace uri mismatch", headerBlock2.getNamespace().getName().equals("http://www.example.org"));
+
+ assertFalse("SOAP 1.2 Header Test : - After calling addHeaderBlock method twice, examineAllHeaderBlocks method returns an iterator with more than two object", iterator.hasNext());
+ }
+// public void testSOAP12ExtractAllHeaderBlocks() {
+//
+// }
+
+ public void testSOAP12GetHeaderBolcksWithNSURI() {
+ soap12Header.addHeaderBlock("echoOk1", namespace);
+ soap12Header.addHeaderBlock("echoOk2", omFactory.createOMNamespace("http://www.test1.org", "test1"));
+ ArrayList arrayList = soap12Header.getHeaderBolcksWithNSURI("http://www.test1.org");
+ assertTrue("SOAP 1.2 Header Test : - getHeaderBolcksWithNSURI returns an arrayList of incorrect size", arrayList.size() == 1);
+ assertTrue("SOAP 1.2 Header Test : - headerBlock of given namespace uri, mismatch", ((SOAPHeaderBlock) arrayList.get(0)).getNamespace().getName().equals("http://www.test1.org"));
+ }
+
+ //SOAP 1.1 Header Test (With Parser)---------------------------------------------------------------------------------------------
+ public void testSOAP11ExamineHeaderBlocksWithParser() {
+ Iterator iterator = soap11HeaderWithParser.examineHeaderBlocks("http://schemas.xmlsoap.org/soap/actor/next");
+ iterator.hasNext();
+ SOAPHeaderBlock headerBlock1 = (SOAPHeaderBlock) iterator.next();
+ assertEquals("SOAP 1.1 Header Test With Parser : - headerBlock1 localname mismatch", headerBlock1.getLocalName(), "From");
+ assertTrue("SOAP 1.1 Header Test With Parser : - headerBlock1 role value mismatch", headerBlock1.getRole().equals("http://schemas.xmlsoap.org/soap/actor/next"));
+ iterator.hasNext();
+ SOAPHeaderBlock headerBlock2 = (SOAPHeaderBlock) iterator.next();
+ assertTrue("SOAP 1.1 Header Test With Parser : - headerBlock2 localname mmismatch", headerBlock2.getLocalName().equals("MessageID"));
+ assertTrue("SOAP 1.1 Header Test With Parser : - headerBlock2 role value mmismatch", headerBlock2.getRole().equals("http://schemas.xmlsoap.org/soap/actor/next"));
+
+ assertFalse("SOAP 1.1 Header Test With Parser : - examineHeaderBlocks(String role) method returns an iterator with more than two objects", iterator.hasNext());
+ }
+
+ public void testSOAP11ExamineMustUnderstandHeaderBlocksWithParser() {
+ Iterator iterator = soap11HeaderWithParser.examineMustUnderstandHeaderBlocks("http://schemas.xmlsoap.org/soap/actor/next");
+ iterator.hasNext();
+ SOAPHeaderBlock headerBlock1 = (SOAPHeaderBlock) iterator.next();
+ assertTrue("SOAP 1.1 Header Test With Parser : - headerBlock1 localname mmismatch", headerBlock1.getLocalName().equals("MessageID"));
+ assertTrue("SOAP 1.1 Header Test With Parser : - headerBlock1 role value mmismatch", headerBlock1.getRole().equals("http://schemas.xmlsoap.org/soap/actor/next"));
+
+ assertFalse("SOAP 1.1 Header Test With Parser : - examineMustUnderstandHeaderBlocks(String role) method returns an iterator with more than one objects", iterator.hasNext());
+ }
+
+ public void testSOAP11ExamineAllHeaderBlocksWithParser() {
+ Iterator iterator = soap11HeaderWithParser.examineAllHeaderBlocks();
+ iterator.hasNext();
+ SOAPHeaderBlock headerBlock1 = (SOAPHeaderBlock) iterator.next();
+ assertTrue("SOAP 1.1 Header Test With Parser : - headerBlock1 localname mmismatch", headerBlock1.getLocalName().equals("From"));
+ iterator.hasNext();
+ SOAPHeaderBlock headerBlock2 = (SOAPHeaderBlock) iterator.next();
+ assertTrue("SOAP 1.1 Header Test With Parser : - headerBlock1 localname mmismatch", headerBlock2.getLocalName().equals("MessageID"));
+ iterator.hasNext();
+ SOAPHeaderBlock headerBlock3 = (SOAPHeaderBlock) iterator.next();
+ assertTrue("SOAP 1.1 Header Test With Parser : - headerBlock1 localname mmismatch", headerBlock3.getLocalName().equals("To"));
+
+ assertFalse("SOAP 1.1 Header Test With Parser : - examineAllHeaderBlocks method returns an iterator with more than three objects", iterator.hasNext());
+ }
+
+ public void testSOAP11GetHeaderBolcksWithNSURIWithParser() {
+ ArrayList arrayList = soap11HeaderWithParser.getHeaderBolcksWithNSURI("http://example.org/ts-tests");
+ assertTrue("SOAP 1.1 Header Test With Parser : - getHeaderBolcksWithNSURI returns an arrayList of incorrect size", arrayList.size() == 1);
+ assertTrue("SOAP 1.1 Header Test With Parser : - headerBlock of given namespace uri, local name mismatch", ((SOAPHeaderBlock) arrayList.get(0)).getLocalName().equals("MessageID"));
+ assertTrue("SOAP 1.1 Header Test With Parser : - headerBlock of given namespace uri, mismatch", ((SOAPHeaderBlock) arrayList.get(0)).getNamespace().getName().equals("http://example.org/ts-tests"));
+ }
+
+ //SOAP 1.2 Header Test (With Parser)-------------------------------------------------------------------------------------------
+ public void testSOAP12ExamineHeaderBlocksWithParser() {
+ Iterator iterator = soap12HeaderWithParser.examineHeaderBlocks("http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver");
+ iterator.hasNext();
+ SOAPHeaderBlock headerBlock1 = (SOAPHeaderBlock) iterator.next();
+ assertTrue("SOAP 1.2 Header Test With Parser : - headerBlock1 localname mmismatch", headerBlock1.getLocalName().equals("echoOk"));
+ assertTrue("SOAP 1.2 Header Test With Parser : - headerBlock1 role value mmismatch", headerBlock1.getRole().equals("http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver"));
+ iterator.hasNext();
+ SOAPHeaderBlock headerBlock2 = (SOAPHeaderBlock) iterator.next();
+ assertTrue("SOAP 1.2 Header Test With Parser : - headerBlock2 localname mmismatch", headerBlock2.getLocalName().equals("echoOk2"));
+ assertTrue("SOAP 1.2 Header Test With Parser : - headerBlock2 role value mmismatch", headerBlock2.getRole().equals("http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver"));
+
+ assertFalse("SOAP 1.2 Header Test With Parser : - examineHeaderBlocks(String role) method returns an iterator with more than two objects", iterator.hasNext());
+ }
+
+ public void testSOAP12ExamineMustUnderstandHeaderBlocksWithParser() {
+ Iterator iterator = soap12HeaderWithParser.examineMustUnderstandHeaderBlocks("http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver");
+ iterator.hasNext();
+ SOAPHeaderBlock headerBlock1 = (SOAPHeaderBlock) iterator.next();
+ assertEquals("SOAP 1.2 Header Test With Parser : - headerBlock localname mmismatch", headerBlock1.getLocalName(), "echoOk");
+ assertEquals("SOAP 1.2 Header Test With Parser : - headerBlock role value mmismatch", headerBlock1.getRole(), "http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver");
+
+ iterator.hasNext();
+ SOAPHeaderBlock headerBlock2 = (SOAPHeaderBlock) iterator.next();
+ assertEquals("SOAP 1.2 Header Test With Parser : - headerBlock localname mmismatch", headerBlock2.getLocalName(), "echoOk2");
+ assertEquals("SOAP 1.2 Header Test With Parser : - headerBlock role value mmismatch", headerBlock1.getRole(), "http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver");
+
+ assertFalse("SOAP 1.2 Header Test With Parser : - examineMustUnderstandHeaderBlocks(String role) method returns an iterator with more than one objects", iterator.hasNext());
+ }
+
+ public void testSOAP12ExamineAllHeaderBlocksWithParser() {
+ Iterator iterator = soap12HeaderWithParser.examineAllHeaderBlocks();
+ iterator.next();
+ SOAPHeaderBlock headerBlock1 = (SOAPHeaderBlock) iterator.next();
+ assertTrue("SOAP 1.2 Header Test With Parser : - headerBlock1 localname mmismatch", headerBlock1.getLocalName().equals("echoOk"));
+ iterator.next();
+ SOAPHeaderBlock headerBlock2 = (SOAPHeaderBlock) iterator.next();
+ assertTrue("SOAP 1.2 Header Test With Parser : - headerBlock1 localname mmismatch", headerBlock2.getLocalName().equals("echoOk1"));
+ iterator.next();
+ SOAPHeaderBlock headerBlock3 = (SOAPHeaderBlock) iterator.next();
+ assertTrue("SOAP 1.2 Header Test With Parser : - headerBlock1 localname mmismatch", headerBlock3.getLocalName().equals("echoOk2"));
+
+ assertFalse("SOAP 1.2 Header Test With Parser : - examineAllHeaderBlocks method returns an iterator with more than three objects", iterator.hasNext());
+ }
+
+ public void testSOAP12GetHeaderBolcksWithNSURIWithParser() {
+ ArrayList arrayList = soap12HeaderWithParser.getHeaderBolcksWithNSURI("http://example.org/ts-tests");
+ assertTrue("SOAP 1.2 Header Test With Parser : - getHeaderBolcksWithNSURI returns an arrayList of incorrect size", arrayList.size() == 1);
+ assertTrue("SOAP 1.2 Header Test With Parser : - headerBlock of given namespace uri, local name mismatch", ((SOAPHeaderBlock) arrayList.get(0)).getLocalName().equals("echoOk"));
+ assertTrue("SOAP 1.2 Header Test With Parser : - headerBlock of given namespace uri, mismatch", ((SOAPHeaderBlock) arrayList.get(0)).getNamespace().getName().equals("http://example.org/ts-tests"));
+ }
+}