diff options
author | scottkurz <scottkurz@13f79535-47bb-0310-9956-ffa450edef68> | 2011-01-26 01:23:44 +0000 |
---|---|---|
committer | scottkurz <scottkurz@13f79535-47bb-0310-9956-ffa450edef68> | 2011-01-26 01:23:44 +0000 |
commit | 298bd0043eef84d28bb6559b489f765873a92f70 (patch) | |
tree | 6a4721216fbae62524f4b6411a0faf2c7f49329c /sca-java-2.x/trunk/testing/itest/ws | |
parent | dac345d5480d52c4071c22fbdeba605dc1236cc0 (diff) |
Commit some more multiple output tests and un-ignore existing ones.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1063552 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/testing/itest/ws')
8 files changed, 66 insertions, 18 deletions
diff --git a/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderService.java b/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderService.java index d738dd58fc..718be0b46d 100644 --- a/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderService.java +++ b/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderService.java @@ -46,11 +46,11 @@ public interface OrderService { public String[] reviewOrderTwoOutHolders(
@WebParam(name = "myData", targetNamespace = "", mode = WebParam.Mode.OUT)
Holder<Order> myData,
- @WebParam(name = "myOutParam", targetNamespace = "", mode = WebParam.Mode.OUT)
+ @WebParam(targetNamespace = "", mode = WebParam.Mode.OUT)
Holder<Float> myOutParam);
public String[] reviewOrderTwoInOutsThenIn(
- @WebParam(name = "myData", targetNamespace = "", mode = WebParam.Mode.INOUT)
+ @WebParam(targetNamespace = "", mode = WebParam.Mode.INOUT)
Holder<Order> myData,
@WebParam(name = "myOutParam", targetNamespace = "", mode = WebParam.Mode.INOUT)
Holder<Float> myOutParam,
@@ -62,5 +62,11 @@ public interface OrderService { @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/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderServiceBareForwardImpl.java b/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderServiceBareForwardImpl.java index 644ee86652..7fe39da381 100644 --- a/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderServiceBareForwardImpl.java +++ b/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderServiceBareForwardImpl.java @@ -24,6 +24,6 @@ public class OrderServiceBareForwardImpl implements OrderServiceBare { @Override
public void bareReviewOrderOutHolder(Holder<Order> myData) {
- ref.bareReviewOrderInOutHolder(myData);
+ ref.bareReviewOrderOutHolder(myData);
}
}
diff --git a/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderServiceBareImpl.java b/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderServiceBareImpl.java index fbf68fab7a..05b8538c2a 100644 --- a/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderServiceBareImpl.java +++ b/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderServiceBareImpl.java @@ -46,24 +46,30 @@ public class OrderServiceBareImpl implements OrderServiceBare { @Override
public void bareReviewOrderInOutHolder(Holder<Order> myData) {
+ String customerId = "cust1234";
double total = myData.value.getTotal();
- myData.value = new Order();
+ Order newOrder = new Order();
+
if ( total < 100.0 ) {
- myData.value.setStatus( Status.APPROVED );
+ newOrder.setStatus( Status.APPROVED );
} else if ( total > 1100.0 ) {
- myData.value.setStatus( Status.REJECTED );
- }
+ newOrder.setStatus( Status.REJECTED );
+ }
+ newOrder.setCustomerId(customerId);
+ myData.value = newOrder;
}
@Override
public void bareReviewOrderOutHolder(Holder<Order> myData) {
boolean holderEmpty = (myData.value == null ? true : false);
- myData.value = new Order();
+ Order newOrder = new Order();
+
if (holderEmpty) {
- myData.value.setStatus( Status.APPROVED );
- myData.value.setCustomerId("approved.1234");
+ newOrder.setStatus( Status.APPROVED );
+ newOrder.setCustomerId("approved.1234");
} else {
- myData.value.setStatus( Status.REJECTED );
+ newOrder.setStatus( Status.REJECTED );
}
+ myData.value = newOrder;
}
}
diff --git a/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderServiceForwardImpl.java b/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderServiceForwardImpl.java index 4c89fd59a7..9628963a5e 100644 --- a/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderServiceForwardImpl.java +++ b/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderServiceForwardImpl.java @@ -42,5 +42,11 @@ public class OrderServiceForwardImpl implements OrderService { 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/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderServiceImpl.java b/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderServiceImpl.java index 46eb8a6307..8ec9a94248 100644 --- a/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderServiceImpl.java +++ b/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderServiceImpl.java @@ -155,4 +155,11 @@ public class OrderServiceImpl implements OrderService { }
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/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/resources/ordersca.bare.composite b/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/resources/ordersca.bare.composite index ed8dbb1426..8a563666c8 100644 --- a/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/resources/ordersca.bare.composite +++ b/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/resources/ordersca.bare.composite @@ -26,7 +26,9 @@ <implementation.java class="org.example.orderservice.OrderServiceBareImpl" />
<service name="OrderServiceBare">
<interface.java interface="org.example.orderservice.OrderServiceBare"/>
+<!-- TODO - start mailing list discussion about implications of @SOAPBinding plus binding.sca not being supported in OASIS.
<binding.sca name="sca"/>
+ -->
<binding.ws/>
</service>
</component>
@@ -36,6 +38,9 @@ <reference name="ref">
<binding.ws uri="http://localhost:8080/OrderServiceBareComponent/OrderServiceBare"/>
</reference>
+ <service name="OrderServiceBare">
+ <binding.ws/>
+ </service>
</component>
</composite>
diff --git a/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/test/java/org/example/orderservice/OrderServiceBareTestCase.java b/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/test/java/org/example/orderservice/OrderServiceBareTestCase.java index 804455f055..75bada0174 100644 --- a/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/test/java/org/example/orderservice/OrderServiceBareTestCase.java +++ b/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/test/java/org/example/orderservice/OrderServiceBareTestCase.java @@ -38,7 +38,6 @@ import org.junit.Test; /**
* Tests that the order server responds.
*/
-@Ignore
public class OrderServiceBareTestCase {
private static Node node;
@@ -57,6 +56,7 @@ public class OrderServiceBareTestCase { }
@Test
+ @Ignore
public void testOrderReviewBareApprovedSCA() throws IOException {
OrderServiceBare orderServiceBare =
node.getService(OrderServiceBare.class, "OrderServiceBareComponent/OrderServiceBare");
@@ -72,6 +72,7 @@ public class OrderServiceBareTestCase { testOrderReviewApproved(orderServiceBare);
}
+ @Ignore
@Test
public void testOrderReviewBareRejectedSCA() throws IOException {
OrderServiceBare orderServiceBare =
@@ -88,7 +89,7 @@ public class OrderServiceBareTestCase { testOrderReviewRejected(orderServiceBare);
}
-
+ @Ignore
@Test
public void testOrderReviewInOutBareApprovedSCA() throws IOException {
OrderServiceBare orderServiceBare =
@@ -105,6 +106,7 @@ public class OrderServiceBareTestCase { testOrderReviewApprovedInOutHolder(orderServiceBare);
}
+ @Ignore
@Test
public void testOrderReviewInOutBareRejectedSCA() throws IOException {
OrderServiceBare orderServiceBare =
@@ -121,6 +123,7 @@ public class OrderServiceBareTestCase { testOrderReviewRejectedInOutHolder(orderServiceBare);
}
+ @Ignore
@Test
public void testOrderReviewBareOutHolderSCA() throws IOException {
OrderServiceBare orderServiceBare =
diff --git a/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/test/java/org/example/orderservice/OrderServiceTestCase.java b/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/test/java/org/example/orderservice/OrderServiceTestCase.java index 0f6b858720..f762709a4c 100644 --- a/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/test/java/org/example/orderservice/OrderServiceTestCase.java +++ b/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/test/java/org/example/orderservice/OrderServiceTestCase.java @@ -196,7 +196,6 @@ public class OrderServiceTestCase { testOrderReviewOrderTwoInOutsThenIn(orderService);
}
- @Ignore
@Test
public void testOrderReviewVoidApprovedSCA() throws IOException {
OrderService orderService =
@@ -205,7 +204,6 @@ public class OrderServiceTestCase { testOrderReviewVoidApproved(orderService);
}
- @Ignore
@Test
public void testOrderReviewVoidApprovedWS() throws IOException {
OrderService orderService =
@@ -214,7 +212,6 @@ public class OrderServiceTestCase { testOrderReviewVoidApproved(orderService);
}
- @Ignore
@Test
public void testOrderReviewVoidRejectedSCA() throws IOException {
OrderService orderService =
@@ -223,7 +220,6 @@ public class OrderServiceTestCase { testOrderReviewVoidRejected(orderService);
}
- @Ignore
@Test
public void testOrderReviewVoidRejectedWS() throws IOException {
OrderService orderService =
@@ -232,7 +228,26 @@ public class OrderServiceTestCase { 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<Float> outParam = new Holder<Float>(new Float(57.4));
+ Holder<Order> holder = new Holder<Order>( 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<Float> outParam) throws IOException {
Order order = new Order();
|