Add an information message to the assert so we can see how much it failed by.

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1438272 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Timothy A. Bish 2013-01-24 23:59:04 +00:00
parent 80d0605682
commit 6473236e34
1 changed files with 4 additions and 2 deletions

View File

@ -39,6 +39,7 @@ public class JmsSendWithAsyncCallbackTest extends TestSupport {
private Connection connection; private Connection connection;
@Override
protected void setUp() throws Exception { protected void setUp() throws Exception {
super.setUp(); super.setUp();
connection = createConnection(); connection = createConnection();
@ -47,6 +48,7 @@ public class JmsSendWithAsyncCallbackTest extends TestSupport {
/** /**
* @see junit.framework.TestCase#tearDown() * @see junit.framework.TestCase#tearDown()
*/ */
@Override
protected void tearDown() throws Exception { protected void tearDown() throws Exception {
if (connection != null) { if (connection != null) {
connection.close(); connection.close();
@ -70,7 +72,7 @@ public class JmsSendWithAsyncCallbackTest extends TestSupport {
}); });
// warmup... // warmup...
for(int i=0; i < 10; i++) { for (int i = 0; i < 10; i++) {
benchmarkNonCallbackRate(); benchmarkNonCallbackRate();
benchmarkCallbackRate(); benchmarkCallbackRate();
} }
@ -82,7 +84,7 @@ public class JmsSendWithAsyncCallbackTest extends TestSupport {
LOG.info(String.format("NonAsyncCallback Send rate: %,.2f m/s", nonCallbackRate)); LOG.info(String.format("NonAsyncCallback Send rate: %,.2f m/s", nonCallbackRate));
// The async style HAS to be faster than the non-async style.. // 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 { private double benchmarkNonCallbackRate() throws JMSException {