You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by cs...@apache.org on 2017/10/10 16:47:05 UTC

aries-jax-rs-whiteboard git commit: Fix time dependent test

Repository: aries-jax-rs-whiteboard
Updated Branches:
  refs/heads/master 95c2f63a4 -> d59357142


Fix time dependent test


Project: http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/repo
Commit: http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/commit/d5935714
Tree: http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/tree/d5935714
Diff: http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/diff/d5935714

Branch: refs/heads/master
Commit: d593571421ae91c34378044e7e03e251e5c8bcf8
Parents: 95c2f63
Author: Carlos Sierra <cs...@apache.org>
Authored: Tue Oct 10 18:46:42 2017 +0200
Committer: Carlos Sierra <cs...@apache.org>
Committed: Tue Oct 10 18:46:42 2017 +0200

----------------------------------------------------------------------
 jax-rs.itests/src/main/java/test/JaxrsTest.java | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/d5935714/jax-rs.itests/src/main/java/test/JaxrsTest.java
----------------------------------------------------------------------
diff --git a/jax-rs.itests/src/main/java/test/JaxrsTest.java b/jax-rs.itests/src/main/java/test/JaxrsTest.java
index a6721ea..a85e5e6 100644
--- a/jax-rs.itests/src/main/java/test/JaxrsTest.java
+++ b/jax-rs.itests/src/main/java/test/JaxrsTest.java
@@ -26,8 +26,10 @@ import java.util.Dictionary;
 import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.Set;
+import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
 
 import org.junit.After;
@@ -656,8 +658,16 @@ public class JaxrsTest extends TestHelper {
         AtomicBoolean pre = new AtomicBoolean();
         AtomicBoolean post = new AtomicBoolean();
 
+        CountDownLatch countDownLatch = new CountDownLatch(1);
+
         registerAddon(
-            new TestAsyncResource(() -> pre.set(true), () -> post.set(true)));
+            new TestAsyncResource(
+                () -> pre.set(true),
+                () -> {
+                    post.set(true);
+
+                    countDownLatch.countDown();
+                }));
 
         Future<String> future = webTarget.request().async().get(
             new InvocationCallback<String>() {
@@ -674,6 +684,8 @@ public class JaxrsTest extends TestHelper {
 
         String result = future.get();
 
+        countDownLatch.await(1, TimeUnit.MINUTES);
+
         assertTrue(post.get());
 
         assertEquals("This should say HelloAsync", "HelloAsync", result);