summaryrefslogtreecommitdiffstats
path: root/branches
diff options
context:
space:
mode:
authornash <nash@13f79535-47bb-0310-9956-ffa450edef68>2009-09-03 08:47:56 +0000
committernash <nash@13f79535-47bb-0310-9956-ffa450edef68>2009-09-03 08:47:56 +0000
commitf7806c18a527936d440e55faf87e1956843ca708 (patch)
tree9913e0c871ba9eef20df090713e3f215f616e3bd /branches
parent6ff8d9365787776369e13aba9382e6606c28ea28 (diff)
Update itest/recursive to verify successful completion (TUSCANY-3253)
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@810820 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches')
-rw-r--r--branches/sca-java-1.5.1/itest/recursive/src/main/java/composite/SourceImpl.java4
-rw-r--r--branches/sca-java-1.5.1/itest/recursive/src/test/java/composite/CompositeTestCase.java13
2 files changed, 10 insertions, 7 deletions
diff --git a/branches/sca-java-1.5.1/itest/recursive/src/main/java/composite/SourceImpl.java b/branches/sca-java-1.5.1/itest/recursive/src/main/java/composite/SourceImpl.java
index b9a0c7ff74..72bf552a1e 100644
--- a/branches/sca-java-1.5.1/itest/recursive/src/main/java/composite/SourceImpl.java
+++ b/branches/sca-java-1.5.1/itest/recursive/src/main/java/composite/SourceImpl.java
@@ -27,6 +27,7 @@ import org.osoa.sca.annotations.Service;
@Scope("COMPOSITE")
public class SourceImpl implements Source, SourceCallback {
+ public static int callbackCount = 0;
private Target targetReference;
private Target targetReference2;
@@ -49,6 +50,9 @@ public class SourceImpl implements Source, SourceCallback {
}
public void receiveResult(String result) {
+ synchronized(this) {
+ callbackCount += 1;
+ }
System.out.println("Work thread " + Thread.currentThread());
System.out.println("Result: " + result);
}
diff --git a/branches/sca-java-1.5.1/itest/recursive/src/test/java/composite/CompositeTestCase.java b/branches/sca-java-1.5.1/itest/recursive/src/test/java/composite/CompositeTestCase.java
index 5482e47463..928cb3fea9 100644
--- a/branches/sca-java-1.5.1/itest/recursive/src/test/java/composite/CompositeTestCase.java
+++ b/branches/sca-java-1.5.1/itest/recursive/src/test/java/composite/CompositeTestCase.java
@@ -39,13 +39,12 @@ public class CompositeTestCase extends TestCase {
}
public void test() throws Exception {
- try {
- System.out.println("Main thread " + Thread.currentThread());
- source.clientMethod("Client.main");
- System.out.println("Sleeping ...");
- Thread.sleep(1000);
- } catch (Throwable t) {
- t.printStackTrace();
+ System.out.println("Main thread " + Thread.currentThread());
+ source.clientMethod("Client.main");
+ System.out.println("Sleeping ...");
+ Thread.sleep(1000);
+ if (SourceImpl.callbackCount != 2) {
+ throw new IllegalStateException("Expected callbacks not received");
}
}
}