You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2013/01/25 00:59:04 UTC

svn commit: r1438272 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsSendWithAsyncCallbackTest.java

Author: tabish
Date: Thu Jan 24 23:59:04 2013
New Revision: 1438272

URL: http://svn.apache.org/viewvc?rev=1438272&view=rev
Log:
Add an information message to the assert so we can see how much it failed by. 

Modified:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsSendWithAsyncCallbackTest.java

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsSendWithAsyncCallbackTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsSendWithAsyncCallbackTest.java?rev=1438272&r1=1438271&r2=1438272&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsSendWithAsyncCallbackTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsSendWithAsyncCallbackTest.java Thu Jan 24 23:59:04 2013
@@ -39,6 +39,7 @@ public class JmsSendWithAsyncCallbackTes
 
     private Connection connection;
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
         connection = createConnection();
@@ -47,6 +48,7 @@ public class JmsSendWithAsyncCallbackTes
     /**
      * @see junit.framework.TestCase#tearDown()
      */
+    @Override
     protected void tearDown() throws Exception {
         if (connection != null) {
             connection.close();
@@ -70,7 +72,7 @@ public class JmsSendWithAsyncCallbackTes
         });
 
         // warmup...
-        for(int i=0; i < 10; i++) {
+        for (int i = 0; i < 10; i++) {
             benchmarkNonCallbackRate();
             benchmarkCallbackRate();
         }
@@ -82,7 +84,7 @@ public class JmsSendWithAsyncCallbackTes
         LOG.info(String.format("NonAsyncCallback Send rate: %,.2f m/s", nonCallbackRate));
 
         // The async style HAS to be faster than the non-async style..
-        assertTrue( callbackRate/nonCallbackRate > 1.5 );
+        assertTrue("async rate[" + callbackRate + "] should beat non-async rate[" + nonCallbackRate + "]", callbackRate / nonCallbackRate > 1.5);
     }
 
     private double benchmarkNonCallbackRate() throws JMSException {