qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rob...@apache.org
Subject qpid-jms git commit: reduce time taken for tests, add protective junit timeouts for those testing queue timeouts
Date Mon, 09 Feb 2015 23:07:06 GMT
Repository: qpid-jms
Updated Branches:
  refs/heads/master 040b76198 -> 8b5a0f8a6


reduce time taken for tests, add protective junit timeouts for those testing queue timeouts


Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/8b5a0f8a
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/8b5a0f8a
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/8b5a0f8a

Branch: refs/heads/master
Commit: 8b5a0f8a62e237cd00b8d1c28a7a8d9a540e0369
Parents: 040b761
Author: Robert Gemmell <robbie@apache.org>
Authored: Mon Feb 9 23:04:37 2015 +0000
Committer: Robert Gemmell <robbie@apache.org>
Committed: Mon Feb 9 23:04:55 2015 +0000

----------------------------------------------------------------------
 .../apache/qpid/jms/util/FifoMessageQueueTest.java  |  4 ++--
 .../qpid/jms/util/PriorityMessageQueueTest.java     | 16 ++++++++--------
 2 files changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/8b5a0f8a/qpid-jms-client/src/test/java/org/apache/qpid/jms/util/FifoMessageQueueTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/util/FifoMessageQueueTest.java
b/qpid-jms-client/src/test/java/org/apache/qpid/jms/util/FifoMessageQueueTest.java
index 4bc7908..3a7b656 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/util/FifoMessageQueueTest.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/util/FifoMessageQueueTest.java
@@ -258,7 +258,7 @@ public class FifoMessageQueueTest {
         assertTrue(queue.isEmpty());
     }
 
-    @Test
+    @Test(timeout = 10000)
     public void testDequeueWaitsUntilMessageArrives() throws InterruptedException {
         final JmsInboundMessageDispatch message = createEnvelope();
         Thread runner = new Thread(new Runnable() {
@@ -266,7 +266,7 @@ public class FifoMessageQueueTest {
             @Override
             public void run() {
                 try {
-                    TimeUnit.SECONDS.sleep(2);
+                    TimeUnit.MILLISECONDS.sleep(500);
                 } catch (InterruptedException e) {
                 }
                 queue.enqueueFirst(message);

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/8b5a0f8a/qpid-jms-client/src/test/java/org/apache/qpid/jms/util/PriorityMessageQueueTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/util/PriorityMessageQueueTest.java
b/qpid-jms-client/src/test/java/org/apache/qpid/jms/util/PriorityMessageQueueTest.java
index 79d3c19..ad4d4f3 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/util/PriorityMessageQueueTest.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/util/PriorityMessageQueueTest.java
@@ -283,7 +283,7 @@ public class PriorityMessageQueueTest {
         assertTrue(queue.isEmpty());
     }
 
-    @Test
+    @Test(timeout = 10000)
     public void testDequeueWaitsUntilMessageArrives() throws InterruptedException {
         final JmsInboundMessageDispatch message = createEnvelope();
         Thread runner = new Thread(new Runnable() {
@@ -291,7 +291,7 @@ public class PriorityMessageQueueTest {
             @Override
             public void run() {
                 try {
-                    TimeUnit.SECONDS.sleep(2);
+                    TimeUnit.MILLISECONDS.sleep(200);
                 } catch (InterruptedException e) {
                 }
                 queue.enqueueFirst(message);
@@ -302,7 +302,7 @@ public class PriorityMessageQueueTest {
         assertSame(message, queue.dequeue(-1));
     }
 
-    @Test
+    @Test(timeout = 10000)
     public void testDequeueTimedWaitsUntilMessageArrives() throws InterruptedException {
         final JmsInboundMessageDispatch message = createEnvelope();
         Thread runner = new Thread(new Runnable() {
@@ -310,7 +310,7 @@ public class PriorityMessageQueueTest {
             @Override
             public void run() {
                 try {
-                    TimeUnit.SECONDS.sleep(2);
+                    TimeUnit.MILLISECONDS.sleep(500);
                 } catch (InterruptedException e) {
                 }
                 queue.enqueueFirst(message);
@@ -318,10 +318,10 @@ public class PriorityMessageQueueTest {
         });
         runner.start();
 
-        assertSame(message, queue.dequeue(10000));
+        assertSame(message, queue.dequeue(5000));
     }
 
-    @Test
+    @Test(timeout = 10000)
     public void testDequeueWaitsUntilMessageArrivesWhenLockNotified() throws InterruptedException
{
         final JmsInboundMessageDispatch message = createEnvelope();
         Thread runner = new Thread(new Runnable() {
@@ -329,14 +329,14 @@ public class PriorityMessageQueueTest {
             @Override
             public void run() {
                 try {
-                    TimeUnit.SECONDS.sleep(2);
+                    TimeUnit.MILLISECONDS.sleep(200);
                 } catch (InterruptedException e) {
                 }
                 synchronized (queue.getLock()) {
                     queue.getLock().notify();
                 }
                 try {
-                    TimeUnit.SECONDS.sleep(1);
+                    TimeUnit.MILLISECONDS.sleep(200);
                 } catch (InterruptedException e) {
                 }
                 queue.enqueueFirst(message);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message