Author: timfox
Date: 2009-11-11 09:12:14 -0500 (Wed, 11 Nov 2009)
New Revision: 8261
Modified:
trunk/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java
trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/GroupingFailoverReplicationTest.java
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/GroupingFailoverTestBase.java
Log:
reversed andy's patch
Modified: trunk/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java
===================================================================
---
trunk/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java 2009-11-11
14:08:48 UTC (rev 8260)
+++
trunk/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java 2009-11-11
14:12:14 UTC (rev 8261)
@@ -676,9 +676,8 @@
distance + 1);
bindings.put(clusterName, binding);
- log.info(clusterName + " binding " + binding + " to " +
server.getNodeID() + " distance = " + distance +
server.getConfiguration().isBackup());
- Binding b = postOffice.getBinding(clusterName);
- if (b != null)
+
+ if (postOffice.getBinding(clusterName) != null)
{
// Sanity check - this means the binding has already been added via another
bridge, probably max
// hops is too high
Modified:
trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2009-11-11
14:08:48 UTC (rev 8260)
+++
trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2009-11-11
14:12:14 UTC (rev 8261)
@@ -84,9 +84,7 @@
protected void setUp() throws Exception
{
super.setUp();
- consumers = new ConsumerHolder[MAX_CONSUMERS];
- servers = new HornetQServer[MAX_SERVERS];
- sfs = new ClientSessionFactory[MAX_SERVERS];
+
checkFreePort(PORTS);
clearData();
Modified:
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/GroupingFailoverReplicationTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/GroupingFailoverReplicationTest.java 2009-11-11
14:08:48 UTC (rev 8260)
+++
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/GroupingFailoverReplicationTest.java 2009-11-11
14:12:14 UTC (rev 8261)
@@ -30,18 +30,6 @@
{
private static final Logger log =
Logger.getLogger(GroupingFailoverReplicationTest.class);
- public void test() throws Exception
- {
- int count = 0;
- while (true)
- {
- log.info("**** ITERATION " + count++);
- testGroupingLocalHandlerFails();
- tearDown();
- setUp();
- }
- }
-
protected void setupReplicatedServer(int node, boolean fileStorage, boolean netty, int
backupNode)
{
if (servers[node] != null)
Modified:
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/GroupingFailoverTestBase.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/GroupingFailoverTestBase.java 2009-11-11
14:08:48 UTC (rev 8260)
+++
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/GroupingFailoverTestBase.java 2009-11-11
14:12:14 UTC (rev 8261)
@@ -25,7 +25,6 @@
import org.hornetq.core.server.cluster.MessageFlowRecord;
import org.hornetq.core.server.cluster.impl.ClusterConnectionImpl;
import org.hornetq.core.server.group.impl.GroupingHandlerConfiguration;
-import org.hornetq.core.logging.Logger;
import org.hornetq.tests.integration.cluster.distribution.ClusterTestBase;
import org.hornetq.utils.SimpleString;
@@ -35,10 +34,8 @@
*/
public abstract class GroupingFailoverTestBase extends ClusterTestBase
{
- private static final Logger log = Logger.getLogger(GroupingFailoverTestBase.class);
public void testGroupingLocalHandlerFails() throws Exception
{
-
log.info("***********************************start******************************************");
setupReplicatedServer(2, isFileStorage(), isNetty(), 0);
setupMasterServer(0, isFileStorage(), isNetty());
@@ -46,17 +43,16 @@
setupServer(1, isFileStorage(), isNetty());
setupClusterConnection("cluster0", "queues", false, 1,
isNetty(), 0, 1);
- setupClusterConnection("cluster1", "queues", false, 1,
isNetty(), 1, 0);
- //setupClusterConnectionWithBackups("cluster1", "queues",
false, 1, isNetty(), 1, new int[]{0}, new int[]{2});
+ setupClusterConnectionWithBackups("cluster1", "queues", false,
1, isNetty(), 1, new int[]{0}, new int[]{2});
- //setupClusterConnection("cluster2", "queues", false, 1,
isNetty(), 2, 1);
+ setupClusterConnection("cluster2", "queues", false, 1,
isNetty(), 2, 1);
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.LOCAL, 0);
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.REMOTE, 1);
- //setUpGroupHandler(GroupingHandlerConfiguration.TYPE.LOCAL, 2);
+ setUpGroupHandler(GroupingHandlerConfiguration.TYPE.LOCAL, 2);
startServers(2, 0, 1);
@@ -71,8 +67,6 @@
waitForBindings(0, "queues.testaddress", 1, 0, true);
waitForBindings(1, "queues.testaddress", 1, 0, true);
- waitForBindings(0, "queues.testaddress", 1, 0, false);
- waitForBindings(1, "queues.testaddress", 1, 0, false);
addConsumer(0, 0, "queue0", null);
addConsumer(1, 1, "queue0", null);
@@ -80,7 +74,7 @@
waitForBindings(0, "queues.testaddress", 1, 1, false);
waitForBindings(1, "queues.testaddress", 1, 1, false);
- /*sendWithProperty(0, "queues.testaddress", 10, false,
MessageImpl.HDR_GROUP_ID, new SimpleString("id1"));
+ sendWithProperty(0, "queues.testaddress", 10, false,
MessageImpl.HDR_GROUP_ID, new SimpleString("id1"));
verifyReceiveAll(10, 0);
@@ -130,8 +124,8 @@
sendWithProperty(1, "queues.testaddress", 10, false,
MessageImpl.HDR_GROUP_ID, new SimpleString("id1"));
verifyReceiveAll(10, 2);
-*/
+
System.out.println("*****************************************************************************");
}
finally
{
@@ -139,9 +133,8 @@
closeAllSessionFactories();
- stopServers(2, 0, 1);
+ stopServers(0, 1, 2);
}
-
log.info("***********************************end******************************************");
}
public void testGroupingLocalHandlerFailsMultipleGroups() throws Exception