ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1603082 - in /webservices/axiom/trunk: axiom-spring-ws-testsuite/ axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/ axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/jaxb2/ axiom-spring-ws-testsuite/s...
Date Tue, 17 Jun 2014 07:54:20 GMT
Author: veithen
Date: Tue Jun 17 07:54:20 2014
New Revision: 1603082

URL: http://svn.apache.org/r1603082
Log:
Add tests for the SoapMessageFactory#createWebServiceMessage methods.

Added:
    webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/SOAPSpecAdapter.java
      - copied, changed from r1603081, webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/jaxb2/JAXB2Test.java
    webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/SOAPSpecAdapterFactory.java
      - copied, changed from r1603081, webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/jaxb2/JAXB2Test.java
    webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/SimpleTestCase.java
  (with props)
    webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/SpringWSTestCase.java
  (with props)
    webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/soap/
    webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/soap/messagefactory/
    webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/soap/messagefactory/TestCreateWebServiceMessage.java
  (with props)
    webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/soap/messagefactory/TestCreateWebServiceMessageFromInputStream.java
  (with props)
    webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/resources/META-INF/
    webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/resources/META-INF/services/
    webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/resources/META-INF/services/org.apache.axiom.ts.soap.AdapterFactory
Modified:
    webservices/axiom/trunk/axiom-spring-ws-testsuite/pom.xml
    webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/ScenarioTestCase.java
    webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/SpringWSTestSuiteBuilder.java
    webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/jaxb2/JAXB2Test.java
    webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/jdom/ClientServerTest.java
    webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/wsadom/WSAddressingDOMTest.java
    webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/AxiomSoapMessageFactory.java

Modified: webservices/axiom/trunk/axiom-spring-ws-testsuite/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-spring-ws-testsuite/pom.xml?rev=1603082&r1=1603081&r2=1603082&view=diff
==============================================================================
--- webservices/axiom/trunk/axiom-spring-ws-testsuite/pom.xml (original)
+++ webservices/axiom/trunk/axiom-spring-ws-testsuite/pom.xml Tue Jun 17 07:54:20 2014
@@ -37,6 +37,11 @@
             <version>${project.version}</version>
         </dependency>
         <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>soap-testsuite</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-jcl</artifactId>
             <version>1.6.6</version>

Copied: webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/SOAPSpecAdapter.java
(from r1603081, webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/jaxb2/JAXB2Test.java)
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/SOAPSpecAdapter.java?p2=webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/SOAPSpecAdapter.java&p1=webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/jaxb2/JAXB2Test.java&r1=1603081&r2=1603082&rev=1603082&view=diff
==============================================================================
--- webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/jaxb2/JAXB2Test.java
(original)
+++ webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/SOAPSpecAdapter.java
Tue Jun 17 07:54:20 2014
@@ -16,21 +16,16 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.axiom.ts.springws.jaxb2;
+package org.apache.axiom.ts.springws;
 
-import org.apache.axiom.ts.springws.ScenarioConfig;
-import org.apache.axiom.ts.springws.ScenarioTestCase;
-import org.springframework.ws.client.core.WebServiceTemplate;
+public final class SOAPSpecAdapter {
+    private final String soapVersion;
 
-public class JAXB2Test extends ScenarioTestCase {
-    public JAXB2Test(ScenarioConfig config, String soapVersion) {
-        super(config, soapVersion);
+    SOAPSpecAdapter(String soapVersion) {
+        this.soapVersion = soapVersion;
     }
-    
-    @Override
-    protected void runTest() throws Throwable {
-        GetQuoteRequest request = new GetQuoteRequest();
-        request.setSymbol("GOOG");
-        context.getBean(WebServiceTemplate.class).marshalSendAndReceive(request);
+
+    public String getSoapVersion() {
+        return soapVersion;
     }
 }

Copied: webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/SOAPSpecAdapterFactory.java
(from r1603081, webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/jaxb2/JAXB2Test.java)
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/SOAPSpecAdapterFactory.java?p2=webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/SOAPSpecAdapterFactory.java&p1=webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/jaxb2/JAXB2Test.java&r1=1603081&r2=1603082&rev=1603082&view=diff
==============================================================================
--- webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/jaxb2/JAXB2Test.java
(original)
+++ webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/SOAPSpecAdapterFactory.java
Tue Jun 17 07:54:20 2014
@@ -16,21 +16,14 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.axiom.ts.springws.jaxb2;
+package org.apache.axiom.ts.springws;
 
-import org.apache.axiom.ts.springws.ScenarioConfig;
-import org.apache.axiom.ts.springws.ScenarioTestCase;
-import org.springframework.ws.client.core.WebServiceTemplate;
+import org.apache.axiom.ts.soap.AdapterFactory;
+import org.apache.axiom.ts.soap.Adapters;
+import org.apache.axiom.ts.soap.SOAPSpec;
 
-public class JAXB2Test extends ScenarioTestCase {
-    public JAXB2Test(ScenarioConfig config, String soapVersion) {
-        super(config, soapVersion);
-    }
-    
-    @Override
-    protected void runTest() throws Throwable {
-        GetQuoteRequest request = new GetQuoteRequest();
-        request.setSymbol("GOOG");
-        context.getBean(WebServiceTemplate.class).marshalSendAndReceive(request);
+public class SOAPSpecAdapterFactory implements AdapterFactory<SOAPSpec> {
+    public void createAdapters(SOAPSpec spec, Adapters adapters) {
+        adapters.add(SOAPSpecAdapter.class, new SOAPSpecAdapter(spec == SOAPSpec.SOAP11 ?
"SOAP_11" : "SOAP_12"));
     }
 }

Modified: webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/ScenarioTestCase.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/ScenarioTestCase.java?rev=1603082&r1=1603081&r2=1603082&view=diff
==============================================================================
--- webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/ScenarioTestCase.java
(original)
+++ webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/ScenarioTestCase.java
Tue Jun 17 07:54:20 2014
@@ -18,7 +18,7 @@
  */
 package org.apache.axiom.ts.springws;
 
-import org.apache.axiom.testutils.suite.MatrixTestCase;
+import org.apache.axiom.ts.soap.SOAPSpec;
 import org.eclipse.jetty.server.Connector;
 import org.eclipse.jetty.server.Server;
 import org.eclipse.jetty.server.nio.SelectChannelConnector;
@@ -36,16 +36,16 @@ import org.springframework.mock.env.Mock
 import org.springframework.web.context.support.GenericWebApplicationContext;
 import org.springframework.ws.transport.http.MessageDispatcherServlet;
 
-public abstract class ScenarioTestCase extends MatrixTestCase {
+public abstract class ScenarioTestCase extends SpringWSTestCase {
     private final ScenarioConfig config;
     private Server server;
     protected GenericXmlApplicationContext context;
     
-    public ScenarioTestCase(ScenarioConfig config, String soapVersion) {
+    public ScenarioTestCase(ScenarioConfig config, SOAPSpec spec) {
+        super(spec);
         this.config = config;
         addTestParameter("client", config.getClientMessageFactoryConfigurator().getName());
         addTestParameter("server", config.getServerMessageFactoryConfigurator().getName());
-        addTestParameter("soapVersion", soapVersion);
     }
     
     @Override
@@ -65,7 +65,8 @@ public abstract class ScenarioTestCase e
         servlet.setContextClass(GenericWebApplicationContext.class);
         servlet.setContextInitializers(new ApplicationContextInitializer<ConfigurableApplicationContext>()
{
             public void initialize(ConfigurableApplicationContext applicationContext) {
-                configureContext((GenericWebApplicationContext)applicationContext, config.getServerMessageFactoryConfigurator(),
"server.xml");
+                configureContext((GenericWebApplicationContext)applicationContext, config.getServerMessageFactoryConfigurator(),
+                        new ClassPathResource("server.xml", ScenarioTestCase.this.getClass()));
             }
         });
         ServletHolder servletHolder = new ServletHolder(servlet);
@@ -78,19 +79,11 @@ public abstract class ScenarioTestCase e
         MockPropertySource propertySource = new MockPropertySource("client-properties");
         propertySource.setProperty("port", connector.getLocalPort());
         context.getEnvironment().getPropertySources().replace(StandardEnvironment.SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME,
propertySource);
-        configureContext(context, config.getClientMessageFactoryConfigurator(), "client.xml");
+        configureContext(context, config.getClientMessageFactoryConfigurator(), new ClassPathResource("client.xml",
getClass()));
+
         context.refresh();
     }
     
-    void configureContext(GenericApplicationContext context, MessageFactoryConfigurator messageFactoryConfigurator,
String relativeConfigLocation) {
-        context.getEnvironment().getPropertySources().addFirst(new MatrixTestCasePropertySource(this));
-        messageFactoryConfigurator.configure(context);
-        XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(context);
-        reader.loadBeanDefinitions(
-                new ClassPathResource("common.xml", ScenarioTestCase.class),
-                new ClassPathResource(relativeConfigLocation, getClass()));
-    }
-    
     @Override
     protected void tearDown() throws Exception {
         context.close();

Added: webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/SimpleTestCase.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/SimpleTestCase.java?rev=1603082&view=auto
==============================================================================
--- webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/SimpleTestCase.java
(added)
+++ webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/SimpleTestCase.java
Tue Jun 17 07:54:20 2014
@@ -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.springws;
+
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.springframework.context.support.GenericApplicationContext;
+import org.springframework.ws.soap.SoapMessageFactory;
+
+public abstract class SimpleTestCase extends SpringWSTestCase {
+    private final MessageFactoryConfigurator mfc;
+    
+    public SimpleTestCase(MessageFactoryConfigurator mfc, SOAPSpec spec) {
+        super(spec);
+        this.mfc = mfc;
+    }
+
+    @Override
+    protected final void runTest() throws Throwable {
+        GenericApplicationContext context = new GenericApplicationContext();
+        configureContext(context, mfc, null);
+        context.refresh();
+        try {
+            runTest((SoapMessageFactory)context.getBean("messageFactory"));
+        } finally {
+            context.close();
+        }
+    }
+
+    protected abstract void runTest(SoapMessageFactory messageFactory) throws Throwable;
+}

Propchange: webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/SimpleTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/SpringWSTestCase.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/SpringWSTestCase.java?rev=1603082&view=auto
==============================================================================
--- webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/SpringWSTestCase.java
(added)
+++ webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/SpringWSTestCase.java
Tue Jun 17 07:54:20 2014
@@ -0,0 +1,45 @@
+/*
+ * 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.springws;
+
+import org.apache.axiom.testutils.suite.MatrixTestCase;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
+import org.springframework.context.support.GenericApplicationContext;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.core.io.Resource;
+
+public abstract class SpringWSTestCase extends MatrixTestCase {
+    protected final SOAPSpec spec;
+    
+    public SpringWSTestCase(SOAPSpec spec) {
+        this.spec = spec;
+        addTestParameter("soapVersion", spec.getAdapter(SOAPSpecAdapter.class).getSoapVersion());
+    }
+    
+    void configureContext(GenericApplicationContext context, MessageFactoryConfigurator messageFactoryConfigurator,
Resource configResource) {
+        context.getEnvironment().getPropertySources().addFirst(new MatrixTestCasePropertySource(this));
+        messageFactoryConfigurator.configure(context);
+        XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(context);
+        reader.loadBeanDefinitions(new ClassPathResource("common.xml", ScenarioTestCase.class));
+        if (configResource != null) {
+            reader.loadBeanDefinitions(configResource);
+        }
+    }
+}

Propchange: webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/SpringWSTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/SpringWSTestSuiteBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/SpringWSTestSuiteBuilder.java?rev=1603082&r1=1603081&r2=1603082&view=diff
==============================================================================
--- webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/SpringWSTestSuiteBuilder.java
(original)
+++ webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/SpringWSTestSuiteBuilder.java
Tue Jun 17 07:54:20 2014
@@ -19,8 +19,11 @@
 package org.apache.axiom.ts.springws;
 
 import org.apache.axiom.testutils.suite.MatrixTestSuiteBuilder;
+import org.apache.axiom.ts.soap.SOAPSpec;
 import org.apache.axiom.ts.springws.jaxb2.JAXB2Test;
 import org.apache.axiom.ts.springws.jdom.ClientServerTest;
+import org.apache.axiom.ts.springws.soap.messagefactory.TestCreateWebServiceMessage;
+import org.apache.axiom.ts.springws.soap.messagefactory.TestCreateWebServiceMessageFromInputStream;
 import org.apache.axiom.ts.springws.wsadom.WSAddressingDOMTest;
 
 public class SpringWSTestSuiteBuilder extends MatrixTestSuiteBuilder {
@@ -35,17 +38,24 @@ public class SpringWSTestSuiteBuilder ex
 
     @Override
     protected void addTests() {
-        addTests(new ScenarioConfig(altMessageFactoryConfigurator, messageFactoryConfigurator),
"SOAP_11");
-        addTests(new ScenarioConfig(altMessageFactoryConfigurator, messageFactoryConfigurator),
"SOAP_12");
+        addSimpleTests(messageFactoryConfigurator, SOAPSpec.SOAP11);
+        addSimpleTests(messageFactoryConfigurator, SOAPSpec.SOAP12);
+        addScenarioTests(new ScenarioConfig(altMessageFactoryConfigurator, messageFactoryConfigurator),
SOAPSpec.SOAP11);
+        addScenarioTests(new ScenarioConfig(altMessageFactoryConfigurator, messageFactoryConfigurator),
SOAPSpec.SOAP12);
         if (altMessageFactoryConfigurator != messageFactoryConfigurator) {
-            addTests(new ScenarioConfig(messageFactoryConfigurator, altMessageFactoryConfigurator),
"SOAP_11");
-            addTests(new ScenarioConfig(messageFactoryConfigurator, altMessageFactoryConfigurator),
"SOAP_12");
+            addScenarioTests(new ScenarioConfig(messageFactoryConfigurator, altMessageFactoryConfigurator),
SOAPSpec.SOAP11);
+            addScenarioTests(new ScenarioConfig(messageFactoryConfigurator, altMessageFactoryConfigurator),
SOAPSpec.SOAP12);
         }
     }
     
-    private void addTests(ScenarioConfig config, String soapVersion) {
-        addTest(new ClientServerTest(config, soapVersion));
-        addTest(new WSAddressingDOMTest(config, soapVersion));
-        addTest(new JAXB2Test(config, soapVersion));
+    private void addSimpleTests(MessageFactoryConfigurator mfc, SOAPSpec spec) {
+        addTest(new TestCreateWebServiceMessage(mfc, spec));
+        addTest(new TestCreateWebServiceMessageFromInputStream(mfc, spec));
+    }
+    
+    private void addScenarioTests(ScenarioConfig config, SOAPSpec spec) {
+        addTest(new ClientServerTest(config, spec));
+        addTest(new WSAddressingDOMTest(config, spec));
+        addTest(new JAXB2Test(config, spec));
     }
 }

Modified: webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/jaxb2/JAXB2Test.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/jaxb2/JAXB2Test.java?rev=1603082&r1=1603081&r2=1603082&view=diff
==============================================================================
--- webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/jaxb2/JAXB2Test.java
(original)
+++ webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/jaxb2/JAXB2Test.java
Tue Jun 17 07:54:20 2014
@@ -18,13 +18,14 @@
  */
 package org.apache.axiom.ts.springws.jaxb2;
 
+import org.apache.axiom.ts.soap.SOAPSpec;
 import org.apache.axiom.ts.springws.ScenarioConfig;
 import org.apache.axiom.ts.springws.ScenarioTestCase;
 import org.springframework.ws.client.core.WebServiceTemplate;
 
 public class JAXB2Test extends ScenarioTestCase {
-    public JAXB2Test(ScenarioConfig config, String soapVersion) {
-        super(config, soapVersion);
+    public JAXB2Test(ScenarioConfig config, SOAPSpec spec) {
+        super(config, spec);
     }
     
     @Override

Modified: webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/jdom/ClientServerTest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/jdom/ClientServerTest.java?rev=1603082&r1=1603081&r2=1603082&view=diff
==============================================================================
--- webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/jdom/ClientServerTest.java
(original)
+++ webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/jdom/ClientServerTest.java
Tue Jun 17 07:54:20 2014
@@ -18,6 +18,7 @@
  */
 package org.apache.axiom.ts.springws.jdom;
 
+import org.apache.axiom.ts.soap.SOAPSpec;
 import org.apache.axiom.ts.springws.ScenarioConfig;
 import org.apache.axiom.ts.springws.ScenarioTestCase;
 import org.jdom2.input.SAXBuilder;
@@ -26,8 +27,8 @@ import org.jdom2.transform.JDOMSource;
 import org.springframework.ws.client.core.WebServiceTemplate;
 
 public class ClientServerTest extends ScenarioTestCase {
-    public ClientServerTest(ScenarioConfig config, String soapVersion) {
-        super(config, soapVersion);
+    public ClientServerTest(ScenarioConfig config, SOAPSpec spec) {
+        super(config, spec);
     }
     
     @Override

Added: webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/soap/messagefactory/TestCreateWebServiceMessage.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/soap/messagefactory/TestCreateWebServiceMessage.java?rev=1603082&view=auto
==============================================================================
--- webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/soap/messagefactory/TestCreateWebServiceMessage.java
(added)
+++ webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/soap/messagefactory/TestCreateWebServiceMessage.java
Tue Jun 17 07:54:20 2014
@@ -0,0 +1,55 @@
+/*
+ * 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.springws.soap.messagefactory;
+
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.springws.MessageFactoryConfigurator;
+import org.apache.axiom.ts.springws.SimpleTestCase;
+import org.springframework.ws.soap.SoapBody;
+import org.springframework.ws.soap.SoapEnvelope;
+import org.springframework.ws.soap.SoapHeader;
+import org.springframework.ws.soap.SoapMessage;
+import org.springframework.ws.soap.SoapMessageFactory;
+
+/**
+ * Tests the characteristics of the {@link SoapMessage} returned by
+ * {@link SoapMessageFactory#createWebServiceMessage()}.
+ */
+public class TestCreateWebServiceMessage extends SimpleTestCase {
+    public TestCreateWebServiceMessage(MessageFactoryConfigurator mfc, SOAPSpec spec) {
+        super(mfc, spec);
+    }
+
+    @Override
+    protected void runTest(SoapMessageFactory messageFactory) {
+        SoapMessage message = messageFactory.createWebServiceMessage();
+        
+        SoapEnvelope env = message.getEnvelope();
+        assertNotNull(env);
+        assertEquals(spec.getEnvelopeQName(), env.getName());
+        
+        SoapHeader header = env.getHeader();
+        assertNotNull(header);
+        assertEquals(spec.getHeaderQName(), header.getName());
+        
+        SoapBody body = env.getBody();
+        assertNotNull(body);
+        assertEquals(spec.getHeaderQName(), header.getName());
+    }
+}

Propchange: webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/soap/messagefactory/TestCreateWebServiceMessage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/soap/messagefactory/TestCreateWebServiceMessageFromInputStream.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/soap/messagefactory/TestCreateWebServiceMessageFromInputStream.java?rev=1603082&view=auto
==============================================================================
--- webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/soap/messagefactory/TestCreateWebServiceMessageFromInputStream.java
(added)
+++ webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/soap/messagefactory/TestCreateWebServiceMessageFromInputStream.java
Tue Jun 17 07:54:20 2014
@@ -0,0 +1,47 @@
+/*
+ * 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.springws.soap.messagefactory;
+
+import java.io.InputStream;
+
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.TestMessageSet;
+import org.apache.axiom.ts.springws.MessageFactoryConfigurator;
+import org.apache.axiom.ts.springws.SimpleTestCase;
+import org.springframework.ws.soap.SoapEnvelope;
+import org.springframework.ws.soap.SoapMessage;
+import org.springframework.ws.soap.SoapMessageFactory;
+
+/**
+ * Tests the characteristics of the {@link SoapMessage} returned by
+ * {@link SoapMessageFactory#createWebServiceMessage(InputStream)}.
+ */
+public class TestCreateWebServiceMessageFromInputStream extends SimpleTestCase {
+    public TestCreateWebServiceMessageFromInputStream(MessageFactoryConfigurator mfc, SOAPSpec
spec) {
+        super(mfc, spec);
+    }
+
+    @Override
+    protected void runTest(SoapMessageFactory messageFactory) throws Throwable {
+        SoapMessage message = messageFactory.createWebServiceMessage(TestMessageSet.NO_HEADER.getMessage(spec).getInputStream());
+        SoapEnvelope env = message.getEnvelope();
+        assertNull(env.getHeader());
+        assertNotNull(env.getBody());
+    }
+}

Propchange: webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/soap/messagefactory/TestCreateWebServiceMessageFromInputStream.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/wsadom/WSAddressingDOMTest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/wsadom/WSAddressingDOMTest.java?rev=1603082&r1=1603081&r2=1603082&view=diff
==============================================================================
--- webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/wsadom/WSAddressingDOMTest.java
(original)
+++ webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/wsadom/WSAddressingDOMTest.java
Tue Jun 17 07:54:20 2014
@@ -23,6 +23,7 @@ import javax.xml.parsers.DocumentBuilder
 import javax.xml.transform.dom.DOMResult;
 import javax.xml.transform.dom.DOMSource;
 
+import org.apache.axiom.ts.soap.SOAPSpec;
 import org.apache.axiom.ts.springws.ScenarioConfig;
 import org.apache.axiom.ts.springws.ScenarioTestCase;
 import org.springframework.ws.client.core.WebServiceTemplate;
@@ -31,8 +32,8 @@ import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
 public class WSAddressingDOMTest extends ScenarioTestCase {
-    public WSAddressingDOMTest(ScenarioConfig config, String soapVersion) {
-        super(config, soapVersion);
+    public WSAddressingDOMTest(ScenarioConfig config, SOAPSpec spec) {
+        super(config, spec);
     }
     
     @Override

Added: webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/resources/META-INF/services/org.apache.axiom.ts.soap.AdapterFactory
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/resources/META-INF/services/org.apache.axiom.ts.soap.AdapterFactory?rev=1603082&view=auto
==============================================================================
--- webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/resources/META-INF/services/org.apache.axiom.ts.soap.AdapterFactory
(added)
+++ webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/resources/META-INF/services/org.apache.axiom.ts.soap.AdapterFactory
Tue Jun 17 07:54:20 2014
@@ -0,0 +1 @@
+org.apache.axiom.ts.springws.SOAPSpecAdapterFactory
\ No newline at end of file

Modified: webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/AxiomSoapMessageFactory.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/AxiomSoapMessageFactory.java?rev=1603082&r1=1603081&r2=1603082&view=diff
==============================================================================
--- webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/AxiomSoapMessageFactory.java
(original)
+++ webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/AxiomSoapMessageFactory.java
Tue Jun 17 07:54:20 2014
@@ -79,19 +79,25 @@ public final class AxiomSoapMessageFacto
     }
 
     public SoapMessage createWebServiceMessage(InputStream inputStream) throws IOException
{
-        TransportInputStream transportInputStream = (TransportInputStream)inputStream;
-        Iterator<String> it = transportInputStream.getHeaders(TransportConstants.HEADER_CONTENT_TYPE);
-        ContentType contentType;
-        if (it.hasNext()) {
-            try {
-                contentType = new ContentType(it.next());
-            } catch (ParseException ex) {
-                throw new SoapMessageCreationException("Failed to parse Content-Type header",
ex);
+        String charset;
+        if (inputStream instanceof TransportInputStream) {
+            TransportInputStream transportInputStream = (TransportInputStream)inputStream;
+            Iterator<String> it = transportInputStream.getHeaders(TransportConstants.HEADER_CONTENT_TYPE);
+            ContentType contentType;
+            if (it.hasNext()) {
+                try {
+                    contentType = new ContentType(it.next());
+                } catch (ParseException ex) {
+                    throw new SoapMessageCreationException("Failed to parse Content-Type
header", ex);
+                }
+            } else {
+                throw new SoapMessageCreationException("No Content-Type header found");
             }
+            charset = contentType.getParameter("charset");
         } else {
-            throw new SoapMessageCreationException("No Content-Type header found");
+            charset = null;
         }
-        SOAPModelBuilder builder = OMXMLBuilderFactory.createSOAPModelBuilder(metaFactory,
inputStream, contentType.getParameter("charset"));
+        SOAPModelBuilder builder = OMXMLBuilderFactory.createSOAPModelBuilder(metaFactory,
inputStream, charset);
         // TODO: should SOAPModelBuilder have a getSOAPMessage() method?
         // TODO: need to check that the SOAP version matches the content type
         return new SoapMessageImpl((SOAPMessage)builder.getDocument());



Mime
View raw message