diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2010-06-09 09:58:52 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2010-06-09 09:58:52 +0000 |
commit | 9e744e0ad3d2c889c7fc8780571edd8d9546bdba (patch) | |
tree | 17a11fa2a1fcdcde78529a0bba1238f3a197e373 /sca-java-2.x/trunk/itest | |
parent | fc798cf487086140c5213fdd0dae46b9fa9880cd (diff) |
Add more ws callback test cases
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@952934 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/itest')
3 files changed, 67 insertions, 22 deletions
diff --git a/sca-java-2.x/trunk/itest/callback-basic-ws/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClientImpl.java b/sca-java-2.x/trunk/itest/callback-basic-ws/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClientImpl.java index 4bb6b29a8d..f98a70e5cc 100644 --- a/sca-java-2.x/trunk/itest/callback-basic-ws/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClientImpl.java +++ b/sca-java-2.x/trunk/itest/callback-basic-ws/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClientImpl.java @@ -27,6 +27,7 @@ public class CallBackBasicClientImpl implements CallBackBasicClient, CallBackBas @Reference protected CallBackBasicService aCallBackService; + private static String returnMessage = null; private static int callBackCount = 0; private static Object monitor = new Object(); @@ -34,6 +35,7 @@ public class CallBackBasicClientImpl implements CallBackBasicClient, CallBackBas public void run() { // This tests basic callback patterns. + callBackCount = 0; // Test1 is the basic callback where the target calls back prior to // returning to the client. diff --git a/sca-java-2.x/trunk/itest/callback-basic-ws/src/main/resources/CallBackBasicTest.composite b/sca-java-2.x/trunk/itest/callback-basic-ws/src/main/resources/CallBackBasicTest.composite index 5e77ac2b91..8389be6fad 100644 --- a/sca-java-2.x/trunk/itest/callback-basic-ws/src/main/resources/CallBackBasicTest.composite +++ b/sca-java-2.x/trunk/itest/callback-basic-ws/src/main/resources/CallBackBasicTest.composite @@ -20,24 +20,56 @@ <composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" targetNamespace="http://callback" name="CallBackBasicTest"> + + <!-- 1 - target specified forward binding implied callback binding--> + <component name="CallBackBasicClient1"> + <implementation.java class="org.apache.tuscany.sca.test.CallBackBasicClientImpl"/> + <reference name="aCallBackService" target="CallBackBasicService1"/> + </component> + + <component name="CallBackBasicService1"> + <implementation.java class="org.apache.tuscany.sca.test.CallBackBasicServiceImpl"/> + <service name="CallBackBasicService"> + <binding.ws uri="http://localhost:8085/CallBackTargetService"/> + </service> + </component> - <component name="CallBackBasicClient"> + <!-- 2 - target specified forward binding and fully specified callback binding --> + <component name="CallBackBasicClient2"> <implementation.java class="org.apache.tuscany.sca.test.CallBackBasicClientImpl"/> - <reference name="aCallBackService" target="CallBackBasicService"> + <reference name="aCallBackService" target="CallBackBasicService2"> <callback> - <binding.ws uri="http://localhost:8084/aCallBackService"/> + <binding.ws uri="http://localhost:8084/CallBackClientService"/> </callback> </reference> </component> - <component name="CallBackBasicService"> + <component name="CallBackBasicService2"> <implementation.java class="org.apache.tuscany.sca.test.CallBackBasicServiceImpl"/> <service name="CallBackBasicService"> - <binding.ws uri="http://localhost:8085/CallBackBasicService"/> + <binding.ws uri="http://localhost:8085/CallBackTargetService"/> <callback> - <binding.ws uri="http://localhost:8084/aCallBackService"/> + <binding.ws uri="http://localhost:8084/CallBackClientService"/> </callback> </service> </component> - + + <!-- 3 - fully specified forward binding implied callback binding--> + <component name="CallBackBasicClient3"> + <implementation.java class="org.apache.tuscany.sca.test.CallBackBasicClientImpl"/> + <reference name="aCallBackService"> + <binding.ws uri="http://localhost:8085/CallBackTargetService"/> + </reference> + </component> + + <component name="CallBackBasicService3"> + <implementation.java class="org.apache.tuscany.sca.test.CallBackBasicServiceImpl"/> + <service name="CallBackBasicService"> + <binding.ws uri="http://localhost:8085/CallBackTargetService"/> + </service> + </component> + + <!-- 4 - part specified callback binding --> + <!-- TODO --> + </composite> diff --git a/sca-java-2.x/trunk/itest/callback-basic-ws/src/test/java/org/apache/tuscany/sca/test/CallBackBasicTestCase.java b/sca-java-2.x/trunk/itest/callback-basic-ws/src/test/java/org/apache/tuscany/sca/test/CallBackBasicTestCase.java index 43b812faed..8955e31462 100644 --- a/sca-java-2.x/trunk/itest/callback-basic-ws/src/test/java/org/apache/tuscany/sca/test/CallBackBasicTestCase.java +++ b/sca-java-2.x/trunk/itest/callback-basic-ws/src/test/java/org/apache/tuscany/sca/test/CallBackBasicTestCase.java @@ -24,32 +24,43 @@ import org.apache.tuscany.sca.node.ContributionLocationHelper; import org.apache.tuscany.sca.node.Node; import org.apache.tuscany.sca.node.NodeFactory; import org.junit.After; +import org.junit.AfterClass; import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; public class CallBackBasicTestCase { private static Node node; - private CallBackBasicClient aCallBackClient; + + @BeforeClass + public static void setUp() throws Exception { + String location = ContributionLocationHelper.getContributionLocation("CallBackBasicTest.composite"); + node = NodeFactory.newInstance().createNode("CallBackBasicTest.composite", new Contribution("c1", location)); + node.start(); + } @Test - public void testCallBackBasic() { + public void testCallBackBasic1() { + CallBackBasicClient aCallBackClient = node.getService(CallBackBasicClient.class, "CallBackBasicClient1"); aCallBackClient.run(); } - - @Before - public void setUp() throws Exception { - if (node == null) { - String location = ContributionLocationHelper.getContributionLocation("CallBackBasicTest.composite"); - node = NodeFactory.newInstance().createNode("CallBackBasicTest.composite", new Contribution("c1", location)); - node.start(); - } - - aCallBackClient = node.getService(CallBackBasicClient.class, "CallBackBasicClient"); + + @Test + public void testCallBackBasic2() { + CallBackBasicClient aCallBackClient = node.getService(CallBackBasicClient.class, "CallBackBasicClient2"); + aCallBackClient.run(); } - - @After - public void tearDown() throws Exception { + + @Test + public void testCallBackBasic3() { + CallBackBasicClient aCallBackClient = node.getService(CallBackBasicClient.class, "CallBackBasicClient3"); + aCallBackClient.run(); + } + + @AfterClass + public static void tearDown() throws Exception { node.stop(); } |