Author: clebert.suconic(a)jboss.com
Date: 2011-06-17 12:38:19 -0400 (Fri, 17 Jun 2011)
New Revision: 10850
Added:
branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/distribution/SimpleSymmetricClusterTest.java
Modified:
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/impl/HornetQServerImpl.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/OnewayTwoNodeClusterTest.java
Log:
tweaks
Modified:
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
===================================================================
---
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java 2011-06-17
16:37:51 UTC (rev 10849)
+++
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java 2011-06-17
16:38:19 UTC (rev 10850)
@@ -316,7 +316,14 @@
initialisePart2();
- log.info("Server is now live");
+ if (identity != null)
+ {
+ log.info("Server " + identity + " is now live");
+ }
+ else
+ {
+ log.info("Server is now live");
+ }
}
catch (Exception e)
{
@@ -1134,7 +1141,7 @@
activateCallbacks.remove(callback);
}
- public synchronized ExecutorFactory getExecutorFactory()
+ public ExecutorFactory getExecutorFactory()
{
return executorFactory;
}
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-06-17
16:37:51 UTC (rev 10849)
+++
branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2011-06-17
16:38:19 UTC (rev 10850)
@@ -248,15 +248,16 @@
final int consumerCount,
final boolean local) throws Exception
{
- // System.out.println("waiting for bindings on node " + node +
- // " address " +
- // address +
- // " count " +
- // count +
- // " consumerCount " +
- // consumerCount +
- // " local " +
- // local);
+ log.debug("waiting for bindings on node " + node +
+ " address " +
+ address +
+ " count " +
+ count +
+ " consumerCount " +
+ consumerCount +
+ " local " +
+ local);
+
HornetQServer server = servers[node];
if (server == null)
@@ -301,11 +302,9 @@
}
while (System.currentTimeMillis() - start < ClusterTestBase.WAIT_TIMEOUT);
- // System.out.println(threadDump(" - fired by
ClusterTestBase::waitForBindings"));
-
- String msg = "Timed out waiting for bindings (bindingCount = " +
bindingCount +
+ String msg = "Timed out waiting for bindings (bindingCount = " +
bindingCount + " (expecting " + count + ") "+
", totConsumers = " +
- totConsumers +
+ totConsumers + " (expecting " + consumerCount +
")" +
")";
ClusterTestBase.log.error(msg);
@@ -1714,6 +1713,32 @@
pairs.add(serverTotc.getName());
}
+ ClusterConnectionConfiguration clusterConf = createClusterConfig(name,
+ address,
+
forwardWhenNoConsumers,
+ maxHops,
+ connectorFrom,
+ pairs);
+
+ serverFrom.getConfiguration().getClusterConfigurations().add(clusterConf);
+ }
+
+ /**
+ * @param name
+ * @param address
+ * @param forwardWhenNoConsumers
+ * @param maxHops
+ * @param connectorFrom
+ * @param pairs
+ * @return
+ */
+ protected ClusterConnectionConfiguration createClusterConfig(final String name,
+ final String address,
+ final boolean
forwardWhenNoConsumers,
+ final int maxHops,
+ TransportConfiguration
connectorFrom,
+ List<String> pairs)
+ {
ClusterConnectionConfiguration clusterConf = new
ClusterConnectionConfiguration(name,
address,
connectorFrom.getName(),
@@ -1723,8 +1748,7 @@
maxHops,
1024,
pairs, false);
-
- serverFrom.getConfiguration().getClusterConfigurations().add(clusterConf);
+ return clusterConf;
}
protected void setupClusterConnectionWithBackups(final String name,
Modified:
branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/distribution/OnewayTwoNodeClusterTest.java
===================================================================
---
branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/distribution/OnewayTwoNodeClusterTest.java 2011-06-17
16:37:51 UTC (rev 10849)
+++
branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/distribution/OnewayTwoNodeClusterTest.java 2011-06-17
16:38:19 UTC (rev 10850)
@@ -47,6 +47,7 @@
@Override
protected void tearDown() throws Exception
{
+ log.info("#test Tear down");
closeAllConsumers();
closeAllSessionFactories();
@@ -98,6 +99,20 @@
verifyNotReceive(0);
}
+ public void testLoop() throws Exception
+ {
+ for (int i = 0 ; i < 10; i++)
+ {
+ log.info("#test " + i);
+ testStartSourceServerBeforeTargetServer();
+ if (i + 1 < 100000)
+ {
+ tearDown();
+ setUp();
+ }
+ }
+
+ }
public void testStartSourceServerBeforeTargetServer() throws Exception
{
startServers(0, 1);
Added:
branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/distribution/SimpleSymmetricClusterTest.java
===================================================================
---
branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/distribution/SimpleSymmetricClusterTest.java
(rev 0)
+++
branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/distribution/SimpleSymmetricClusterTest.java 2011-06-17
16:38:19 UTC (rev 10850)
@@ -0,0 +1,107 @@
+/*
+ * Copyright 2010 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.tests.integration.cluster.distribution;
+
+import java.util.List;
+
+import org.hornetq.api.core.TransportConfiguration;
+import org.hornetq.core.config.ClusterConnectionConfiguration;
+
+/**
+ * A SimpleSymmetricClusterTest
+ *
+ * @author clebert
+ *
+ *
+ */
+public class SimpleSymmetricClusterTest extends ClusterTestBase
+{
+
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ // Public --------------------------------------------------------
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ setupServer(0, true, isNetty());
+ setupServer(1, true, isNetty());
+
+ setupClusterConnection("cluster0", "queues", false, 1,
isNetty(), 0, 1);
+ setupClusterConnection("cluster1", "queues", false, 1,
isNetty(), 1, 0);
+
+ startServers(1, 0);
+ }
+
+
+ /**
+ * @param name
+ * @param address
+ * @param forwardWhenNoConsumers
+ * @param maxHops
+ * @param connectorFrom
+ * @param pairs
+ * @return
+ */
+ protected ClusterConnectionConfiguration createClusterConfig(final String name,
+ final String address,
+ final boolean
forwardWhenNoConsumers,
+ final int maxHops,
+ TransportConfiguration
connectorFrom,
+ List<String> pairs)
+ {
+ ClusterConnectionConfiguration clusterConf = new
ClusterConnectionConfiguration(name,
+
address,
+
connectorFrom.getName(),
+
2000,
+
true,
+
forwardWhenNoConsumers,
+
maxHops,
+
1024,
+
pairs, false);
+ return clusterConf;
+ }
+
+
+ public void tearDown() throws Exception
+ {
+ stopServers(0, 1);
+ super.tearDown();
+ }
+
+ public boolean isNetty()
+ {
+ return false;
+ }
+
+ public void testSimple() throws Exception
+ {
+
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+
+}