Author: borges
Date: 2011-11-28 07:47:33 -0500 (Mon, 28 Nov 2011)
New Revision: 11776
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailoverTest.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/util/SameProcessHornetQServer.java
Log:
Improve test failure messages
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailoverTest.java
===================================================================
---
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailoverTest.java 2011-11-28
12:47:17 UTC (rev 11775)
+++
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailoverTest.java 2011-11-28
12:47:33 UTC (rev 11776)
@@ -428,7 +428,7 @@
message = consumer.receiveImmediate();
- Assert.assertNotNull(message);
+ Assert.assertNotNull("expecting a message", message);
Assert.assertEquals(counter,
message.getIntProperty("counter").intValue());
session.close();
@@ -1427,7 +1427,7 @@
committer.join();
- Assert.assertFalse(committer.failed);
+ Assert.assertFalse("second attempt succeed?", committer.failed);
session.close();
@@ -1462,13 +1462,13 @@
}
catch (HornetQException e)
{
- assertEquals(HornetQException.DUPLICATE_ID_REJECTED, e.getCode());
+ assertEquals(e.getMessage(), HornetQException.DUPLICATE_ID_REJECTED,
e.getCode());
}
- ClientConsumer consumer = session2.createConsumer(FailoverTestBase.ADDRESS);
session2.start();
+ ClientConsumer consumer = session2.createConsumer(FailoverTestBase.ADDRESS);
receiveMessages(consumer);
ClientMessage message = consumer.receiveImmediate();
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java
===================================================================
---
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java 2011-11-28
12:47:17 UTC (rev 11775)
+++
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java 2011-11-28
12:47:33 UTC (rev 11776)
@@ -165,7 +165,7 @@
for (int j = 0; j < LARGE_MESSAGE_SIZE; j++)
{
- Assert.assertTrue("expecting " + LARGE_MESSAGE_SIZE + " bytes,
got " + j, buffer.readable());
+ Assert.assertTrue("msg " + i + ", expecting " +
LARGE_MESSAGE_SIZE + " bytes, got " + j, buffer.readable());
Assert.assertEquals("equal at " + j, UnitTestCase.getSamplebyte(j),
buffer.readByte());
}
}
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/util/SameProcessHornetQServer.java
===================================================================
---
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/util/SameProcessHornetQServer.java 2011-11-28
12:47:17 UTC (rev 11775)
+++
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/util/SameProcessHornetQServer.java 2011-11-28
12:47:33 UTC (rev 11776)
@@ -100,7 +100,8 @@
{
// Wait to be informed of failure
boolean ok = listener.getLatch().await(10000, TimeUnit.MILLISECONDS);
- Assert.assertTrue("Failed to stop the server! Latch count is " +
listener.getLatch().getCount(), ok);
+ Assert.assertTrue("Failed to stop the server! Latch count is " +
listener.getLatch().getCount() + " out of " +
+ sessions.length, ok);
}
}
Show replies by date