From 2f187c12e2ceceb61ca2745463fcd7fbbb438b72 Mon Sep 17 00:00:00 2001 From: antelder Date: Thu, 16 Feb 2012 15:39:43 +0000 Subject: Rename beta3 tag to final name git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1245035 13f79535-47bb-0310-9956-ffa450edef68 --- .../ws/holder-ws-service-multiple-outputs/pom.xml | 123 ------- .../main/java/org/example/orderservice/Order.java | 147 -------- .../org/example/orderservice/OrderService.java | 72 ---- .../org/example/orderservice/OrderServiceBare.java | 43 --- .../orderservice/OrderServiceBareForwardImpl.java | 47 --- .../example/orderservice/OrderServiceBareImpl.java | 75 ---- .../orderservice/OrderServiceForwardImpl.java | 70 ---- .../org/example/orderservice/OrderServiceImpl.java | 165 --------- .../main/java/org/example/orderservice/Status.java | 75 ---- .../src/main/resources/ordersca.bare.composite | 46 --- .../src/main/resources/ordersca.composite | 41 --- .../orderservice/OrderServiceBareTestCase.java | 206 ----------- .../example/orderservice/OrderServiceTestCase.java | 395 --------------------- 13 files changed, 1505 deletions(-) delete mode 100644 sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/pom.xml delete mode 100644 sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/Order.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderService.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderServiceBare.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderServiceBareForwardImpl.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderServiceBareImpl.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderServiceForwardImpl.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderServiceImpl.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/Status.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/resources/ordersca.bare.composite delete mode 100644 sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/resources/ordersca.composite delete mode 100644 sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/test/java/org/example/orderservice/OrderServiceBareTestCase.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/test/java/org/example/orderservice/OrderServiceTestCase.java (limited to 'sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs') diff --git a/sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/pom.xml b/sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/pom.xml deleted file mode 100644 index 67734bd676..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/pom.xml +++ /dev/null @@ -1,123 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - itest-ws - 2.0-Beta3 - ../pom.xml - - - jar - itest-holder-ws-service-multiple-outputs - Apache Tuscany SCA itest WS Holder Input/MultipleOutputs - - - - org.apache.tuscany.sca - tuscany-assembly - 2.0-Beta3 - - - - org.apache.tuscany.sca - tuscany-sca-api - 2.0-Beta3 - - - org.apache.tuscany.sca - tuscany-node-api - 2.0-Beta3 - - - org.apache.tuscany.sca - tuscany-node-impl - 2.0-Beta3 - - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime - 2.0-Beta3 - runtime - - - - org.apache.tuscany.sca - tuscany-binding-ws - 2.0-Beta3 - runtime - - - - org.apache.tuscany.sca - tuscany-binding-ws-wsdlgen - 2.0-Beta3 - runtime - - - - org.apache.tuscany.sca - tuscany-host-http - 2.0-Beta3 - runtime - - - - org.apache.tuscany.sca - tuscany-host-jetty - 2.0-Beta3 - runtime - - - - org.apache.tuscany.sca - tuscany-policy-security - 2.0-Beta3 - runtime - - - - org.apache.tuscany.sca - tuscany-binding-ws-runtime-axis2 - 2.0-Beta3 - runtime - - - - junit - junit - 4.8.1 - test - - - - - ${project.artifactId} - - - org.apache.tuscany.sca - tuscany-maven-plugin - 2.0-Beta3 - - - - diff --git a/sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/Order.java b/sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/Order.java deleted file mode 100644 index 2a4bb26858..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/Order.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - * 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.example.orderservice; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for order complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="order">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="customerId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- *         <element name="status" type="{http://www.example.org/OrderService/}status" minOccurs="0"/>
- *         <element name="total" type="{http://www.w3.org/2001/XMLSchema}double"/>
- *         <element name="orderId" type="{http://www.w3.org/2001/XMLSchema}int"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "order", propOrder = { - "customerId", - "status", - "total", - "orderId" -}) -public class Order { - - protected String customerId; - protected Status status; - protected double total; - protected int orderId; - - /** - * Gets the value of the customerId property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getCustomerId() { - return customerId; - } - - /** - * Sets the value of the customerId property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setCustomerId(String value) { - this.customerId = value; - } - - /** - * Gets the value of the status property. - * - * @return - * possible object is - * {@link Status } - * - */ - public Status getStatus() { - return status; - } - - /** - * Sets the value of the status property. - * - * @param value - * allowed object is - * {@link Status } - * - */ - public void setStatus(Status value) { - this.status = value; - } - - /** - * Gets the value of the total property. - * - */ - public double getTotal() { - return total; - } - - /** - * Sets the value of the total property. - * - */ - public void setTotal(double value) { - this.total = value; - } - - /** - * Gets the value of the orderId property. - * - */ - public int getOrderId() { - return orderId; - } - - /** - * Sets the value of the orderId property. - * - */ - public void setOrderId(int value) { - this.orderId = value; - } - - // Added manually from wsimport generated class to improve debugging. - public String toString() { - return "Order[customerId=" + customerId + ",orderId=" + orderId + ",total=" + total + ",status=" + status.value() + "]"; - } -} diff --git a/sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderService.java b/sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderService.java deleted file mode 100644 index 718be0b46d..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderService.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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.example.orderservice; - -import javax.jws.WebParam; -import javax.jws.WebService; -import javax.xml.ws.Holder; - -import org.oasisopen.sca.annotation.Remotable; - - - -@WebService -@Remotable -public interface OrderService { - - public String[] reviewOrder( - @WebParam(name = "myData", targetNamespace = "", mode = WebParam.Mode.INOUT) - Holder myData, - @WebParam(name = "myOutParam", targetNamespace = "", mode = WebParam.Mode.OUT) - Holder myOutParam); - - public String[] reviewOrderTwoInOuts( - @WebParam(name = "myData", targetNamespace = "", mode = WebParam.Mode.INOUT) - Holder myData, - @WebParam(name = "myOutParam", targetNamespace = "", mode = WebParam.Mode.INOUT) - Holder myOutParam); - - public String[] reviewOrderTwoOutHolders( - @WebParam(name = "myData", targetNamespace = "", mode = WebParam.Mode.OUT) - Holder myData, - @WebParam(targetNamespace = "", mode = WebParam.Mode.OUT) - Holder myOutParam); - - public String[] reviewOrderTwoInOutsThenIn( - @WebParam(targetNamespace = "", mode = WebParam.Mode.INOUT) - Holder myData, - @WebParam(name = "myOutParam", targetNamespace = "", mode = WebParam.Mode.INOUT) - Holder myOutParam, - Integer myCode); - - public void reviewOrderTwoInOutsVoid( - @WebParam(name = "myData", targetNamespace = "", mode = WebParam.Mode.INOUT) - Holder myData, - @WebParam(name = "myOutParam", targetNamespace = "", mode = WebParam.Mode.INOUT) - Holder myOutParam); - - public String[] reviewOrderOutThenInOut( - @WebParam(name = "myOutParam", targetNamespace = "", mode = WebParam.Mode.OUT) - Holder myOutParam, - @WebParam(name = "myData", targetNamespace = "", mode = WebParam.Mode.INOUT) - Holder myData); - - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderServiceBare.java b/sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderServiceBare.java deleted file mode 100644 index b607250806..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderServiceBare.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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.example.orderservice; - -import javax.jws.WebParam; -import javax.jws.WebService; -import javax.jws.soap.SOAPBinding; -import javax.xml.ws.Holder; - -import org.oasisopen.sca.annotation.Remotable; - -@WebService -@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE) -public interface OrderServiceBare { - - public Order bareReviewOrder(Order order); - - public void bareReviewOrderInOutHolder( - @WebParam(mode = WebParam.Mode.INOUT) - Holder myData); - - public void bareReviewOrderOutHolder( - @WebParam(mode = WebParam.Mode.OUT) - Holder myData); - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderServiceBareForwardImpl.java b/sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderServiceBareForwardImpl.java deleted file mode 100644 index 31af9e19f9..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderServiceBareForwardImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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.example.orderservice; - -import javax.xml.ws.Holder; - -import org.oasisopen.sca.annotation.Reference; -import org.oasisopen.sca.annotation.Service; - -@Service(OrderServiceBare.class) -public class OrderServiceBareForwardImpl implements OrderServiceBare { - - @Reference - public OrderServiceBare ref; - - @Override - public Order bareReviewOrder(Order myData) { - Order retVal = ref.bareReviewOrder(myData); - return retVal; - } - - @Override - public void bareReviewOrderInOutHolder(Holder myData) { - ref.bareReviewOrderInOutHolder(myData); - } - - @Override - public void bareReviewOrderOutHolder(Holder myData) { - ref.bareReviewOrderOutHolder(myData); - } -} diff --git a/sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderServiceBareImpl.java b/sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderServiceBareImpl.java deleted file mode 100644 index 05b8538c2a..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderServiceBareImpl.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * 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.example.orderservice; - -// import org.osoa.sca.annotations.Service; -import java.util.Random; - -import javax.jws.WebParam; -import javax.xml.ws.Holder; - -import org.oasisopen.sca.annotation.Service; - -/** - * This class implements the OrderService service. - */ -@Service(OrderServiceBare.class) -public class OrderServiceBareImpl implements OrderServiceBare { - - @Override - public Order bareReviewOrder(Order order) { - double total = order.getTotal(); - Order retVal = new Order(); - if ( total < 100.0 ) { - retVal.setStatus( Status.APPROVED ); - } else if ( total > 1100.0 ) { - retVal.setStatus( Status.REJECTED ); - } - return retVal; - } - - @Override - public void bareReviewOrderInOutHolder(Holder myData) { - String customerId = "cust1234"; - double total = myData.value.getTotal(); - Order newOrder = new Order(); - - if ( total < 100.0 ) { - newOrder.setStatus( Status.APPROVED ); - } else if ( total > 1100.0 ) { - newOrder.setStatus( Status.REJECTED ); - } - newOrder.setCustomerId(customerId); - myData.value = newOrder; - } - - @Override - public void bareReviewOrderOutHolder(Holder myData) { - boolean holderEmpty = (myData.value == null ? true : false); - Order newOrder = new Order(); - - if (holderEmpty) { - newOrder.setStatus( Status.APPROVED ); - newOrder.setCustomerId("approved.1234"); - } else { - newOrder.setStatus( Status.REJECTED ); - } - myData.value = newOrder; - } -} diff --git a/sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderServiceForwardImpl.java b/sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderServiceForwardImpl.java deleted file mode 100644 index d14269fde2..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderServiceForwardImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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.example.orderservice; - -import javax.xml.ws.Holder; - -import org.oasisopen.sca.annotation.Reference; -import org.oasisopen.sca.annotation.Service; - -@Service(OrderService.class) -public class OrderServiceForwardImpl implements OrderService { - - @Reference - public OrderService ref; - - public String[] reviewOrder(Holder myData, Holder myOutParam) { - String[] retVal = ref.reviewOrder(myData, myOutParam); - return retVal; - } - - @Override - public String[] reviewOrderTwoInOuts(Holder myData, - Holder myOutParam) { - String[] retVal = ref.reviewOrderTwoInOuts(myData, myOutParam); - return retVal; - } - - @Override - public String[] reviewOrderTwoOutHolders(Holder myData, - Holder myOutParam) { - String[] retVal = ref.reviewOrderTwoOutHolders(myData, myOutParam); - return retVal; - } - - @Override - public String[] reviewOrderTwoInOutsThenIn(Holder myData, - Holder myOutParam, Integer myCode) { - String[] retVal = ref.reviewOrderTwoInOutsThenIn(myData, myOutParam, myCode); - return retVal; - } - - @Override - public void reviewOrderTwoInOutsVoid(Holder myData, Holder myOutParam) { - ref.reviewOrderTwoInOutsVoid(myData, myOutParam); - } - - @Override - public String[] reviewOrderOutThenInOut(Holder myOutParam, Holder myData) { - String[] retVal = ref.reviewOrderOutThenInOut(myOutParam, myData); - return retVal; - } - - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderServiceImpl.java b/sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderServiceImpl.java deleted file mode 100644 index 8ec9a94248..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderServiceImpl.java +++ /dev/null @@ -1,165 +0,0 @@ -/* - * 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.example.orderservice; - -// import org.osoa.sca.annotations.Service; -import java.util.Random; - -import javax.jws.WebParam; -import javax.xml.ws.Holder; - -import org.oasisopen.sca.annotation.Service; - -/** - * This class implements the OrderService service. - */ -@Service(OrderService.class) -public class OrderServiceImpl implements OrderService { - - /** This dummy implementation approves or rejects orders: - * < 100 - always approved. - * 100-1100 - randomly approved. Probability = (1100 - amount)/10 - * >1100 - always rejected. - */ - // public Order reviewOrder(Order order) { - // @WebMethod(action = "http://www.example.org/OrderService/reviewOrder") - // @RequestWrapper(localName = "reviewOrder", targetNamespace = "http://www.example.org/OrderService/", className = "org.example.orderservice.ReviewOrder") - // @ResponseWrapper(localName = "reviewOrderResponse", targetNamespace = "http://www.example.org/OrderService/", className = "org.example.orderservice.ReviewOrderResponse") - public String[] reviewOrder( - @WebParam(name = "myData", targetNamespace = "", mode = WebParam.Mode.INOUT) - Holder myData, - @WebParam(name="myOutParam", targetNamespace = "", mode = WebParam.Mode.OUT) - Holder myOutParam) { - String[] returnVal = {"retval1", "retval2"}; - Order order = myData.value; - double total = order.getTotal(); - if ( total < 100.0 ) { - order.setStatus( Status.APPROVED ); - } else if ( total > 1100.0 ) { - order.setStatus( Status.REJECTED ); - } else { - int probability = (int) ((-100.0 + total) / 10.0); - Random approver = new Random(); - if ( approver.nextInt( 100 ) < probability ) - order.setStatus( Status.APPROVED ); - else - order.setStatus( Status.REJECTED ); - } - System.out.println( ">>> OrderService.reviewOrder return=" + order ); - - if ( myOutParam.value == null ) { - myOutParam.value = new Float("97"); - } else { - myOutParam.value = new Float("-1000"); - } - return returnVal; - } - - @Override - public String[] reviewOrderTwoInOuts(Holder myData, - Holder myOutParam) { - String[] returnVal = {"retval1", "retval2"}; - Order order = myData.value; - double total = order.getTotal(); - if ( total < 100.0 ) { - order.setStatus( Status.APPROVED ); - } else if ( total > 1100.0 ) { - order.setStatus( Status.REJECTED ); - } else { - int probability = (int) ((-100.0 + total) / 10.0); - Random approver = new Random(); - if ( approver.nextInt( 100 ) < probability ) - order.setStatus( Status.APPROVED ); - else - order.setStatus( Status.REJECTED ); - } - System.out.println( ">>> OrderService.reviewOrder return=" + order ); - - // Since this is an INOUT, expect "111" to signify test pass - if ( myOutParam.value.equals(new Float("111"))) { - myOutParam.value = new Float("97"); - } else { - myOutParam.value = new Float("-1000"); - } - return returnVal; - } - - @Override - public String[] reviewOrderTwoOutHolders(Holder myData, - Holder myOutParam) { - String[] returnVal = {"retval1", "retval2"}; - if (myData.value == null) { - myData.value = new Order(); - myData.value.setStatus(Status.REJECTED); - } else { - // Do nothing so test logic will fail - } - - // Use test logic to check it's truly treated as an OUT parm - if ( myOutParam.value == null ) { - myOutParam.value = new Float("97"); - } else { - myOutParam.value = new Float("-1000"); - } - return returnVal; - } - - @Override - public String[] reviewOrderTwoInOutsThenIn(Holder myData, - Holder myOutParam, - Integer myCode) { - String[] returnVal = {"retval1", "retval2"}; - Order order = myData.value; - double total = order.getTotal(); - if ( total < 50.1 && myCode.equals(new Integer("23")) ) { - order.setStatus( Status.APPROVED ); - } else { - order.setStatus( Status.REJECTED); - } - - // Use test logic to check it's truly treated as an INOUT parm - if ( myOutParam.value != null ) { - myOutParam.value = new Float("97"); - } else { - myOutParam.value = new Float("-1000"); - } - return returnVal; - } - - @Override - public void reviewOrderTwoInOutsVoid(Holder myData, Holder myOutParam) { - double total = myData.value.getTotal(); - Order retOrder = new Order(); - if (total < 50.1 && myOutParam.value < 50) { - myOutParam.value = new Float("1"); - retOrder.setStatus(Status.APPROVED); - } else { - myOutParam.value = new Float("-1"); - retOrder.setStatus(Status.REJECTED); - } - myData.value = retOrder; - } - - @Override - // Simply delegate to existing test method with parms reversed. - public String[] reviewOrderOutThenInOut(Holder myOutParam, Holder myData) { - String[] retVal = reviewOrder(myData, myOutParam); - return retVal; - } -} diff --git a/sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/Status.java b/sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/Status.java deleted file mode 100644 index 83b198ab35..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/Status.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * 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.example.orderservice; - -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlEnumValue; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for status. - * - *

The following schema fragment specifies the expected content contained within this class. - *

- *

- * <simpleType name="status">
- *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
- *     <enumeration value="Created"/>
- *     <enumeration value="Submitted"/>
- *     <enumeration value="Approved"/>
- *     <enumeration value="Rejected"/>
- *   </restriction>
- * </simpleType>
- * 
- * - */ -@XmlType(name = "status") -@XmlEnum -public enum Status { - - @XmlEnumValue("Created") - CREATED("Created"), - @XmlEnumValue("Submitted") - SUBMITTED("Submitted"), - @XmlEnumValue("Approved") - APPROVED("Approved"), - @XmlEnumValue("Rejected") - REJECTED("Rejected"); - private final String value; - - Status(String v) { - value = v; - } - - public String value() { - return value; - } - - public static Status fromValue(String v) { - for (Status c: Status.values()) { - if (c.value.equals(v)) { - return c; - } - } - throw new IllegalArgumentException(v); - } - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/resources/ordersca.bare.composite b/sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/resources/ordersca.bare.composite deleted file mode 100644 index 8a563666c8..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/resources/ordersca.bare.composite +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/resources/ordersca.composite b/sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/resources/ordersca.composite deleted file mode 100644 index 9d7d052472..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/resources/ordersca.composite +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/test/java/org/example/orderservice/OrderServiceBareTestCase.java b/sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/test/java/org/example/orderservice/OrderServiceBareTestCase.java deleted file mode 100644 index 5da7e870ed..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/test/java/org/example/orderservice/OrderServiceBareTestCase.java +++ /dev/null @@ -1,206 +0,0 @@ -/* - * 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.example.orderservice; - -import static junit.framework.Assert.assertNotNull; -import static junit.framework.Assert.assertTrue; -import static org.junit.Assert.assertEquals; - -import java.io.IOException; - -import javax.xml.ws.Holder; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.ContributionLocationHelper; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Ignore; -import org.junit.Test; - -/** - * Tests that the order server responds. - */ - -public class OrderServiceBareTestCase { - - private static Node node; - - @BeforeClass - public static void startServer() throws Exception { - try { - - NodeFactory factory = NodeFactory.newInstance(); - String contribution = ContributionLocationHelper.getContributionLocation(OrderServiceBare.class); - node = factory.createNode("ordersca.bare.composite", new Contribution("order.bare", contribution)).start(); - } catch (Exception e) { - e.printStackTrace(); - } - - } - - @Test - public void testOrderReviewBareApprovedSCA() throws IOException { - OrderServiceBare orderServiceBare = - node.getService(OrderServiceBare.class, "OrderServiceBareComponent/OrderServiceBare"); - assertNotNull(orderServiceBare); - testOrderReviewApproved(orderServiceBare); - } - - @Test - public void testOrderReviewBareApprovedWS() throws IOException { - OrderServiceBare orderServiceBare = - node.getService(OrderServiceBare.class, "OrderServiceBareForwardComponent/OrderServiceBare"); - assertNotNull(orderServiceBare); - testOrderReviewApproved(orderServiceBare); - } - - @Test - public void testOrderReviewBareRejectedSCA() throws IOException { - OrderServiceBare orderServiceBare = - node.getService(OrderServiceBare.class, "OrderServiceBareComponent/OrderServiceBare"); - assertNotNull(orderServiceBare); - testOrderReviewRejected(orderServiceBare); - } - - @Test - public void testOrderReviewBareRejectedWS() throws IOException { - OrderServiceBare orderServiceBare = - node.getService(OrderServiceBare.class, "OrderServiceBareForwardComponent/OrderServiceBare"); - assertNotNull(orderServiceBare); - testOrderReviewRejected(orderServiceBare); - } - - @Test - public void testOrderReviewInOutBareApprovedSCA() throws IOException { - OrderServiceBare orderServiceBare = - node.getService(OrderServiceBare.class, "OrderServiceBareComponent/OrderServiceBare"); - assertNotNull(orderServiceBare); - testOrderReviewApprovedInOutHolder(orderServiceBare); - } - - @Test - public void testOrderReviewInOutBareApprovedWS() throws IOException { - OrderServiceBare orderServiceBare = - node.getService(OrderServiceBare.class, "OrderServiceBareForwardComponent/OrderServiceBare"); - assertNotNull(orderServiceBare); - testOrderReviewApprovedInOutHolder(orderServiceBare); - } - - @Test - public void testOrderReviewInOutBareRejectedSCA() throws IOException { - OrderServiceBare orderServiceBare = - node.getService(OrderServiceBare.class, "OrderServiceBareComponent/OrderServiceBare"); - assertNotNull(orderServiceBare); - testOrderReviewRejectedInOutHolder(orderServiceBare); - } - - @Test - public void testOrderReviewInOutBareRejectedWS() throws IOException { - OrderServiceBare orderServiceBare = - node.getService(OrderServiceBare.class, "OrderServiceBareForwardComponent/OrderServiceBare"); - assertNotNull(orderServiceBare); - testOrderReviewRejectedInOutHolder(orderServiceBare); - } - - @Test - public void testOrderReviewBareOutHolderSCA() throws IOException { - OrderServiceBare orderServiceBare = - node.getService(OrderServiceBare.class, "OrderServiceBareComponent/OrderServiceBare"); - assertNotNull(orderServiceBare); - testOrderReviewOutHolder(orderServiceBare); - } - - @Test - public void testOrderReviewBareOutHolderWS() throws IOException { - OrderServiceBare orderServiceBare = - node.getService(OrderServiceBare.class, "OrderServiceBareForwardComponent/OrderServiceBare"); - assertNotNull(orderServiceBare); - testOrderReviewOutHolder(orderServiceBare); - } - - private void testOrderReviewApproved(OrderServiceBare orderServiceBare) throws IOException { - Order order = new Order(); - order.setStatus( Status.CREATED ); - order.setCustomerId("cust1234"); - order.setTotal( 50.0 ); - - Order returnValue = null; - returnValue = orderServiceBare.bareReviewOrder(order); - assertTrue( returnValue.getStatus() == Status.APPROVED ); - } - - private void testOrderReviewRejected(OrderServiceBare orderServiceBare) throws IOException { - Order order = new Order(); - order.setStatus( Status.CREATED ); - order.setCustomerId("cust1234"); - order.setTotal( 50000.0 ); - - Order returnValue = null; - returnValue = orderServiceBare.bareReviewOrder(order); - assertTrue( returnValue.getStatus() == Status.REJECTED ); - } - - private void testOrderReviewApprovedInOutHolder(OrderServiceBare orderServiceBare) throws IOException { - String customerId = "cust1234"; - Order order = new Order(); - order.setStatus( Status.CREATED ); - order.setCustomerId(customerId); - order.setTotal( 50.0 ); - - Holder holder = new Holder(order); - orderServiceBare.bareReviewOrderInOutHolder(holder); - assertTrue( holder.value.getStatus() == Status.APPROVED ); - assertTrue( holder.value.getCustomerId().equals(customerId)); - } - - private void testOrderReviewRejectedInOutHolder(OrderServiceBare orderServiceBare) throws IOException { - String customerId = "cust1234"; - Order order = new Order(); - order.setStatus( Status.CREATED ); - order.setCustomerId(customerId); - order.setTotal( 50000.0 ); - - Holder holder = new Holder(order); - orderServiceBare.bareReviewOrderInOutHolder(holder); - assertTrue( holder.value.getStatus() == Status.REJECTED ); - assertTrue( holder.value.getCustomerId().equals(customerId)); - } - - private void testOrderReviewOutHolder(OrderServiceBare orderServiceBare) throws IOException { - Order order = new Order(); - order.setStatus( Status.CREATED ); - order.setCustomerId("cust1234"); - order.setTotal( 50.0 ); - Holder holder = new Holder(order); - orderServiceBare.bareReviewOrderOutHolder(holder); - assertTrue( holder.value.getStatus() == Status.APPROVED ); - assertTrue( holder.value.getCustomerId().equals("approved.1234")); - } - - - - @AfterClass - public static void stopServer() throws Exception { - if (node != null) - node.stop(); - } - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/test/java/org/example/orderservice/OrderServiceTestCase.java b/sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/test/java/org/example/orderservice/OrderServiceTestCase.java deleted file mode 100644 index f762709a4c..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/test/java/org/example/orderservice/OrderServiceTestCase.java +++ /dev/null @@ -1,395 +0,0 @@ -/* - * 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.example.orderservice; - -import static junit.framework.Assert.assertNotNull; -import static junit.framework.Assert.assertTrue; -import static org.junit.Assert.assertEquals; - -import java.io.IOException; - -import javax.xml.ws.Holder; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.ContributionLocationHelper; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Ignore; -import org.junit.Test; - -/** - * Tests that the order server responds. - */ -public class OrderServiceTestCase { - - private static Node node; - - @BeforeClass - public static void startServer() throws Exception { - try { - NodeFactory factory = NodeFactory.newInstance(); - String contribution = ContributionLocationHelper.getContributionLocation(OrderService.class); - node = factory.createNode("ordersca.composite", new Contribution("order", contribution)).start(); - } catch (Exception e) { - e.printStackTrace(); - } - - } - - @Test - public void testOrderReviewApprovedSCA() throws IOException { - OrderService orderService = - node.getService(OrderService.class, "OrderServiceComponent/OrderService"); - assertNotNull(orderService); - Holder outParam = new Holder(new Float(57.4)); - testOrderReviewApproved(orderService, outParam); - } - - @Test - public void testOrderReviewApprovedWS() throws IOException { - OrderService orderService = - node.getService(OrderService.class, "OrderServiceForwardComponent/OrderService"); - assertNotNull(orderService); - Holder outParam = new Holder(new Float(57.4)); - testOrderReviewApproved(orderService, outParam); - } - - @Test - public void testOrderReviewRejectedSCA() throws IOException { - OrderService orderService = - node.getService(OrderService.class, "OrderServiceComponent/OrderService"); - assertNotNull(orderService); - Holder outParam = new Holder(new Float(57.4)); - testOrderReviewRejected(orderService, outParam); - } - - @Test - public void testOrderReviewRejectedWS() throws IOException { - OrderService orderService = - node.getService(OrderService.class, "OrderServiceForwardComponent/OrderService"); - assertNotNull(orderService); - Holder outParam = new Holder(new Float(57.4)); - testOrderReviewRejected(orderService, outParam); - } - - @Test - public void testOrderReviewRandomSCA() throws IOException { - OrderService orderService = - node.getService(OrderService.class, "OrderServiceComponent/OrderService"); - assertNotNull(orderService); - Holder outParam = new Holder(new Float(57.4)); - testOrderReviewRandom(orderService, outParam); - } - - @Test - public void testOrderReviewRandomWS() throws IOException { - OrderService orderService = - node.getService(OrderService.class, "OrderServiceForwardComponent/OrderService"); - assertNotNull(orderService); - Holder outParam = new Holder(new Float(57.4)); - testOrderReviewRandom(orderService, outParam); - } - - - - @Test - public void testOrderReviewApprovedTwoInOutsSCA() throws IOException { - OrderService orderService = - node.getService(OrderService.class, "OrderServiceComponent/OrderService"); - assertNotNull(orderService); - Holder outParam = new Holder(new Float(111)); - testOrderReviewApproved(orderService, outParam); - } - - @Test - public void testOrderReviewApprovedTwoInOutsWS() throws IOException { - OrderService orderService = - node.getService(OrderService.class, "OrderServiceForwardComponent/OrderService"); - assertNotNull(orderService); - Holder outParam = new Holder(new Float(111)); - testOrderReviewApproved(orderService, outParam); - } - - @Test - public void testOrderReviewRejectedTwoInOutsSCA() throws IOException { - OrderService orderService = - node.getService(OrderService.class, "OrderServiceComponent/OrderService"); - assertNotNull(orderService); - Holder outParam = new Holder(new Float(111)); - testOrderReviewRejected(orderService, outParam); - } - - @Test - public void testOrderReviewRejectedTwoInOutsWS() throws IOException { - OrderService orderService = - node.getService(OrderService.class, "OrderServiceForwardComponent/OrderService"); - assertNotNull(orderService); - Holder outParam = new Holder(new Float(111)); - testOrderReviewRejected(orderService, outParam); - } - - @Test - public void testOrderReviewRandomTwoInOutsSCA() throws IOException { - OrderService orderService = - node.getService(OrderService.class, "OrderServiceComponent/OrderService"); - assertNotNull(orderService); - Holder outParam = new Holder(new Float(111)); - testOrderReviewRandom(orderService, outParam); - } - - @Test - public void testOrderReviewRandomTwoInOutsWS() throws IOException { - OrderService orderService = - node.getService(OrderService.class, "OrderServiceForwardComponent/OrderService"); - assertNotNull(orderService); - Holder outParam = new Holder(new Float(111)); - testOrderReviewRandom(orderService, outParam); - } - - @Test - public void testOrderReviewTwoOutHoldersSCA() throws IOException { - OrderService orderService = - node.getService(OrderService.class, "OrderServiceComponent/OrderService"); - assertNotNull(orderService); - testOrderReviewTwoOutHolders(orderService); - } - - @Test - public void testOrderReviewTwoOutHoldersWS() throws IOException { - OrderService orderService = - node.getService(OrderService.class, "OrderServiceForwardComponent/OrderService"); - assertNotNull(orderService); - testOrderReviewTwoOutHolders(orderService); - } - - @Test - public void testOrderReviewTwoInOutsThenInSCA() throws IOException { - OrderService orderService = - node.getService(OrderService.class, "OrderServiceComponent/OrderService"); - assertNotNull(orderService); - testOrderReviewOrderTwoInOutsThenIn(orderService); - } - - @Test - public void testOrderReviewTwoInOutsThenInWS() throws IOException { - OrderService orderService = - node.getService(OrderService.class, "OrderServiceForwardComponent/OrderService"); - assertNotNull(orderService); - testOrderReviewOrderTwoInOutsThenIn(orderService); - } - - @Test - public void testOrderReviewVoidApprovedSCA() throws IOException { - OrderService orderService = - node.getService(OrderService.class, "OrderServiceComponent/OrderService"); - assertNotNull(orderService); - testOrderReviewVoidApproved(orderService); - } - - @Test - public void testOrderReviewVoidApprovedWS() throws IOException { - OrderService orderService = - node.getService(OrderService.class, "OrderServiceForwardComponent/OrderService"); - assertNotNull(orderService); - testOrderReviewVoidApproved(orderService); - } - - @Test - public void testOrderReviewVoidRejectedSCA() throws IOException { - OrderService orderService = - node.getService(OrderService.class, "OrderServiceComponent/OrderService"); - assertNotNull(orderService); - testOrderReviewVoidRejected(orderService); - } - - @Test - public void testOrderReviewVoidRejectedWS() throws IOException { - OrderService orderService = - node.getService(OrderService.class, "OrderServiceForwardComponent/OrderService"); - assertNotNull(orderService); - testOrderReviewVoidRejected(orderService); - } - - @Test - public void testOrderReviewOutThenInOutApprovedWS() throws IOException { - OrderService orderService = - node.getService(OrderService.class, "OrderServiceForwardComponent/OrderService"); - assertNotNull(orderService); - Order order = new Order(); - order.setStatus( Status.CREATED ); - order.setCustomerId("cust1234"); - order.setTotal( 50.0 ); - System.out.println( ">>> Order submitted=" + order ); - Holder outParam = new Holder(new Float(57.4)); - Holder holder = new Holder( order ); - String[] returnValue = null; - returnValue = orderService.reviewOrderOutThenInOut(outParam, holder); - assertTrue( holder.value.getStatus() == Status.APPROVED ); - assertEquals("retval1", returnValue[0]); - assertEquals("retval2", returnValue[1]); - assertTrue(outParam.value.floatValue() == 97); - } - - - private void testOrderReviewApproved(OrderService orderService, Holder outParam) throws IOException { - Order order = new Order(); - order.setStatus( Status.CREATED ); - order.setCustomerId("cust1234"); - order.setTotal( 50.0 ); - - System.out.println( ">>> Order submitted=" + order ); - Holder holder = new Holder( order ); - String[] returnValue = null; - if (outParam.value.equals(new Float("111"))) { - returnValue = orderService.reviewOrderTwoInOuts( holder, outParam ); - } else { - returnValue = orderService.reviewOrder( holder, outParam ); - } - System.out.println( ">>> Order returned=" + holder.value ); - assertTrue( holder.value.getStatus() == Status.APPROVED ); - assertEquals("retval1", returnValue[0]); - assertEquals("retval2", returnValue[1]); - assertTrue(outParam.value.floatValue() == 97); - } - - private void testOrderReviewRejected(OrderService orderService, Holder outParam) throws IOException { - Order order = new Order(); - order.setStatus( Status.CREATED ); - order.setCustomerId("cust2345"); - order.setTotal( 50000.0 ); - - System.out.println( ">>> Order submitted=" + order ); - Holder holder = new Holder( order ); - String[] returnValue = null; - if (outParam.value.equals(new Float("111"))) { - returnValue = orderService.reviewOrderTwoInOuts( holder, outParam ); - } else { - returnValue = orderService.reviewOrder( holder, outParam ); - } - System.out.println( ">>> Order returned=" + holder.value ); - System.out.println( ">>> return values: " + returnValue[0] + " " + returnValue[1]); - assertTrue( holder.value.getStatus() == Status.REJECTED ); - assertEquals("retval1", returnValue[0]); - assertEquals("retval2", returnValue[1]); - assertTrue(outParam.value.floatValue() == 97); - } - - private void testOrderReviewRandom(OrderService orderService, Holder outParam) throws IOException { - Order order = new Order(); - order.setStatus( Status.CREATED ); - order.setCustomerId("cust3456"); - order.setTotal( 600.0 ); - - System.out.println( ">>> Order submitted=" + order ); - Holder holder = new Holder( order ); - String[] returnValue = null; - if (outParam.value.equals(new Float("111"))) { - returnValue = orderService.reviewOrderTwoInOuts( holder, outParam ); - } else { - returnValue = orderService.reviewOrder( holder, outParam ); - } - System.out.println( ">>> Order returned=" + holder.value ); - assertTrue( holder.value.getStatus() != Status.CREATED ); - assertEquals("retval1", returnValue[0]); - assertEquals("retval2", returnValue[1]); - assertTrue(outParam.value.floatValue() == 97); - } - - private void testOrderReviewTwoOutHolders(OrderService orderService) throws IOException { - Order order = new Order(); - order.setStatus( Status.CREATED ); - order.setCustomerId("cust3456"); - order.setTotal( 600.0 ); - - System.out.println( ">>> Order submitted=" + order ); - Holder holder = new Holder( order ); - Holder outParam = new Holder(new Float(57.4)); - String[] returnValue = orderService.reviewOrderTwoOutHolders( holder, outParam ); - System.out.println( ">>> Order returned=" + holder.value ); - assertTrue( holder.value.getStatus() == Status.REJECTED ); - assertEquals("retval1", returnValue[0]); - assertEquals("retval2", returnValue[1]); - assertTrue(outParam.value.floatValue() == 97); - } - - private void testOrderReviewOrderTwoInOutsThenIn(OrderService orderService) throws IOException { - Order order = new Order(); - order.setStatus( Status.CREATED ); - order.setCustomerId("cust1234"); - order.setTotal( 50.0 ); - - System.out.println( ">>> Order submitted=" + order ); - Holder holder = new Holder( order ); - Holder outParam = new Holder( new Float("1820.234")); - String[] returnValue = null; - Integer checkForMe = new Integer("23"); - returnValue = orderService.reviewOrderTwoInOutsThenIn( holder, outParam, checkForMe); - System.out.println( ">>> Order returned=" + holder.value ); - assertTrue( holder.value.getStatus() == Status.APPROVED ); - assertEquals("retval1", returnValue[0]); - assertEquals("retval2", returnValue[1]); - assertTrue(outParam.value.floatValue() == 97); - } - - private void testOrderReviewVoidApproved(OrderService orderService) throws IOException { - Order order = new Order(); - order.setStatus( Status.CREATED ); - order.setCustomerId("cust1234"); - order.setTotal( 50.0 ); - - System.out.println( ">>> Order submitted=" + order ); - Holder holder = new Holder(order); - - Float parm2 = new Float("45"); - Holder outParam = new Holder(parm2); - - orderService.reviewOrderTwoInOutsVoid(holder, outParam ); - - assertTrue( holder.value.getStatus() == Status.APPROVED ); - assertEquals(outParam.value, new Float("1")); - } - - private void testOrderReviewVoidRejected(OrderService orderService) throws IOException { - Order order = new Order(); - order.setStatus( Status.CREATED ); - order.setCustomerId("cust2345"); - order.setTotal( 50000.0 ); - - System.out.println( ">>> Order submitted=" + order ); - Holder holder = new Holder(order); - - Float parm2 = new Float("76"); - Holder outParam = new Holder(parm2); - - orderService.reviewOrderTwoInOutsVoid(holder, outParam ); - - assertTrue( holder.value.getStatus() == Status.REJECTED ); - assertEquals(outParam.value, new Float("-1")); - } - - - @AfterClass - public static void stopServer() throws Exception { - if (node != null) - node.stop(); - } - -} -- cgit v1.2.3