diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2012-02-16 15:38:02 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2012-02-16 15:38:02 +0000 |
commit | 6a5618b2741471546e0b0885e1758c391837dff6 (patch) | |
tree | 4ce17155a4e4e9046d4cc1355042ac35d96209a2 /sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java | |
parent | 498901ee4d30917ba1fd696e75b61ce3aea79c29 (diff) |
Rename beta3 tag to final name
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1245031 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/tags/2.0-Beta3/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java')
8 files changed, 694 insertions, 0 deletions
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 new file mode 100644 index 0000000000..2a4bb26858 --- /dev/null +++ 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 @@ -0,0 +1,147 @@ +/*
+ * 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;
+
+
+/**
+ * <p>Java class for order complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <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>
+ * </pre>
+ *
+ *
+ */
+@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 new file mode 100644 index 0000000000..718be0b46d --- /dev/null +++ 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 @@ -0,0 +1,72 @@ +/*
+ * 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<Order> myData,
+ @WebParam(name = "myOutParam", targetNamespace = "", mode = WebParam.Mode.OUT)
+ Holder<Float> myOutParam);
+
+ public String[] reviewOrderTwoInOuts(
+ @WebParam(name = "myData", targetNamespace = "", mode = WebParam.Mode.INOUT)
+ Holder<Order> myData,
+ @WebParam(name = "myOutParam", targetNamespace = "", mode = WebParam.Mode.INOUT)
+ Holder<Float> myOutParam);
+
+ public String[] reviewOrderTwoOutHolders(
+ @WebParam(name = "myData", targetNamespace = "", mode = WebParam.Mode.OUT)
+ Holder<Order> myData,
+ @WebParam(targetNamespace = "", mode = WebParam.Mode.OUT)
+ Holder<Float> myOutParam);
+
+ public String[] reviewOrderTwoInOutsThenIn(
+ @WebParam(targetNamespace = "", mode = WebParam.Mode.INOUT)
+ Holder<Order> myData,
+ @WebParam(name = "myOutParam", targetNamespace = "", mode = WebParam.Mode.INOUT)
+ Holder<Float> myOutParam,
+ Integer myCode);
+
+ public void reviewOrderTwoInOutsVoid(
+ @WebParam(name = "myData", targetNamespace = "", mode = WebParam.Mode.INOUT)
+ Holder<Order> myData,
+ @WebParam(name = "myOutParam", targetNamespace = "", mode = WebParam.Mode.INOUT)
+ Holder<Float> myOutParam);
+
+ public String[] reviewOrderOutThenInOut(
+ @WebParam(name = "myOutParam", targetNamespace = "", mode = WebParam.Mode.OUT)
+ Holder<Float> myOutParam,
+ @WebParam(name = "myData", targetNamespace = "", mode = WebParam.Mode.INOUT)
+ Holder<Order> 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 new file mode 100644 index 0000000000..b607250806 --- /dev/null +++ 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 @@ -0,0 +1,43 @@ +/*
+ * 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<Order> myData);
+
+ public void bareReviewOrderOutHolder(
+ @WebParam(mode = WebParam.Mode.OUT)
+ Holder<Order> 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 new file mode 100644 index 0000000000..31af9e19f9 --- /dev/null +++ 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 @@ -0,0 +1,47 @@ +/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.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<Order> myData) {
+ ref.bareReviewOrderInOutHolder(myData);
+ }
+
+ @Override
+ public void bareReviewOrderOutHolder(Holder<Order> 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 new file mode 100644 index 0000000000..05b8538c2a --- /dev/null +++ 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 @@ -0,0 +1,75 @@ +/*
+ * 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<Order> 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<Order> 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 new file mode 100644 index 0000000000..d14269fde2 --- /dev/null +++ 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 @@ -0,0 +1,70 @@ +/*
+ * 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<Order> myData, Holder<Float> myOutParam) {
+ String[] retVal = ref.reviewOrder(myData, myOutParam);
+ return retVal;
+ }
+
+ @Override
+ public String[] reviewOrderTwoInOuts(Holder<Order> myData,
+ Holder<Float> myOutParam) {
+ String[] retVal = ref.reviewOrderTwoInOuts(myData, myOutParam);
+ return retVal;
+ }
+
+ @Override
+ public String[] reviewOrderTwoOutHolders(Holder<Order> myData,
+ Holder<Float> myOutParam) {
+ String[] retVal = ref.reviewOrderTwoOutHolders(myData, myOutParam);
+ return retVal;
+ }
+
+ @Override
+ public String[] reviewOrderTwoInOutsThenIn(Holder<Order> myData,
+ Holder<Float> myOutParam, Integer myCode) {
+ String[] retVal = ref.reviewOrderTwoInOutsThenIn(myData, myOutParam, myCode);
+ return retVal;
+ }
+
+ @Override
+ public void reviewOrderTwoInOutsVoid(Holder<Order> myData, Holder<Float> myOutParam) {
+ ref.reviewOrderTwoInOutsVoid(myData, myOutParam);
+ }
+
+ @Override
+ public String[] reviewOrderOutThenInOut(Holder<Float> myOutParam, Holder<Order> 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 new file mode 100644 index 0000000000..8ec9a94248 --- /dev/null +++ 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 @@ -0,0 +1,165 @@ +/*
+ * 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<Order> myData,
+ @WebParam(name="myOutParam", targetNamespace = "", mode = WebParam.Mode.OUT)
+ Holder<Float> 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<Order> myData,
+ Holder<Float> 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<Order> myData,
+ Holder<Float> 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<Order> myData,
+ Holder<Float> 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<Order> myData, Holder<Float> 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<Float> myOutParam, Holder<Order> 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 new file mode 100644 index 0000000000..83b198ab35 --- /dev/null +++ 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 @@ -0,0 +1,75 @@ +/*
+ * 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;
+
+
+/**
+ * <p>Java class for status.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * <p>
+ * <pre>
+ * <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>
+ * </pre>
+ *
+ */
+@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);
+ }
+
+}
|