You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by ve...@apache.org on 2014/06/04 19:07:42 UTC

svn commit: r1600356 - 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...

Author: veithen
Date: Wed Jun  4 17:07:41 2014
New Revision: 1600356

URL: http://svn.apache.org/r1600356
Log:
AXIOM-447 - Iteration 5 - Tests: Added test cases with JAXB2 data binding.

Added:
    webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/jaxb2/
    webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/jaxb2/GetQuoteRequest.java   (with props)
    webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/jaxb2/GetQuoteResponse.java   (with props)
    webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/jaxb2/JAXB2Test.java   (with props)
    webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/jaxb2/StockQuoteEndpoint.java   (with props)
    webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/jaxb2/
    webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/jaxb2/client.xml   (with props)
    webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/jaxb2/server.xml   (with props)
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/SpringWSTestSuiteBuilder.java
    webservices/axiom/trunk/axiom-spring-ws/src/test/java/org/apache/axiom/spring/ws/test/DOOMSpringWSTest.java
    webservices/axiom/trunk/axiom-spring-ws/src/test/java/org/apache/axiom/spring/ws/test/LLOMSpringWSTest.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=1600356&r1=1600355&r2=1600356&view=diff
==============================================================================
--- webservices/axiom/trunk/axiom-spring-ws-testsuite/pom.xml (original)
+++ webservices/axiom/trunk/axiom-spring-ws-testsuite/pom.xml Wed Jun  4 17:07:41 2014
@@ -68,6 +68,19 @@
             <artifactId>jaxen</artifactId>
         </dependency>
         <dependency>
+            <groupId>javax.xml.bind</groupId>
+            <artifactId>jaxb-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.sun.xml.bind</groupId>
+            <artifactId>jaxb-impl</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-oxm</artifactId>
+            <version>3.2.9.RELEASE</version>
+        </dependency>
+        <dependency>
             <groupId>log4j</groupId>
             <artifactId>log4j</artifactId>
             <scope>test</scope>

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=1600356&r1=1600355&r2=1600356&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 Wed Jun  4 17:07:41 2014
@@ -19,6 +19,7 @@
 package org.apache.axiom.ts.springws;
 
 import org.apache.axiom.testutils.suite.MatrixTestSuiteBuilder;
+import org.apache.axiom.ts.springws.jaxb2.JAXB2Test;
 import org.apache.axiom.ts.springws.jdom.ClientServerTest;
 import org.apache.axiom.ts.springws.wsadom.WSAddressingDOMTest;
 
@@ -45,5 +46,6 @@ public class SpringWSTestSuiteBuilder ex
     private void addTests(ScenarioConfig config, String soapVersion) {
         addTest(new ClientServerTest(config, soapVersion));
         addTest(new WSAddressingDOMTest(config, soapVersion));
+        addTest(new JAXB2Test(config, soapVersion));
     }
 }

Added: webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/jaxb2/GetQuoteRequest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/jaxb2/GetQuoteRequest.java?rev=1600356&view=auto
==============================================================================
--- webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/jaxb2/GetQuoteRequest.java (added)
+++ webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/jaxb2/GetQuoteRequest.java Wed Jun  4 17:07:41 2014
@@ -0,0 +1,36 @@
+/*
+ * 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.jaxb2;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlRootElement(namespace="urn:stockquote", name="GetQuote")
+@XmlType
+public class GetQuoteRequest {
+    private String symbol;
+
+    public String getSymbol() {
+        return symbol;
+    }
+
+    public void setSymbol(String symbol) {
+        this.symbol = symbol;
+    }
+}

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

Added: webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/jaxb2/GetQuoteResponse.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/jaxb2/GetQuoteResponse.java?rev=1600356&view=auto
==============================================================================
--- webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/jaxb2/GetQuoteResponse.java (added)
+++ webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/jaxb2/GetQuoteResponse.java Wed Jun  4 17:07:41 2014
@@ -0,0 +1,36 @@
+/*
+ * 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.jaxb2;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlRootElement(namespace="urn:stockquote", name="GetQuoteResponse")
+@XmlType
+public class GetQuoteResponse {
+    private double price;
+
+    public double getPrice() {
+        return price;
+    }
+
+    public void setPrice(double price) {
+        this.price = price;
+    }
+}

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

Added: 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=1600356&view=auto
==============================================================================
--- webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/jaxb2/JAXB2Test.java (added)
+++ webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/jaxb2/JAXB2Test.java Wed Jun  4 17:07:41 2014
@@ -0,0 +1,36 @@
+/*
+ * 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.jaxb2;
+
+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);
+    }
+    
+    @Override
+    protected void runTest() throws Throwable {
+        GetQuoteRequest request = new GetQuoteRequest();
+        request.setSymbol("GOOG");
+        context.getBean(WebServiceTemplate.class).marshalSendAndReceive(request);
+    }
+}

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

Added: webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/jaxb2/StockQuoteEndpoint.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/jaxb2/StockQuoteEndpoint.java?rev=1600356&view=auto
==============================================================================
--- webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/jaxb2/StockQuoteEndpoint.java (added)
+++ webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/jaxb2/StockQuoteEndpoint.java Wed Jun  4 17:07:41 2014
@@ -0,0 +1,35 @@
+/*
+ * 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.jaxb2;
+
+import org.springframework.ws.server.endpoint.annotation.Endpoint;
+import org.springframework.ws.server.endpoint.annotation.PayloadRoot;
+import org.springframework.ws.server.endpoint.annotation.RequestPayload;
+import org.springframework.ws.server.endpoint.annotation.ResponsePayload;
+
+@Endpoint
+public class StockQuoteEndpoint {
+    @PayloadRoot(namespace="urn:stockquote", localPart="GetQuote")
+    @ResponsePayload
+    public GetQuoteResponse getQuote(@RequestPayload GetQuoteRequest request) {
+        GetQuoteResponse response = new GetQuoteResponse();
+        response.setPrice(105.37);
+        return response;
+    }
+}

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

Added: webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/jaxb2/client.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/jaxb2/client.xml?rev=1600356&view=auto
==============================================================================
--- webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/jaxb2/client.xml (added)
+++ webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/jaxb2/client.xml Wed Jun  4 17:07:41 2014
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:oxm="http://www.springframework.org/schema/oxm"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="
+         http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
+         http://www.springframework.org/schema/oxm http://www.springframework.org/schema/oxm/spring-oxm-3.2.xsd">
+    <oxm:jaxb2-marshaller id="marshaller">
+        <oxm:class-to-be-bound name="org.apache.axiom.ts.springws.jaxb2.GetQuoteRequest"/>
+        <oxm:class-to-be-bound name="org.apache.axiom.ts.springws.jaxb2.GetQuoteResponse"/>
+    </oxm:jaxb2-marshaller>
+    <bean class="org.springframework.ws.client.core.WebServiceTemplate">
+        <constructor-arg ref="messageFactory"/>
+        <property name="marshaller" ref="marshaller"/>
+        <property name="unmarshaller" ref="marshaller"/>
+        <property name="defaultUri" value="http://localhost:${port}/"/>
+    </bean>
+</beans>

Propchange: webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/jaxb2/client.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/jaxb2/server.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/jaxb2/server.xml?rev=1600356&view=auto
==============================================================================
--- webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/jaxb2/server.xml (added)
+++ webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/jaxb2/server.xml Wed Jun  4 17:07:41 2014
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:sws="http://www.springframework.org/schema/web-services"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="
+         http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
+         http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
+         http://www.springframework.org/schema/web-services http://www.springframework.org/schema/web-services/web-services-2.0.xsd">
+    <context:component-scan base-package="org.apache.axiom.ts.springws.jaxb2"/>
+    <sws:annotation-driven/>
+</beans>

Propchange: webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/jaxb2/server.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: webservices/axiom/trunk/axiom-spring-ws/src/test/java/org/apache/axiom/spring/ws/test/DOOMSpringWSTest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-spring-ws/src/test/java/org/apache/axiom/spring/ws/test/DOOMSpringWSTest.java?rev=1600356&r1=1600355&r2=1600356&view=diff
==============================================================================
--- webservices/axiom/trunk/axiom-spring-ws/src/test/java/org/apache/axiom/spring/ws/test/DOOMSpringWSTest.java (original)
+++ webservices/axiom/trunk/axiom-spring-ws/src/test/java/org/apache/axiom/spring/ws/test/DOOMSpringWSTest.java Wed Jun  4 17:07:41 2014
@@ -21,6 +21,7 @@ package org.apache.axiom.spring.ws.test;
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.ts.springws.MessageFactoryConfigurator;
 import org.apache.axiom.ts.springws.SpringWSTestSuiteBuilder;
+import org.apache.axiom.ts.springws.jaxb2.JAXB2Test;
 
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
@@ -29,6 +30,9 @@ public class DOOMSpringWSTest extends Te
     public static TestSuite suite() {
         SpringWSTestSuiteBuilder builder = new SpringWSTestSuiteBuilder(new AxiomMessageFactoryConfigurator(OMAbstractFactory.FEATURE_DOM), MessageFactoryConfigurator.SAAJ);
         
+        // TODO: Iteration 5
+        builder.exclude(JAXB2Test.class);
+        
         return builder.build();
     }
 }

Modified: webservices/axiom/trunk/axiom-spring-ws/src/test/java/org/apache/axiom/spring/ws/test/LLOMSpringWSTest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-spring-ws/src/test/java/org/apache/axiom/spring/ws/test/LLOMSpringWSTest.java?rev=1600356&r1=1600355&r2=1600356&view=diff
==============================================================================
--- webservices/axiom/trunk/axiom-spring-ws/src/test/java/org/apache/axiom/spring/ws/test/LLOMSpringWSTest.java (original)
+++ webservices/axiom/trunk/axiom-spring-ws/src/test/java/org/apache/axiom/spring/ws/test/LLOMSpringWSTest.java Wed Jun  4 17:07:41 2014
@@ -21,6 +21,7 @@ package org.apache.axiom.spring.ws.test;
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.ts.springws.MessageFactoryConfigurator;
 import org.apache.axiom.ts.springws.SpringWSTestSuiteBuilder;
+import org.apache.axiom.ts.springws.jaxb2.JAXB2Test;
 
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
@@ -29,6 +30,9 @@ public class LLOMSpringWSTest extends Te
     public static TestSuite suite() {
         SpringWSTestSuiteBuilder builder = new SpringWSTestSuiteBuilder(new AxiomMessageFactoryConfigurator(OMAbstractFactory.FEATURE_DEFAULT), MessageFactoryConfigurator.SAAJ);
         
+        // TODO: Iteration 5
+        builder.exclude(JAXB2Test.class);
+        
         return builder.build();
     }
 }