Author: clebert.suconic(a)jboss.com
Date: 2011-09-01 18:50:36 -0400 (Thu, 01 Sep 2011)
New Revision: 11281
Modified:
branches/one-offs/Hornetq_2_2_4_EAP_JBPAPP_7116/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
Log:
Improving test
Modified:
branches/one-offs/Hornetq_2_2_4_EAP_JBPAPP_7116/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
===================================================================
---
branches/one-offs/Hornetq_2_2_4_EAP_JBPAPP_7116/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2011-09-01
22:35:21 UTC (rev 11280)
+++
branches/one-offs/Hornetq_2_2_4_EAP_JBPAPP_7116/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2011-09-01
22:50:36 UTC (rev 11281)
@@ -38,7 +38,6 @@
import org.hornetq.core.config.BroadcastGroupConfiguration;
import org.hornetq.core.config.ClusterConnectionConfiguration;
import org.hornetq.core.config.Configuration;
-import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.postoffice.Binding;
import org.hornetq.core.postoffice.Bindings;
@@ -693,6 +692,11 @@
Assert.assertNotNull("consumer " + consumerIDs[i] + " did
not receive message " + j, message);
}
+ if (isLargeMessage())
+ {
+ validateLargeMessage(message);
+ }
+
if (ack)
{
message.acknowledge();
@@ -751,6 +755,11 @@
Assert.fail("consumer " + i + " did not receive all
messages");
}
+ if (isLargeMessage())
+ {
+ validateLargeMessage(message);
+ }
+
if (ack)
{
message.acknowledge();
@@ -795,10 +804,7 @@
if (isLargeMessage())
{
- for (int posMsg = 0; posMsg < getLargeMessageSize(); posMsg++)
- {
- assertEquals(getSamplebyte(posMsg),
message.getBodyBuffer().readByte());
- }
+ validateLargeMessage(message);
}
if (ack)
@@ -894,6 +900,11 @@
if (message != null)
{
+ if (isLargeMessage())
+ {
+ validateLargeMessage(message);
+ }
+
ClusterTestBase.log.info("check receive Consumer " + consumerID
+
" received message " +
message.getObjectProperty(ClusterTestBase.COUNT_PROP));
@@ -928,6 +939,10 @@
Assert.assertEquals("consumer " + consumerIDs[count] + " message
" + i,
i,
message.getObjectProperty(ClusterTestBase.COUNT_PROP));
+ if (isLargeMessage())
+ {
+ validateLargeMessage(message);
+ }
count++;
@@ -984,6 +999,10 @@
ClientMessage msg = holder.consumer.receive(10000);
Assert.assertNotNull(msg);
+ if (isLargeMessage())
+ {
+ validateLargeMessage(msg);
+ }
int count = msg.getIntProperty(ClusterTestBase.COUNT_PROP);
@@ -1027,6 +1046,10 @@
ClientMessage msg = holder.consumer.consumer.receive(10000);
Assert.assertNotNull(msg);
+ if (isLargeMessage())
+ {
+ validateLargeMessage(msg);
+ }
int p = msg.getIntProperty(ClusterTestBase.COUNT_PROP);
@@ -1083,10 +1106,7 @@
if (isLargeMessage())
{
- for (int posMsg = 0; posMsg < getLargeMessageSize(); posMsg++)
- {
- assertEquals(getSamplebyte(posMsg),
message.getBodyBuffer().readByte());
- }
+ validateLargeMessage(message);
}
// log.info("consumer " + consumerIDs[i] + " received
message " + count);
@@ -1185,10 +1205,7 @@
if (isLargeMessage())
{
- for (int posMsg = 0; posMsg < getLargeMessageSize(); posMsg++)
- {
- assertEquals(getSamplebyte(posMsg),
message.getBodyBuffer().readByte());
- }
+ validateLargeMessage(message);
}
if (ack)
@@ -1923,6 +1940,17 @@
}
}
+ /**
+ * @param message
+ */
+ private void validateLargeMessage(ClientMessage message)
+ {
+ for (int posMsg = 0; posMsg < getLargeMessageSize(); posMsg++)
+ {
+ assertEquals(getSamplebyte(posMsg), message.getBodyBuffer().readByte());
+ }
+ }
+
protected boolean isFileStorage()
{
return true;
Show replies by date