Author: veithen
Date: Fri Jan 21 20:01:44 2011
New Revision: 1061992
URL: http://svn.apache.org/viewvc?rev=1061992&view=rev
Log:
Refactored a couple of SOAPHeader and SOAPHeaderBlock tests.
Added:
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestAddHeaderBlock.java
(with props)
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestExamineAllHeaderBlocks.java
(with props)
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestExamineHeaderBlocks.java
(with props)
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestGetHeaderBlocksWithNSURI.java
(with props)
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestGetMustUnderstand.java
(with props)
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestGetRole.java
(with props)
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestSetMustUnderstand.java
(with props)
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestSetMustUnderstandString01.java
(with props)
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestSetMustUnderstandWithInvalidValue.java
(with props)
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestSetRole.java
(with props)
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAPHeaderBlockTestBase.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-testsuite/src/main/java/org/apache/axiom/ts/SOAPTestSuiteBuilder.java
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPSpec.java
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestCase.java
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-api/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?rev=1061992&r1=1061991&r2=1061992&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-api/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
Fri Jan 21 20:01:44 2011
@@ -33,81 +33,4 @@ public class SOAPHeaderBlockTestBase ext
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 {
- soapHeaderBlock.setRole("Any Value");
- } catch (Exception e) {
- fail(
- "SOAP HeaderBlock Test : - role value can not be set to
any value");
- }
- }
-
- public void testGetRole() {
- SOAPHeaderBlock soapHeaderBlock = createSOAPHeaderBlock();
- assertTrue(
- "SOAP HeaderBlock Test : - After creating SOAPHeaderBlock, it
has a role",
- soapHeaderBlock.getRole() == null);
- 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"));
- }
-
- public void testSetMustUnderstand() {
- 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 false
calling setMustUnderstand method , getMustUnderstand method returns true",
- soapHeaderBlock.getMustUnderstand());
- }
-
- public void testSetMustUnderstandString01() {
- SOAPHeaderBlock soapHeaderBlock = createSOAPHeaderBlock();
- soapHeaderBlock.setMustUnderstand("1");
- assertTrue(
- "SOAP HeaderBlock Test : - After setting MustUnderstand \"1\"
calling setMustUnderstand method , getMustUnderstand method returns false",
- soapHeaderBlock.getMustUnderstand());
- soapHeaderBlock.setMustUnderstand("0");
- assertFalse(
- "SOAP HeaderBlock Test : - After setting MustUnderstand \"0\"
calling setMustUnderstand method , getMustUnderstand method returns true",
- soapHeaderBlock.getMustUnderstand());
- }
-
- public void testSetMustUnderstandWithInvalidValue() {
- SOAPHeaderBlock soapHeaderBlock = createSOAPHeaderBlock();
- try {
- soapHeaderBlock.setMustUnderstand("otherValue");
- fail(
- "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 testGetMustUnderstand() {
- SOAPHeaderBlock soapHeaderBlock = createSOAPHeaderBlock();
- assertFalse(
- "SOAP HeaderBlock Test : - After creating SOAPHeaderBlock,
default MustUnderstand value true",
- soapHeaderBlock.getMustUnderstand());
- soapHeaderBlock.setMustUnderstand(true);
- assertTrue(
- "SOAP HeaderBlock Test : - After setting MustUnderstand true
calling setMustUnderstand method , getMustUnderstand method returns false",
- soapHeaderBlock.getMustUnderstand());
- }
}
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAPHeaderTestBase.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAPHeaderTestBase.java?rev=1061992&r1=1061991&r2=1061992&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAPHeaderTestBase.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAPHeaderTestBase.java
Fri Jan 21 20:01:44 2011
@@ -19,11 +19,7 @@
package org.apache.axiom.soap;
-import java.util.ArrayList;
-import java.util.Iterator;
-
import org.apache.axiom.om.OMMetaFactory;
-import org.apache.axiom.om.OMNamespace;
public class SOAPHeaderTestBase extends UnifiedSOAPTestCase {
protected final String roleNextURI;
@@ -32,114 +28,4 @@ public class SOAPHeaderTestBase extends
super(omMetaFactory, envelopeNamespaceURI);
this.roleNextURI = roleNextURI;
}
-
- //SOAP Header Test (Programaticaly
Created)--------------------------------------------------------------------------------
- public void testAddHeaderBlock() {
- SOAPEnvelope soapEnvelope = soapFactory.createSOAPEnvelope();
- SOAPHeader soapHeader = soapFactory.createSOAPHeader(soapEnvelope);
- OMNamespace namespace =
soapFactory.createOMNamespace("http://www.example.org", "test");
- soapHeader.addHeaderBlock("echoOk1", namespace);
- soapHeader.addHeaderBlock("echoOk2", namespace);
- Iterator iterator = soapHeader.getChildren();
- SOAPHeaderBlock headerBlock1 = (SOAPHeaderBlock) iterator.next();
- assertFalse(
- "SOAP Header Test : - After calling addHeaderBlock method
twice, getChildren method returns empty iterator",
- headerBlock1 == null);
- assertTrue("SOAP Header Test : - HeaderBlock1 local name mismatch",
- headerBlock1.getLocalName().equals("echoOk1"));
- assertTrue(
- "SOAP Header Test : - HeaderBlock1 namespace uri mismatch",
- headerBlock1.getNamespace().getNamespaceURI().equals(
- "http://www.example.org"));
-
- SOAPHeaderBlock headerBlock2 = (SOAPHeaderBlock) iterator.next();
- assertFalse(
- "SOAP Header Test : - After calling addHeaderBlock method
twice, getChildren method returns an iterator with only one object",
- headerBlock2 == null);
- assertTrue("SOAP Header Test : - HeaderBlock2 local name mismatch",
- headerBlock2.getLocalName().equals("echoOk2"));
- assertTrue(
- "SOAP Header Test : - HeaderBlock2 namespace uri mismatch",
- headerBlock2.getNamespace().getNamespaceURI().equals(
- "http://www.example.org"));
-
- assertTrue(
- "SOAP Header Test : - After calling addHeaderBlock method
twice, getChildren method returns an iterator with more than two elements",
- !iterator.hasNext());
- }
-
- public void testExamineHeaderBlocks() {
- SOAPEnvelope soapEnvelope = soapFactory.createSOAPEnvelope();
- SOAPHeader soapHeader = soapFactory.createSOAPHeader(soapEnvelope);
- OMNamespace namespace =
soapFactory.createOMNamespace("http://www.example.org", "test");
- soapHeader.addHeaderBlock("echoOk1",
namespace).setRole("urn:test-role");
- soapHeader.addHeaderBlock("echoOk2", namespace).setRole(roleNextURI);
- Iterator iterator = soapHeader.examineHeaderBlocks(roleNextURI);
- iterator.hasNext();
- SOAPHeaderBlock headerBlockWithRole = (SOAPHeaderBlock)
iterator.next();
- assertEquals(
- "SOAP Header Test : - headerBlockWithRole local name mismatch",
- "echoOk2", headerBlockWithRole.getLocalName());
- assertEquals(
- "SOAP Header Test : - headerBlockWithRole role value mismatch",
- roleNextURI, headerBlockWithRole.getRole());
-
- assertFalse(
- "SOAP 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 testExamineAllHeaderBlocks() {
- SOAPEnvelope soapEnvelope = soapFactory.createSOAPEnvelope();
- SOAPHeader soapHeader = soapFactory.createSOAPHeader(soapEnvelope);
- OMNamespace namespace =
soapFactory.createOMNamespace("http://www.example.org", "test");
- soapHeader.addHeaderBlock("echoOk1", namespace);
- soapHeader.addHeaderBlock("echoOk2", namespace);
- Iterator iterator = soapHeader.examineAllHeaderBlocks();
- iterator.hasNext();
- SOAPHeaderBlock headerBlock1 = (SOAPHeaderBlock) iterator.next();
- assertFalse(
- "SOAP Header Test : - After calling addHeaderBlock method
twice, examineAllHeaderBlocks method returns empty iterator",
- headerBlock1 == null);
- assertTrue("SOAP Header Test : - HeaderBlock1 local name mismatch",
- headerBlock1.getLocalName().equals("echoOk1"));
- assertTrue(
- "SOAP Header Test : - HeaderBlock1 namespace uri mismatch",
- headerBlock1.getNamespace().getNamespaceURI().equals(
- "http://www.example.org"));
-
- assertTrue(iterator.hasNext());
- SOAPHeaderBlock headerBlock2 = (SOAPHeaderBlock) iterator.next();
- assertFalse(
- "SOAP Header Test : - After calling addHeaderBlock method
twice, examineAllHeaderBlocks method returns an iterator with only one object",
- headerBlock2 == null);
- assertTrue("SOAP Header Test : - HeaderBlock2 local name mismatch",
- headerBlock2.getLocalName().equals("echoOk2"));
- assertTrue(
- "SOAP Header Test : - HeaderBlock2 namespace uri mismatch",
- headerBlock2.getNamespace().getNamespaceURI().equals(
- "http://www.example.org"));
-
- assertFalse(
- "SOAP Header Test : - After calling addHeaderBlock method
twice, examineAllHeaderBlocks method returns an iterator with more than two
object",
- iterator.hasNext());
- }
-
- public void testGetHeaderBlocksWithNSURI() {
- SOAPEnvelope soapEnvelope = soapFactory.createSOAPEnvelope();
- SOAPHeader soapHeader = soapFactory.createSOAPHeader(soapEnvelope);
- OMNamespace namespace =
soapFactory.createOMNamespace("http://www.example.org", "test");
- soapHeader.addHeaderBlock("echoOk1", namespace);
- soapHeader.addHeaderBlock("echoOk2",
-
soapFactory.createOMNamespace("http://www.test1.org", "test1"));
- ArrayList arrayList = soapHeader.getHeaderBlocksWithNSURI(
- "http://www.test1.org");
- assertTrue(
- "SOAP Header Test : - getHeaderBlocksWithNSURI returns an
arrayList of incorrect size",
- arrayList.size() == 1);
- assertTrue(
- "SOAP Header Test : - headerBlock of given namespace uri
mismatch",
- ((SOAPHeaderBlock)
arrayList.get(0)).getNamespace().getNamespaceURI()
- .equals("http://www.test1.org"));
- }
}
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=1061992&r1=1061991&r2=1061992&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
Fri Jan 21 20:01:44 2011
@@ -62,6 +62,16 @@ public class SOAPTestSuiteBuilder extend
addTest(new
org.apache.axiom.ts.soap.faultdetail.TestGetAllDetailEntriesWithParser(metaFactory,
spec));
addTest(new
org.apache.axiom.ts.soap.faultdetail.TestSerialization(metaFactory, spec));
addTest(new
org.apache.axiom.ts.soap.faultdetail.TestWSCommons202(metaFactory, spec));
+ addTest(new
org.apache.axiom.ts.soap.header.TestAddHeaderBlock(metaFactory, spec));
+ addTest(new
org.apache.axiom.ts.soap.header.TestExamineAllHeaderBlocks(metaFactory, spec));
+ addTest(new
org.apache.axiom.ts.soap.header.TestExamineHeaderBlocks(metaFactory, spec));
+ addTest(new
org.apache.axiom.ts.soap.header.TestGetHeaderBlocksWithNSURI(metaFactory,
spec));
+ addTest(new
org.apache.axiom.ts.soap.headerblock.TestGetMustUnderstand(metaFactory, spec));
+ addTest(new
org.apache.axiom.ts.soap.headerblock.TestGetRole(metaFactory, spec));
+ addTest(new
org.apache.axiom.ts.soap.headerblock.TestSetMustUnderstand(metaFactory, spec));
+ addTest(new
org.apache.axiom.ts.soap.headerblock.TestSetMustUnderstandString01(metaFactory,
spec));
+ addTest(new
org.apache.axiom.ts.soap.headerblock.TestSetMustUnderstandWithInvalidValue(metaFactory,
spec));
+ addTest(new
org.apache.axiom.ts.soap.headerblock.TestSetRole(metaFactory, spec));
}
protected void addTests() {
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPSpec.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPSpec.java?rev=1061992&r1=1061991&r2=1061992&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPSpec.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPSpec.java
Fri Jan 21 20:01:44 2011
@@ -20,7 +20,9 @@ package org.apache.axiom.ts.soap;
import org.apache.axiom.om.OMMetaFactory;
import org.apache.axiom.soap.SOAP11Constants;
+import org.apache.axiom.soap.SOAP11Version;
import org.apache.axiom.soap.SOAP12Constants;
+import org.apache.axiom.soap.SOAP12Version;
import org.apache.axiom.soap.SOAPFactory;
import org.apache.axiom.soap.SOAPVersion;
@@ -28,8 +30,8 @@ import org.apache.axiom.soap.SOAPVersion
* Describes the characteristics of a given SOAP version. This is similar to
{@link SOAPVersion},
* but is designed specifically for the test suite.
*/
-public interface SOAPSpec {
- SOAPSpec SOAP11 = new SOAPSpec() {
+public abstract class SOAPSpec {
+ public static final SOAPSpec SOAP11 = new
SOAPSpec(SOAP11Version.getSingleton()) {
public String getName() {
return "soap11";
}
@@ -63,7 +65,7 @@ public interface SOAPSpec {
}
};
- SOAPSpec SOAP12 = new SOAPSpec() {
+ public static final SOAPSpec SOAP12 = new
SOAPSpec(SOAP12Version.getSingleton()) {
public String getName() {
return "soap12";
}
@@ -97,12 +99,22 @@ public interface SOAPSpec {
}
};
- String getName();
- SOAPFactory getFactory(OMMetaFactory metaFactory);
- SOAPFactory getAltFactory(OMMetaFactory metaFactory);
- String getEnvelopeNamespaceURI();
- String getFaultCodeLocalName();
- String getFaultReasonLocalName();
- String getFaultRoleLocalName();
- String getFaultDetailLocalName();
+ private final SOAPVersion version;
+
+ public SOAPSpec(SOAPVersion version) {
+ this.version = version;
+ }
+
+ public abstract String getName();
+ public abstract SOAPFactory getFactory(OMMetaFactory metaFactory);
+ public abstract SOAPFactory getAltFactory(OMMetaFactory metaFactory);
+ public abstract String getEnvelopeNamespaceURI();
+ public abstract String getFaultCodeLocalName();
+ public abstract String getFaultReasonLocalName();
+ public abstract String getFaultRoleLocalName();
+ public abstract String getFaultDetailLocalName();
+
+ public String getNextRoleURI() {
+ return version.getNextRoleURI();
+ }
}
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestCase.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestCase.java?rev=1061992&r1=1061991&r2=1061992&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestCase.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestCase.java
Fri Jan 21 20:01:44 2011
@@ -22,10 +22,12 @@ import java.io.InputStream;
import org.apache.axiom.om.AbstractTestCase;
import org.apache.axiom.om.OMMetaFactory;
-import org.apache.axiom.om.OMXMLBuilderFactory;
+import org.apache.axiom.om.OMNamespace;
import org.apache.axiom.om.util.StAXParserConfiguration;
import org.apache.axiom.soap.SOAPEnvelope;
import org.apache.axiom.soap.SOAPFactory;
+import org.apache.axiom.soap.SOAPHeader;
+import org.apache.axiom.soap.SOAPHeaderBlock;
import org.apache.axiom.ts.AxiomTestCase;
import org.xml.sax.InputSource;
@@ -56,4 +58,11 @@ public class SOAPTestCase extends AxiomT
assertSame(spec.getEnvelopeNamespaceURI(),
((SOAPFactory)envelope.getOMFactory()).getSoapVersionURI());
return envelope;
}
+
+ 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);
+ }
}
Added:
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestAddHeaderBlock.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestAddHeaderBlock.java?rev=1061992&view=auto
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestAddHeaderBlock.java
(added)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestAddHeaderBlock.java
Fri Jan 21 20:01:44 2011
@@ -0,0 +1,69 @@
+/*
+ * 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.soap.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 TestAddHeaderBlock extends SOAPTestCase {
+ public TestAddHeaderBlock(OMMetaFactory metaFactory, SOAPSpec spec) {
+ super(metaFactory, spec);
+ }
+
+ 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);
+ soapHeader.addHeaderBlock("echoOk2", namespace);
+ Iterator iterator = soapHeader.getChildren();
+ SOAPHeaderBlock headerBlock1 = (SOAPHeaderBlock) iterator.next();
+ assertFalse(
+ "SOAP Header Test : - After calling addHeaderBlock method
twice, getChildren method returns empty iterator",
+ headerBlock1 == null);
+ assertTrue("SOAP Header Test : - HeaderBlock1 local name mismatch",
+ headerBlock1.getLocalName().equals("echoOk1"));
+ assertTrue(
+ "SOAP Header Test : - HeaderBlock1 namespace uri mismatch",
+ headerBlock1.getNamespace().getNamespaceURI().equals(
+ "http://www.example.org"));
+
+ SOAPHeaderBlock headerBlock2 = (SOAPHeaderBlock) iterator.next();
+ assertFalse(
+ "SOAP Header Test : - After calling addHeaderBlock method
twice, getChildren method returns an iterator with only one object",
+ headerBlock2 == null);
+ assertTrue("SOAP Header Test : - HeaderBlock2 local name mismatch",
+ headerBlock2.getLocalName().equals("echoOk2"));
+ assertTrue(
+ "SOAP Header Test : - HeaderBlock2 namespace uri mismatch",
+ headerBlock2.getNamespace().getNamespaceURI().equals(
+ "http://www.example.org"));
+
+ assertTrue(
+ "SOAP Header Test : - After calling addHeaderBlock method
twice, getChildren method returns an iterator with more than two elements",
+ !iterator.hasNext());
+ }
+}
Propchange:
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestAddHeaderBlock.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestExamineAllHeaderBlocks.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestExamineAllHeaderBlocks.java?rev=1061992&view=auto
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestExamineAllHeaderBlocks.java
(added)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestExamineAllHeaderBlocks.java
Fri Jan 21 20:01:44 2011
@@ -0,0 +1,71 @@
+/*
+ * 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.soap.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 TestExamineAllHeaderBlocks extends SOAPTestCase {
+ public TestExamineAllHeaderBlocks(OMMetaFactory metaFactory, SOAPSpec
spec) {
+ super(metaFactory, spec);
+ }
+
+ 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);
+ soapHeader.addHeaderBlock("echoOk2", namespace);
+ Iterator iterator = soapHeader.examineAllHeaderBlocks();
+ iterator.hasNext();
+ SOAPHeaderBlock headerBlock1 = (SOAPHeaderBlock) iterator.next();
+ assertFalse(
+ "SOAP Header Test : - After calling addHeaderBlock method
twice, examineAllHeaderBlocks method returns empty iterator",
+ headerBlock1 == null);
+ assertTrue("SOAP Header Test : - HeaderBlock1 local name mismatch",
+ headerBlock1.getLocalName().equals("echoOk1"));
+ assertTrue(
+ "SOAP Header Test : - HeaderBlock1 namespace uri mismatch",
+ headerBlock1.getNamespace().getNamespaceURI().equals(
+ "http://www.example.org"));
+
+ assertTrue(iterator.hasNext());
+ SOAPHeaderBlock headerBlock2 = (SOAPHeaderBlock) iterator.next();
+ assertFalse(
+ "SOAP Header Test : - After calling addHeaderBlock method
twice, examineAllHeaderBlocks method returns an iterator with only one object",
+ headerBlock2 == null);
+ assertTrue("SOAP Header Test : - HeaderBlock2 local name mismatch",
+ headerBlock2.getLocalName().equals("echoOk2"));
+ assertTrue(
+ "SOAP Header Test : - HeaderBlock2 namespace uri mismatch",
+ headerBlock2.getNamespace().getNamespaceURI().equals(
+ "http://www.example.org"));
+
+ assertFalse(
+ "SOAP Header Test : - After calling addHeaderBlock method
twice, examineAllHeaderBlocks method returns an iterator with more than two
object",
+ iterator.hasNext());
+ }
+}
Propchange:
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestExamineAllHeaderBlocks.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestExamineHeaderBlocks.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestExamineHeaderBlocks.java?rev=1061992&view=auto
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestExamineHeaderBlocks.java
(added)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestExamineHeaderBlocks.java
Fri Jan 21 20:01:44 2011
@@ -0,0 +1,57 @@
+/*
+ * 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.soap.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 TestExamineHeaderBlocks extends SOAPTestCase {
+ public TestExamineHeaderBlocks(OMMetaFactory metaFactory, SOAPSpec spec) {
+ super(metaFactory, spec);
+ }
+
+ protected void runTest() throws Throwable {
+ String roleNextURI = spec.getNextRoleURI();
+ SOAPEnvelope soapEnvelope = soapFactory.createSOAPEnvelope();
+ SOAPHeader soapHeader = soapFactory.createSOAPHeader(soapEnvelope);
+ OMNamespace namespace =
soapFactory.createOMNamespace("http://www.example.org", "test");
+ soapHeader.addHeaderBlock("echoOk1",
namespace).setRole("urn:test-role");
+ soapHeader.addHeaderBlock("echoOk2", namespace).setRole(roleNextURI);
+ Iterator iterator = soapHeader.examineHeaderBlocks(roleNextURI);
+ iterator.hasNext();
+ SOAPHeaderBlock headerBlockWithRole = (SOAPHeaderBlock)
iterator.next();
+ assertEquals(
+ "SOAP Header Test : - headerBlockWithRole local name mismatch",
+ "echoOk2", headerBlockWithRole.getLocalName());
+ assertEquals(
+ "SOAP Header Test : - headerBlockWithRole role value mismatch",
+ roleNextURI, headerBlockWithRole.getRole());
+
+ assertFalse(
+ "SOAP Header Test : - header has one headerBlock with role,
but examineHeaderBlocks(String role) 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/soap/header/TestExamineHeaderBlocks.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestGetHeaderBlocksWithNSURI.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestGetHeaderBlocksWithNSURI.java?rev=1061992&view=auto
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestGetHeaderBlocksWithNSURI.java
(added)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestGetHeaderBlocksWithNSURI.java
Fri Jan 21 20:01:44 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.soap.header;
+
+import java.util.ArrayList;
+
+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 TestGetHeaderBlocksWithNSURI extends SOAPTestCase {
+ public TestGetHeaderBlocksWithNSURI(OMMetaFactory metaFactory, SOAPSpec
spec) {
+ super(metaFactory, spec);
+ }
+
+ 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);
+ soapHeader.addHeaderBlock("echoOk2",
+
soapFactory.createOMNamespace("http://www.test1.org", "test1"));
+ ArrayList arrayList = soapHeader.getHeaderBlocksWithNSURI(
+ "http://www.test1.org");
+ assertTrue(
+ "SOAP Header Test : - getHeaderBlocksWithNSURI returns an
arrayList of incorrect size",
+ arrayList.size() == 1);
+ assertTrue(
+ "SOAP Header Test : - headerBlock of given namespace uri
mismatch",
+ ((SOAPHeaderBlock)
arrayList.get(0)).getNamespace().getNamespaceURI()
+ .equals("http://www.test1.org"));
+ }
+}
Propchange:
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestGetHeaderBlocksWithNSURI.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestGetMustUnderstand.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestGetMustUnderstand.java?rev=1061992&view=auto
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestGetMustUnderstand.java
(added)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestGetMustUnderstand.java
Fri Jan 21 20:01:44 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.soap.headerblock;
+
+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 TestGetMustUnderstand extends SOAPTestCase {
+ public TestGetMustUnderstand(OMMetaFactory metaFactory, SOAPSpec spec) {
+ super(metaFactory, spec);
+ }
+
+ protected void runTest() throws Throwable {
+ SOAPHeaderBlock soapHeaderBlock = createSOAPHeaderBlock();
+ assertFalse(
+ "SOAP HeaderBlock Test : - After creating SOAPHeaderBlock,
default MustUnderstand value true",
+ soapHeaderBlock.getMustUnderstand());
+ soapHeaderBlock.setMustUnderstand(true);
+ assertTrue(
+ "SOAP HeaderBlock Test : - After setting MustUnderstand true
calling setMustUnderstand method , getMustUnderstand method returns false",
+ soapHeaderBlock.getMustUnderstand());
+ }
+}
Propchange:
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestGetMustUnderstand.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestGetRole.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestGetRole.java?rev=1061992&view=auto
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestGetRole.java
(added)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestGetRole.java
Fri Jan 21 20:01:44 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.soap.headerblock;
+
+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 TestGetRole extends SOAPTestCase {
+ public TestGetRole(OMMetaFactory metaFactory, SOAPSpec spec) {
+ super(metaFactory, spec);
+ }
+
+ protected void runTest() throws Throwable {
+ SOAPHeaderBlock soapHeaderBlock = createSOAPHeaderBlock();
+ assertTrue(
+ "SOAP HeaderBlock Test : - After creating SOAPHeaderBlock, it
has a role",
+ soapHeaderBlock.getRole() == null);
+ 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"));
+ }
+}
Propchange:
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestGetRole.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestSetMustUnderstand.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestSetMustUnderstand.java?rev=1061992&view=auto
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestSetMustUnderstand.java
(added)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestSetMustUnderstand.java
Fri Jan 21 20:01:44 2011
@@ -0,0 +1,42 @@
+/*
+ * 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.soap.headerblock;
+
+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 TestSetMustUnderstand extends SOAPTestCase {
+ public TestSetMustUnderstand(OMMetaFactory metaFactory, SOAPSpec spec) {
+ super(metaFactory, spec);
+ }
+
+ protected void runTest() throws Throwable {
+ 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 false
calling setMustUnderstand method , getMustUnderstand method returns true",
+ soapHeaderBlock.getMustUnderstand());
+ }
+}
Propchange:
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestSetMustUnderstand.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestSetMustUnderstandString01.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestSetMustUnderstandString01.java?rev=1061992&view=auto
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestSetMustUnderstandString01.java
(added)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestSetMustUnderstandString01.java
Fri Jan 21 20:01:44 2011
@@ -0,0 +1,42 @@
+/*
+ * 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.soap.headerblock;
+
+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 TestSetMustUnderstandString01 extends SOAPTestCase {
+ public TestSetMustUnderstandString01(OMMetaFactory metaFactory, SOAPSpec
spec) {
+ super(metaFactory, spec);
+ }
+
+ protected void runTest() throws Throwable {
+ SOAPHeaderBlock soapHeaderBlock = createSOAPHeaderBlock();
+ soapHeaderBlock.setMustUnderstand("1");
+ assertTrue(
+ "SOAP HeaderBlock Test : - After setting MustUnderstand \"1\"
calling setMustUnderstand method , getMustUnderstand method returns false",
+ soapHeaderBlock.getMustUnderstand());
+ soapHeaderBlock.setMustUnderstand("0");
+ assertFalse(
+ "SOAP HeaderBlock Test : - After setting MustUnderstand \"0\"
calling setMustUnderstand method , getMustUnderstand method returns true",
+ soapHeaderBlock.getMustUnderstand());
+ }
+}
Propchange:
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestSetMustUnderstandString01.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestSetMustUnderstandWithInvalidValue.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestSetMustUnderstandWithInvalidValue.java?rev=1061992&view=auto
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestSetMustUnderstandWithInvalidValue.java
(added)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestSetMustUnderstandWithInvalidValue.java
Fri Jan 21 20:01:44 2011
@@ -0,0 +1,42 @@
+/*
+ * 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.soap.headerblock;
+
+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 TestSetMustUnderstandWithInvalidValue extends SOAPTestCase {
+ public TestSetMustUnderstandWithInvalidValue(OMMetaFactory metaFactory,
SOAPSpec spec) {
+ super(metaFactory, spec);
+ }
+
+ protected void runTest() throws Throwable {
+ SOAPHeaderBlock soapHeaderBlock = createSOAPHeaderBlock();
+ try {
+ soapHeaderBlock.setMustUnderstand("otherValue");
+ fail(
+ "SOAP HeaderBlock Test : - MustUnderstand value can not be
set to any value rather than 1 , 0 , true , false");
+
+ } catch (Exception e) {
+ assertTrue(true);
+ }
+ }
+}
Propchange:
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestSetMustUnderstandWithInvalidValue.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestSetRole.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestSetRole.java?rev=1061992&view=auto
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestSetRole.java
(added)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestSetRole.java
Fri Jan 21 20:01:44 2011
@@ -0,0 +1,46 @@
+/*
+ * 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.soap.headerblock;
+
+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 TestSetRole extends SOAPTestCase {
+ public TestSetRole(OMMetaFactory metaFactory, SOAPSpec spec) {
+ super(metaFactory, spec);
+ }
+
+ protected void runTest() throws Throwable {
+ 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 {
+ soapHeaderBlock.setRole("Any Value");
+ } catch (Exception e) {
+ fail(
+ "SOAP HeaderBlock Test : - role value can not be set to
any value");
+ }
+ }
+}
Propchange:
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestSetRole.java
------------------------------------------------------------------------------
svn:eol-style = native