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/17 09:55:30 UTC
svn commit: r1603090 - 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/scenario/broker/
axiom-spring-ws-t...
Author: veithen
Date: Tue Jun 17 07:55:29 2014
New Revision: 1603090
URL: http://svn.apache.org/r1603090
Log:
AXIOM-447: Add another Spring-WS scenario test that covers multiple aspects of the API.
Added:
webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/
webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/BrokerClient.java
- copied, changed from r1603089, webservices/axiom/trunk/axiom-spring-ws/src/test/java/org/apache/axiom/spring/ws/test/LLOMSpringWSTest.java
webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/BrokerEndpoint.java (with props)
webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/BrokerScenarioTest.java (with props)
webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/CustomerService.java
- copied, changed from r1603089, webservices/axiom/trunk/axiom-spring-ws/src/test/java/org/apache/axiom/spring/ws/test/LLOMSpringWSTest.java
webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/MockCustomerService.java
- copied, changed from r1603089, webservices/axiom/trunk/axiom-spring-ws/src/test/java/org/apache/axiom/spring/ws/test/LLOMSpringWSTest.java
webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/Order.java (with props)
webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/OrderStatus.java
- copied, changed from r1603089, webservices/axiom/trunk/axiom-spring-ws/src/test/java/org/apache/axiom/spring/ws/test/LLOMSpringWSTest.java
webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/RetrieveNextOrder.java
- copied, changed from r1603089, webservices/axiom/trunk/axiom-spring-ws/src/test/java/org/apache/axiom/spring/ws/test/LLOMSpringWSTest.java
webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/UnknownCustomerException.java
- copied, changed from r1603089, webservices/axiom/trunk/axiom-spring-ws/src/test/java/org/apache/axiom/spring/ws/test/LLOMSpringWSTest.java
webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/scenario/broker/
webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/scenario/broker/client.xml (with props)
webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/scenario/broker/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
webservices/axiom/trunk/testsuites/soap-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPSpec.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=1603090&r1=1603089&r2=1603090&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:55:29 2014
@@ -94,8 +94,19 @@
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
- <source>1.5</source>
- <target>1.5</target>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>animal-sniffer-maven-plugin</artifactId>
+ <configuration>
+ <signature>
+ <groupId>org.codehaus.mojo.signature</groupId>
+ <artifactId>java16</artifactId>
+ <version>1.0</version>
+ </signature>
</configuration>
</plugin>
</plugins>
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=1603090&r1=1603089&r2=1603090&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:55:29 2014
@@ -21,6 +21,7 @@ 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.scenario.ScenarioConfig;
+import org.apache.axiom.ts.springws.scenario.broker.BrokerScenarioTest;
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;
@@ -58,5 +59,6 @@ public class SpringWSTestSuiteBuilder ex
addTest(new ClientServerTest(config, spec));
addTest(new WSAddressingDOMTest(config, spec));
addTest(new JAXB2Test(config, spec));
+ addTest(new BrokerScenarioTest(config, spec));
}
}
Copied: webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/BrokerClient.java (from r1603089, 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-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/BrokerClient.java?p2=webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/BrokerClient.java&p1=webservices/axiom/trunk/axiom-spring-ws/src/test/java/org/apache/axiom/spring/ws/test/LLOMSpringWSTest.java&r1=1603089&r2=1603090&rev=1603090&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-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/BrokerClient.java Tue Jun 17 07:55:29 2014
@@ -16,19 +16,22 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.axiom.spring.ws.test;
+package org.apache.axiom.ts.springws.scenario.broker;
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.ts.springws.MessageFactoryConfigurator;
-import org.apache.axiom.ts.springws.SpringWSTestSuiteBuilder;
+import org.springframework.ws.client.core.WebServiceTemplate;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+public class BrokerClient {
+ private final WebServiceTemplate webServiceTemplate;
-public class LLOMSpringWSTest extends TestCase {
- public static TestSuite suite() {
- SpringWSTestSuiteBuilder builder = new SpringWSTestSuiteBuilder(new AxiomMessageFactoryConfigurator(OMAbstractFactory.FEATURE_DEFAULT), MessageFactoryConfigurator.SAAJ);
-
- return builder.build();
+ public BrokerClient(WebServiceTemplate webServiceTemplate) {
+ this.webServiceTemplate = webServiceTemplate;
+ }
+
+ public OrderStatus order(Order order) {
+ return (OrderStatus)webServiceTemplate.marshalSendAndReceive(order);
+ }
+
+ public Order receiveNextOrder() {
+ return (Order)webServiceTemplate.marshalSendAndReceive(new RetrieveNextOrder());
}
}
Added: webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/BrokerEndpoint.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/BrokerEndpoint.java?rev=1603090&view=auto
==============================================================================
--- webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/BrokerEndpoint.java (added)
+++ webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/BrokerEndpoint.java Tue Jun 17 07:55:29 2014
@@ -0,0 +1,78 @@
+/*
+ * 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.broker;
+
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.Deque;
+import java.util.LinkedList;
+
+import javax.xml.transform.Source;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.springframework.ws.server.endpoint.annotation.Endpoint;
+import org.springframework.ws.server.endpoint.annotation.Namespace;
+import org.springframework.ws.server.endpoint.annotation.Namespaces;
+import org.springframework.ws.server.endpoint.annotation.PayloadRoot;
+import org.springframework.ws.server.endpoint.annotation.RequestPayload;
+import org.springframework.ws.server.endpoint.annotation.ResponsePayload;
+import org.springframework.ws.server.endpoint.annotation.XPathParam;
+import org.springframework.xml.transform.TransformerHelper;
+
+@Endpoint
+public class BrokerEndpoint {
+ private final CustomerService customerService;
+ private final TransformerHelper transformerHelper = new TransformerHelper();
+ private final Deque<String> orderQueue = new LinkedList<String>();
+
+ public BrokerEndpoint(CustomerService customerService) {
+ this.customerService = customerService;
+ }
+
+ @PayloadRoot(namespace="urn:broker", localPart="Order")
+ @ResponsePayload
+ @Namespaces(@Namespace(prefix="p", uri="urn:broker"))
+ public OrderStatus order(@XPathParam("/p:Order/p:Customer") Integer customer, @RequestPayload Source payloadSource) throws UnknownCustomerException, TransformerException {
+ customerService.validateCustomer(customer);
+ StringWriter sw = new StringWriter();
+ transformerHelper.transform(payloadSource, new StreamResult(sw));
+ String payload = sw.toString();
+ synchronized (orderQueue) {
+ orderQueue.addLast(payload);
+ orderQueue.notify();
+ }
+ OrderStatus status = new OrderStatus();
+ status.setReceived(new Date());
+ return status;
+ }
+
+ @PayloadRoot(namespace="urn:broker", localPart="RetrieveNextOrder")
+ @ResponsePayload
+ public Source retrieveNextOrder() throws InterruptedException {
+ synchronized (orderQueue) {
+ while (orderQueue.isEmpty()) {
+ orderQueue.wait();
+ }
+ return new StreamSource(new StringReader(orderQueue.removeFirst()));
+ }
+ }
+}
Propchange: webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/BrokerEndpoint.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/BrokerScenarioTest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/BrokerScenarioTest.java?rev=1603090&view=auto
==============================================================================
--- webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/BrokerScenarioTest.java (added)
+++ webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/BrokerScenarioTest.java Tue Jun 17 07:55:29 2014
@@ -0,0 +1,77 @@
+/*
+ * 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.broker;
+
+import javax.xml.transform.Source;
+
+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.server.endpoint.annotation.XPathParam;
+import org.springframework.ws.soap.client.SoapFaultClientException;
+
+/**
+ * Broker scenario test.
+ * <p>
+ * The test uses a method endpoint and covers the following aspects:
+ * <ul>
+ * <li>{@link XPathParam} parameters.
+ * <li>{@link Source} parameters and return values.
+ * <li>Endpoint methods with multiple parameters that require procession the payload.
+ * <li>SOAP faults.
+ * </ul>
+ */
+public class BrokerScenarioTest extends ScenarioTestCase {
+ public BrokerScenarioTest(ScenarioConfig config, SOAPSpec spec) {
+ super(config, spec);
+ }
+
+ @Override
+ protected void runTest() throws Throwable {
+ BrokerClient client = context.getBean(BrokerClient.class);
+
+ Order order = new Order();
+ order.setCustomer(47892);
+ Order.Item item1 = new Order.Item();
+ item1.setStock("GOOG");
+ item1.setCount(100);
+ Order.Item item2 = new Order.Item();
+ item2.setStock("MSFT");
+ item2.setCount(10);
+ order.setItems(new Order.Item[] { item1, item2 });
+ OrderStatus status = client.order(order);
+ assertNotNull(status.getReceived());
+
+ Order receivedOrder = client.receiveNextOrder();
+ assertNotNull(receivedOrder);
+ assertEquals(order.getCustomer(), receivedOrder.getCustomer());
+ assertEquals(order.getItems().length, receivedOrder.getItems().length);
+ assertEquals(order.getItems()[0].getStock(), receivedOrder.getItems()[0].getStock());
+ assertEquals(order.getItems()[0].getCount(), receivedOrder.getItems()[0].getCount());
+
+ order.setCustomer(23629);
+ try {
+ client.order(order);
+ fail("Expected SoapFaultClientException");
+ } catch (SoapFaultClientException ex) {
+ assertEquals(spec.getSenderFaultCode(), ex.getFaultCode());
+ assertEquals("Customer 23629 unknown", ex.getMessage());
+ }
+ }
+}
Propchange: webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/BrokerScenarioTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Copied: webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/CustomerService.java (from r1603089, 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-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/CustomerService.java?p2=webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/CustomerService.java&p1=webservices/axiom/trunk/axiom-spring-ws/src/test/java/org/apache/axiom/spring/ws/test/LLOMSpringWSTest.java&r1=1603089&r2=1603090&rev=1603090&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-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/CustomerService.java Tue Jun 17 07:55:29 2014
@@ -16,19 +16,8 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.axiom.spring.ws.test;
+package org.apache.axiom.ts.springws.scenario.broker;
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.ts.springws.MessageFactoryConfigurator;
-import org.apache.axiom.ts.springws.SpringWSTestSuiteBuilder;
-
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class LLOMSpringWSTest extends TestCase {
- public static TestSuite suite() {
- SpringWSTestSuiteBuilder builder = new SpringWSTestSuiteBuilder(new AxiomMessageFactoryConfigurator(OMAbstractFactory.FEATURE_DEFAULT), MessageFactoryConfigurator.SAAJ);
-
- return builder.build();
- }
+public interface CustomerService {
+ void validateCustomer(int customerId) throws UnknownCustomerException;
}
Copied: webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/MockCustomerService.java (from r1603089, 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-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/MockCustomerService.java?p2=webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/MockCustomerService.java&p1=webservices/axiom/trunk/axiom-spring-ws/src/test/java/org/apache/axiom/spring/ws/test/LLOMSpringWSTest.java&r1=1603089&r2=1603090&rev=1603090&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-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/MockCustomerService.java Tue Jun 17 07:55:29 2014
@@ -16,19 +16,12 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.axiom.spring.ws.test;
+package org.apache.axiom.ts.springws.scenario.broker;
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.ts.springws.MessageFactoryConfigurator;
-import org.apache.axiom.ts.springws.SpringWSTestSuiteBuilder;
-
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class LLOMSpringWSTest extends TestCase {
- public static TestSuite suite() {
- SpringWSTestSuiteBuilder builder = new SpringWSTestSuiteBuilder(new AxiomMessageFactoryConfigurator(OMAbstractFactory.FEATURE_DEFAULT), MessageFactoryConfigurator.SAAJ);
-
- return builder.build();
+public class MockCustomerService implements CustomerService {
+ public void validateCustomer(int customerId) throws UnknownCustomerException {
+ if (customerId != 47892) {
+ throw new UnknownCustomerException("Customer " + customerId + " unknown");
+ }
}
}
Added: webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/Order.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/Order.java?rev=1603090&view=auto
==============================================================================
--- webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/Order.java (added)
+++ webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/Order.java Tue Jun 17 07:55:29 2014
@@ -0,0 +1,73 @@
+/*
+ * 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.broker;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlRootElement(namespace="urn:broker", name="Order")
+@XmlType(propOrder={"customer","items"})
+public class Order {
+ @XmlRootElement(namespace="urn:broker", name="Item")
+ @XmlType(propOrder={"stock","count"})
+ public static class Item {
+ private String stock;
+ private int count;
+
+ @XmlElement(namespace="urn:broker", name="Stock")
+ public String getStock() {
+ return stock;
+ }
+
+ public void setStock(String stock) {
+ this.stock = stock;
+ }
+
+ @XmlElement(namespace="urn:broker", name="Count")
+ public int getCount() {
+ return count;
+ }
+
+ public void setCount(int count) {
+ this.count = count;
+ }
+ }
+
+ private int customer;
+ private Item[] items;
+
+ @XmlElement(namespace="urn:broker", name="Customer")
+ public int getCustomer() {
+ return customer;
+ }
+
+ public void setCustomer(int customer) {
+ this.customer = customer;
+ }
+
+ @XmlElement(namespace="urn:broker", name="Item")
+ public Item[] getItems() {
+ return items;
+ }
+
+ public void setItems(Item[] items) {
+ this.items = items;
+ }
+}
Propchange: webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/Order.java
------------------------------------------------------------------------------
svn:eol-style = native
Copied: webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/OrderStatus.java (from r1603089, 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-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/OrderStatus.java?p2=webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/OrderStatus.java&p1=webservices/axiom/trunk/axiom-spring-ws/src/test/java/org/apache/axiom/spring/ws/test/LLOMSpringWSTest.java&r1=1603089&r2=1603090&rev=1603090&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-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/OrderStatus.java Tue Jun 17 07:55:29 2014
@@ -16,19 +16,25 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.axiom.spring.ws.test;
+package org.apache.axiom.ts.springws.scenario.broker;
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.ts.springws.MessageFactoryConfigurator;
-import org.apache.axiom.ts.springws.SpringWSTestSuiteBuilder;
+import java.util.Date;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
-public class LLOMSpringWSTest extends TestCase {
- public static TestSuite suite() {
- SpringWSTestSuiteBuilder builder = new SpringWSTestSuiteBuilder(new AxiomMessageFactoryConfigurator(OMAbstractFactory.FEATURE_DEFAULT), MessageFactoryConfigurator.SAAJ);
-
- return builder.build();
+@XmlRootElement(namespace="urn:broker", name="OrderStatus")
+@XmlType
+public class OrderStatus {
+ private Date received;
+
+ @XmlElement(namespace="urn:broker", name="Received")
+ public Date getReceived() {
+ return received;
+ }
+
+ public void setReceived(Date received) {
+ this.received = received;
}
}
Copied: webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/RetrieveNextOrder.java (from r1603089, 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-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/RetrieveNextOrder.java?p2=webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/RetrieveNextOrder.java&p1=webservices/axiom/trunk/axiom-spring-ws/src/test/java/org/apache/axiom/spring/ws/test/LLOMSpringWSTest.java&r1=1603089&r2=1603090&rev=1603090&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-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/RetrieveNextOrder.java Tue Jun 17 07:55:29 2014
@@ -16,19 +16,13 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.axiom.spring.ws.test;
+package org.apache.axiom.ts.springws.scenario.broker;
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.ts.springws.MessageFactoryConfigurator;
-import org.apache.axiom.ts.springws.SpringWSTestSuiteBuilder;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+@XmlRootElement(namespace="urn:broker", name="RetrieveNextOrder")
+@XmlType
+public class RetrieveNextOrder {
-public class LLOMSpringWSTest extends TestCase {
- public static TestSuite suite() {
- SpringWSTestSuiteBuilder builder = new SpringWSTestSuiteBuilder(new AxiomMessageFactoryConfigurator(OMAbstractFactory.FEATURE_DEFAULT), MessageFactoryConfigurator.SAAJ);
-
- return builder.build();
- }
}
Copied: webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/UnknownCustomerException.java (from r1603089, 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-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/UnknownCustomerException.java?p2=webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/UnknownCustomerException.java&p1=webservices/axiom/trunk/axiom-spring-ws/src/test/java/org/apache/axiom/spring/ws/test/LLOMSpringWSTest.java&r1=1603089&r2=1603090&rev=1603090&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-testsuite/src/main/java/org/apache/axiom/ts/springws/scenario/broker/UnknownCustomerException.java Tue Jun 17 07:55:29 2014
@@ -16,19 +16,12 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.axiom.spring.ws.test;
+package org.apache.axiom.ts.springws.scenario.broker;
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.ts.springws.MessageFactoryConfigurator;
-import org.apache.axiom.ts.springws.SpringWSTestSuiteBuilder;
+public class UnknownCustomerException extends Exception {
+ private static final long serialVersionUID = 1L;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class LLOMSpringWSTest extends TestCase {
- public static TestSuite suite() {
- SpringWSTestSuiteBuilder builder = new SpringWSTestSuiteBuilder(new AxiomMessageFactoryConfigurator(OMAbstractFactory.FEATURE_DEFAULT), MessageFactoryConfigurator.SAAJ);
-
- return builder.build();
+ public UnknownCustomerException(String message) {
+ super(message);
}
}
Added: webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/scenario/broker/client.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/scenario/broker/client.xml?rev=1603090&view=auto
==============================================================================
--- webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/scenario/broker/client.xml (added)
+++ webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/scenario/broker/client.xml Tue Jun 17 07:55:29 2014
@@ -0,0 +1,41 @@
+<?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.scenario.broker.Order"/>
+ <oxm:class-to-be-bound name="org.apache.axiom.ts.springws.scenario.broker.OrderStatus"/>
+ <oxm:class-to-be-bound name="org.apache.axiom.ts.springws.scenario.broker.RetrieveNextOrder"/>
+ </oxm:jaxb2-marshaller>
+ <bean class="org.apache.axiom.ts.springws.scenario.broker.BrokerClient">
+ <constructor-arg>
+ <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>
+ </constructor-arg>
+ </bean>
+</beans>
Propchange: webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/scenario/broker/client.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/scenario/broker/server.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/scenario/broker/server.xml?rev=1603090&view=auto
==============================================================================
--- webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/scenario/broker/server.xml (added)
+++ webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/scenario/broker/server.xml Tue Jun 17 07:55:29 2014
@@ -0,0 +1,41 @@
+<?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"
+ default-autowire="constructor">
+ <bean id="customerService" class="org.apache.axiom.ts.springws.scenario.broker.MockCustomerService"/>
+ <context:component-scan base-package="org.apache.axiom.ts.springws.scenario.broker"/>
+ <sws:annotation-driven/>
+ <bean id="exceptionResolver" class="org.springframework.ws.soap.server.endpoint.SoapFaultMappingExceptionResolver">
+ <property name="order" value="-1"/>
+ <property name="defaultFault" value="SERVER"/>
+ <property name="exceptionMappings">
+ <value>
+ org.apache.axiom.ts.springws.scenario.broker.UnknownCustomerException=CLIENT
+ </value>
+ </property>
+ </bean>
+</beans>
Propchange: webservices/axiom/trunk/axiom-spring-ws-testsuite/src/main/resources/org/apache/axiom/ts/springws/scenario/broker/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=1603090&r1=1603089&r2=1603090&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 Tue Jun 17 07:55:29 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.scenario.broker.BrokerScenarioTest;
import org.apache.axiom.ts.springws.scenario.jaxb2.JAXB2Test;
import junit.framework.TestCase;
@@ -30,6 +31,8 @@ public class DOOMSpringWSTest extends Te
public static TestSuite suite() {
SpringWSTestSuiteBuilder builder = new SpringWSTestSuiteBuilder(new AxiomMessageFactoryConfigurator(OMAbstractFactory.FEATURE_DOM), MessageFactoryConfigurator.SAAJ);
+ builder.exclude(BrokerScenarioTest.class);
+
// TODO: Iteration 5
builder.exclude(JAXB2Test.class);
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=1603090&r1=1603089&r2=1603090&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 Tue Jun 17 07:55:29 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.scenario.broker.BrokerScenarioTest;
import junit.framework.TestCase;
import junit.framework.TestSuite;
@@ -29,6 +30,8 @@ public class LLOMSpringWSTest extends Te
public static TestSuite suite() {
SpringWSTestSuiteBuilder builder = new SpringWSTestSuiteBuilder(new AxiomMessageFactoryConfigurator(OMAbstractFactory.FEATURE_DEFAULT), MessageFactoryConfigurator.SAAJ);
+ builder.exclude(BrokerScenarioTest.class);
+
return builder.build();
}
}
Modified: webservices/axiom/trunk/testsuites/soap-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPSpec.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testsuites/soap-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPSpec.java?rev=1603090&r1=1603089&r2=1603090&view=diff
==============================================================================
--- webservices/axiom/trunk/testsuites/soap-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPSpec.java (original)
+++ webservices/axiom/trunk/testsuites/soap-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPSpec.java Tue Jun 17 07:55:29 2014
@@ -39,7 +39,9 @@ public abstract class SOAPSpec extends A
null,
new QName("faultactor"),
new QName("detail"),
- "http://schemas.xmlsoap.org/soap/actor/next") {
+ "http://schemas.xmlsoap.org/soap/actor/next",
+ new QName("http://schemas.xmlsoap.org/soap/envelope/", "Client"),
+ new QName("http://schemas.xmlsoap.org/soap/envelope/", "Server")) {
public SOAPSpec getAltSpec() {
return SOAPSpec.SOAP12;
}
@@ -59,7 +61,9 @@ public abstract class SOAPSpec extends A
new QName("http://www.w3.org/2003/05/soap-envelope", "Node"),
new QName("http://www.w3.org/2003/05/soap-envelope", "Role"),
new QName("http://www.w3.org/2003/05/soap-envelope", "Detail"),
- "http://www.w3.org/2003/05/soap-envelope/role/next") {
+ "http://www.w3.org/2003/05/soap-envelope/role/next",
+ new QName("http://www.w3.org/2003/05/soap-envelope", "Sender"),
+ new QName("http://www.w3.org/2003/05/soap-envelope", "Receiver")) {
public SOAPSpec getAltSpec() {
return SOAPSpec.SOAP11;
}
@@ -84,11 +88,13 @@ public abstract class SOAPSpec extends A
private final QName faultRoleQName;
private final QName faultDetailQName;
private final String nextRoleURI;
+ private final QName senderFaultCode;
+ private final QName receiverFaultCode;
public SOAPSpec(String name, String envelopeNamespaceURI, BooleanLiteral[] booleanLiterals,
QName faultCodeQName, QName faultValueQName, QName faultSubCodeQName, QName faultReasonQName,
QName faultTextQName, QName faultNodeQName, QName faultRoleQName, QName faultDetailQName,
- String nextRoleURI) {
+ String nextRoleURI, QName senderFaultCode, QName receiverFaultCode) {
this.name = name;
this.envelopeNamespaceURI = envelopeNamespaceURI;
this.booleanLiterals = booleanLiterals;
@@ -104,6 +110,8 @@ public abstract class SOAPSpec extends A
this.faultRoleQName = faultRoleQName;
this.faultDetailQName = faultDetailQName;
this.nextRoleURI = nextRoleURI;
+ this.senderFaultCode = senderFaultCode;
+ this.receiverFaultCode = receiverFaultCode;
}
public final String getName() {
@@ -223,4 +231,12 @@ public abstract class SOAPSpec extends A
public final String getNextRoleURI() {
return nextRoleURI;
}
+
+ public final QName getSenderFaultCode() {
+ return senderFaultCode;
+ }
+
+ public final QName getReceiverFaultCode() {
+ return receiverFaultCode;
+ }
}