JBoss hornetq SVN: r11026 - in branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster: failover and 1 other directory.
by do-not-reply@jboss.org
Author: borges
Date: 2011-07-22 09:59:26 -0400 (Fri, 22 Jul 2011)
New Revision: 11026
Modified:
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailoverTest.java
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FileStorageDiscoveryClusterWithBackupFailoverTest.java
Log:
clean up
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2011-07-22 13:58:45 UTC (rev 11025)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2011-07-22 13:59:26 UTC (rev 11026)
@@ -1549,21 +1549,21 @@
configuration.setJournalCompactMinFiles(0);
configuration.setBackup(true);
+ // add acceptor
configuration.getAcceptorConfigurations().clear();
TransportConfiguration acceptorConfig = createTransportConfiguration(netty, true, generateParams(node, netty));
configuration.getAcceptorConfigurations().add(acceptorConfig);
- //add backup connector
+
+
+ // add backup connector
TransportConfiguration liveConfig = createTransportConfiguration(netty, false, generateParams(liveNode, netty));
configuration.getConnectorConfigurations().put(liveConfig.getName(), liveConfig);
TransportConfiguration backupConfig = createTransportConfiguration(netty, false, generateParams(node, netty));
configuration.getConnectorConfigurations().put(backupConfig.getName(), backupConfig);
configuration.setLiveConnectorName(liveConfig.getName());
- HornetQServer server;
- server = createInVMFailoverServer(fileStorage, configuration, nodeManager);
-
- servers[node] = server;
+ servers[node] = createInVMFailoverServer(fileStorage, configuration, nodeManager);
}
protected void setupLiveServerWithDiscovery(final int node,
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailoverTest.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailoverTest.java 2011-07-22 13:58:45 UTC (rev 11025)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailoverTest.java 2011-07-22 13:59:26 UTC (rev 11026)
@@ -369,7 +369,7 @@
ClientMessage message = consumer.receiveImmediate();
- Assert.assertNull(message);
+ Assert.assertNull("null message", message);
session.close();
@@ -1582,7 +1582,7 @@
ClientMessage message = consumer.receiveImmediate();
- Assert.assertNull(message);
+ Assert.assertNull("Null message", message);
session2.close();
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FileStorageDiscoveryClusterWithBackupFailoverTest.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FileStorageDiscoveryClusterWithBackupFailoverTest.java 2011-07-22 13:58:45 UTC (rev 11025)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FileStorageDiscoveryClusterWithBackupFailoverTest.java 2011-07-22 13:59:26 UTC (rev 11026)
@@ -26,8 +26,6 @@
* A FileStorageClusterWithBackupFailoverTest
*
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- *
*/
public class FileStorageDiscoveryClusterWithBackupFailoverTest extends DiscoveryClusterWithBackupFailoverTest
{
13 years, 5 months
JBoss hornetq SVN: r11025 - branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution.
by do-not-reply@jboss.org
Author: borges
Date: 2011-07-22 09:58:45 -0400 (Fri, 22 Jul 2011)
New Revision: 11025
Modified:
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
Log:
Improve failure message, and test
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2011-07-22 13:58:06 UTC (rev 11024)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2011-07-22 13:58:45 UTC (rev 11025)
@@ -294,7 +294,7 @@
for (Binding binding : bindings.getBindings())
{
- if (binding instanceof LocalQueueBinding && local || binding instanceof RemoteQueueBinding && !local)
+ if ((binding instanceof LocalQueueBinding && local) || (binding instanceof RemoteQueueBinding && !local))
{
QueueBinding qBinding = (QueueBinding)binding;
@@ -315,10 +315,9 @@
// System.out.println(threadDump(" - fired by ClusterTestBase::waitForBindings"));
- String msg = "Timed out waiting for bindings (bindingCount = " + bindingCount +
- ", totConsumers = " +
- totConsumers +
- ")";
+ String msg =
+ "Timed out waiting for bindings [bindingCount = " + bindingCount + " (expected=" + count +
+ ")], [totConsumers = " + totConsumers + ", expected" + consumerCount + ")";
ClusterTestBase.log.error(msg);
13 years, 5 months
JBoss hornetq SVN: r11024 - branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/client/impl.
by do-not-reply@jboss.org
Author: borges
Date: 2011-07-22 09:58:06 -0400 (Fri, 22 Jul 2011)
New Revision: 11024
Modified:
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/client/impl/ServerLocatorImpl.java
Log:
Make sure both executors receive a shutdown request.
Modified: branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/client/impl/ServerLocatorImpl.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/client/impl/ServerLocatorImpl.java 2011-07-22 13:57:33 UTC (rev 11023)
+++ branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/client/impl/ServerLocatorImpl.java 2011-07-22 13:58:06 UTC (rev 11024)
@@ -176,13 +176,19 @@
public static synchronized void clearThreadPools()
{
-
if (globalThreadPool != null)
{
globalThreadPool.shutdown();
+ }
+ if (globalScheduledThreadPool != null)
+ {
+ globalScheduledThreadPool.shutdown();
+ }
+ try
+ {
try
{
- if (!globalThreadPool.awaitTermination(10, TimeUnit.SECONDS))
+ if (globalThreadPool != null && !globalThreadPool.awaitTermination(10, TimeUnit.SECONDS))
{
throw new IllegalStateException("Couldn't finish the globalThreadPool");
}
@@ -190,30 +196,23 @@
catch (InterruptedException e)
{
}
- finally
- {
- globalThreadPool = null;
- }
- }
-
- if (globalScheduledThreadPool != null)
- {
- globalScheduledThreadPool.shutdown();
try
{
- if (!globalScheduledThreadPool.awaitTermination(10, TimeUnit.SECONDS))
+ if (globalScheduledThreadPool != null && !globalScheduledThreadPool.awaitTermination(10, TimeUnit.SECONDS))
{
throw new IllegalStateException("Couldn't finish the globalScheduledThreadPool");
}
}
+
catch (InterruptedException e)
{
}
- finally
- {
- globalScheduledThreadPool = null;
- }
}
+ finally
+ {
+ globalThreadPool = null;
+ globalScheduledThreadPool = null;
+ }
}
private static synchronized ExecutorService getGlobalThreadPool()
13 years, 5 months
JBoss hornetq SVN: r11023 - in branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster: failover and 1 other directory.
by do-not-reply@jboss.org
Author: borges
Date: 2011-07-22 09:57:33 -0400 (Fri, 22 Jul 2011)
New Revision: 11023
Modified:
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/ClusterWithBackupTest.java
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/ClusteredRequestResponseTest.java
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ClusterWithBackupFailoverTestBase.java
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/GroupingFailoverTestBase.java
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/LargeMessageFailoverTest.java
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ReplicatedDistributionTest.java
Log:
Make sure resources are closed at tearDown
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2011-07-22 13:56:49 UTC (rev 11022)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2011-07-22 13:57:33 UTC (rev 11023)
@@ -25,6 +25,7 @@
import junit.framework.Assert;
import org.hornetq.api.core.DiscoveryGroupConfiguration;
+import org.hornetq.api.core.HornetQException;
import org.hornetq.api.core.Message;
import org.hornetq.api.core.SimpleString;
import org.hornetq.api.core.TransportConfiguration;
@@ -83,6 +84,18 @@
private static final long WAIT_TIMEOUT = 5000;
+ private static final SimpleString COUNT_PROP = new SimpleString("count_prop");
+
+ protected static final SimpleString FILTER_PROP = new SimpleString("animal");
+
+ private static final int MAX_SERVERS = 10;
+
+ protected ConsumerHolder[] consumers;
+ protected HornetQServer[] servers;
+ protected NodeManager[] nodeManagers;
+ protected ServerLocator[] locators0;
+ protected ClientSessionFactory[] sfs;
+
@Override
protected void setUp() throws Exception
{
@@ -95,55 +108,47 @@
consumers = new ConsumerHolder[ClusterTestBase.MAX_CONSUMERS];
servers = new HornetQServer[ClusterTestBase.MAX_SERVERS];
-
sfs = new ClientSessionFactory[ClusterTestBase.MAX_SERVERS];
-
nodeManagers = new NodeManager[ClusterTestBase.MAX_SERVERS];
+ locators0 = new ServerLocator[ClusterTestBase.MAX_SERVERS];
for (int i = 0, nodeManagersLength = nodeManagers.length; i < nodeManagersLength; i++)
{
nodeManagers[i] = new InVMNodeManager();
}
- locators = new ServerLocator[ClusterTestBase.MAX_SERVERS];
-
}
@Override
protected void tearDown() throws Exception
{
- for (ServerLocator locator : locators)
+ closeAllConsumers();
+ closeAllSessionFactories();
+ closeAllServerLocatorsFactories();
+ for (int i = 0; i < MAX_SERVERS; i++)
{
- try
+ if (servers[i] == null)
+ continue;
+
+ for (ClusterConnection cc : servers[i].getClusterManager().getClusterConnections())
{
- locator.close();
+ cc.stop();
}
- catch (Exception e)
- {
- //
- }
+ stopComponent(servers[i]);
+
}
-
- locators = null;
-
- locators = new ServerLocator[ClusterTestBase.MAX_SERVERS];
+ for (int i = 0; i < MAX_SERVERS; i++)
+ {
+ stopComponent(nodeManagers[i]);
+ }
UnitTestCase.checkFreePort(ClusterTestBase.PORTS);
+ locators0 = null;
servers = null;
-
sfs = null;
-
- consumers = null;
-
- consumers = new ConsumerHolder[ClusterTestBase.MAX_CONSUMERS];
-
-
-
nodeManagers = null;
super.tearDown();
-
- // ServerLocatorImpl.shutdown();
}
// Private -------------------------------------------------------------------------------------------------------
@@ -161,29 +166,37 @@
ConsumerHolder(final int id, final ClientConsumer consumer, final ClientSession session)
{
this.id = id;
-
this.consumer = consumer;
-
this.session = session;
}
- }
- private static final SimpleString COUNT_PROP = new SimpleString("count_prop");
+ void close()
+ {
+ if (consumer != null)
+ {
+ try
+ {
+ consumer.close();
+ }
+ catch (HornetQException e)
+ {
+ // ignore
+ }
+ }
+ if (session != null) {
+ try
+ {
+ session.close();
+ }
+ catch (HornetQException e)
+ {
+ // ignore
+ }
+ }
+ }
- protected static final SimpleString FILTER_PROP = new SimpleString("animal");
+ }
- private static final int MAX_SERVERS = 10;
-
- protected ConsumerHolder[] consumers;
-
- protected HornetQServer[] servers;
-
- protected NodeManager[] nodeManagers;
-
- protected ServerLocator[] locators;
-
- protected ClientSessionFactory[] sfs;
-
protected ClientConsumer getConsumer(final int node)
{
return consumers[node].consumer;
@@ -415,7 +428,7 @@
}
catch (Exception e)
{
- // Proxy the faliure and print a dump into System.out, so it is captured by Hudson reports
+ // Proxy the failure and print a dump into System.out, so it is captured by Hudson reports
e.printStackTrace();
System.out.println(UnitTestCase.threadDump(" - fired by ClusterTestBase::addConsumer"));
@@ -471,15 +484,15 @@
protected void closeAllServerLocatorsFactories() throws Exception
{
- for (int i = 0; i < locators.length; i++)
+ for (int i = 0; i < locators0.length; i++)
{
- ServerLocator sf = locators[i];
+ ServerLocator sf = locators0[i];
if (sf != null)
{
sf.close();
- locators[i] = null;
+ locators0[i] = null;
}
}
}
@@ -1212,16 +1225,16 @@
if (ha)
{
- locators[node] = HornetQClient.createServerLocatorWithHA(serverTotc);
+ locators0[node] = HornetQClient.createServerLocatorWithHA(serverTotc);
}
else
{
- locators[node] = HornetQClient.createServerLocatorWithoutHA(serverTotc);
+ locators0[node] = HornetQClient.createServerLocatorWithoutHA(serverTotc);
}
- locators[node].setBlockOnNonDurableSend(true);
- locators[node].setBlockOnDurableSend(true);
- ClientSessionFactory sf = locators[node].createSessionFactory();
+ locators0[node].setBlockOnNonDurableSend(true);
+ locators0[node].setBlockOnDurableSend(true);
+ ClientSessionFactory sf = locators0[node].createSessionFactory();
sfs[node] = sf;
}
@@ -1247,12 +1260,12 @@
serverTotc = new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY, params);
}
- locators[node] = HornetQClient.createServerLocatorWithoutHA(serverTotc);
+ locators0[node] = HornetQClient.createServerLocatorWithoutHA(serverTotc);
- locators[node].setBlockOnNonDurableSend(true);
- locators[node].setBlockOnDurableSend(true);
- locators[node].setReconnectAttempts(reconnectAttempts);
- ClientSessionFactory sf = locators[node].createSessionFactory();
+ locators0[node].setBlockOnNonDurableSend(true);
+ locators0[node].setBlockOnDurableSend(true);
+ locators0[node].setReconnectAttempts(reconnectAttempts);
+ ClientSessionFactory sf = locators0[node].createSessionFactory();
sfs[node] = sf;
}
@@ -1278,14 +1291,14 @@
}
- locators[node] = HornetQClient.createServerLocatorWithHA(serverTotc);
- locators[node].setRetryInterval(100);
- locators[node].setRetryIntervalMultiplier(1d);
- locators[node].setReconnectAttempts(-1);
- locators[node].setBlockOnNonDurableSend(blocking);
- locators[node].setBlockOnDurableSend(blocking);
+ locators0[node] = HornetQClient.createServerLocatorWithHA(serverTotc);
+ locators0[node].setRetryInterval(100);
+ locators0[node].setRetryIntervalMultiplier(1d);
+ locators0[node].setReconnectAttempts(-1);
+ locators0[node].setBlockOnNonDurableSend(blocking);
+ locators0[node].setBlockOnDurableSend(blocking);
- ClientSessionFactory sf = locators[node].createSessionFactory();
+ ClientSessionFactory sf = locators0[node].createSessionFactory();
sfs[node] = sf;
}
@@ -1733,14 +1746,6 @@
}
}
- protected void clearAllServers()
- {
- for (int i = 0; i < servers.length; i++)
- {
- servers[i] = null;
- }
- }
-
protected void setupClusterConnection(final String name,
final int nodeFrom,
final int nodeTo,
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/ClusterWithBackupTest.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/ClusterWithBackupTest.java 2011-07-22 13:56:49 UTC (rev 11022)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/ClusterWithBackupTest.java 2011-07-22 13:57:33 UTC (rev 11023)
@@ -46,14 +46,6 @@
setupServers();
}
- @Override
- protected void tearDown() throws Exception
- {
- stopServers();
-
- super.tearDown();
- }
-
protected boolean isNetty()
{
return false;
@@ -125,16 +117,4 @@
setupLiveServer(5, isFileStorage(), true, isNetty());
}
-
- protected void stopServers() throws Exception
- {
- closeAllConsumers();
-
- closeAllSessionFactories();
-
- closeAllServerLocatorsFactories();
-
- stopServers(0, 1, 2, 3, 4, 5);
- }
-
}
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/ClusteredRequestResponseTest.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/ClusteredRequestResponseTest.java 2011-07-22 13:56:49 UTC (rev 11022)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/ClusteredRequestResponseTest.java 2011-07-22 13:57:33 UTC (rev 11023)
@@ -36,14 +36,6 @@
setupServers();
}
- @Override
- protected void tearDown() throws Exception
- {
- stopServers();
-
- super.tearDown();
- }
-
protected boolean isNetty()
{
return false;
@@ -152,16 +144,4 @@
setupServer(3, isFileStorage(), isNetty());
setupServer(4, isFileStorage(), isNetty());
}
-
- protected void stopServers() throws Exception
- {
- closeAllConsumers();
-
- closeAllSessionFactories();
-
- closeAllServerLocatorsFactories();
-
- stopServers(0, 1, 2, 3, 4);
- }
-
}
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ClusterWithBackupFailoverTestBase.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ClusterWithBackupFailoverTestBase.java 2011-07-22 13:56:49 UTC (rev 11022)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ClusterWithBackupFailoverTestBase.java 2011-07-22 13:57:33 UTC (rev 11023)
@@ -64,16 +64,6 @@
setupServers();
}
- @Override
- protected void tearDown() throws Exception
- {
- stopServers();
-
- // FailoverManagerImpl.disableDebug();
-
- super.tearDown();
- }
-
protected boolean isNetty()
{
return false;
@@ -180,10 +170,6 @@
removeConsumer(0);
removeConsumer(1);
removeConsumer(2);
-
- stopServers();
-
- ClusterWithBackupFailoverTestBase.log.info("*** test done");
}
private void waitForBindings() throws Exception
@@ -270,10 +256,6 @@
removeConsumer(0);
removeConsumer(1);
removeConsumer(2);
-
- stopServers();
-
- ClusterWithBackupFailoverTestBase.log.info("*** test done");
}
protected void setupCluster() throws Exception
@@ -281,17 +263,6 @@
setupCluster(false);
}
- protected void stopServers() throws Exception
- {
-
- closeAllServerLocatorsFactories();
- closeAllConsumers();
-
- closeAllSessionFactories();
-
- stopServers(0, 1, 2, 3, 4, 5);
- }
-
protected void failNode(final int node) throws Exception
{
ClusterWithBackupFailoverTestBase.log.info("*** failing node " + node);
@@ -447,9 +418,5 @@
removeConsumer(2);
failNode(5);
-
- stopServers();
-
- ClusterWithBackupFailoverTestBase.log.info("*** test done");
}
}
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/GroupingFailoverTestBase.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/GroupingFailoverTestBase.java 2011-07-22 13:56:49 UTC (rev 11022)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/GroupingFailoverTestBase.java 2011-07-22 13:57:33 UTC (rev 11023)
@@ -12,12 +12,6 @@
*/
package org.hornetq.tests.integration.cluster.failover;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-import junit.framework.Assert;
-
-import org.hornetq.api.core.HornetQException;
import org.hornetq.api.core.Message;
import org.hornetq.api.core.SimpleString;
import org.hornetq.core.client.impl.Topology;
@@ -25,7 +19,6 @@
import org.hornetq.core.server.NodeManager;
import org.hornetq.core.server.group.impl.GroupingHandlerConfiguration;
import org.hornetq.core.server.impl.InVMNodeManager;
-import org.hornetq.spi.core.protocol.RemotingConnection;
import org.hornetq.tests.integration.cluster.distribution.ClusterTestBase;
/**
@@ -56,9 +49,6 @@
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.LOCAL, 2);
-
- try
- {
startServers(0, 2, 1);
setupSessionFactory(0, isNetty());
setupSessionFactory(1, isNetty());
@@ -102,18 +92,7 @@
System.out.println("*****************************************************************************");
}
- finally
- {
- closeAllConsumers();
- closeAllSessionFactories();
-
- closeAllServerLocatorsFactories();
-
- stopServers(0, 1, 2);
- }
- }
-
public void testGroupingLocalHandlerFailsMultipleGroups() throws Exception
{
NodeManager nodeManager = new InVMNodeManager();
@@ -138,8 +117,6 @@
setUpGroupHandler(GroupingHandlerConfiguration.TYPE.LOCAL, 2);
- try
- {
startServers(0, 2, 1);
setupSessionFactory(0, isNetty());
@@ -203,17 +180,6 @@
verifyReceiveAllWithGroupIDRoundRobin(2, 30, 1, 2);
System.out.println("*****************************************************************************");
- }
- finally
- {
- closeAllConsumers();
-
- closeAllSessionFactories();
-
- closeAllServerLocatorsFactories();
-
- stopServers(0, 1, 2);
- }
}
private void waitForServerTopology(HornetQServer server, int nodes, int seconds)
@@ -238,16 +204,4 @@
abstract boolean isSharedServer();
- private void fail(final RemotingConnection conn, final CountDownLatch latch) throws InterruptedException
- {
- // Simulate failure on connection
- conn.fail(new HornetQException(HornetQException.NOT_CONNECTED));
-
- // Wait to be informed of failure
-
- boolean ok = latch.await(1000, TimeUnit.MILLISECONDS);
-
- Assert.assertTrue(ok);
- }
-
}
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/LargeMessageFailoverTest.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/LargeMessageFailoverTest.java 2011-07-22 13:56:49 UTC (rev 11022)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/LargeMessageFailoverTest.java 2011-07-22 13:57:33 UTC (rev 11023)
@@ -73,12 +73,14 @@
public void testLiveAndBackupLiveComesBackNewFactory() throws Exception
{
// skip test because it triggers OutOfMemoryError.
+ Thread.sleep(1000);
}
@Override
public void testLiveAndBackupBackupComesBackNewFactory() throws Exception
{
// skip test because it triggers OutOfMemoryError.
+ Thread.sleep(1000);
}
/**
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ReplicatedDistributionTest.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ReplicatedDistributionTest.java 2011-07-22 13:56:49 UTC (rev 11022)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ReplicatedDistributionTest.java 2011-07-22 13:57:33 UTC (rev 11023)
@@ -289,18 +289,4 @@
{
return false;
}
-
- @Override
- protected void tearDown() throws Exception
- {
- servers[2].stop();
- servers[1].stop();
- servers[3].stop();
- super.tearDown();
- }
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
}
13 years, 5 months
JBoss hornetq SVN: r11022 - branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover.
by do-not-reply@jboss.org
Author: borges
Date: 2011-07-22 09:56:49 -0400 (Fri, 22 Jul 2011)
New Revision: 11022
Modified:
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/LargeMessageFailoverTest.java
Log:
Document reason why tests are turned off
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/LargeMessageFailoverTest.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/LargeMessageFailoverTest.java 2011-07-22 13:56:11 UTC (rev 11021)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/LargeMessageFailoverTest.java 2011-07-22 13:56:49 UTC (rev 11022)
@@ -72,13 +72,13 @@
@Override
public void testLiveAndBackupLiveComesBackNewFactory() throws Exception
{
- Thread.sleep(1000);
+ // skip test because it triggers OutOfMemoryError.
}
@Override
public void testLiveAndBackupBackupComesBackNewFactory() throws Exception
{
- Thread.sleep(1000);
+ // skip test because it triggers OutOfMemoryError.
}
/**
13 years, 5 months
JBoss hornetq SVN: r11021 - branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover.
by do-not-reply@jboss.org
Author: borges
Date: 2011-07-22 09:56:11 -0400 (Fri, 22 Jul 2011)
New Revision: 11021
Modified:
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailoverTest.java
Log:
Close all test's resources
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailoverTest.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailoverTest.java 2011-07-22 13:55:28 UTC (rev 11020)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailoverTest.java 2011-07-22 13:56:11 UTC (rev 11021)
@@ -684,13 +684,13 @@
{
createSessionFactory();
- ClientSession session = createSession(sf, true, false, false);
+ final ClientSession session = createSession(sf, true, false, false);
Xid xid = new XidImpl("uhuhuhu".getBytes(), 126512, "auhsduashd".getBytes());
session.createQueue(FailoverTestBase.ADDRESS, FailoverTestBase.ADDRESS, null, true);
- ClientProducer producer = session.createProducer(FailoverTestBase.ADDRESS);
+ final ClientProducer producer = session.createProducer(FailoverTestBase.ADDRESS);
@@ -711,6 +711,7 @@
catch (XAException e)
{
Assert.assertEquals(XAException.XA_RBOTHER, e.errorCode);
+ session.rollback();
}
ClientConsumer consumer = session.createConsumer(FailoverTestBase.ADDRESS);
@@ -721,6 +722,8 @@
Assert.assertNull(message);
+ producer.close();
+ consumer.close();
session.close();
closeSessionFactory();
13 years, 5 months
JBoss hornetq SVN: r11020 - branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover.
by do-not-reply@jboss.org
Author: borges
Date: 2011-07-22 09:55:28 -0400 (Fri, 22 Jul 2011)
New Revision: 11020
Modified:
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ClusterWithBackupFailoverTestBase.java
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/GroupingFailoverTestBase.java
Log:
Start live first, backup second
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ClusterWithBackupFailoverTestBase.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ClusterWithBackupFailoverTestBase.java 2011-07-22 13:54:52 UTC (rev 11019)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ClusterWithBackupFailoverTestBase.java 2011-07-22 13:55:28 UTC (rev 11020)
@@ -339,7 +339,7 @@
{
setupCluster();
- startServers(3, 4, 5, 0, 1, 2);
+ startServers(0, 1, 2, 3, 4, 5);
setupSessionFactory(0, 3, isNetty(), false);
setupSessionFactory(1, 4, isNetty(), false);
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/GroupingFailoverTestBase.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/GroupingFailoverTestBase.java 2011-07-22 13:54:52 UTC (rev 11019)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/GroupingFailoverTestBase.java 2011-07-22 13:55:28 UTC (rev 11020)
@@ -59,7 +59,7 @@
try
{
- startServers(2, 0, 1);
+ startServers(0, 2, 1);
setupSessionFactory(0, isNetty());
setupSessionFactory(1, isNetty());
@@ -87,7 +87,7 @@
closeSessionFactory(0);
servers[0].stop(true);
-
+
waitForServerRestart(2);
setupSessionFactory(2, isNetty());
@@ -140,7 +140,7 @@
try
{
- startServers(2, 0, 1);
+ startServers(0, 2, 1);
setupSessionFactory(0, isNetty());
13 years, 5 months
JBoss hornetq SVN: r11019 - in branches/HORNETQ-720_Replication: hornetq-core/src/test/java/org/hornetq/tests/util and 2 other directories.
by do-not-reply@jboss.org
Author: borges
Date: 2011-07-22 09:54:52 -0400 (Fri, 22 Jul 2011)
New Revision: 11019
Modified:
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java
branches/HORNETQ-720_Replication/hornetq-core/src/test/java/org/hornetq/tests/util/UnitTestCase.java
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ClusterWithBackupFailoverTestBase.java
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/DiscoveryClusterWithBackupFailoverTest.java
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailoverTest.java
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/GroupingFailoverReplicationTest.java
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/GroupingFailoverSharedServerTest.java
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/GroupingFailoverTestBase.java
Log:
Remove unused imports & clean up
Modified: branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java 2011-07-22 13:53:35 UTC (rev 11018)
+++ branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java 2011-07-22 13:54:52 UTC (rev 11019)
@@ -41,7 +41,6 @@
import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.core.client.ClientSessionFactory;
import org.hornetq.api.core.client.HornetQClient;
-import org.hornetq.api.core.client.ServerLocator;
import org.hornetq.core.asyncio.impl.AsynchronousFileImpl;
import org.hornetq.core.client.impl.ClientSessionFactoryImpl;
import org.hornetq.core.client.impl.ServerLocatorInternal;
Modified: branches/HORNETQ-720_Replication/hornetq-core/src/test/java/org/hornetq/tests/util/UnitTestCase.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-core/src/test/java/org/hornetq/tests/util/UnitTestCase.java 2011-07-22 13:53:35 UTC (rev 11018)
+++ branches/HORNETQ-720_Replication/hornetq-core/src/test/java/org/hornetq/tests/util/UnitTestCase.java 2011-07-22 13:54:52 UTC (rev 11019)
@@ -898,7 +898,7 @@
" has running locators on test " +
getName() +
" on this following dump"));
- fail("test left serverlocator running, this could effect other tests");
+ fail("test '" + getName() + "' left serverlocator running, this could effect other tests");
// System.exit(0);
}
else if (stackTraceElement.getMethodName().contains("BroadcastGroupImpl.run") && !alreadyFailedThread.contains(thread))
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2011-07-22 13:53:35 UTC (rev 11018)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2011-07-22 13:54:52 UTC (rev 11019)
@@ -949,7 +949,7 @@
ClientMessage msg = holder.consumer.receive(10000);
- Assert.assertNotNull(msg);
+ Assert.assertNotNull("msg must exist", msg);
int count = msg.getIntProperty(ClusterTestBase.COUNT_PROP);
@@ -992,7 +992,7 @@
{
ClientMessage msg = holder.consumer.consumer.receive(10000);
- Assert.assertNotNull(msg);
+ Assert.assertNotNull("msg must exist", msg);
int p = msg.getIntProperty(ClusterTestBase.COUNT_PROP);
@@ -1904,14 +1904,14 @@
ClusterTestBase.log.info("started server " + node);
/*
- * we need to wait a lil while between server start up to allow the server to communicate in some order.
- * This is to avoid split brain on startup
- * */
+ * we need to wait a little while between server start up to allow the server to
+ * communicate in some order. This is to avoid split brain on startup
+ */
Thread.sleep(500);
}
for (int node : nodes)
{
- //wait for each server to start, it may be a backup and started in a separate thread
+ // wait for each server to start, it may be a backup and started in a separate thread
waitForComponent(servers[node], 5);
}
}
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ClusterWithBackupFailoverTestBase.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ClusterWithBackupFailoverTestBase.java 2011-07-22 13:53:35 UTC (rev 11018)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ClusterWithBackupFailoverTestBase.java 2011-07-22 13:54:52 UTC (rev 11019)
@@ -32,15 +32,14 @@
import org.hornetq.core.server.cluster.impl.ClusterManagerImpl;
import org.hornetq.spi.core.protocol.RemotingConnection;
import org.hornetq.tests.integration.cluster.distribution.ClusterTestBase;
-import org.hornetq.tests.util.ServiceTestBase;
import org.hornetq.tests.util.UnitTestCase;
/**
- *
+ *
* A ClusterWithBackupFailoverTest
*
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
+ *
* Created 9 Mar 2009 16:31:21
*
*
@@ -48,7 +47,7 @@
public abstract class ClusterWithBackupFailoverTestBase extends ClusterTestBase
{
private static final String QUEUE_NAME = "queue0";
- private static final String QUEUES_TESTADDRESS = "queues.testaddress";
+ private static final String QUEUES_TESTADDRESS = "queues.testaddress";
private static final Logger log = Logger.getLogger(ClusterWithBackupFailoverTestBase.class);
protected abstract void setupCluster(final boolean forwardWhenNoConsumers) throws Exception;
@@ -197,7 +196,7 @@
waitForBindings(1, QUEUES_TESTADDRESS, 2, 2, false);
waitForBindings(2, QUEUES_TESTADDRESS, 2, 2, false);
}
-
+
public void testFailBackupNodes() throws Exception
{
setupCluster();
@@ -266,8 +265,8 @@
send(2, QUEUES_TESTADDRESS, 10, false, null);
verifyReceiveRoundRobinInSomeOrder(true, 10, 0, 1, 2);
-
+
removeConsumer(0);
removeConsumer(1);
removeConsumer(2);
@@ -432,7 +431,7 @@
waitForBindings(2, QUEUES_TESTADDRESS, 1, 1, true);
// live nodes
waitForBindings(2, QUEUES_TESTADDRESS, 1, 0, false);
-
+
send(2, QUEUES_TESTADDRESS, 10, false, null);
verifyReceiveRoundRobinInSomeOrder(true, 10, 2);
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/DiscoveryClusterWithBackupFailoverTest.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/DiscoveryClusterWithBackupFailoverTest.java 2011-07-22 13:53:35 UTC (rev 11018)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/DiscoveryClusterWithBackupFailoverTest.java 2011-07-22 13:54:52 UTC (rev 11019)
@@ -45,17 +45,13 @@
// The lives
setupDiscoveryClusterConnection("cluster0", 0, "dg1", "queues", forwardWhenNoConsumers, 1, isNetty());
-
setupDiscoveryClusterConnection("cluster1", 1, "dg1", "queues", forwardWhenNoConsumers, 1, isNetty());
-
setupDiscoveryClusterConnection("cluster2", 2, "dg1", "queues", forwardWhenNoConsumers, 1, isNetty());
// The backups
setupDiscoveryClusterConnection("cluster0", 3, "dg1", "queues", forwardWhenNoConsumers, 1, isNetty());
-
setupDiscoveryClusterConnection("cluster1", 4, "dg1", "queues", forwardWhenNoConsumers, 1, isNetty());
-
setupDiscoveryClusterConnection("cluster2", 5, "dg1", "queues", forwardWhenNoConsumers, 1, isNetty());
}
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailoverTest.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailoverTest.java 2011-07-22 13:53:35 UTC (rev 11018)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailoverTest.java 2011-07-22 13:54:52 UTC (rev 11019)
@@ -769,8 +769,6 @@
Assert.assertNull(message);
session.close();
-
- closeSessionFactory();
}
public void testXAMessagesNotSentSoNoRollbackOnCommit() throws Exception
@@ -1024,18 +1022,8 @@
ClientProducer producer = sendSession.createProducer(FailoverTestBase.ADDRESS);
+ sendMessages(sendSession, producer,NUM_MESSAGES);
- for (int i = 0; i < NUM_MESSAGES; i++)
- {
- ClientMessage message = sendSession.createMessage(true);
-
- setBody(i, message);
-
- message.putIntProperty("counter", i);
-
- producer.send(message);
- }
-
Set<ClientSession> sessionSet = sessionConsumerMap.keySet();
ClientSession[] sessions = new ClientSession[sessionSet.size()];
sessionSet.toArray(sessions);
@@ -1521,18 +1509,8 @@
session.createQueue(FailoverTestBase.ADDRESS, FailoverTestBase.ADDRESS, null, true);
ClientProducer producer = session.createProducer(FailoverTestBase.ADDRESS);
+ sendMessages(session, producer,NUM_MESSAGES);
- for (int i = 0; i < NUM_MESSAGES; i++)
- {
- ClientMessage message = session.createMessage(true);
-
- setBody(i, message);
-
- message.putIntProperty("counter", i);
-
- producer.send(message);
- }
-
class Committer extends Thread
{
@Override
@@ -1589,18 +1567,8 @@
producer = session2.createProducer(FailoverTestBase.ADDRESS);
// We now try and resend the messages since we get a transaction rolled back exception
+ sendMessages(session2, producer,NUM_MESSAGES);
- for (int i = 0; i < NUM_MESSAGES; i++)
- {
- ClientMessage message = session2.createMessage(true);
-
- setBody(i, message);
-
- message.putIntProperty("counter", i);
-
- producer.send(message);
- }
-
session2.commit();
ClientConsumer consumer = session2.createConsumer(FailoverTestBase.ADDRESS);
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java 2011-07-22 13:53:35 UTC (rev 11018)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java 2011-07-22 13:54:52 UTC (rev 11019)
@@ -152,12 +152,12 @@
{
final TransportConfiguration liveConnector = getConnectorTransportConfiguration(true);
final TransportConfiguration backupConnector = getConnectorTransportConfiguration(false);
+ final TransportConfiguration backupAcceptor = getAcceptorTransportConfiguration(false);
nodeManager = new InVMNodeManager();
+ backupConfig = createDefaultConfig();
+ liveConfig = createDefaultConfig();
- backupConfig = super.createDefaultConfig();
- liveConfig = super.createDefaultConfig();
- TransportConfiguration backupAcceptor = getAcceptorTransportConfiguration(false);
ReplicatedBackupUtils.configureReplicationPair(backupConfig, backupConnector, backupAcceptor, liveConfig,
liveConnector);
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/GroupingFailoverReplicationTest.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/GroupingFailoverReplicationTest.java 2011-07-22 13:53:35 UTC (rev 11018)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/GroupingFailoverReplicationTest.java 2011-07-22 13:54:52 UTC (rev 11019)
@@ -12,17 +12,6 @@
*/
package org.hornetq.tests.integration.cluster.failover;
-import java.util.Map;
-
-import org.hornetq.api.core.TransportConfiguration;
-import org.hornetq.core.config.Configuration;
-import org.hornetq.core.config.impl.ConfigurationImpl;
-import org.hornetq.core.logging.Logger;
-import org.hornetq.core.server.HornetQServer;
-import org.hornetq.core.server.HornetQServers;
-import org.hornetq.core.server.JournalType;
-import org.hornetq.tests.util.ServiceTestBase;
-
/**
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
* Created Oct 26, 2009
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/GroupingFailoverSharedServerTest.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/GroupingFailoverSharedServerTest.java 2011-07-22 13:53:35 UTC (rev 11018)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/GroupingFailoverSharedServerTest.java 2011-07-22 13:54:52 UTC (rev 11019)
@@ -12,16 +12,6 @@
*/
package org.hornetq.tests.integration.cluster.failover;
-import java.util.Map;
-
-import org.hornetq.api.core.TransportConfiguration;
-import org.hornetq.core.config.Configuration;
-import org.hornetq.core.config.impl.ConfigurationImpl;
-import org.hornetq.core.server.HornetQServer;
-import org.hornetq.core.server.HornetQServers;
-import org.hornetq.core.server.impl.InVMNodeManager;
-import org.hornetq.tests.util.ServiceTestBase;
-
/**
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
* Created Oct 26, 2009
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/GroupingFailoverTestBase.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/GroupingFailoverTestBase.java 2011-07-22 13:53:35 UTC (rev 11018)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/GroupingFailoverTestBase.java 2011-07-22 13:54:52 UTC (rev 11019)
@@ -12,7 +12,6 @@
*/
package org.hornetq.tests.integration.cluster.failover;
-import java.util.Map;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
@@ -22,11 +21,8 @@
import org.hornetq.api.core.Message;
import org.hornetq.api.core.SimpleString;
import org.hornetq.core.client.impl.Topology;
-import org.hornetq.core.remoting.FailureListener;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.NodeManager;
-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.server.impl.InVMNodeManager;
import org.hornetq.spi.core.protocol.RemotingConnection;
13 years, 5 months
JBoss hornetq SVN: r11018 - branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover.
by do-not-reply@jboss.org
Author: borges
Date: 2011-07-22 09:53:35 -0400 (Fri, 22 Jul 2011)
New Revision: 11018
Modified:
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ClusterWithBackupFailoverTestBase.java
Log:
Use constants instead of hardcoded values
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ClusterWithBackupFailoverTestBase.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ClusterWithBackupFailoverTestBase.java 2011-07-22 13:53:02 UTC (rev 11017)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ClusterWithBackupFailoverTestBase.java 2011-07-22 13:53:35 UTC (rev 11018)
@@ -33,6 +33,7 @@
import org.hornetq.spi.core.protocol.RemotingConnection;
import org.hornetq.tests.integration.cluster.distribution.ClusterTestBase;
import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.util.UnitTestCase;
/**
*
@@ -46,6 +47,8 @@
*/
public abstract class ClusterWithBackupFailoverTestBase extends ClusterTestBase
{
+ private static final String QUEUE_NAME = "queue0";
+ private static final String QUEUES_TESTADDRESS = "queues.testaddress";
private static final Logger log = Logger.getLogger(ClusterWithBackupFailoverTestBase.class);
protected abstract void setupCluster(final boolean forwardWhenNoConsumers) throws Exception;
@@ -87,98 +90,92 @@
setupSessionFactory(1, 4, isNetty(), false);
setupSessionFactory(2, 5, isNetty(), false);
- createQueue(0, "queues.testaddress", "queue0", null, true);
- createQueue(1, "queues.testaddress", "queue0", null, true);
- createQueue(2, "queues.testaddress", "queue0", null, true);
+ createQueue(0, QUEUES_TESTADDRESS, QUEUE_NAME, null, true);
+ createQueue(1, QUEUES_TESTADDRESS, QUEUE_NAME, null, true);
+ createQueue(2, QUEUES_TESTADDRESS, QUEUE_NAME, null, true);
- addConsumer(0, 0, "queue0", null);
- addConsumer(1, 1, "queue0", null);
- addConsumer(2, 2, "queue0", null);
+ addConsumer(0, 0, QUEUE_NAME, null);
+ addConsumer(1, 1, QUEUE_NAME, null);
+ addConsumer(2, 2, QUEUE_NAME, null);
- waitForBindings(0, "queues.testaddress", 1, 1, true);
- waitForBindings(1, "queues.testaddress", 1, 1, true);
- waitForBindings(2, "queues.testaddress", 1, 1, true);
+ waitForBindings();
- waitForBindings(0, "queues.testaddress", 2, 2, false);
- waitForBindings(1, "queues.testaddress", 2, 2, false);
- waitForBindings(2, "queues.testaddress", 2, 2, false);
-
- send(0, "queues.testaddress", 10, false, null);
+ send(0, QUEUES_TESTADDRESS, 10, false, null);
verifyReceiveRoundRobinInSomeOrder(true, 10, 0, 1, 2);
- send(1, "queues.testaddress", 10, false, null);
+ send(1, QUEUES_TESTADDRESS, 10, false, null);
verifyReceiveRoundRobinInSomeOrder(true, 10, 0, 1, 2);
- send(2, "queues.testaddress", 10, false, null);
+ send(2, QUEUES_TESTADDRESS, 10, false, null);
verifyReceiveRoundRobinInSomeOrder(true, 10, 0, 1, 2);
failNode(0);
// live nodes
- waitForBindings(1, "queues.testaddress", 1, 1, true);
- waitForBindings(2, "queues.testaddress", 1, 1, true);
+ waitForBindings(1, QUEUES_TESTADDRESS, 1, 1, true);
+ waitForBindings(2, QUEUES_TESTADDRESS, 1, 1, true);
// activated backup nodes
- waitForBindings(3, "queues.testaddress", 1, 1, true);
+ waitForBindings(3, QUEUES_TESTADDRESS, 1, 1, true);
// live nodes
- waitForBindings(1, "queues.testaddress", 2, 2, false);
- waitForBindings(2, "queues.testaddress", 2, 2, false);
+ waitForBindings(1, QUEUES_TESTADDRESS, 2, 2, false);
+ waitForBindings(2, QUEUES_TESTADDRESS, 2, 2, false);
// activated backup nodes
- waitForBindings(3, "queues.testaddress", 2, 2, false);
+ waitForBindings(3, QUEUES_TESTADDRESS, 2, 2, false);
ClusterWithBackupFailoverTestBase.log.info("** now sending");
- send(0, "queues.testaddress", 10, false, null);
+ send(0, QUEUES_TESTADDRESS, 10, false, null);
verifyReceiveRoundRobinInSomeOrder(true, 10, 0, 1, 2);
- send(1, "queues.testaddress", 10, false, null);
+ send(1, QUEUES_TESTADDRESS, 10, false, null);
verifyReceiveRoundRobinInSomeOrder(true, 10, 0, 1, 2);
- send(2, "queues.testaddress", 10, false, null);
+ send(2, QUEUES_TESTADDRESS, 10, false, null);
verifyReceiveRoundRobinInSomeOrder(true, 10, 0, 1, 2);
failNode(1);
// live nodes
- waitForBindings(2, "queues.testaddress", 1, 1, true);
+ waitForBindings(2, QUEUES_TESTADDRESS, 1, 1, true);
// activated backup nodes
- waitForBindings(3, "queues.testaddress", 1, 1, true);
- waitForBindings(4, "queues.testaddress", 1, 1, true);
+ waitForBindings(3, QUEUES_TESTADDRESS, 1, 1, true);
+ waitForBindings(4, QUEUES_TESTADDRESS, 1, 1, true);
// live nodes
- waitForBindings(2, "queues.testaddress", 2, 2, false);
+ waitForBindings(2, QUEUES_TESTADDRESS, 2, 2, false);
// activated backup nodes
- waitForBindings(3, "queues.testaddress", 2, 2, false);
- waitForBindings(4, "queues.testaddress", 2, 2, false);
+ waitForBindings(3, QUEUES_TESTADDRESS, 2, 2, false);
+ waitForBindings(4, QUEUES_TESTADDRESS, 2, 2, false);
- send(0, "queues.testaddress", 10, false, null);
+ send(0, QUEUES_TESTADDRESS, 10, false, null);
verifyReceiveRoundRobinInSomeOrder(true, 10, 0, 1, 2);
- send(1, "queues.testaddress", 10, false, null);
+ send(1, QUEUES_TESTADDRESS, 10, false, null);
verifyReceiveRoundRobinInSomeOrder(true, 10, 0, 1, 2);
- send(2, "queues.testaddress", 10, false, null);
+ send(2, QUEUES_TESTADDRESS, 10, false, null);
verifyReceiveRoundRobinInSomeOrder(true, 10, 0, 1, 2);
failNode(2);
// activated backup nodes
- waitForBindings(3, "queues.testaddress", 1, 1, true);
- waitForBindings(4, "queues.testaddress", 1, 1, true);
- waitForBindings(5, "queues.testaddress", 1, 1, true);
+ waitForBindings(3, QUEUES_TESTADDRESS, 1, 1, true);
+ waitForBindings(4, QUEUES_TESTADDRESS, 1, 1, true);
+ waitForBindings(5, QUEUES_TESTADDRESS, 1, 1, true);
// activated backup nodes
- waitForBindings(3, "queues.testaddress", 2, 2, false);
- waitForBindings(4, "queues.testaddress", 2, 2, false);
- waitForBindings(5, "queues.testaddress", 2, 2, false);
+ waitForBindings(3, QUEUES_TESTADDRESS, 2, 2, false);
+ waitForBindings(4, QUEUES_TESTADDRESS, 2, 2, false);
+ waitForBindings(5, QUEUES_TESTADDRESS, 2, 2, false);
- send(0, "queues.testaddress", 10, false, null);
+ send(0, QUEUES_TESTADDRESS, 10, false, null);
verifyReceiveRoundRobinInSomeOrder(true, 10, 0, 1, 2);
- send(1, "queues.testaddress", 10, false, null);
+ send(1, QUEUES_TESTADDRESS, 10, false, null);
verifyReceiveRoundRobinInSomeOrder(true, 10, 0, 1, 2);
- send(2, "queues.testaddress", 10, false, null);
+ send(2, QUEUES_TESTADDRESS, 10, false, null);
verifyReceiveRoundRobinInSomeOrder(true, 10, 0, 1, 2);
removeConsumer(0);
@@ -189,6 +186,17 @@
ClusterWithBackupFailoverTestBase.log.info("*** test done");
}
+
+ private void waitForBindings() throws Exception
+ {
+ waitForBindings(0, QUEUES_TESTADDRESS, 1, 1, true);
+ waitForBindings(1, QUEUES_TESTADDRESS, 1, 1, true);
+ waitForBindings(2, QUEUES_TESTADDRESS, 1, 1, true);
+
+ waitForBindings(0, QUEUES_TESTADDRESS, 2, 2, false);
+ waitForBindings(1, QUEUES_TESTADDRESS, 2, 2, false);
+ waitForBindings(2, QUEUES_TESTADDRESS, 2, 2, false);
+ }
public void testFailBackupNodes() throws Exception
{
@@ -200,86 +208,62 @@
setupSessionFactory(1, 4, isNetty(), false);
setupSessionFactory(2, 5, isNetty(), false);
- createQueue(0, "queues.testaddress", "queue0", null, true);
- createQueue(1, "queues.testaddress", "queue0", null, true);
- createQueue(2, "queues.testaddress", "queue0", null, true);
+ createQueue(0, QUEUES_TESTADDRESS, QUEUE_NAME, null, true);
+ createQueue(1, QUEUES_TESTADDRESS, QUEUE_NAME, null, true);
+ createQueue(2, QUEUES_TESTADDRESS, QUEUE_NAME, null, true);
- addConsumer(0, 0, "queue0", null);
- addConsumer(1, 1, "queue0", null);
- addConsumer(2, 2, "queue0", null);
+ addConsumer(0, 0, QUEUE_NAME, null);
+ addConsumer(1, 1, QUEUE_NAME, null);
+ addConsumer(2, 2, QUEUE_NAME, null);
- waitForBindings(0, "queues.testaddress", 1, 1, true);
- waitForBindings(1, "queues.testaddress", 1, 1, true);
- waitForBindings(2, "queues.testaddress", 1, 1, true);
+ waitForBindings();
- waitForBindings(0, "queues.testaddress", 2, 2, false);
- waitForBindings(1, "queues.testaddress", 2, 2, false);
- waitForBindings(2, "queues.testaddress", 2, 2, false);
-
- send(0, "queues.testaddress", 10, false, null);
+ send(0, QUEUES_TESTADDRESS, 10, false, null);
verifyReceiveRoundRobinInSomeOrder(true, 10, 0, 1, 2);
- send(1, "queues.testaddress", 10, false, null);
+ send(1, QUEUES_TESTADDRESS, 10, false, null);
verifyReceiveRoundRobinInSomeOrder(true, 10, 0, 1, 2);
- send(2, "queues.testaddress", 10, false, null);
+ send(2, QUEUES_TESTADDRESS, 10, false, null);
verifyReceiveRoundRobinInSomeOrder(true, 10, 0, 1, 2);
failNode(3);
- waitForBindings(0, "queues.testaddress", 1, 1, true);
- waitForBindings(1, "queues.testaddress", 1, 1, true);
- waitForBindings(2, "queues.testaddress", 1, 1, true);
+ waitForBindings();
- waitForBindings(0, "queues.testaddress", 2, 2, false);
- waitForBindings(1, "queues.testaddress", 2, 2, false);
- waitForBindings(2, "queues.testaddress", 2, 2, false);
-
- send(0, "queues.testaddress", 10, false, null);
+ send(0, QUEUES_TESTADDRESS, 10, false, null);
verifyReceiveRoundRobinInSomeOrder(true, 10, 0, 1, 2);
- send(1, "queues.testaddress", 10, false, null);
+ send(1, QUEUES_TESTADDRESS, 10, false, null);
verifyReceiveRoundRobinInSomeOrder(true, 10, 0, 1, 2);
- send(2, "queues.testaddress", 10, false, null);
+ send(2, QUEUES_TESTADDRESS, 10, false, null);
verifyReceiveRoundRobinInSomeOrder(true, 10, 0, 1, 2);
failNode(4);
- waitForBindings(0, "queues.testaddress", 1, 1, true);
- waitForBindings(1, "queues.testaddress", 1, 1, true);
- waitForBindings(2, "queues.testaddress", 1, 1, true);
+ waitForBindings();
- waitForBindings(0, "queues.testaddress", 2, 2, false);
- waitForBindings(1, "queues.testaddress", 2, 2, false);
- waitForBindings(2, "queues.testaddress", 2, 2, false);
-
- send(0, "queues.testaddress", 10, false, null);
+ send(0, QUEUES_TESTADDRESS, 10, false, null);
verifyReceiveRoundRobinInSomeOrder(true, 10, 0, 1, 2);
- send(1, "queues.testaddress", 10, false, null);
+ send(1, QUEUES_TESTADDRESS, 10, false, null);
verifyReceiveRoundRobinInSomeOrder(true, 10, 0, 1, 2);
- send(2, "queues.testaddress", 10, false, null);
+ send(2, QUEUES_TESTADDRESS, 10, false, null);
verifyReceiveRoundRobinInSomeOrder(true, 10, 0, 1, 2);
failNode(5);
- waitForBindings(0, "queues.testaddress", 1, 1, true);
- waitForBindings(1, "queues.testaddress", 1, 1, true);
- waitForBindings(2, "queues.testaddress", 1, 1, true);
+ waitForBindings();
- waitForBindings(0, "queues.testaddress", 2, 2, false);
- waitForBindings(1, "queues.testaddress", 2, 2, false);
- waitForBindings(2, "queues.testaddress", 2, 2, false);
-
- send(0, "queues.testaddress", 10, false, null);
+ send(0, QUEUES_TESTADDRESS, 10, false, null);
verifyReceiveRoundRobinInSomeOrder(true, 10, 0, 1, 2);
- send(1, "queues.testaddress", 10, false, null);
+ send(1, QUEUES_TESTADDRESS, 10, false, null);
verifyReceiveRoundRobinInSomeOrder(true, 10, 0, 1, 2);
- send(2, "queues.testaddress", 10, false, null);
+ send(2, QUEUES_TESTADDRESS, 10, false, null);
verifyReceiveRoundRobinInSomeOrder(true, 10, 0, 1, 2);
@@ -319,11 +303,11 @@
if (isNetty())
{
- serverTC = new TransportConfiguration(ServiceTestBase.NETTY_CONNECTOR_FACTORY, params);
+ serverTC = new TransportConfiguration(UnitTestCase.NETTY_CONNECTOR_FACTORY, params);
}
else
{
- serverTC = new TransportConfiguration(ServiceTestBase.INVM_CONNECTOR_FACTORY, params);
+ serverTC = new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY, params);
}
HornetQServer server = getServer(node);
@@ -362,110 +346,104 @@
setupSessionFactory(1, 4, isNetty(), false);
setupSessionFactory(2, 5, isNetty(), false);
- createQueue(0, "queues.testaddress", "queue0", null, true);
- createQueue(1, "queues.testaddress", "queue0", null, true);
- createQueue(2, "queues.testaddress", "queue0", null, true);
+ createQueue(0, QUEUES_TESTADDRESS, QUEUE_NAME, null, true);
+ createQueue(1, QUEUES_TESTADDRESS, QUEUE_NAME, null, true);
+ createQueue(2, QUEUES_TESTADDRESS, QUEUE_NAME, null, true);
- addConsumer(0, 0, "queue0", null);
- addConsumer(1, 1, "queue0", null);
- addConsumer(2, 2, "queue0", null);
+ addConsumer(0, 0, QUEUE_NAME, null);
+ addConsumer(1, 1, QUEUE_NAME, null);
+ addConsumer(2, 2, QUEUE_NAME, null);
- waitForBindings(0, "queues.testaddress", 1, 1, true);
- waitForBindings(1, "queues.testaddress", 1, 1, true);
- waitForBindings(2, "queues.testaddress", 1, 1, true);
+ waitForBindings();
- waitForBindings(0, "queues.testaddress", 2, 2, false);
- waitForBindings(1, "queues.testaddress", 2, 2, false);
- waitForBindings(2, "queues.testaddress", 2, 2, false);
-
- send(0, "queues.testaddress", 10, false, null);
+ send(0, QUEUES_TESTADDRESS, 10, false, null);
verifyReceiveRoundRobinInSomeOrder(true, 10, 0, 1, 2);
- send(1, "queues.testaddress", 10, false, null);
+ send(1, QUEUES_TESTADDRESS, 10, false, null);
verifyReceiveRoundRobinInSomeOrder(true, 10, 0, 1, 2);
- send(2, "queues.testaddress", 10, false, null);
+ send(2, QUEUES_TESTADDRESS, 10, false, null);
verifyReceiveRoundRobinInSomeOrder(true, 10, 0, 1, 2);
failNode(0);
// live nodes
- waitForBindings(1, "queues.testaddress", 1, 1, true);
- waitForBindings(2, "queues.testaddress", 1, 1, true);
+ waitForBindings(1, QUEUES_TESTADDRESS, 1, 1, true);
+ waitForBindings(2, QUEUES_TESTADDRESS, 1, 1, true);
// activated backup nodes
- waitForBindings(3, "queues.testaddress", 1, 1, true);
+ waitForBindings(3, QUEUES_TESTADDRESS, 1, 1, true);
// live nodes
- waitForBindings(1, "queues.testaddress", 2, 2, false);
- waitForBindings(2, "queues.testaddress", 2, 2, false);
+ waitForBindings(1, QUEUES_TESTADDRESS, 2, 2, false);
+ waitForBindings(2, QUEUES_TESTADDRESS, 2, 2, false);
// activated backup nodes
- waitForBindings(3, "queues.testaddress", 2, 2, false);
+ waitForBindings(3, QUEUES_TESTADDRESS, 2, 2, false);
ClusterWithBackupFailoverTestBase.log.info("** now sending");
- send(0, "queues.testaddress", 10, false, null);
+ send(0, QUEUES_TESTADDRESS, 10, false, null);
verifyReceiveRoundRobinInSomeOrder(true, 10, 0, 1, 2);
- send(1, "queues.testaddress", 10, false, null);
+ send(1, QUEUES_TESTADDRESS, 10, false, null);
verifyReceiveRoundRobinInSomeOrder(true, 10, 0, 1, 2);
- send(2, "queues.testaddress", 10, false, null);
+ send(2, QUEUES_TESTADDRESS, 10, false, null);
verifyReceiveRoundRobinInSomeOrder(true, 10, 0, 1, 2);
removeConsumer(0);
failNode(3);
// live nodes
- waitForBindings(1, "queues.testaddress", 1, 1, true);
- waitForBindings(2, "queues.testaddress", 1, 1, true);
+ waitForBindings(1, QUEUES_TESTADDRESS, 1, 1, true);
+ waitForBindings(2, QUEUES_TESTADDRESS, 1, 1, true);
// live nodes
- waitForBindings(1, "queues.testaddress", 1, 1, false);
- waitForBindings(2, "queues.testaddress", 1, 1, false);
+ waitForBindings(1, QUEUES_TESTADDRESS, 1, 1, false);
+ waitForBindings(2, QUEUES_TESTADDRESS, 1, 1, false);
- send(1, "queues.testaddress", 10, false, null);
+ send(1, QUEUES_TESTADDRESS, 10, false, null);
verifyReceiveRoundRobinInSomeOrder(true, 10, 1, 2);
- send(2, "queues.testaddress", 10, false, null);
+ send(2, QUEUES_TESTADDRESS, 10, false, null);
verifyReceiveRoundRobinInSomeOrder(true, 10, 1, 2);
failNode(1);
// live nodes
- waitForBindings(2, "queues.testaddress", 1, 1, true);
+ waitForBindings(2, QUEUES_TESTADDRESS, 1, 1, true);
// activated backup nodes
- waitForBindings(4, "queues.testaddress", 1, 1, true);
+ waitForBindings(4, QUEUES_TESTADDRESS, 1, 1, true);
// live nodes
- waitForBindings(2, "queues.testaddress", 1, 1, false);
+ waitForBindings(2, QUEUES_TESTADDRESS, 1, 1, false);
// activated backup nodes
- waitForBindings(4, "queues.testaddress", 1, 1, false);
+ waitForBindings(4, QUEUES_TESTADDRESS, 1, 1, false);
- send(1, "queues.testaddress", 10, false, null);
+ send(1, QUEUES_TESTADDRESS, 10, false, null);
verifyReceiveRoundRobinInSomeOrder(true, 10, 1, 2);
- send(2, "queues.testaddress", 10, false, null);
+ send(2, QUEUES_TESTADDRESS, 10, false, null);
verifyReceiveRoundRobinInSomeOrder(true, 10, 1, 2);
removeConsumer(1);
failNode(4);
// live nodes
- waitForBindings(2, "queues.testaddress", 1, 1, true);
+ waitForBindings(2, QUEUES_TESTADDRESS, 1, 1, true);
// live nodes
- waitForBindings(2, "queues.testaddress", 1, 0, false);
+ waitForBindings(2, QUEUES_TESTADDRESS, 1, 0, false);
- send(2, "queues.testaddress", 10, false, null);
+ send(2, QUEUES_TESTADDRESS, 10, false, null);
verifyReceiveRoundRobinInSomeOrder(true, 10, 2);
failNode(2);
// live nodes
- waitForBindings(5, "queues.testaddress", 1, 1, true);
+ waitForBindings(5, QUEUES_TESTADDRESS, 1, 1, true);
// live nodes
- waitForBindings(5, "queues.testaddress", 0, 0, false);
+ waitForBindings(5, QUEUES_TESTADDRESS, 0, 0, false);
- send(2, "queues.testaddress", 10, false, null);
+ send(2, QUEUES_TESTADDRESS, 10, false, null);
verifyReceiveRoundRobinInSomeOrder(true, 10, 2);
removeConsumer(2);
13 years, 5 months
JBoss hornetq SVN: r11017 - branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution.
by do-not-reply@jboss.org
Author: borges
Date: 2011-07-22 09:53:02 -0400 (Fri, 22 Jul 2011)
New Revision: 11017
Modified:
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
Log:
Delete spurious method
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2011-07-22 13:52:26 UTC (rev 11016)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2011-07-22 13:53:02 UTC (rev 11017)
@@ -188,7 +188,7 @@
{
return consumers[node].consumer;
}
-
+
protected void waitForMessages(final int node, final String address, final int count) throws Exception
{
HornetQServer server = servers[node];
@@ -752,10 +752,10 @@
for (int j = msgStart; j < msgEnd; j++)
{
-
+
ClientMessage message = holder.consumer.receive(WAIT_TIMEOUT);
-
-
+
+
if (message == null)
{
ClusterTestBase.log.info("*** dumping consumers:");
@@ -802,7 +802,7 @@
}
}
}
-
+
protected String clusterDescription(HornetQServer server)
{
String br = "-------------------------\n";
@@ -1160,7 +1160,7 @@
{
res[j++] = i;
}
-
+
if (ack)
{
// just to flush acks
@@ -1203,11 +1203,11 @@
if (netty)
{
- serverTotc = new TransportConfiguration(ServiceTestBase.NETTY_CONNECTOR_FACTORY, params);
+ serverTotc = new TransportConfiguration(UnitTestCase.NETTY_CONNECTOR_FACTORY, params);
}
else
{
- serverTotc = new TransportConfiguration(ServiceTestBase.INVM_CONNECTOR_FACTORY, params);
+ serverTotc = new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY, params);
}
if (ha)
@@ -1240,11 +1240,11 @@
if (netty)
{
- serverTotc = new TransportConfiguration(ServiceTestBase.NETTY_CONNECTOR_FACTORY, params);
+ serverTotc = new TransportConfiguration(UnitTestCase.NETTY_CONNECTOR_FACTORY, params);
}
else
{
- serverTotc = new TransportConfiguration(ServiceTestBase.INVM_CONNECTOR_FACTORY, params);
+ serverTotc = new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY, params);
}
locators[node] = HornetQClient.createServerLocatorWithoutHA(serverTotc);
@@ -1270,11 +1270,11 @@
if (netty)
{
- serverTotc = new TransportConfiguration(ServiceTestBase.NETTY_CONNECTOR_FACTORY, params);
+ serverTotc = new TransportConfiguration(UnitTestCase.NETTY_CONNECTOR_FACTORY, params);
}
else
{
- serverTotc = new TransportConfiguration(ServiceTestBase.INVM_CONNECTOR_FACTORY, params);
+ serverTotc = new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY, params);
}
@@ -1756,12 +1756,12 @@
{
throw new IllegalStateException("No server at node " + nodeFrom);
}
-
+
TransportConfiguration connectorFrom = createTransportConfiguration(netty, false, generateParams(nodeFrom, netty));
serverFrom.getConfiguration().getConnectorConfigurations().put(name, connectorFrom);
List<String> pairs = null;
-
+
if (nodeTo != -1)
{
TransportConfiguration serverTotc = createTransportConfiguration(netty, false, generateParams(nodeTo, netty));
@@ -1800,7 +1800,7 @@
TransportConfiguration connectorFrom = createTransportConfiguration(netty, false, generateParams(nodeFrom, netty));
serverFrom.getConfiguration().getConnectorConfigurations().put(connectorFrom.getName(), connectorFrom);
-
+
List<String> pairs = new ArrayList<String>();
for (int element : nodesTo)
{
@@ -1912,28 +1912,10 @@
for (int node : nodes)
{
//wait for each server to start, it may be a backup and started in a separate thread
- waitForServer(servers[node]);
+ waitForComponent(servers[node], 5);
}
}
- private void waitForServer(HornetQServer server)
- throws InterruptedException
- {
- long timetowait =System.currentTimeMillis() + 5000;
- while(!server.isStarted())
- {
- Thread.sleep(100);
- if(server.isStarted())
- {
- break;
- }
- else if(System.currentTimeMillis() > timetowait)
- {
- fail("server didnt start");
- }
- }
- }
-
protected void stopClusterConnections(final int... nodes) throws Exception
{
for (int node : nodes)
13 years, 5 months