Author: veithen
Date: Sun Apr 18 20:21:37 2010
New Revision: 935404
URL: http://svn.apache.org/viewvc?rev=935404&view=rev
Log:
WSCOMMONS-419: Eliminated some duplicate code and moved test cases to the right
module.
Added:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAP11HeaderBlockTestBase.java
(with props)
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAP12HeaderBlockTestBase.java
(with props)
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAPHeaderBlockTestBase.java
- copied, changed from r935365,
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPHeaderBlockTestBase.java
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP11HeaderBlockTest.java
(with props)
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP12HeaderBlockTest.java
(with props)
Removed:
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPHeaderBlockTestBase.java
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPHeaderTestCase.java
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/llom/SOAPHeaderBlockTest.java
Added:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAP11HeaderBlockTestBase.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAP11HeaderBlockTestBase.java?rev=935404&view=auto
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAP11HeaderBlockTestBase.java
(added)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAP11HeaderBlockTestBase.java
Sun Apr 18 20:21:37 2010
@@ -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.soap;
+
+import java.util.Iterator;
+
+import org.apache.axiom.om.OMMetaFactory;
+
+public class SOAP11HeaderBlockTestBase extends SOAPHeaderBlockTestBase {
+ public SOAP11HeaderBlockTestBase(OMMetaFactory omMetaFactory) {
+ super(omMetaFactory, SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
+ }
+
+ public void testSetMustUnderstandStringTrueFalse() {
+ SOAPHeaderBlock soapHeaderBlock = createSOAPHeaderBlock();
+ try {
+ soapHeaderBlock.setMustUnderstand("true");
+ } catch (Exception e) {
+ fail(
+ "SOAP HeaderBlock Test : - MustUnderstand value can not be
set to any value rather than 1 or 0");
+ }
+ }
+
+ // SOAPHeaderBlock Test (With Parser)
+ public void testGetRoleWithParser() {
+ Iterator iterator =
getTestMessage(MESSAGE).getHeader().examineAllHeaderBlocks();
+ assertTrue(
+ "SOAP HeaderBlock Test With Parser : - getRole method returns
incorrect role value",
+ ((SOAPHeaderBlock) iterator.next()).getRole().equals(
+ "http://schemas.xmlsoap.org/soap/actor/next"));
+ }
+
+ public void testGetMustUnderstandWithParser() {
+ Iterator iterator =
getTestMessage(MESSAGE).getHeader().examineAllHeaderBlocks();
+ iterator.next();
+ assertTrue(
+ "SOAP HeaderBlock Test With Parser : - getMustUnderstand
method returns incorrect value",
+ ((SOAPHeaderBlock) iterator.next()).getMustUnderstand());
+ assertFalse(
+ "SOAP HeaderBlock Test With Parser : - getMustUnderstand
method returns incorrect value",
+ ((SOAPHeaderBlock) iterator.next()).getMustUnderstand());
+ }
+}
Propchange:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAP11HeaderBlockTestBase.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAP12HeaderBlockTestBase.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAP12HeaderBlockTestBase.java?rev=935404&view=auto
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAP12HeaderBlockTestBase.java
(added)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAP12HeaderBlockTestBase.java
Sun Apr 18 20:21:37 2010
@@ -0,0 +1,84 @@
+/*
+ * 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.soap;
+
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.om.OMNamespace;
+
+import java.util.Iterator;
+
+public class SOAP12HeaderBlockTestBase extends SOAPHeaderBlockTestBase {
+ public SOAP12HeaderBlockTestBase(OMMetaFactory omMetaFactory) {
+ super(omMetaFactory, SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
+ }
+
+ public void testSetMustUnderstandStringTrueFalse() {
+ SOAPHeaderBlock soapHeaderBlock = createSOAPHeaderBlock();
+ soapHeaderBlock.setMustUnderstand("true");
+ assertTrue(
+ "SOAP HeaderBlock Test : - After setting MustUnderstand
\"true\" calling setMustUnderstand method , getMustUnderstand method returns
false",
+ soapHeaderBlock.getMustUnderstand());
+ soapHeaderBlock.setMustUnderstand("false");
+ assertFalse(
+ "SOAP HeaderBlock Test : - After setting MustUnderstand \"0\"
calling setMustUnderstand method , getMustUnderstand method returns true",
+ soapHeaderBlock.getMustUnderstand());
+ }
+
+ // SOAPHeaderBlock Test (With Parser)
+ public void testGetRoleWithParser() {
+ Iterator iterator =
getTestMessage(MESSAGE).getHeader().examineAllHeaderBlocks();
+ assertTrue(
+ "SOAP HeaderBlock Test With Parser : - getRole method returns
incorrect role value",
+ ((SOAPHeaderBlock) iterator.next()).getRole().equals(
+
"http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver"));
+ }
+
+ public void testGetMustUnderstandWithParser() {
+ Iterator iterator =
getTestMessage(MESSAGE).getHeader().examineAllHeaderBlocks();
+ assertTrue(
+ "SOAP HeaderBlock Test With Parser : - getMustUnderstand
method returns incorrect value",
+ ((SOAPHeaderBlock) iterator.next()).getMustUnderstand());
+ assertFalse(
+ "SOAP HeaderBlock Test With Parser : - getMustUnderstand
method returns incorrect value",
+ ((SOAPHeaderBlock) iterator.next()).getMustUnderstand());
+ ((SOAPHeaderBlock) iterator.next()).getMustUnderstand();
+ }
+
+ public void testRelayAttributeWithParser() throws Exception {
+ Iterator iterator =
getTestMessage(MESSAGE).getHeader().examineAllHeaderBlocks();
+ assertFalse(((SOAPHeaderBlock) iterator.next()).getRelay());
+ assertTrue(((SOAPHeaderBlock) iterator.next()).getRelay());
+ assertFalse(((SOAPHeaderBlock) iterator.next()).getRelay());
+ }
+
+ public void testRelayAttribute() throws Exception {
+ SOAPEnvelope env = soapFactory.createSOAPEnvelope();
+ SOAPHeader header = soapFactory.createSOAPHeader(env);
+ soapFactory.createSOAPBody(env);
+ OMNamespace ns = soapFactory.createOMNamespace("http://ns1", "ns1");
+ SOAPHeaderBlock relayHeader = header.addHeaderBlock("foo", ns);
+ relayHeader.setText("hey there");
+ relayHeader.setRelay(true);
+
+ String envString = env.toString();
+ assertTrue("No relay header after setRelay(true)",
+ envString.indexOf("relay=\"true\"") >= 0);
+ }
+}
Propchange:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAP12HeaderBlockTestBase.java
------------------------------------------------------------------------------
svn:eol-style = native
Copied:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAPHeaderBlockTestBase.java
(from r935365,
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPHeaderBlockTestBase.java)
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAPHeaderBlockTestBase.java?p2=webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAPHeaderBlockTestBase.java&p1=webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPHeaderBlockTestBase.java&r1=935365&r2=935404&rev=935404&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPHeaderBlockTestBase.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAPHeaderBlockTestBase.java
Sun Apr 18 20:21:37 2010
@@ -22,230 +22,92 @@ package org.apache.axiom.soap;
import org.apache.axiom.om.OMMetaFactory;
import org.apache.axiom.om.OMNamespace;
-import java.util.Iterator;
-
-public class SOAPHeaderBlockTestBase 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 SOAPHeaderBlockTestBase(OMMetaFactory omMetaFactory) {
- super(omMetaFactory);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- soap11HeaderBlock =
- soap11Factory.createSOAPHeaderBlock("testHeaderBlock",
- namespace,
- soap11Header);
- soap12HeaderBlock =
- soap12Factory.createSOAPHeaderBlock("testHeaderBlock",
- namespace,
- soap12Header);
- Iterator iterator = soap11HeaderWithParser.examineAllHeaderBlocks();
- soap11HeaderBlock1WithParser = (SOAPHeaderBlock) iterator.next();
- soap11HeaderBlock2WithParser = (SOAPHeaderBlock) iterator.next();
- soap11HeaderBlock3WithParser = (SOAPHeaderBlock) iterator.next();
-
- iterator = soap12HeaderWithParser.examineAllHeaderBlocks();
- soap12HeaderBlock1WithParser = (SOAPHeaderBlock) iterator.next();
- soap12HeaderBlock2WithParser = (SOAPHeaderBlock) 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"));
+public class SOAPHeaderBlockTestBase extends UnifiedSOAPTestCase {
+ public SOAPHeaderBlockTestBase(OMMetaFactory omMetaFactory, String
envelopeNamespaceURI) {
+ super(omMetaFactory, envelopeNamespaceURI);
+ }
+
+ protected SOAPHeaderBlock createSOAPHeaderBlock() {
+ OMNamespace namespace =
soapFactory.createOMNamespace("http://www.example.org", "test");;
+ SOAPEnvelope soapEnvelope = soapFactory.createSOAPEnvelope();
+ SOAPHeader soapHeader = soapFactory.createSOAPHeader(soapEnvelope);
+ return soapFactory.createSOAPHeaderBlock("testHeaderBlock", namespace,
soapHeader);
+ }
+
+ // SOAPHeaderBlock Test (Programaticaly Created)
+ public void testSetRole() {
+ SOAPHeaderBlock soapHeaderBlock = createSOAPHeaderBlock();
+ soapHeaderBlock.setRole(
+ "http://example.org/my-role");
+ assertTrue(
+ "SOAP HeaderBlock Test : - After calling setRole method,
getRole method returns incorrect role value",
+ soapHeaderBlock.getRole().equals(
+ "http://example.org/my-role"));
try {
- soap11HeaderBlock.setRole("Any Value");
+ soapHeaderBlock.setRole("Any Value");
} catch (Exception e) {
fail(
- "SOAP 1.1 HeaderBlock Test : - role value can not be set
to any value");
+ "SOAP HeaderBlock Test : - role value can not be set to
any value");
}
}
- public void testSOAP11GetRole() {
+ public void testGetRole() {
+ SOAPHeaderBlock soapHeaderBlock = createSOAPHeaderBlock();
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);
+ "SOAP HeaderBlock Test : - After creating SOAPHeaderBlock, it
has a role",
+ soapHeaderBlock.getRole() == null);
+ soapHeaderBlock.setRole(
+ "http://example.org/my-role");
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 : - MustUnderstand 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");
- }
+ "SOAP HeaderBlock Test : - After calling setRole method,
getRole method returns incorrect role value",
+ soapHeaderBlock.getRole().equals(
+ "http://example.org/my-role"));
}
- public void testSOAP12GetRole() {
+ public void testSetMustUnderstand() {
+ SOAPHeaderBlock soapHeaderBlock = createSOAPHeaderBlock();
+ soapHeaderBlock.setMustUnderstand(true);
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"));
+ "SOAP HeaderBlock Test : - After setting MustUnderstand true
calling setMustUnderstand method , getMustUnderstand method returns false",
+ soapHeaderBlock.getMustUnderstand());
+ soapHeaderBlock.setMustUnderstand(false);
+ assertFalse(
+ "SOAP HeaderBlock Test : - After setting MustUnderstand false
calling setMustUnderstand method , getMustUnderstand method returns true",
+ soapHeaderBlock.getMustUnderstand());
}
-
- public void testSOAP12SetMustUnderstand() {
- soap12HeaderBlock.setMustUnderstand(true);
+
+ public void testSetMustUnderstandString01() {
+ SOAPHeaderBlock soapHeaderBlock = createSOAPHeaderBlock();
+ soapHeaderBlock.setMustUnderstand("1");
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");
+ "SOAP HeaderBlock Test : - After setting MustUnderstand \"1\"
calling setMustUnderstand method , getMustUnderstand method returns false",
+ soapHeaderBlock.getMustUnderstand());
+ soapHeaderBlock.setMustUnderstand("0");
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());
+ "SOAP HeaderBlock Test : - After setting MustUnderstand \"0\"
calling setMustUnderstand method , getMustUnderstand method returns true",
+ soapHeaderBlock.getMustUnderstand());
+ }
+
+ public void testSetMustUnderstandWithInvalidValue() {
+ SOAPHeaderBlock soapHeaderBlock = createSOAPHeaderBlock();
try {
- soap12HeaderBlock.setMustUnderstand("otherValue");
+ soapHeaderBlock.setMustUnderstand("otherValue");
fail(
- "SOAP 1.2 HeaderBlock Test : - MustUnderstand value can
not be set to any value rather than 1 , 0 , true , false");
+ "SOAP HeaderBlock Test : - MustUnderstand 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 With 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 With Parser : - getMustUnderstand
method returns incorrect value",
- soap11HeaderBlock2WithParser.getMustUnderstand());
+ public void testGetMustUnderstand() {
+ SOAPHeaderBlock soapHeaderBlock = createSOAPHeaderBlock();
assertFalse(
- "SOAP 1.1 HeaderBlock Test With Parser : - getMustUnderstand
method returns incorrect value",
- soap11HeaderBlock3WithParser.getMustUnderstand());
-
- }
-
- //SOAP 1.2 SOAPHeaderBlock Test (With Parser)
- public void testSOAP12GetRoleWithParser() {
- assertTrue(
- "SOAP 1.2 HeaderBlock Test With Parser : - getRole method
returns incorrect role value",
- soap12HeaderBlock1WithParser.getRole().equals(
-
"http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver"));
- }
-
- public void testSOAP12GetMustUnderstandWithParser() {
+ "SOAP HeaderBlock Test : - After creating SOAPHeaderBlock,
default MustUnderstand value true",
+ soapHeaderBlock.getMustUnderstand());
+ soapHeaderBlock.setMustUnderstand(true);
assertTrue(
- "SOAP 1.2 HeaderBlock Test With Parser : - getMustUnderstand
method returns incorrect value",
- soap12HeaderBlock1WithParser.getMustUnderstand());
- assertFalse(
- "SOAP 1.2 HeaderBlock Test With Parser : - getMustUnderstand
method returns incorrect value",
- soap12HeaderBlock2WithParser.getMustUnderstand());
- soap12HeaderBlock3WithParser.getMustUnderstand();
- }
-
- public void testRelayAttribute() throws Exception {
- assertFalse(soap12HeaderBlock1WithParser.getRelay());
- assertTrue(soap12HeaderBlock2WithParser.getRelay());
- assertFalse(soap12HeaderBlock3WithParser.getRelay());
-
- SOAPEnvelope env = soap12Factory.createSOAPEnvelope();
- SOAPHeader header = soap12Factory.createSOAPHeader(env);
- soap12Factory.createSOAPBody(env);
- OMNamespace ns = soap12Factory.createOMNamespace("http://ns1", "ns1");
- SOAPHeaderBlock relayHeader = header.addHeaderBlock("foo", ns);
- relayHeader.setText("hey there");
- relayHeader.setRelay(true);
-
- String envString = env.toString();
- assertTrue("No relay header after setRelay(true)",
- envString.indexOf("relay=\"true\"") >= 0);
+ "SOAP HeaderBlock Test : - After setting MustUnderstand true
calling setMustUnderstand method , getMustUnderstand method returns false",
+ soapHeaderBlock.getMustUnderstand());
}
}
Added:
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP11HeaderBlockTest.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP11HeaderBlockTest.java?rev=935404&view=auto
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP11HeaderBlockTest.java
(added)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP11HeaderBlockTest.java
Sun Apr 18 20:21:37 2010
@@ -0,0 +1,29 @@
+/*
+ * 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.soap.impl.llom;
+
+import org.apache.axiom.om.impl.llom.factory.OMLinkedListMetaFactory;
+import org.apache.axiom.soap.SOAP11HeaderBlockTestBase;
+
+public class SOAP11HeaderBlockTest extends SOAP11HeaderBlockTestBase {
+ public SOAP11HeaderBlockTest() {
+ super(new OMLinkedListMetaFactory());
+ }
+}
Propchange:
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP11HeaderBlockTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP12HeaderBlockTest.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP12HeaderBlockTest.java?rev=935404&view=auto
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP12HeaderBlockTest.java
(added)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP12HeaderBlockTest.java
Sun Apr 18 20:21:37 2010
@@ -0,0 +1,29 @@
+/*
+ * 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.soap.impl.llom;
+
+import org.apache.axiom.om.impl.llom.factory.OMLinkedListMetaFactory;
+import org.apache.axiom.soap.SOAP12HeaderBlockTestBase;
+
+public class SOAP12HeaderBlockTest extends SOAP12HeaderBlockTestBase {
+ public SOAP12HeaderBlockTest() {
+ super(new OMLinkedListMetaFactory());
+ }
+}
Propchange:
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP12HeaderBlockTest.java
------------------------------------------------------------------------------
svn:eol-style = native