[hornetq-commits] JBoss hornetq SVN: r10990 - in branches/Branch_2_2_EAP_cluster_clean2: src/main/org/hornetq/core/server/impl and 2 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Fri Jul 15 18:47:48 EDT 2011
Author: clebert.suconic at jboss.com
Date: 2011-07-15 18:47:48 -0400 (Fri, 15 Jul 2011)
New Revision: 10990
Modified:
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionBridge.java
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/impl/ServerConsumerImpl.java
branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/restart/ClusterRestartTest.java
Log:
Fixing tests
Modified: branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java
===================================================================
--- branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java 2011-07-14 23:29:23 UTC (rev 10989)
+++ branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java 2011-07-15 22:47:48 UTC (rev 10990)
@@ -546,6 +546,11 @@
fail(false);
}
+ scheduleRetryReconnect(me.getCode());
+ }
+
+ protected void scheduleRetryReconnect(int errorCode)
+ {
scheduleRetryConnect();
}
Modified: branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionBridge.java
===================================================================
--- branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionBridge.java 2011-07-14 23:29:23 UTC (rev 10989)
+++ branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionBridge.java 2011-07-15 22:47:48 UTC (rev 10990)
@@ -140,6 +140,15 @@
}
@Override
+ protected void scheduleRetryReconnect(int errorCode)
+ {
+ if (errorCode != HornetQException.DISCONNECTED)
+ {
+ scheduleRetryConnect();
+ }
+ }
+
+ @Override
protected ServerMessage beforeForward(ServerMessage message)
{
// We make a copy of the message, then we strip out the unwanted routing id headers and leave
Modified: branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/impl/ServerConsumerImpl.java
===================================================================
--- branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/impl/ServerConsumerImpl.java 2011-07-14 23:29:23 UTC (rev 10989)
+++ branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/impl/ServerConsumerImpl.java 2011-07-15 22:47:48 UTC (rev 10990)
@@ -232,7 +232,7 @@
{
return HandleStatus.BUSY;
}
-
+
// If there is a pendingLargeMessage we can't take another message
// This has to be checked inside the lock as the set to null is done inside the lock
if (largeMessageInDelivery)
@@ -240,6 +240,11 @@
return HandleStatus.BUSY;
}
+ if (log.isTraceEnabled())
+ {
+ log.trace("Handling reference " + ref);
+ }
+
final ServerMessage message = ref.getMessage();
if (filter != null && !filter.match(message))
Modified: branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
===================================================================
--- branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2011-07-14 23:29:23 UTC (rev 10989)
+++ branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2011-07-15 22:47:48 UTC (rev 10990)
@@ -839,6 +839,7 @@
final int... consumerIDs) throws Exception
{
boolean outOfOrder = false;
+ String firstOutOfOrderMessage = null;
for (int consumerID : consumerIDs)
{
ConsumerHolder holder = consumers[consumerID];
@@ -860,11 +861,11 @@
dumpConsumers();
- Assert.assertNotNull("consumer " + consumerID + " did not receive message " + j, message);
+ Assert.fail("consumer " + consumerID + " did not receive message " + j);
}
+
+ log.info("msg on ClusterTestBase = " + message);
-
-
if (ack)
{
message.acknowledge();
@@ -877,15 +878,22 @@
if (j != (Integer)message.getObjectProperty(ClusterTestBase.COUNT_PROP))
{
+ if (firstOutOfOrderMessage == null)
+ {
+ firstOutOfOrderMessage = "expected " + j + " received " + message.getObjectProperty(ClusterTestBase.COUNT_PROP);
+ }
outOfOrder = true;
System.out.println("Message j=" + j +
" was received out of order = " +
message.getObjectProperty(ClusterTestBase.COUNT_PROP));
+ log.info("Message j=" + j +
+ " was received out of order = " +
+ message.getObjectProperty(ClusterTestBase.COUNT_PROP));
}
}
}
- Assert.assertFalse("Messages were consumed out of order, look at System.out for more information", outOfOrder);
+ Assert.assertFalse("Messages were consumed out of order::" + firstOutOfOrderMessage, outOfOrder);
}
private void dumpConsumers() throws Exception
Modified: branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/restart/ClusterRestartTest.java
===================================================================
--- branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/restart/ClusterRestartTest.java 2011-07-14 23:29:23 UTC (rev 10989)
+++ branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/restart/ClusterRestartTest.java 2011-07-15 22:47:48 UTC (rev 10990)
@@ -15,6 +15,7 @@
import java.util.Collection;
import org.hornetq.api.core.SimpleString;
+import org.hornetq.core.logging.Logger;
import org.hornetq.core.postoffice.Binding;
import org.hornetq.tests.integration.cluster.distribution.ClusterTestBase;
@@ -24,6 +25,8 @@
*/
public class ClusterRestartTest extends ClusterTestBase
{
+ Logger log = Logger.getLogger(ClusterRestartTest.class);
+
public void testRestartWithQueuesCreateInDiffOrder() throws Exception
{
setupServer(0, isFileStorage(), isNetty());
@@ -71,12 +74,11 @@
sendInRange(1, "queues.testaddress", 0, 10, true, null);
- System.out.println("stopping******************************************************");
+ log.info("stopping******************************************************");
stopServers(0);
+ log.info("stopped, waiting 2 seconds************************************");
Thread.sleep(2000);
- System.out.println("stopped******************************************************");
startServers(0);
-
waitForBindings(0, "queues.testaddress", 1, 1, true);
waitForBindings(1, "queues.testaddress", 1, 0, true);
More information about the hornetq-commits
mailing list