[hornetq-commits] JBoss hornetq SVN: r10995 - in branches/Branch_2_2_EAP_cluster_clean2: src/main/org/hornetq/core/server/cluster/impl and 1 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Mon Jul 18 18:05:11 EDT 2011
Author: clebert.suconic at jboss.com
Date: 2011-07-18 18:05:10 -0400 (Mon, 18 Jul 2011)
New Revision: 10995
Modified:
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/client/impl/ServerLocatorInternal.java
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/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/OneWayChainClusterTest.java
Log:
Fixing tests
Modified: branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
===================================================================
--- branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java 2011-07-18 17:05:58 UTC (rev 10994)
+++ branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java 2011-07-18 22:05:10 UTC (rev 10995)
@@ -660,7 +660,10 @@
}
else
{
- connection.destroy();
+ if (connection != null)
+ {
+ connection.destroy();
+ }
connection = null;
}
@@ -975,7 +978,15 @@
if (reconnectAttempts != -1 && count == reconnectAttempts)
{
- log.warn("Tried " + reconnectAttempts + " times to connect. Now giving up on reconnecting it.");
+ if (reconnectAttempts != 1)
+ {
+ log.warn("Tried " + reconnectAttempts + " times to connect. Now giving up on reconnecting it.");
+ }
+ else
+ if (reconnectAttempts == 1)
+ {
+ log.debug("Trying to connect towards " + this);
+ }
return;
}
Modified: branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/client/impl/ServerLocatorInternal.java
===================================================================
--- branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/client/impl/ServerLocatorInternal.java 2011-07-18 17:05:58 UTC (rev 10994)
+++ branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/client/impl/ServerLocatorInternal.java 2011-07-18 22:05:10 UTC (rev 10995)
@@ -13,14 +13,13 @@
package org.hornetq.core.client.impl;
-import org.hornetq.api.core.HornetQException;
+import java.util.concurrent.Executor;
+
import org.hornetq.api.core.Pair;
import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.core.client.ClientSessionFactory;
import org.hornetq.api.core.client.ServerLocator;
-import java.util.concurrent.Executor;
-
/**
* A ServerLocatorInternal
*
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-18 17:05:58 UTC (rev 10994)
+++ branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java 2011-07-18 22:05:10 UTC (rev 10995)
@@ -537,20 +537,8 @@
{
}
- if (me.getCode() == HornetQException.DISCONNECTED)
- {
- fail(true);
- }
- else
- {
- fail(false);
- }
+ 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-18 17:05:58 UTC (rev 10994)
+++ branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionBridge.java 2011-07-18 22:05:10 UTC (rev 10995)
@@ -140,15 +140,6 @@
}
@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/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-18 17:05:58 UTC (rev 10994)
+++ branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2011-07-18 22:05:10 UTC (rev 10995)
@@ -13,7 +13,6 @@
package org.hornetq.tests.integration.cluster.distribution;
-import java.io.PrintStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.ArrayList;
@@ -913,7 +912,7 @@
{
String br = "-------------------------\n";
String out = br;
- out += "HornetQ server " + server.getNodeID() + "\n";
+ out += "HornetQ server " + server + "\n";
ClusterManager clusterManager = server.getClusterManager();
if (clusterManager == null)
{
@@ -1791,7 +1790,7 @@
ClusterConnectionConfiguration clusterConf = new ClusterConnectionConfiguration(name,
address,
name,
- 100,
+ 500,
true,
forwardWhenNoConsumers,
maxHops,
@@ -1995,6 +1994,19 @@
ClusterTestBase.log.info("started server " + node);
waitForServer(servers[node]);
+
+ for (int i = 0 ; i <= node; i++)
+ {
+ try
+ {
+ log.info("Describing Server " + servers[i]);
+ log.info(servers[i].describe());
+ }
+ catch (Throwable ignored)
+ {
+
+ }
+ }
}
}
@@ -2041,7 +2053,7 @@
{
ClusterTestBase.log.info("stopping server " + node);
servers[node].stop();
- ClusterTestBase.log.info("server stopped");
+ ClusterTestBase.log.info("server " + node + " stopped");
}
catch (Exception e)
{
Modified: branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/distribution/OneWayChainClusterTest.java
===================================================================
--- branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/distribution/OneWayChainClusterTest.java 2011-07-18 17:05:58 UTC (rev 10994)
+++ branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/distribution/OneWayChainClusterTest.java 2011-07-18 22:05:10 UTC (rev 10995)
@@ -314,29 +314,33 @@
verifyReceiveRoundRobin(10, 0, 1);
verifyNotReceive(0, 1);
- System.out.println(clusterDescription(servers[0]));
- System.out.println(clusterDescription(servers[1]));
- System.out.println(clusterDescription(servers[2]));
- System.out.println(clusterDescription(servers[3]));
- System.out.println(clusterDescription(servers[4]));
+ log.info("============================================ before restart");
+ log.info(clusterDescription(servers[0]));
+ log.info(clusterDescription(servers[1]));
+ log.info(clusterDescription(servers[2]));
+ log.info(clusterDescription(servers[3]));
+ log.info(clusterDescription(servers[4]));
stopServers(2);
Thread.sleep(2000);
- System.out.println(clusterDescription(servers[0]));
- System.out.println(clusterDescription(servers[1]));
- System.out.println(clusterDescription(servers[3]));
- System.out.println(clusterDescription(servers[4]));
+ log.info("============================================ after stop");
+ log.info(clusterDescription(servers[0]));
+ log.info(clusterDescription(servers[1]));
+ log.info(clusterDescription(servers[3]));
+ log.info(clusterDescription(servers[4]));
+
startServers(2);
Thread.sleep(2000);
- System.out.println(clusterDescription(servers[0]));
- System.out.println(clusterDescription(servers[1]));
- System.out.println(clusterDescription(servers[2]));
- System.out.println(clusterDescription(servers[3]));
- System.out.println(clusterDescription(servers[4]));
+ log.info("============================================ after start");
+ log.info(clusterDescription(servers[0]));
+ log.info(clusterDescription(servers[1]));
+ log.info(clusterDescription(servers[2]));
+ log.info(clusterDescription(servers[3]));
+ log.info(clusterDescription(servers[4]));
send(0, "queues.testaddress", 10, false, null);
More information about the hornetq-commits
mailing list