ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1144864 - in /webservices/commons/trunk/modules/axiom/modules: axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/ axiom-testsuite/src/main/java/org/apache/axiom/ts/ axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/
Date Sun, 10 Jul 2011 14:18:51 GMT
Author: veithen
Date: Sun Jul 10 14:18:50 2011
New Revision: 1144864

URL: http://svn.apache.org/viewvc?rev=1144864&view=rev
Log:
Added a test case for SOAPHeader#getHeadersToProcess(RolePlayer, String).

Added:
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestGetHeadersToProcessWithNamespace.java
  (with props)
Modified:
    webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/SOAPImplementationTest.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-dom/src/test/java/org/apache/axiom/om/impl/dom/SOAPImplementationTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/SOAPImplementationTest.java?rev=1144864&r1=1144863&r2=1144864&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/SOAPImplementationTest.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/SOAPImplementationTest.java
Sun Jul 10 14:18:50 2011
@@ -26,6 +26,7 @@ import org.apache.axiom.ts.SOAPTestSuite
 import org.apache.axiom.ts.soap.factory.TestGetDefaultFaultEnvelope;
 import org.apache.axiom.ts.soap.faultdetail.TestWSCommons202;
 import org.apache.axiom.ts.soap.faulttext.TestSetLang;
+import org.apache.axiom.ts.soap.header.TestGetHeadersToProcessWithNamespace;
 import org.apache.axiom.ts.soap12.fault.TestMoreChildrenAddition;
 
 public class SOAPImplementationTest extends TestCase {
@@ -37,6 +38,7 @@ public class SOAPImplementationTest exte
         // TODO: not sure if this is an issue in DOOM or if the test case is wrong
         builder.exclude(TestMoreChildrenAddition.class);
         
+        builder.exclude(TestGetHeadersToProcessWithNamespace.class);
         builder.exclude(org.apache.axiom.ts.soap11.header.TestGetHeadersToProcessWithParser.class);
         builder.exclude(org.apache.axiom.ts.soap12.header.TestGetHeadersToProcessWithParser.class);
         

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=1144864&r1=1144863&r2=1144864&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
Sun Jul 10 14:18:50 2011
@@ -78,6 +78,7 @@ public class SOAPTestSuiteBuilder extend
         addTest(new org.apache.axiom.ts.soap.header.TestExamineHeaderBlocks(metaFactory,
spec));
         addTest(new org.apache.axiom.ts.soap.header.TestExtractAllHeaderBlocks(metaFactory,
spec));
         addTest(new org.apache.axiom.ts.soap.header.TestGetHeaderBlocksWithNSURI(metaFactory,
spec));
+        addTest(new org.apache.axiom.ts.soap.header.TestGetHeadersToProcessWithNamespace(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.TestSetMustUnderstandBoolean(metaFactory,
spec, true, spec == SOAPSpec.SOAP11 ? "1" : "true"));

Added: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestGetHeadersToProcessWithNamespace.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestGetHeadersToProcessWithNamespace.java?rev=1144864&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestGetHeadersToProcessWithNamespace.java
(added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestGetHeadersToProcessWithNamespace.java
Sun Jul 10 14:18:50 2011
@@ -0,0 +1,61 @@
+/*
+ * 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.RolePlayer;
+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;
+
+/**
+ * Tests the behavior of {@link SOAPHeader#getHeadersToProcess(RolePlayer, String)}
+ */
+public class TestGetHeadersToProcessWithNamespace extends SOAPRoleTest {
+    public TestGetHeadersToProcessWithNamespace(OMMetaFactory metaFactory, SOAPSpec spec)
{
+        super(metaFactory, spec);
+    }
+
+    protected void runTest() throws Throwable {
+        SOAPEnvelope envelope = soapFactory.createSOAPEnvelope();
+        SOAPHeader header = soapFactory.createSOAPHeader(envelope);
+        OMNamespace ns1 = soapFactory.createOMNamespace("urn:ns1", "ns1");
+        OMNamespace ns2 = soapFactory.createOMNamespace("urn:ns2", "ns2");
+        String myRole = "urn:myRole";
+        String otherRole ="urn:otherRole";
+        SOAPHeaderBlock headerBlock1 = header.addHeaderBlock("header1", ns1);
+        headerBlock1.setRole(myRole);
+        SOAPHeaderBlock headerBlock2 = header.addHeaderBlock("header2", ns2);
+        headerBlock2.setRole(myRole);
+        SOAPHeaderBlock headerBlock3 = header.addHeaderBlock("header3", ns1);
+        headerBlock3.setRole(myRole);
+        SOAPHeaderBlock headerBlock4 = header.addHeaderBlock("header4", ns1);
+        headerBlock4.setRole(otherRole);
+        Iterator it = header.getHeadersToProcess(new MyRolePlayer(false, new String[] { myRole
}), ns1.getNamespaceURI());
+        assertTrue(it.hasNext());
+        assertSame(headerBlock1, it.next());
+        assertTrue(it.hasNext());
+        assertSame(headerBlock3, it.next());
+        assertFalse(it.hasNext());
+    }
+}

Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestGetHeadersToProcessWithNamespace.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message