summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.x/modules/binding-erlang-runtime/src/test
diff options
context:
space:
mode:
authorwjaniszewski <wjaniszewski@13f79535-47bb-0310-9956-ffa450edef68>2009-04-03 21:45:50 +0000
committerwjaniszewski <wjaniszewski@13f79535-47bb-0310-9956-ffa450edef68>2009-04-03 21:45:50 +0000
commit2de833622c128decbfe98f187105eff9e3c9d13c (patch)
treef796d86d7a7bfb88ed3c64b3fd8d0591014acc6e /branches/sca-java-1.x/modules/binding-erlang-runtime/src/test
parent707688021dcefb93f9ceb7098d73dd695d7be7a8 (diff)
Added configurable thread pools, fixed problem with ReferenceServiceTestCase.testMultipleMethod() test case, added writing to binding processor - problems with testing
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@761812 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.x/modules/binding-erlang-runtime/src/test')
-rw-r--r--branches/sca-java-1.x/modules/binding-erlang-runtime/src/test/java/org/apache/tuscany/sca/binding/erlang/testing/MboxListener.java16
-rw-r--r--branches/sca-java-1.x/modules/binding-erlang-runtime/src/test/java/org/apache/tuscany/sca/binding/erlang/testing/ReferenceServiceTestCase.java1
2 files changed, 15 insertions, 2 deletions
diff --git a/branches/sca-java-1.x/modules/binding-erlang-runtime/src/test/java/org/apache/tuscany/sca/binding/erlang/testing/MboxListener.java b/branches/sca-java-1.x/modules/binding-erlang-runtime/src/test/java/org/apache/tuscany/sca/binding/erlang/testing/MboxListener.java
index 0460db2c1e..8450fd48a4 100644
--- a/branches/sca-java-1.x/modules/binding-erlang-runtime/src/test/java/org/apache/tuscany/sca/binding/erlang/testing/MboxListener.java
+++ b/branches/sca-java-1.x/modules/binding-erlang-runtime/src/test/java/org/apache/tuscany/sca/binding/erlang/testing/MboxListener.java
@@ -37,7 +37,7 @@ public class MboxListener implements Runnable {
public MboxListener(OtpMbox mbox, Object response) {
this(mbox, response, 0);
}
-
+
public MboxListener(OtpMbox mbox, Object response, long duration) {
this.mbox = mbox;
this.response = response;
@@ -59,6 +59,20 @@ public class MboxListener implements Runnable {
}
public OtpMsg getMsg() {
+ // Sometimes clients tries to get message which isn't fully received.
+ // If so - give it more tries. This sometimes caused
+ // NullPointerException in
+ // ReferenceServiceTestCase.testMultipleArguments().
+ for (int i = 0; i < 3; i++) {
+ if (msg != null) {
+ return msg;
+ } else {
+ try {
+ Thread.sleep(100);
+ } catch (InterruptedException e) {
+ }
+ }
+ }
return msg;
}
diff --git a/branches/sca-java-1.x/modules/binding-erlang-runtime/src/test/java/org/apache/tuscany/sca/binding/erlang/testing/ReferenceServiceTestCase.java b/branches/sca-java-1.x/modules/binding-erlang-runtime/src/test/java/org/apache/tuscany/sca/binding/erlang/testing/ReferenceServiceTestCase.java
index 6d9d117b0e..b602590183 100644
--- a/branches/sca-java-1.x/modules/binding-erlang-runtime/src/test/java/org/apache/tuscany/sca/binding/erlang/testing/ReferenceServiceTestCase.java
+++ b/branches/sca-java-1.x/modules/binding-erlang-runtime/src/test/java/org/apache/tuscany/sca/binding/erlang/testing/ReferenceServiceTestCase.java
@@ -284,7 +284,6 @@ public class ReferenceServiceTestCase {
*
* @throws Exception
*/
- // TODO: this test fails sometime
@Test(timeout = 1000)
public void testMultipleArguments() throws Exception {
MboxListener mboxListener = new MboxListener(serMbox, true);