diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2011-01-21 15:39:42 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2011-01-21 15:39:42 +0000 |
commit | 2ea0eebe2f68ad06dc19abc7be2b6597ee80ed49 (patch) | |
tree | d00125252f5c701c8d8d682d4e314afa09fb75c6 /sca-java-2.x/trunk/samples/extending-tuscany/implementation-sample/src/test/java/sample/UpperSampleAsyncReferenceImpl.java | |
parent | 79e8d82441ee88da9ef1720d94ca8ccb573c306f (diff) |
TUSCANY-3783 - Fix a hole in the AsyncReponseInvoker serialization to cover the case there invoker is de-serialized inside the same context that serialized it. Update the sample to demonstrate a stop/start scenario.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1061851 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/samples/extending-tuscany/implementation-sample/src/test/java/sample/UpperSampleAsyncReferenceImpl.java')
-rw-r--r-- | sca-java-2.x/trunk/samples/extending-tuscany/implementation-sample/src/test/java/sample/UpperSampleAsyncReferenceImpl.java | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/sca-java-2.x/trunk/samples/extending-tuscany/implementation-sample/src/test/java/sample/UpperSampleAsyncReferenceImpl.java b/sca-java-2.x/trunk/samples/extending-tuscany/implementation-sample/src/test/java/sample/UpperSampleAsyncReferenceImpl.java index 4bfc8356c4..e21ab5ac90 100644 --- a/sca-java-2.x/trunk/samples/extending-tuscany/implementation-sample/src/test/java/sample/UpperSampleAsyncReferenceImpl.java +++ b/sca-java-2.x/trunk/samples/extending-tuscany/implementation-sample/src/test/java/sample/UpperSampleAsyncReferenceImpl.java @@ -62,14 +62,17 @@ public class UpperSampleAsyncReferenceImpl { upper.callAsync("upper", ureq); try { - Thread.sleep(500); - latch.await(500, TimeUnit.SECONDS); + //Thread.sleep(500); + latch.await(5, TimeUnit.SECONDS); } catch (Exception ex) { // do nothing } - if( response != null ) return response.getTextContent(); - else return "upper did not get called back"; + if( response != null ) { + return response.getTextContent(); + } else { + return "upper did not get called back"; + } } /** @@ -95,14 +98,19 @@ public class UpperSampleAsyncReferenceImpl { upper.callAsync("upper2", ureq); try { - Thread.sleep(500); - latch.await(500, TimeUnit.SECONDS); + //Thread.sleep(500); + latch.await(5, TimeUnit.SECONDS); } catch (Exception ex) { // do nothing } - if( response2 != null ) return response2.getTextContent(); - else return "upper did not get called back"; + // because we serialize the upper request and re-use it in upper2 + // the response to upper2 comes back to the upper callback + if( response != null ) { + return response.getTextContent(); + } else { + return "upper2 did not get called back"; + } } /** |