activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbert...@apache.org
Subject [3/5] activemq-6 git commit: Improving test timing
Date Thu, 09 Apr 2015 19:16:57 GMT
Improving test timing

HangConsumerTest was hanging for 20 seconds for no real reason. this change will improve the
timing on the test


Project: http://git-wip-us.apache.org/repos/asf/activemq-6/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-6/commit/abeb0bf3
Tree: http://git-wip-us.apache.org/repos/asf/activemq-6/tree/abeb0bf3
Diff: http://git-wip-us.apache.org/repos/asf/activemq-6/diff/abeb0bf3

Branch: refs/heads/master
Commit: abeb0bf3c248a01dafff9d19d02231dfe087d3a6
Parents: 2154c75
Author: Clebert Suconic <clebertsuconic@apache.org>
Authored: Thu Apr 2 15:22:56 2015 -0400
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Thu Apr 9 15:05:19 2015 -0400

----------------------------------------------------------------------
 .../integration/client/HangConsumerTest.java    | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-6/blob/abeb0bf3/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/client/HangConsumerTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/client/HangConsumerTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/client/HangConsumerTest.java
index fb56440..1b6349a 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/client/HangConsumerTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/client/HangConsumerTest.java
@@ -15,12 +15,7 @@
  * limitations under the License.
  */
 package org.apache.activemq.tests.integration.client;
-import org.apache.activemq.api.core.ActiveMQException;
-import org.apache.activemq.core.server.ServerConsumer;
-import org.junit.Before;
-import org.junit.After;
-import org.junit.Test;
-
+import javax.management.MBeanServer;
 import java.lang.management.ManagementFactory;
 import java.util.LinkedList;
 import java.util.concurrent.CountDownLatch;
@@ -29,9 +24,7 @@ import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.Semaphore;
 import java.util.concurrent.TimeUnit;
 
-import javax.management.MBeanServer;
-
-import org.junit.Assert;
+import org.apache.activemq.api.core.ActiveMQException;
 import org.apache.activemq.api.core.Interceptor;
 import org.apache.activemq.api.core.SimpleString;
 import org.apache.activemq.api.core.client.ClientConsumer;
@@ -56,6 +49,7 @@ import org.apache.activemq.core.protocol.core.Packet;
 import org.apache.activemq.core.protocol.core.impl.wireformat.SessionReceiveMessage;
 import org.apache.activemq.core.server.ActiveMQServer;
 import org.apache.activemq.core.server.Queue;
+import org.apache.activemq.core.server.ServerConsumer;
 import org.apache.activemq.core.server.ServerMessage;
 import org.apache.activemq.core.server.ServerSessionFactory;
 import org.apache.activemq.core.server.impl.ActiveMQServerImpl;
@@ -72,6 +66,10 @@ import org.apache.activemq.spi.core.security.ActiveMQSecurityManagerImpl;
 import org.apache.activemq.tests.util.ServiceTestBase;
 import org.apache.activemq.utils.ExecutorFactory;
 import org.apache.activemq.utils.ReusableLatch;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
 
 /**
  * This test will simulate a consumer hanging on the delivery packet due to unbehaved clients
@@ -150,8 +148,8 @@ public class HangConsumerTest extends ServiceTestBase
          sessionProducer.commit();
 
          // These three operations should finish without the test hanging
-         getMessagesAdded(queue);
-         getMessageCount(queue);
+         queue.getMessagesAdded();
+         queue.getMessageCount();
 
          releaseConsumers();
 


Mime
View raw message