You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by ve...@apache.org on 2011/04/07 11:24:52 UTC
svn commit: r1089788 - in /webservices/commons/trunk/modules/axiom/modules:
axiom-api/src/test/java/org/apache/axiom/soap/
axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/
axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/ axiom-tests/src...
Author: veithen
Date: Thu Apr 7 09:24:51 2011
New Revision: 1089788
URL: http://svn.apache.org/viewvc?rev=1089788&view=rev
Log:
AXIOM-311: Refactored a couple more SOAP unit tests.
Added:
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/faultreason/
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/faultreason/TestAddSOAPText.java (with props)
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/faultreason/TestGetFirstSOAPText.java (with props)
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/header/TestExamineAllHeaderBlocksWithParser.java (with props)
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/header/TestExamineHeaderBlocksWithParser.java (with props)
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/header/TestExamineMustUnderstandHeaderBlocksWithParser.java (with props)
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/header/TestGetHeaderBlocksWithNSURIWithParser.java (with props)
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faultreason/
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faultreason/TestAddSOAPText.java (with props)
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faultreason/TestAddSOAPTextWithSOAPVersionMismatch.java (with props)
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faultreason/TestGetFirstSOAPText.java (with props)
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faultreason/TestGetFirstSOAPTextWithParser.java (with props)
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faulttext/
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faulttext/TestGetLangWithParser.java (with props)
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/header/TestExamineAllHeaderBlocksWithParser.java (with props)
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/header/TestExamineHeaderBlocksWithParser.java (with props)
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/header/TestExamineMustUnderstandHeaderBlocks.java (with props)
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/header/TestExamineMustUnderstandHeaderBlocksWithParser.java (with props)
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/header/TestGetHeaderBlocksWithNSURIWithParser.java (with props)
Removed:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAP11HeaderTestBase.java
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAP12HeaderTestBase.java
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAPFaultReasonTestBase.java
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAPHeaderTestBase.java
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/SOAP11HeaderTest.java
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/SOAP12HeaderTest.java
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/SOAPFaultReasonTest.java
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP11HeaderTest.java
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP12HeaderTest.java
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAPFaultReasonTest.java
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFaultTextTestBase.java
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/SOAPTestSuiteBuilder.java
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFaultTextTestBase.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFaultTextTestBase.java?rev=1089788&r1=1089787&r2=1089788&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFaultTextTestBase.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFaultTextTestBase.java Thu Apr 7 09:24:51 2011
@@ -19,7 +19,6 @@
package org.apache.axiom.soap;
-import org.apache.axiom.om.OMAttribute;
import org.apache.axiom.om.OMMetaFactory;
public class SOAPFaultTextTestBase extends SOAPFaultReasonTestCase {
@@ -107,26 +106,6 @@ public class SOAPFaultTextTestBase exten
}
//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.getAllAttributes()
- .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().getNamespaceURI().equals(
- SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_NS_URI));
- }
-
public void testSOAP12GetTextWithParser() {
assertTrue(
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/SOAPTestSuiteBuilder.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/SOAPTestSuiteBuilder.java?rev=1089788&r1=1089787&r2=1089788&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/SOAPTestSuiteBuilder.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/SOAPTestSuiteBuilder.java Thu Apr 7 09:24:51 2011
@@ -92,6 +92,12 @@ public class SOAPTestSuiteBuilder extend
addTest(new org.apache.axiom.ts.soap11.envelope.TestAddElementAfterBody(metaFactory));
addTest(new org.apache.axiom.ts.soap11.fault.TestGetNode(metaFactory));
addTest(new org.apache.axiom.ts.soap11.fault.TestSetNode(metaFactory));
+ addTest(new org.apache.axiom.ts.soap11.faultreason.TestAddSOAPText(metaFactory));
+ addTest(new org.apache.axiom.ts.soap11.faultreason.TestGetFirstSOAPText(metaFactory));
+ addTest(new org.apache.axiom.ts.soap11.header.TestExamineAllHeaderBlocksWithParser(metaFactory));
+ addTest(new org.apache.axiom.ts.soap11.header.TestExamineHeaderBlocksWithParser(metaFactory));
+ addTest(new org.apache.axiom.ts.soap11.header.TestExamineMustUnderstandHeaderBlocksWithParser(metaFactory));
+ addTest(new org.apache.axiom.ts.soap11.header.TestGetHeaderBlocksWithNSURIWithParser(metaFactory));
addTest(new org.apache.axiom.ts.soap11.header.TestSOAP11Roles(metaFactory));
addTest(new org.apache.axiom.ts.soap12.envelope.TestAddElementAfterBody(metaFactory));
addTest(new org.apache.axiom.ts.soap12.fault.TestGetNode(metaFactory));
@@ -101,6 +107,16 @@ public class SOAPTestSuiteBuilder extend
addTest(new org.apache.axiom.ts.soap12.faultcode.TestGetSubCodeWithParser(metaFactory));
addTest(new org.apache.axiom.ts.soap12.faultcode.TestGetTextAsQNameWithParser(metaFactory));
addTest(new org.apache.axiom.ts.soap12.faultcode.TestGetValueWithParser(metaFactory));
+ addTest(new org.apache.axiom.ts.soap12.faultreason.TestAddSOAPText(metaFactory));
+ addTest(new org.apache.axiom.ts.soap12.faultreason.TestAddSOAPTextWithSOAPVersionMismatch(metaFactory));
+ addTest(new org.apache.axiom.ts.soap12.faultreason.TestGetFirstSOAPText(metaFactory));
+ addTest(new org.apache.axiom.ts.soap12.faultreason.TestGetFirstSOAPTextWithParser(metaFactory));
+ addTest(new org.apache.axiom.ts.soap12.faulttext.TestGetLangWithParser(metaFactory));
+ addTest(new org.apache.axiom.ts.soap12.header.TestExamineAllHeaderBlocksWithParser(metaFactory));
+ addTest(new org.apache.axiom.ts.soap12.header.TestExamineHeaderBlocksWithParser(metaFactory));
+ addTest(new org.apache.axiom.ts.soap12.header.TestExamineMustUnderstandHeaderBlocks(metaFactory));
+ addTest(new org.apache.axiom.ts.soap12.header.TestExamineMustUnderstandHeaderBlocksWithParser(metaFactory));
+ addTest(new org.apache.axiom.ts.soap12.header.TestGetHeaderBlocksWithNSURIWithParser(metaFactory));
addTest(new org.apache.axiom.ts.soap12.header.TestSOAP12Roles(metaFactory));
}
}
Added: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/faultreason/TestAddSOAPText.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/faultreason/TestAddSOAPText.java?rev=1089788&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/faultreason/TestAddSOAPText.java (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/faultreason/TestAddSOAPText.java Thu Apr 7 09:24:51 2011
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.axiom.ts.soap11.faultreason;
+
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.soap.SOAPFault;
+import org.apache.axiom.soap.SOAPFaultReason;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SOAPTestCase;
+
+public class TestAddSOAPText extends SOAPTestCase {
+ public TestAddSOAPText(OMMetaFactory metaFactory) {
+ super(metaFactory, SOAPSpec.SOAP11);
+ }
+
+ protected void runTest() throws Throwable {
+ SOAPFault fault = soapFactory.createSOAPFault();
+ SOAPFaultReason faultReason = soapFactory.createSOAPFaultReason(fault);
+ boolean gotFault = false;
+ try {
+ faultReason.addSOAPText(soapFactory.createSOAPFaultText(faultReason));
+ } catch (UnsupportedOperationException e) {
+ // Cool, continue.
+ gotFault = true;
+ }
+ assertTrue("Didn't get expected Exception for addSOAPText()!", gotFault);
+ }
+}
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/faultreason/TestAddSOAPText.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/faultreason/TestGetFirstSOAPText.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/faultreason/TestGetFirstSOAPText.java?rev=1089788&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/faultreason/TestGetFirstSOAPText.java (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/faultreason/TestGetFirstSOAPText.java Thu Apr 7 09:24:51 2011
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.axiom.ts.soap11.faultreason;
+
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.soap.SOAPFault;
+import org.apache.axiom.soap.SOAPFaultReason;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SOAPTestCase;
+
+public class TestGetFirstSOAPText extends SOAPTestCase {
+ public TestGetFirstSOAPText(OMMetaFactory metaFactory) {
+ super(metaFactory, SOAPSpec.SOAP11);
+ }
+
+ protected void runTest() throws Throwable {
+ SOAPFault fault = soapFactory.createSOAPFault();
+ SOAPFaultReason faultReason = soapFactory.createSOAPFaultReason(fault);
+ try {
+ faultReason.getFirstSOAPText();
+ } catch (UnsupportedOperationException e) {
+ // Cool, continue.
+ return;
+ }
+ fail("Didn't get expected Exception for getFirstSOAPText()!");
+ }
+}
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/faultreason/TestGetFirstSOAPText.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/header/TestExamineAllHeaderBlocksWithParser.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/header/TestExamineAllHeaderBlocksWithParser.java?rev=1089788&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/header/TestExamineAllHeaderBlocksWithParser.java (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/header/TestExamineAllHeaderBlocksWithParser.java Thu Apr 7 09:24:51 2011
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.axiom.ts.soap11.header;
+
+import java.util.Iterator;
+
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.soap.SOAPHeaderBlock;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SOAPTestCase;
+
+public class TestExamineAllHeaderBlocksWithParser extends SOAPTestCase {
+ public TestExamineAllHeaderBlocksWithParser(OMMetaFactory metaFactory) {
+ super(metaFactory, SOAPSpec.SOAP11);
+ }
+
+ protected void runTest() throws Throwable {
+ Iterator iterator = getTestMessage(MESSAGE).getHeader().examineAllHeaderBlocks();
+ iterator.hasNext();
+ SOAPHeaderBlock headerBlock1 = (SOAPHeaderBlock) iterator.next();
+ assertTrue(
+ "SOAP Header Test With Parser : - headerBlock1 localname mmismatch",
+ headerBlock1.getLocalName().equals("From"));
+ assertTrue(iterator.hasNext());
+ SOAPHeaderBlock headerBlock2 = (SOAPHeaderBlock) iterator.next();
+ assertTrue(
+ "SOAP Header Test With Parser : - headerBlock1 localname mmismatch",
+ headerBlock2.getLocalName().equals("MessageID"));
+ assertTrue(iterator.hasNext());
+ SOAPHeaderBlock headerBlock3 = (SOAPHeaderBlock) iterator.next();
+ assertTrue(
+ "SOAP Header Test With Parser : - headerBlock1 localname mmismatch",
+ headerBlock3.getLocalName().equals("To"));
+
+ assertFalse(
+ "SOAP Header Test With Parser : - examineAllHeaderBlocks method returns an iterator with more than three objects",
+ iterator.hasNext());
+ }
+}
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/header/TestExamineAllHeaderBlocksWithParser.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/header/TestExamineHeaderBlocksWithParser.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/header/TestExamineHeaderBlocksWithParser.java?rev=1089788&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/header/TestExamineHeaderBlocksWithParser.java (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/header/TestExamineHeaderBlocksWithParser.java Thu Apr 7 09:24:51 2011
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.axiom.ts.soap11.header;
+
+import java.util.Iterator;
+
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.soap.SOAPHeaderBlock;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SOAPTestCase;
+
+public class TestExamineHeaderBlocksWithParser extends SOAPTestCase {
+ public TestExamineHeaderBlocksWithParser(OMMetaFactory metaFactory) {
+ super(metaFactory, SOAPSpec.SOAP11);
+ }
+
+ protected void runTest() throws Throwable {
+ Iterator iterator = getTestMessage(MESSAGE).getHeader().examineHeaderBlocks(
+ "http://schemas.xmlsoap.org/soap/actor/next");
+ iterator.hasNext();
+ SOAPHeaderBlock headerBlock1 = (SOAPHeaderBlock) iterator.next();
+ assertEquals(
+ "SOAP Header Test With Parser : - headerBlock1 localname mismatch",
+ headerBlock1.getLocalName(),
+ "From");
+ assertTrue(
+ "SOAP 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 Header Test With Parser : - headerBlock2 localname mmismatch",
+ headerBlock2.getLocalName().equals("MessageID"));
+ assertTrue(
+ "SOAP Header Test With Parser : - headerBlock2 role value mmismatch",
+ headerBlock2.getRole().equals(
+ "http://schemas.xmlsoap.org/soap/actor/next"));
+
+ assertFalse(
+ "SOAP Header Test With Parser : - examineHeaderBlocks(String role) method returns an iterator with more than two objects",
+ iterator.hasNext());
+ }
+}
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/header/TestExamineHeaderBlocksWithParser.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/header/TestExamineMustUnderstandHeaderBlocksWithParser.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/header/TestExamineMustUnderstandHeaderBlocksWithParser.java?rev=1089788&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/header/TestExamineMustUnderstandHeaderBlocksWithParser.java (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/header/TestExamineMustUnderstandHeaderBlocksWithParser.java Thu Apr 7 09:24:51 2011
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.axiom.ts.soap11.header;
+
+import java.util.Iterator;
+
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.soap.SOAPHeaderBlock;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SOAPTestCase;
+
+public class TestExamineMustUnderstandHeaderBlocksWithParser extends SOAPTestCase {
+ public TestExamineMustUnderstandHeaderBlocksWithParser(OMMetaFactory metaFactory) {
+ super(metaFactory, SOAPSpec.SOAP11);
+ }
+
+ protected void runTest() throws Throwable {
+ Iterator iterator = getTestMessage(MESSAGE).getHeader().examineMustUnderstandHeaderBlocks(
+ "http://schemas.xmlsoap.org/soap/actor/next");
+ iterator.hasNext();
+ SOAPHeaderBlock headerBlock1 = (SOAPHeaderBlock) iterator.next();
+ assertTrue(
+ "SOAP Header Test With Parser : - headerBlock1 localname mmismatch",
+ headerBlock1.getLocalName().equals("MessageID"));
+ assertTrue(
+ "SOAP Header Test With Parser : - headerBlock1 role value mmismatch",
+ headerBlock1.getRole().equals(
+ "http://schemas.xmlsoap.org/soap/actor/next"));
+
+ assertFalse(
+ "SOAP Header Test With Parser : - examineMustUnderstandHeaderBlocks(String role) method returns an iterator with more than one objects",
+ iterator.hasNext());
+ }
+}
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/header/TestExamineMustUnderstandHeaderBlocksWithParser.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/header/TestGetHeaderBlocksWithNSURIWithParser.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/header/TestGetHeaderBlocksWithNSURIWithParser.java?rev=1089788&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/header/TestGetHeaderBlocksWithNSURIWithParser.java (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/header/TestGetHeaderBlocksWithNSURIWithParser.java Thu Apr 7 09:24:51 2011
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.axiom.ts.soap11.header;
+
+import java.util.ArrayList;
+
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.soap.SOAPHeaderBlock;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SOAPTestCase;
+
+public class TestGetHeaderBlocksWithNSURIWithParser extends SOAPTestCase {
+ public TestGetHeaderBlocksWithNSURIWithParser(OMMetaFactory metaFactory) {
+ super(metaFactory, SOAPSpec.SOAP11);
+ }
+
+ protected void runTest() throws Throwable {
+ ArrayList arrayList = getTestMessage(MESSAGE).getHeader().getHeaderBlocksWithNSURI(
+ "http://example.org/ts-tests");
+ assertTrue(
+ "SOAP Header Test With Parser : - getHeaderBlocksWithNSURI returns an arrayList of incorrect size",
+ arrayList.size() == 1);
+ assertTrue(
+ "SOAP Header Test With Parser : - headerBlock of given namespace uri, local name mismatch",
+ ((SOAPHeaderBlock) arrayList.get(0)).getLocalName().equals(
+ "MessageID"));
+ assertTrue(
+ "SOAP Header Test With Parser : - headerBlock of given namespace uri, mismatch",
+ ((SOAPHeaderBlock) arrayList.get(0)).getNamespace().getNamespaceURI()
+ .equals("http://example.org/ts-tests"));
+ }
+}
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/header/TestGetHeaderBlocksWithNSURIWithParser.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faultreason/TestAddSOAPText.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faultreason/TestAddSOAPText.java?rev=1089788&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faultreason/TestAddSOAPText.java (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faultreason/TestAddSOAPText.java Thu Apr 7 09:24:51 2011
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.axiom.ts.soap12.faultreason;
+
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.soap.SOAPFault;
+import org.apache.axiom.soap.SOAPFaultReason;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SOAPTestCase;
+
+public class TestAddSOAPText extends SOAPTestCase {
+ public TestAddSOAPText(OMMetaFactory metaFactory) {
+ super(metaFactory, SOAPSpec.SOAP12);
+ }
+
+ protected void runTest() throws Throwable {
+ SOAPFault fault = soapFactory.createSOAPFault();
+ SOAPFaultReason faultReason = soapFactory.createSOAPFaultReason(fault);
+ faultReason.addSOAPText(
+ soapFactory.createSOAPFaultText(faultReason));
+ assertFalse(
+ "SOAP 1.2 FaultReason Test : - After calling addSOAPText, getFirstSOAPText returns null",
+ faultReason.getFirstSOAPText() == null);
+ }
+}
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faultreason/TestAddSOAPText.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faultreason/TestAddSOAPTextWithSOAPVersionMismatch.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faultreason/TestAddSOAPTextWithSOAPVersionMismatch.java?rev=1089788&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faultreason/TestAddSOAPTextWithSOAPVersionMismatch.java (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faultreason/TestAddSOAPTextWithSOAPVersionMismatch.java Thu Apr 7 09:24:51 2011
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.axiom.ts.soap12.faultreason;
+
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.soap.SOAPFault;
+import org.apache.axiom.soap.SOAPFaultReason;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SOAPTestCase;
+
+public class TestAddSOAPTextWithSOAPVersionMismatch extends SOAPTestCase {
+ public TestAddSOAPTextWithSOAPVersionMismatch(OMMetaFactory metaFactory) {
+ super(metaFactory, SOAPSpec.SOAP12);
+ }
+
+ protected void runTest() throws Throwable {
+ SOAPFault soap12Fault = soapFactory.createSOAPFault();
+ SOAPFaultReason soap12FaultReason = soapFactory.createSOAPFaultReason(soap12Fault);
+ SOAPFault soap11Fault = altSoapFactory.createSOAPFault();
+ SOAPFaultReason soap11FaultReason = altSoapFactory.createSOAPFaultReason(soap11Fault);
+ try {
+ soap12FaultReason.addSOAPText(
+ altSoapFactory.createSOAPFaultText(soap11FaultReason));
+ fail("SOAP11FaultText should not be added to SOAP12FaultReason");
+ } catch (Exception e) {
+ assertTrue(true);
+ }
+ }
+}
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faultreason/TestAddSOAPTextWithSOAPVersionMismatch.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faultreason/TestGetFirstSOAPText.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faultreason/TestGetFirstSOAPText.java?rev=1089788&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faultreason/TestGetFirstSOAPText.java (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faultreason/TestGetFirstSOAPText.java Thu Apr 7 09:24:51 2011
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.axiom.ts.soap12.faultreason;
+
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.soap.SOAPFault;
+import org.apache.axiom.soap.SOAPFaultReason;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SOAPTestCase;
+
+public class TestGetFirstSOAPText extends SOAPTestCase {
+ public TestGetFirstSOAPText(OMMetaFactory metaFactory) {
+ super(metaFactory, SOAPSpec.SOAP12);
+ }
+
+ protected void runTest() throws Throwable {
+ SOAPFault fault = soapFactory.createSOAPFault();
+ SOAPFaultReason faultReason = soapFactory.createSOAPFaultReason(fault);
+ assertTrue(
+ "SOAP 1.2 FaultReason Test : - After creating SOAP12FaultReason, it has a SOAPFaultText",
+ faultReason.getFirstSOAPText() == null);
+ faultReason.addSOAPText(
+ soapFactory.createSOAPFaultText(faultReason));
+ assertFalse(
+ "SOAP 1.2 FaultReason Test : - After calling addSOAPText, getFirstSOAPText returns null",
+ faultReason.getFirstSOAPText() == null);
+ }
+}
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faultreason/TestGetFirstSOAPText.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faultreason/TestGetFirstSOAPTextWithParser.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faultreason/TestGetFirstSOAPTextWithParser.java?rev=1089788&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faultreason/TestGetFirstSOAPTextWithParser.java (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faultreason/TestGetFirstSOAPTextWithParser.java Thu Apr 7 09:24:51 2011
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.axiom.ts.soap12.faultreason;
+
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.soap.SOAPFaultReason;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SOAPTestCase;
+
+public class TestGetFirstSOAPTextWithParser extends SOAPTestCase {
+ public TestGetFirstSOAPTextWithParser(OMMetaFactory metaFactory) {
+ super(metaFactory, SOAPSpec.SOAP12);
+ }
+
+ protected void runTest() throws Throwable {
+ SOAPFaultReason faultReason = getTestMessage(MESSAGE).getBody().getFault().getReason();
+ assertFalse(
+ "SOAP 1.2 FaultReason Test With Parser : - getFirstSOAPText method returns null",
+ faultReason.getFirstSOAPText() == null);
+ }
+}
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faultreason/TestGetFirstSOAPTextWithParser.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faulttext/TestGetLangWithParser.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faulttext/TestGetLangWithParser.java?rev=1089788&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faulttext/TestGetLangWithParser.java (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faulttext/TestGetLangWithParser.java Thu Apr 7 09:24:51 2011
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.axiom.ts.soap12.faulttext;
+
+import org.apache.axiom.om.OMAttribute;
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.soap.SOAP12Constants;
+import org.apache.axiom.soap.SOAPFaultText;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SOAPTestCase;
+
+public class TestGetLangWithParser extends SOAPTestCase {
+ public TestGetLangWithParser(OMMetaFactory metaFactory) {
+ super(metaFactory, SOAPSpec.SOAP12);
+ }
+
+ protected void runTest() throws Throwable {
+ SOAPFaultText faultText = getTestMessage(MESSAGE).getBody().getFault().getReason().getFirstSOAPText();
+ assertTrue(
+ "SOAP 1.2 Fault Text Test With Parser : - getLang method returns incorrect string",
+ faultText.getLang().equals("en"));
+ OMAttribute langAttribute = (OMAttribute) faultText.getAllAttributes()
+ .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().getNamespaceURI().equals(
+ SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_NS_URI));
+ }
+}
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faulttext/TestGetLangWithParser.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/header/TestExamineAllHeaderBlocksWithParser.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/header/TestExamineAllHeaderBlocksWithParser.java?rev=1089788&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/header/TestExamineAllHeaderBlocksWithParser.java (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/header/TestExamineAllHeaderBlocksWithParser.java Thu Apr 7 09:24:51 2011
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.axiom.ts.soap12.header;
+
+import java.util.Iterator;
+
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.soap.SOAPHeaderBlock;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SOAPTestCase;
+
+public class TestExamineAllHeaderBlocksWithParser extends SOAPTestCase {
+ public TestExamineAllHeaderBlocksWithParser(OMMetaFactory metaFactory) {
+ super(metaFactory, SOAPSpec.SOAP12);
+ }
+
+ protected void runTest() throws Throwable {
+ Iterator iterator = getTestMessage(MESSAGE).getHeader().examineAllHeaderBlocks();
+ assertTrue(iterator.hasNext());
+ SOAPHeaderBlock headerBlock1 = (SOAPHeaderBlock) iterator.next();
+ assertTrue(
+ "SOAP Header Test With Parser : - headerBlock1 localname mmismatch",
+ headerBlock1.getLocalName().equals("echoOk"));
+ assertTrue(iterator.hasNext());
+ SOAPHeaderBlock headerBlock2 = (SOAPHeaderBlock) iterator.next();
+ assertTrue(
+ "SOAP Header Test With Parser : - headerBlock1 localname mmismatch",
+ headerBlock2.getLocalName().equals("echoOk1"));
+ assertTrue(iterator.hasNext());
+ SOAPHeaderBlock headerBlock3 = (SOAPHeaderBlock) iterator.next();
+ assertTrue(
+ "SOAP Header Test With Parser : - headerBlock1 localname mmismatch",
+ headerBlock3.getLocalName().equals("echoOk2"));
+
+ assertFalse(
+ "SOAP Header Test With Parser : - examineAllHeaderBlocks method returns an iterator with more than three objects",
+ iterator.hasNext());
+ }
+}
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/header/TestExamineAllHeaderBlocksWithParser.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/header/TestExamineHeaderBlocksWithParser.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/header/TestExamineHeaderBlocksWithParser.java?rev=1089788&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/header/TestExamineHeaderBlocksWithParser.java (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/header/TestExamineHeaderBlocksWithParser.java Thu Apr 7 09:24:51 2011
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.axiom.ts.soap12.header;
+
+import java.util.Iterator;
+
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.soap.SOAPHeaderBlock;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SOAPTestCase;
+
+public class TestExamineHeaderBlocksWithParser extends SOAPTestCase {
+ public TestExamineHeaderBlocksWithParser(OMMetaFactory metaFactory) {
+ super(metaFactory, SOAPSpec.SOAP12);
+ }
+
+ protected void runTest() throws Throwable {
+ Iterator iterator = getTestMessage(MESSAGE).getHeader().examineHeaderBlocks(
+ "http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver");
+ iterator.hasNext();
+ SOAPHeaderBlock headerBlock1 = (SOAPHeaderBlock) iterator.next();
+ assertTrue(
+ "SOAP Header Test With Parser : - headerBlock1 localname mmismatch",
+ headerBlock1.getLocalName().equals("echoOk"));
+ assertTrue(
+ "SOAP 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 Header Test With Parser : - headerBlock2 localname mmismatch",
+ headerBlock2.getLocalName().equals("echoOk2"));
+ assertTrue(
+ "SOAP Header Test With Parser : - headerBlock2 role value mmismatch",
+ headerBlock2.getRole().equals(
+ "http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver"));
+
+ assertFalse(
+ "SOAP Header Test With Parser : - examineHeaderBlocks(String role) method returns an iterator with more than two objects",
+ iterator.hasNext());
+ }
+}
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/header/TestExamineHeaderBlocksWithParser.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/header/TestExamineMustUnderstandHeaderBlocks.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/header/TestExamineMustUnderstandHeaderBlocks.java?rev=1089788&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/header/TestExamineMustUnderstandHeaderBlocks.java (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/header/TestExamineMustUnderstandHeaderBlocks.java Thu Apr 7 09:24:51 2011
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.axiom.ts.soap12.header;
+
+import java.util.Iterator;
+
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axiom.soap.SOAPHeader;
+import org.apache.axiom.soap.SOAPHeaderBlock;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SOAPTestCase;
+
+public class TestExamineMustUnderstandHeaderBlocks extends SOAPTestCase {
+ public TestExamineMustUnderstandHeaderBlocks(OMMetaFactory metaFactory) {
+ super(metaFactory, SOAPSpec.SOAP12);
+ }
+
+ protected void runTest() throws Throwable {
+ SOAPEnvelope soapEnvelope = soapFactory.createSOAPEnvelope();
+ SOAPHeader soapHeader = soapFactory.createSOAPHeader(soapEnvelope);
+ OMNamespace namespace = soapFactory.createOMNamespace("http://www.example.org", "test");
+ soapHeader.addHeaderBlock("echoOk1", namespace).setRole(
+ "http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver");
+
+ SOAPHeaderBlock headerBlock1 = soapHeader.addHeaderBlock("echoOk2",
+ namespace);
+ headerBlock1.setRole(
+ "http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver");
+ headerBlock1.setMustUnderstand(true);
+
+ soapHeader.addHeaderBlock("echoOk3", namespace).setMustUnderstand(
+ true);
+
+ Iterator iterator = soapHeader.examineMustUnderstandHeaderBlocks(
+ "http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver");
+ iterator.hasNext();
+ SOAPHeaderBlock headerBlock = (SOAPHeaderBlock) iterator.next();
+ assertFalse(
+ "SOAP Header Test : - examineMustUnderstandHeaderBlocks method returns empty iterator",
+ headerBlock == null);
+ assertTrue("SOAP Header Test : - HeaderBlock local name mismatch",
+ headerBlock.getLocalName().equals("echoOk2"));
+ assertTrue("SOAP Header Test : - HeaderBlock role value mismatch",
+ headerBlock.getRole().equals(
+ "http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver"));
+ assertFalse(
+ "SOAP Header Test : - examineMustUnderstandHeaderBlocks method returns an iterator with more than one object",
+ iterator.hasNext());
+ }
+}
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/header/TestExamineMustUnderstandHeaderBlocks.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/header/TestExamineMustUnderstandHeaderBlocksWithParser.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/header/TestExamineMustUnderstandHeaderBlocksWithParser.java?rev=1089788&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/header/TestExamineMustUnderstandHeaderBlocksWithParser.java (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/header/TestExamineMustUnderstandHeaderBlocksWithParser.java Thu Apr 7 09:24:51 2011
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.axiom.ts.soap12.header;
+
+import java.util.Iterator;
+
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.soap.SOAPHeaderBlock;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SOAPTestCase;
+
+public class TestExamineMustUnderstandHeaderBlocksWithParser extends SOAPTestCase {
+ public TestExamineMustUnderstandHeaderBlocksWithParser(OMMetaFactory metaFactory) {
+ super(metaFactory, SOAPSpec.SOAP12);
+ }
+
+ protected void runTest() throws Throwable {
+ Iterator iterator = getTestMessage(MESSAGE).getHeader().examineMustUnderstandHeaderBlocks(
+ "http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver");
+ iterator.hasNext();
+ SOAPHeaderBlock headerBlock1 = (SOAPHeaderBlock) iterator.next();
+ assertEquals(
+ "SOAP Header Test With Parser : - headerBlock localname mmismatch",
+ headerBlock1.getLocalName(),
+ "echoOk");
+ assertEquals(
+ "SOAP 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 Header Test With Parser : - headerBlock localname mmismatch",
+ headerBlock2.getLocalName(),
+ "echoOk2");
+ assertEquals(
+ "SOAP Header Test With Parser : - headerBlock role value mmismatch",
+ headerBlock1.getRole(),
+ "http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver");
+
+ assertFalse(
+ "SOAP Header Test With Parser : - examineMustUnderstandHeaderBlocks(String role) method returns an iterator with more than one objects",
+ iterator.hasNext());
+ }
+}
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/header/TestExamineMustUnderstandHeaderBlocksWithParser.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/header/TestGetHeaderBlocksWithNSURIWithParser.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/header/TestGetHeaderBlocksWithNSURIWithParser.java?rev=1089788&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/header/TestGetHeaderBlocksWithNSURIWithParser.java (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/header/TestGetHeaderBlocksWithNSURIWithParser.java Thu Apr 7 09:24:51 2011
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.axiom.ts.soap12.header;
+
+import java.util.ArrayList;
+
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.soap.SOAPHeaderBlock;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SOAPTestCase;
+
+public class TestGetHeaderBlocksWithNSURIWithParser extends SOAPTestCase {
+ public TestGetHeaderBlocksWithNSURIWithParser(OMMetaFactory metaFactory) {
+ super(metaFactory, SOAPSpec.SOAP12);
+ }
+
+ protected void runTest() throws Throwable {
+ ArrayList arrayList = getTestMessage(MESSAGE).getHeader().getHeaderBlocksWithNSURI(
+ "http://example.org/ts-tests");
+ assertTrue(
+ "SOAP Header Test With Parser : - getHeaderBlocksWithNSURI returns an arrayList of incorrect size",
+ arrayList.size() == 1);
+ assertTrue(
+ "SOAP Header Test With Parser : - headerBlock of given namespace uri, local name mismatch",
+ ((SOAPHeaderBlock) arrayList.get(0)).getLocalName().equals(
+ "echoOk"));
+ assertTrue(
+ "SOAP Header Test With Parser : - headerBlock of given namespace uri, mismatch",
+ ((SOAPHeaderBlock) arrayList.get(0)).getNamespace().getNamespaceURI()
+ .equals("http://example.org/ts-tests"));
+ }
+}
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/header/TestGetHeaderBlocksWithNSURIWithParser.java
------------------------------------------------------------------------------
svn:eol-style = native