ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1719718 - in /webservices/axiom/trunk/testing: axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/ axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/ axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/header/ axiom-te...
Date Sat, 12 Dec 2015 18:41:48 GMT
Author: veithen
Date: Sat Dec 12 18:41:48 2015
New Revision: 1719718

URL: http://svn.apache.org/viewvc?rev=1719718&view=rev
Log:
Unify TestExamineHeaderBlocksWithParser.

Added:
    webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestExamineHeaderBlocksWithParser.java
  (with props)
Removed:
    webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/header/TestExamineHeaderBlocksWithParser.java
    webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/header/TestExamineHeaderBlocksWithParser.java
Modified:
    webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java
    webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestGetHeadersToProcessWithParser.java
    webservices/axiom/trunk/testing/soap-testsuite/src/main/resources/test-message/set/roles.xml

Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java?rev=1719718&r1=1719717&r2=1719718&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java
(original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java
Sat Dec 12 18:41:48 2015
@@ -235,6 +235,7 @@ public class SOAPTestSuiteBuilder extend
         addTest(new org.apache.axiom.ts.soap.header.TestExamineAllHeaderBlocks(metaFactory,
spec));
         addTest(new org.apache.axiom.ts.soap.header.TestExamineAllHeaderBlocksWithParser(metaFactory,
spec));
         addTest(new org.apache.axiom.ts.soap.header.TestExamineHeaderBlocks(metaFactory,
spec));
+        addTest(new org.apache.axiom.ts.soap.header.TestExamineHeaderBlocksWithParser(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));
@@ -334,7 +335,6 @@ public class SOAPTestSuiteBuilder extend
         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.faultreason.TestGetTextWithCDATA(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.headerblock.TestGetMustUnderstandWithParser(metaFactory));
@@ -367,7 +367,6 @@ public class SOAPTestSuiteBuilder extend
         addTest(new org.apache.axiom.ts.soap12.faultsubcode.TestGetValueAsQNameWithParser(metaFactory));
         addTest(new org.apache.axiom.ts.soap12.faultsubcode.TestGetValueWithParser(metaFactory));
         addTest(new org.apache.axiom.ts.soap12.faulttext.TestGetLangWithParser(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));

Added: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestExamineHeaderBlocksWithParser.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestExamineHeaderBlocksWithParser.java?rev=1719718&view=auto
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestExamineHeaderBlocksWithParser.java
(added)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestExamineHeaderBlocksWithParser.java
Sat Dec 12 18:41:48 2015
@@ -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 static com.google.common.truth.Truth.assertThat;
+
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axiom.soap.SOAPHeaderBlock;
+import org.apache.axiom.ts.soap.SOAPSampleSet;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SampleBasedSOAPTestCase;
+
+public class TestExamineHeaderBlocksWithParser extends SampleBasedSOAPTestCase {
+    public TestExamineHeaderBlocksWithParser(OMMetaFactory metaFactory, SOAPSpec spec) {
+        super(metaFactory, spec, SOAPSampleSet.ROLES);
+    }
+
+    @Override
+    protected void runTest(SOAPEnvelope envelope) throws Throwable {
+        String roleNextURI = spec.getNextRoleURI();
+        Iterator it = envelope.getHeader().examineHeaderBlocks(roleNextURI);
+        assertThat(it.hasNext()).isTrue();
+        SOAPHeaderBlock headerBlock = (SOAPHeaderBlock)it.next();
+        assertThat(headerBlock.getQName()).isEqualTo(new QName("http://example.org/RoleTest",
"h2"));
+        assertThat(headerBlock.getRole()).isEqualTo(roleNextURI);
+        assertThat(it.hasNext()).isTrue();
+        headerBlock = (SOAPHeaderBlock)it.next();
+        assertThat(headerBlock.getQName()).isEqualTo(new QName("http://example.org/RoleTest",
"h7"));
+        assertThat(headerBlock.getRole()).isEqualTo(roleNextURI);
+        assertThat(it.hasNext()).isFalse();
+    }
+}

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

Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestGetHeadersToProcessWithParser.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestGetHeadersToProcessWithParser.java?rev=1719718&r1=1719717&r2=1719718&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestGetHeadersToProcessWithParser.java
(original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestGetHeadersToProcessWithParser.java
Sat Dec 12 18:41:48 2015
@@ -50,7 +50,7 @@ public class TestGetHeadersToProcessWith
             numHeaders++;
         }
 
-        assertEquals("Didn't get right number of headers (with custom role)", 5, numHeaders);
+        assertEquals("Didn't get right number of headers (with custom role)", 6, numHeaders);
 
         rp = new MyRolePlayer(true);
 
@@ -63,7 +63,7 @@ public class TestGetHeadersToProcessWith
             numHeaders++;
         }
 
-        assertEquals("Didn't get right number of headers (no custom role)", 4, numHeaders);
+        assertEquals("Didn't get right number of headers (no custom role)", 5, numHeaders);
 
         // Intermediary test
         rp = new MyRolePlayer(false);
@@ -77,6 +77,6 @@ public class TestGetHeadersToProcessWith
             numHeaders++;
         }
 
-        assertEquals("Didn't get right number of headers (no custom role)", 1, numHeaders);
+        assertEquals("Didn't get right number of headers (no custom role)", 2, numHeaders);
     }
 }

Modified: webservices/axiom/trunk/testing/soap-testsuite/src/main/resources/test-message/set/roles.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/soap-testsuite/src/main/resources/test-message/set/roles.xml?rev=1719718&r1=1719717&r2=1719718&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/soap-testsuite/src/main/resources/test-message/set/roles.xml
(original)
+++ webservices/axiom/trunk/testing/soap-testsuite/src/main/resources/test-message/set/roles.xml
Sat Dec 12 18:41:48 2015
@@ -21,6 +21,10 @@
         <test:h6 env:role="">
             Going all the way baby! (empty role)
         </test:h6>
+        <test:h7 env:role="http://www.w3.org/2003/05/soap-envelope/role/next"
+                env:mustUnderstand="true">
+            Another header for the next node.
+        </test:h7>
     </env:Header>
     <env:Body>
         <Echo>This is a test, this is only a test...</Echo>



Mime
View raw message