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/25 21:16:24 UTC

svn commit: r1605563 - in /webservices/axiom/trunk/testsuites/spring-ws-testsuite: ./ src/main/java/org/apache/axiom/ts/springws/ src/main/java/org/apache/axiom/ts/springws/scenario/castor/ src/main/resources/org/apache/axiom/ts/springws/scenario/castor/

Author: veithen
Date: Wed Jun 25 19:16:23 2014
New Revision: 1605563

URL: http://svn.apache.org/r1605563
Log:
AXIOM-447: Added a test case that uses Castor data binding.

Added:
    webservices/axiom/trunk/testsuites/spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/castor/
    webservices/axiom/trunk/testsuites/spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/castor/CastorTest.java   (with props)
    webservices/axiom/trunk/testsuites/spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/castor/GetQuoteRequest.java   (with props)
    webservices/axiom/trunk/testsuites/spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/castor/GetQuoteResponse.java   (with props)
    webservices/axiom/trunk/testsuites/spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/castor/StockQuoteEndpoint.java   (with props)
    webservices/axiom/trunk/testsuites/spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/scenario/castor/
    webservices/axiom/trunk/testsuites/spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/scenario/castor/client.xml   (with props)
    webservices/axiom/trunk/testsuites/spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/scenario/castor/mapping.xml   (with props)
    webservices/axiom/trunk/testsuites/spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/scenario/castor/server.xml   (with props)
Modified:
    webservices/axiom/trunk/testsuites/spring-ws-testsuite/pom.xml
    webservices/axiom/trunk/testsuites/spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/SpringWSTestSuiteBuilder.java

Modified: webservices/axiom/trunk/testsuites/spring-ws-testsuite/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testsuites/spring-ws-testsuite/pom.xml?rev=1605563&r1=1605562&r2=1605563&view=diff
==============================================================================
--- webservices/axiom/trunk/testsuites/spring-ws-testsuite/pom.xml (original)
+++ webservices/axiom/trunk/testsuites/spring-ws-testsuite/pom.xml Wed Jun 25 19:16:23 2014
@@ -84,6 +84,11 @@
             <version>3.2.9.RELEASE</version>
         </dependency>
         <dependency>
+            <groupId>org.codehaus.castor</groupId>
+            <artifactId>castor</artifactId>
+            <version>1.2</version>
+        </dependency>
+        <dependency>
             <groupId>log4j</groupId>
             <artifactId>log4j</artifactId>
             <scope>test</scope>

Modified: webservices/axiom/trunk/testsuites/spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/SpringWSTestSuiteBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testsuites/spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/SpringWSTestSuiteBuilder.java?rev=1605563&r1=1605562&r2=1605563&view=diff
==============================================================================
--- webservices/axiom/trunk/testsuites/spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/SpringWSTestSuiteBuilder.java (original)
+++ webservices/axiom/trunk/testsuites/spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/SpringWSTestSuiteBuilder.java Wed Jun 25 19:16:23 2014
@@ -22,6 +22,7 @@ import org.apache.axiom.testutils.suite.
 import org.apache.axiom.ts.soap.SOAPSpec;
 import org.apache.axiom.ts.springws.scenario.ScenarioConfig;
 import org.apache.axiom.ts.springws.scenario.broker.BrokerScenarioTest;
+import org.apache.axiom.ts.springws.scenario.castor.CastorTest;
 import org.apache.axiom.ts.springws.scenario.jaxb2.JAXB2Test;
 import org.apache.axiom.ts.springws.scenario.jdom.ClientServerTest;
 import org.apache.axiom.ts.springws.scenario.wsadom.WSAddressingDOMTest;
@@ -59,6 +60,7 @@ public class SpringWSTestSuiteBuilder ex
         addTest(new ClientServerTest(config, spec));
         addTest(new WSAddressingDOMTest(config, spec));
         addTest(new JAXB2Test(config, spec));
+        addTest(new CastorTest(config, spec));
         addTest(new BrokerScenarioTest(config, spec));
     }
 }

Added: webservices/axiom/trunk/testsuites/spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/castor/CastorTest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testsuites/spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/castor/CastorTest.java?rev=1605563&view=auto
==============================================================================
--- webservices/axiom/trunk/testsuites/spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/castor/CastorTest.java (added)
+++ webservices/axiom/trunk/testsuites/spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/castor/CastorTest.java Wed Jun 25 19:16:23 2014
@@ -0,0 +1,37 @@
+/*
+ * 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.scenario.castor;
+
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.springws.scenario.ScenarioConfig;
+import org.apache.axiom.ts.springws.scenario.ScenarioTestCase;
+import org.springframework.ws.client.core.WebServiceTemplate;
+
+public class CastorTest extends ScenarioTestCase {
+    public CastorTest(ScenarioConfig config, SOAPSpec spec) {
+        super(config, spec);
+    }
+    
+    @Override
+    protected void runTest() throws Throwable {
+        GetQuoteRequest request = new GetQuoteRequest();
+        request.setSymbol("GOOG");
+        context.getBean(WebServiceTemplate.class).marshalSendAndReceive(request);
+    }
+}

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

Added: webservices/axiom/trunk/testsuites/spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/castor/GetQuoteRequest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testsuites/spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/castor/GetQuoteRequest.java?rev=1605563&view=auto
==============================================================================
--- webservices/axiom/trunk/testsuites/spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/castor/GetQuoteRequest.java (added)
+++ webservices/axiom/trunk/testsuites/spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/castor/GetQuoteRequest.java Wed Jun 25 19:16:23 2014
@@ -0,0 +1,31 @@
+/*
+ * 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.scenario.castor;
+
+public class GetQuoteRequest {
+    private String symbol;
+
+    public String getSymbol() {
+        return symbol;
+    }
+
+    public void setSymbol(String symbol) {
+        this.symbol = symbol;
+    }
+}

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

Added: webservices/axiom/trunk/testsuites/spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/castor/GetQuoteResponse.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testsuites/spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/castor/GetQuoteResponse.java?rev=1605563&view=auto
==============================================================================
--- webservices/axiom/trunk/testsuites/spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/castor/GetQuoteResponse.java (added)
+++ webservices/axiom/trunk/testsuites/spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/castor/GetQuoteResponse.java Wed Jun 25 19:16:23 2014
@@ -0,0 +1,31 @@
+/*
+ * 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.scenario.castor;
+
+public class GetQuoteResponse {
+    private double price;
+
+    public double getPrice() {
+        return price;
+    }
+
+    public void setPrice(double price) {
+        this.price = price;
+    }
+}

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

Added: webservices/axiom/trunk/testsuites/spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/castor/StockQuoteEndpoint.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testsuites/spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/castor/StockQuoteEndpoint.java?rev=1605563&view=auto
==============================================================================
--- webservices/axiom/trunk/testsuites/spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/castor/StockQuoteEndpoint.java (added)
+++ webservices/axiom/trunk/testsuites/spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/castor/StockQuoteEndpoint.java Wed Jun 25 19:16:23 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.scenario.castor;
+
+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/testsuites/spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/castor/StockQuoteEndpoint.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: webservices/axiom/trunk/testsuites/spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/scenario/castor/client.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testsuites/spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/scenario/castor/client.xml?rev=1605563&view=auto
==============================================================================
--- webservices/axiom/trunk/testsuites/spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/scenario/castor/client.xml (added)
+++ webservices/axiom/trunk/testsuites/spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/scenario/castor/client.xml Wed Jun 25 19:16:23 2014
@@ -0,0 +1,35 @@
+<?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">
+    <bean id="marshaller" class="org.springframework.oxm.castor.CastorMarshaller">
+        <property name="mappingLocation" value="classpath:org/apache/axiom/ts/springws/scenario/castor/mapping.xml"/>
+    </bean>
+    <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/testsuites/spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/scenario/castor/client.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: webservices/axiom/trunk/testsuites/spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/scenario/castor/mapping.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testsuites/spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/scenario/castor/mapping.xml?rev=1605563&view=auto
==============================================================================
--- webservices/axiom/trunk/testsuites/spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/scenario/castor/mapping.xml (added)
+++ webservices/axiom/trunk/testsuites/spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/scenario/castor/mapping.xml Wed Jun 25 19:16:23 2014
@@ -0,0 +1,28 @@
+<?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.
+  -->
+<!DOCTYPE mapping PUBLIC "-//EXOLAB/Castor Mapping DTD Version 1.0//EN" "http://castor.codehaus.org/mapping.dtd">
+<mapping>
+    <class name="org.apache.axiom.ts.springws.scenario.castor.GetQuoteRequest" auto-complete="true">
+        <map-to xml="GetQuote" ns-uri="urn:stockquote"/>
+    </class>
+    <class name="org.apache.axiom.ts.springws.scenario.castor.GetQuoteResponse" auto-complete="true">
+        <map-to xml="GetQuoteResponse" ns-uri="urn:stockquote"/>
+    </class>
+</mapping>
\ No newline at end of file

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

Added: webservices/axiom/trunk/testsuites/spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/scenario/castor/server.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testsuites/spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/scenario/castor/server.xml?rev=1605563&view=auto
==============================================================================
--- webservices/axiom/trunk/testsuites/spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/scenario/castor/server.xml (added)
+++ webservices/axiom/trunk/testsuites/spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/scenario/castor/server.xml Wed Jun 25 19:16:23 2014
@@ -0,0 +1,33 @@
+<?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">
+    <bean id="marshaller" class="org.springframework.oxm.castor.CastorMarshaller">
+        <property name="mappingLocation" value="classpath:org/apache/axiom/ts/springws/scenario/castor/mapping.xml"/>
+    </bean>
+    <context:component-scan base-package="org.apache.axiom.ts.springws.scenario.castor"/>
+    <sws:annotation-driven marshaller="marshaller" unmarshaller="marshaller"/>
+</beans>

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