ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1796217 - in /webservices/axiom/trunk: axiom-api/src/test/resources/soap/soap11/ axiom-api/src/test/resources/soap/soap12/ testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/ testing/axiom-testsuite/src/main/java/org/apache/axi...
Date Thu, 25 May 2017 22:23:26 GMT
Author: veithen
Date: Thu May 25 22:23:26 2017
New Revision: 1796217

URL: http://svn.apache.org/viewvc?rev=1796217&view=rev
Log:
AXIOM-311: Decouple SOAPTestCase from AbstractTestCase in axiom-api.

Added:
    webservices/axiom/trunk/testing/soap-testsuite/src/main/resources/test-message/soap12/relay.xml
      - copied, changed from r1796216, webservices/axiom/trunk/axiom-api/src/test/resources/soap/soap12/message.xml
Removed:
    webservices/axiom/trunk/axiom-api/src/test/resources/soap/soap11/message.xml
    webservices/axiom/trunk/axiom-api/src/test/resources/soap/soap12/message.xml
Modified:
    webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestCase.java
    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/soap12/headerblock/TestGetRelayWithParser.java
    webservices/axiom/trunk/testing/soap-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPSample.java

Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestCase.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestCase.java?rev=1796217&r1=1796216&r2=1796217&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestCase.java
(original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestCase.java
Thu May 25 22:23:26 2017
@@ -18,22 +18,15 @@
  */
 package org.apache.axiom.ts.soap;
 
-import java.io.InputStream;
-
-import org.apache.axiom.om.AbstractTestCase;
 import org.apache.axiom.om.OMMetaFactory;
 import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.om.OMXMLBuilderFactory;
 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.soap.SOAPModelBuilder;
 import org.apache.axiom.ts.AxiomTestCase;
 
 public abstract class SOAPTestCase extends AxiomTestCase {
-    protected static final String MESSAGE = "message.xml";
-    
     protected final SOAPSpec spec;
     protected SOAPFactory soapFactory;
     protected SOAPFactory altSoapFactory;
@@ -51,17 +44,6 @@ public abstract class SOAPTestCase exten
         altSoapFactory = spec.getAltSpec().getAdapter(FactorySelector.class).getFactory(metaFactory);
     }
 
-    protected SOAPModelBuilder getBuilderForTestMessage(String name) {
-        InputStream in = AbstractTestCase.getTestResource("soap/" + spec.getName() + "/"
+ name);
-        return OMXMLBuilderFactory.createSOAPModelBuilder(metaFactory, in, null);
-    }
-    
-    protected SOAPEnvelope getTestMessage(String name) {
-        SOAPEnvelope envelope = getBuilderForTestMessage(name).getSOAPEnvelope();
-        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();

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=1796217&r1=1796216&r2=1796217&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
Thu May 25 22:23:26 2017
@@ -55,8 +55,6 @@ public class SOAPTestSuiteBuilder extend
                 new SimpleSOAPSample(SOAPSpec.SOAP11, "soap/soap11/soapfault.xml"),
                 new SimpleSOAPSample(SOAPSpec.SOAP11, "soap/soap11/soapfault2.xml"),
                 new SimpleSOAPSample(SOAPSpec.SOAP11, "soap/soap11/bodyNotQualified.xml"),
-                new SimpleSOAPSample(SOAPSpec.SOAP11, "soap/soap11/message.xml"),
-                new SimpleSOAPSample(SOAPSpec.SOAP12, "soap/soap12/message.xml"),
                 new SimpleSOAPSample(SOAPSpec.SOAP11, "soap/soap11/faultelements-with-comment.xml"),
                 new SimpleSOAPSample(SOAPSpec.SOAP11, "soap/soap11/additional-element-after-body.xml"),
                 new SimpleSOAPSample(SOAPSpec.SOAP11, "soap/soap11/empty-header.xml"),

Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/headerblock/TestGetRelayWithParser.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/headerblock/TestGetRelayWithParser.java?rev=1796217&r1=1796216&r2=1796217&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/headerblock/TestGetRelayWithParser.java
(original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/headerblock/TestGetRelayWithParser.java
Thu May 25 22:23:26 2017
@@ -21,18 +21,19 @@ package org.apache.axiom.ts.soap12.heade
 import java.util.Iterator;
 
 import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.soap.SOAPEnvelope;
 import org.apache.axiom.soap.SOAPHeaderBlock;
-import org.apache.axiom.ts.soap.SOAPSpec;
-import org.apache.axiom.ts.soap.SOAPTestCase;
+import org.apache.axiom.ts.soap.SOAPSample;
+import org.apache.axiom.ts.soap.SampleBasedSOAPTestCase;
 
-public class TestGetRelayWithParser extends SOAPTestCase {
+public class TestGetRelayWithParser extends SampleBasedSOAPTestCase {
     public TestGetRelayWithParser(OMMetaFactory metaFactory) {
-        super(metaFactory, SOAPSpec.SOAP12);
+        super(metaFactory, SOAPSample.SOAP12_RELAY);
     }
 
     @Override
-    protected void runTest() throws Throwable {
-        Iterator<SOAPHeaderBlock> iterator = getTestMessage(MESSAGE).getHeader().examineAllHeaderBlocks();
+    protected void runTest(SOAPEnvelope envelope) throws Throwable {
+        Iterator<SOAPHeaderBlock> iterator = envelope.getHeader().examineAllHeaderBlocks();
         assertFalse(iterator.next().getRelay());
         assertTrue(iterator.next().getRelay());
         assertFalse(iterator.next().getRelay());

Modified: webservices/axiom/trunk/testing/soap-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPSample.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/soap-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPSample.java?rev=1796217&r1=1796216&r2=1796217&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/soap-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPSample.java
(original)
+++ webservices/axiom/trunk/testing/soap-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPSample.java
Thu May 25 22:23:26 2017
@@ -45,6 +45,11 @@ public class SOAPSample extends XMLSampl
      */
     public static final SOAPSample SOAP12_FAULT = new SimpleSOAPSample(SOAPSpec.SOAP12, "test-message/soap12/fault.xml",
"soap12/fault.xml");
     
+    /**
+     * A SOAP 1.2 message that uses the relay attribute.
+     */
+    public static final SOAPSample SOAP12_RELAY = new SimpleSOAPSample(SOAPSpec.SOAP12, "test-message/soap12/relay.xml",
"soap12/relay.xml");
+    
     private final SOAPSpec spec;
     
     SOAPSample(SOAPSpec spec, MessageContent content, String name) {

Copied: webservices/axiom/trunk/testing/soap-testsuite/src/main/resources/test-message/soap12/relay.xml
(from r1796216, webservices/axiom/trunk/axiom-api/src/test/resources/soap/soap12/message.xml)
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/soap-testsuite/src/main/resources/test-message/soap12/relay.xml?p2=webservices/axiom/trunk/testing/soap-testsuite/src/main/resources/test-message/soap12/relay.xml&p1=webservices/axiom/trunk/axiom-api/src/test/resources/soap/soap12/message.xml&r1=1796216&r2=1796217&rev=1796217&view=diff
==============================================================================
--- webservices/axiom/trunk/axiom-api/src/test/resources/soap/soap12/message.xml (original)
+++ webservices/axiom/trunk/testing/soap-testsuite/src/main/resources/test-message/soap12/relay.xml
Thu May 25 22:23:26 2017
@@ -1,22 +1,3 @@
-<!--
-  ~ 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.
-  -->
-
 <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:xml="http://www.w3.org/XML/1998/namespace">
     <env:Header>
         <test:echoOk xmlns:test="http://example.org/ts-tests"
@@ -39,38 +20,6 @@
         </test2:echoOk2>
     </env:Header>
     <env:Body>
-        <env:Fault xmlns:m="http:www.sample.org">
-            <env:Code>
-                <env:Value>env:Sender</env:Value>
-                <env:Subcode>
-                    <env:Value>m:MessageTimeout_In_First_Subcode</env:Value>
-                    <env:Subcode>
-                        <env:Value>m:MessageTimeout_In_Second_Subcode</env:Value>
-                        <env:Subcode>
-                            <env:Value>m:MessageTimeout_In_Third_Subcode</env:Value>
-                        </env:Subcode>
-                    </env:Subcode>
-                </env:Subcode>
-            </env:Code>
-            <env:Reason>
-                <env:Text xml:lang="en">Sender Timeout</env:Text>
-            </env:Reason>
-            <env:Node>
-                http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver
-            </env:Node>
-            <env:Role>
-                ultimateReceiver
-            </env:Role>
-            <env:Detail>
-                <m:MaxTime m:detail="This is only a test">
-                    P5M\n
-                </m:MaxTime>
-                <m:AveTime>
-                    <m:Time>
-                        P3M\n
-                    </m:Time>
-                </m:AveTime>
-            </env:Detail>
-        </env:Fault>
+        <p:echo xmlns:p="urn:echo"/>
     </env:Body>
 </env:Envelope>
\ No newline at end of file



Mime
View raw message