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;