JBoss hornetq SVN: r11006 - branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-07-20 02:02:09 -0400 (Wed, 20 Jul 2011)
New Revision: 11006
Modified:
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionBridge.java
Log:
fixing tests
Modified: branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java
===================================================================
--- branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java 2011-07-19 19:59:01 UTC (rev 11005)
+++ branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java 2011-07-20 06:02:09 UTC (rev 11006)
@@ -112,8 +112,6 @@
private volatile boolean active;
- private volatile boolean stopping;
-
private final String user;
private final String password;
@@ -286,8 +284,6 @@
{
log.debug("Bridge " + this.name + " being stopped");
}
-
- stopping = true;
if (futureScheduledReconnection != null)
{
@@ -408,6 +404,10 @@
if (ref != null)
{
+ if (isTrace)
+ {
+ log.trace(this + " Acking " + ref + " on queue " + ref.getQueue());
+ }
ref.getQueue().acknowledge(ref);
}
}
@@ -466,7 +466,10 @@
{
if (!active)
{
- log.debug(name + "::Ignoring reference on bridge as it is set to iniactive ref=" + ref);
+ if (log.isDebugEnabled())
+ {
+ log.debug(this + "::Ignoring reference on bridge as it is set to iniactive ref=" + ref);
+ }
return HandleStatus.BUSY;
}
@@ -503,7 +506,7 @@
}
catch (HornetQException e)
{
- log.warn("Unable to send message, will try again once bridge reconnects", e);
+ log.warn("Unable to send message " + ref + ", will try again once bridge reconnects", e);
refs.remove(ref);
@@ -539,6 +542,11 @@
fail(me.getCode() == HornetQException.DISCONNECTED);
+ tryScheduleRetryReconnect(me.getCode());
+ }
+
+ protected void tryScheduleRetryReconnect(final int code)
+ {
scheduleRetryConnect();
}
@@ -560,7 +568,7 @@
@Override
public String toString()
{
- return this.getClass().getName() + " [name=" + name + ", queue=" + queue + " targetConnector=" + this.serverLocator + "]";
+ return this.getClass().getSimpleName() + "@" + Integer.toHexString(System.identityHashCode(this)) + " [name=" + name + ", queue=" + queue + " targetConnector=" + this.serverLocator + "]";
}
protected void fail(final boolean permanently)
@@ -571,6 +579,10 @@
{
try
{
+ if (isTrace)
+ {
+ log.trace("Removing consumer on fail " + this + " from queue " + queue);
+ }
queue.removeConsumer(this);
}
catch (Exception dontcare)
@@ -591,6 +603,11 @@
{
retryCount = 0;
reconnectAttemptsInUse = reconnectAttempts;
+ if (futureScheduledReconnection != null)
+ {
+ futureScheduledReconnection.cancel(true);
+ futureScheduledReconnection = null;
+ }
}
/* Hook for creating session factory */
@@ -794,6 +811,10 @@
}
+ if (isTrace)
+ {
+ log.trace("Removing consumer on stopRunnable " + this + " from queue " + queue);
+ }
queue.removeConsumer(BridgeImpl.this);
internalCancelReferences();
Modified: branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionBridge.java
===================================================================
--- branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionBridge.java 2011-07-19 19:59:01 UTC (rev 11005)
+++ branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionBridge.java 2011-07-20 06:02:09 UTC (rev 11006)
@@ -279,6 +279,15 @@
super.stop();
}
+ protected void tryScheduleRetryReconnect(final int code)
+ {
+ if (code != HornetQException.DISCONNECTED)
+ {
+ scheduleRetryConnect();
+ }
+ }
+
+
protected void fail(final boolean permanently)
{
log.debug("Cluster Bridge " + this.getName() + " failed, permanently=" + permanently);
13 years, 8 months
JBoss hornetq SVN: r11005 - branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/bridge.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-07-19 15:59:01 -0400 (Tue, 19 Jul 2011)
New Revision: 11005
Modified:
branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/bridge/BridgeReconnectTest.java
Log:
Fixing test
Modified: branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/bridge/BridgeReconnectTest.java
===================================================================
--- branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/bridge/BridgeReconnectTest.java 2011-07-19 11:54:31 UTC (rev 11004)
+++ branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/bridge/BridgeReconnectTest.java 2011-07-19 19:59:01 UTC (rev 11005)
@@ -57,6 +57,7 @@
{
private static final Logger log = Logger.getLogger(BridgeReconnectTest.class);
+ private final int NUM_MESSAGES = 100;
protected boolean isNetty()
{
return false;
@@ -129,7 +130,7 @@
HornetQClient.DEFAULT_MAX_RETRY_INTERVAL,
retryIntervalMultiplier,
reconnectAttempts,
- false,
+ true,
confirmationWindowSize,
staticConnectors,
false,
@@ -181,7 +182,7 @@
session2.start();
- final int numMessages = 10;
+ final int numMessages = NUM_MESSAGES;
SimpleString propKey = new SimpleString("propkey");
@@ -273,7 +274,7 @@
HornetQClient.DEFAULT_MAX_RETRY_INTERVAL,
retryIntervalMultiplier,
reconnectAttempts,
- false,
+ true,
confirmationWindowSize,
staticConnectors,
false,
@@ -318,7 +319,7 @@
session2.start();
- final int numMessages = 10;
+ final int numMessages = NUM_MESSAGES;
SimpleString propKey = new SimpleString("propkey");
@@ -401,7 +402,7 @@
HornetQClient.DEFAULT_MAX_RETRY_INTERVAL,
retryIntervalMultiplier,
reconnectAttempts,
- false,
+ true,
confirmationWindowSize,
staticConnectors,
false,
@@ -451,7 +452,7 @@
forwardingConnection = getForwardingConnection(bridge);
forwardingConnection.fail(new HornetQException(HornetQException.NOT_CONNECTED));
- final int numMessages = 10;
+ final int numMessages = NUM_MESSAGES;
SimpleString propKey = new SimpleString("propkey");
@@ -544,7 +545,7 @@
HornetQClient.DEFAULT_MAX_RETRY_INTERVAL,
retryIntervalMultiplier,
reconnectAttempts,
- false,
+ true,
confirmationWindowSize,
staticConnectors,
false,
@@ -596,7 +597,7 @@
session1.start();
- final int numMessages = 10;
+ final int numMessages = NUM_MESSAGES;
SimpleString propKey = new SimpleString("propkey");
@@ -637,7 +638,7 @@
Assert.assertEquals(0, server0.getRemotingService().getConnections().size());
Assert.assertEquals(0, server1.getRemotingService().getConnections().size());
}
-
+
public void testFailoverThenFailAgainAndReconnect() throws Exception
{
Map<String, Object> server0Params = new HashMap<String, Object>();
@@ -680,7 +681,7 @@
HornetQClient.DEFAULT_MAX_RETRY_INTERVAL,
retryIntervalMultiplier,
reconnectAttempts,
- false,
+ true,
confirmationWindowSize,
staticConnectors,
false,
@@ -725,9 +726,9 @@
InVMConnector.failOnCreateConnection = true;
InVMConnector.numberOfFailures = reconnectAttempts - 1;
forwardingConnection.fail(new HornetQException(HornetQException.NOT_CONNECTED));
+
+ final int numMessages = NUM_MESSAGES;
- final int numMessages = 10;
-
SimpleString propKey = new SimpleString("propkey");
for (int i = 0; i < numMessages; i++)
@@ -737,19 +738,32 @@
prod0.send(message);
}
+ int outOfOrder = -1;
+ int supposed = -1;
for (int i = 0; i < numMessages; i++)
{
ClientMessage r1 = cons1.receive(1500);
Assert.assertNotNull(r1);
- Assert.assertEquals(i, r1.getObjectProperty(propKey));
+ if (outOfOrder == -1 && i != r1.getIntProperty(propKey).intValue())
+ {
+ outOfOrder = r1.getIntProperty(propKey).intValue();
+ supposed = i;
+ }
}
+ if (outOfOrder != -1)
+ {
+ fail("Message " + outOfOrder + " was received out of order, it was supposed to be " + supposed);
+ }
+ log.info("=========== second failure, sending message");
+
+
// Fail again - should reconnect
forwardingConnection = ((BridgeImpl)bridge).getForwardingConnection();
InVMConnector.failOnCreateConnection = true;
InVMConnector.numberOfFailures = reconnectAttempts - 1;
- forwardingConnection.fail(new HornetQException(HornetQException.NOT_CONNECTED));
+ forwardingConnection.fail(new HornetQException(5));
for (int i = 0; i < numMessages; i++)
{
@@ -762,12 +776,22 @@
for (int i = 0; i < numMessages; i++)
{
ClientMessage r1 = cons1.receive(1500);
- Assert.assertNotNull(r1);
- Assert.assertEquals(i, r1.getObjectProperty(propKey));
+ Assert.assertNotNull("Didn't receive message", r1);
+ if (outOfOrder == -1 && i != r1.getIntProperty(propKey).intValue())
+ {
+ outOfOrder = r1.getIntProperty(propKey).intValue();
+ supposed = i;
+ }
}
+
session0.close();
session1.close();
+
+ if (outOfOrder != -1)
+ {
+ fail("Message " + outOfOrder + " was received out of order, it was supposed to be " + supposed);
+ }
}
finally
{
13 years, 8 months
JBoss hornetq SVN: r11004 - in branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster: util and 1 other directory.
by do-not-reply@jboss.org
Author: borges
Date: 2011-07-19 07:54:31 -0400 (Tue, 19 Jul 2011)
New Revision: 11004
Modified:
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailBackAutoTest.java
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/RemoteFailoverTest.java
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ReplicatedAsynchronousFailoverTest.java
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/util/SameProcessHornetQServer.java
Log:
Fix NPE in replicatedAsync...FailoverTest
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailBackAutoTest.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailBackAutoTest.java 2011-07-19 11:53:53 UTC (rev 11003)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailBackAutoTest.java 2011-07-19 11:54:31 UTC (rev 11004)
@@ -303,6 +303,7 @@
* @param message
* @throws Exception
*/
+ @Override
protected void setBody(final int i, final ClientMessage message) throws Exception
{
message.getBodyBuffer().writeString("message" + i);
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/RemoteFailoverTest.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/RemoteFailoverTest.java 2011-07-19 11:53:53 UTC (rev 11003)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/RemoteFailoverTest.java 2011-07-19 11:54:31 UTC (rev 11004)
@@ -42,7 +42,7 @@
// Attributes ----------------------------------------------------
// Static --------------------------------------------------------
-
+
public static class SharedLiveServerConfiguration extends RemoteServerConfiguration
{
@@ -110,7 +110,7 @@
}
return createTransportConfiguration(true, false, params);
}
-
+
@Override
protected TransportConfiguration getAcceptorTransportConfiguration(boolean live)
{
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ReplicatedAsynchronousFailoverTest.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ReplicatedAsynchronousFailoverTest.java 2011-07-19 11:53:53 UTC (rev 11003)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ReplicatedAsynchronousFailoverTest.java 2011-07-19 11:54:31 UTC (rev 11004)
@@ -13,7 +13,6 @@
package org.hornetq.tests.integration.cluster.failover;
-import org.hornetq.core.config.Configuration;
import org.hornetq.tests.integration.cluster.util.SameProcessHornetQServer;
import org.hornetq.tests.integration.cluster.util.TestableServer;
@@ -40,46 +39,22 @@
// Package protected ---------------------------------------------
// Protected -----------------------------------------------------
-
+
+ @Override
protected TestableServer createLiveServer()
{
return new SameProcessHornetQServer(createServer(true, liveConfig));
}
+ @Override
protected TestableServer createBackupServer()
{
return new SameProcessHornetQServer(createServer(true, backupConfig));
}
-
+
@Override
protected void createConfigs() throws Exception
{
- Configuration config1 = super.createDefaultConfig();
- config1.setBindingsDirectory(config1.getBindingsDirectory() + "_backup");
- config1.setJournalDirectory(config1.getJournalDirectory() + "_backup");
- config1.getAcceptorConfigurations().clear();
- config1.getAcceptorConfigurations().add(getAcceptorTransportConfiguration(false));
- config1.setSecurityEnabled(false);
- config1.setSharedStore(false);
- config1.setBackup(true);
- backupServer = createBackupServer();
-
- Configuration config0 = super.createDefaultConfig();
- config0.getAcceptorConfigurations().clear();
- config0.getAcceptorConfigurations().add(getAcceptorTransportConfiguration(true));
-
- /*liveConfig.getConnectorConfigurations().put("toBackup", getConnectorTransportConfiguration(false));
- liveConfig.setBackupConnectorName("toBackup");*/
- config0.setSecurityEnabled(false);
- config0.setSharedStore(false);
- liveServer = createLiveServer();
-
- backupServer.start();
- liveServer.start();
+ createReplicatedConfigs();
}
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
}
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/util/SameProcessHornetQServer.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/util/SameProcessHornetQServer.java 2011-07-19 11:53:53 UTC (rev 11003)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/util/SameProcessHornetQServer.java 2011-07-19 11:54:31 UTC (rev 11004)
@@ -98,6 +98,7 @@
ClusterManagerImpl clusterManager = (ClusterManagerImpl) server.getClusterManager();
clusterManager.clear();
+ Assert.assertTrue("server should be running!", server.isStarted());
server.stop(true);
13 years, 8 months
JBoss hornetq SVN: r11003 - 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-19 07:53:53 -0400 (Tue, 19 Jul 2011)
New Revision: 11003
Modified:
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/SingleLiveMultipleBackupsFailoverTest.java
Log:
make sure servers are closed
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/SingleLiveMultipleBackupsFailoverTest.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/SingleLiveMultipleBackupsFailoverTest.java 2011-07-19 11:53:21 UTC (rev 11002)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/SingleLiveMultipleBackupsFailoverTest.java 2011-07-19 11:53:53 UTC (rev 11003)
@@ -17,6 +17,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.core.client.ClientSession;
@@ -64,7 +65,7 @@
ClientSession session = sendAndConsume(sf, true);
System.out.println("failing node 0");
servers.get(0).crash(session);
-
+
session.close();
backupNode = waitForNewLive(5, true, servers, 1, 2, 3, 4, 5);
session = sendAndConsume(sf, false);
@@ -97,12 +98,13 @@
locator.close();
}
-
+
protected void createBackupConfig(int liveNode, int nodeid, int... nodes)
{
Configuration config1 = super.createDefaultConfig();
config1.getAcceptorConfigurations().clear();
- config1.getAcceptorConfigurations().add(createTransportConfiguration(isNetty(), true, generateParams(nodeid, isNetty())));
+ config1.getAcceptorConfigurations().add(createTransportConfiguration(isNetty(), true,
+ generateParams(nodeid, isNetty())));
config1.setSecurityEnabled(false);
config1.setSharedStore(true);
config1.setBackup(true);
@@ -111,12 +113,16 @@
for (int node : nodes)
{
- TransportConfiguration liveConnector = createTransportConfiguration(isNetty(), false, generateParams(node, isNetty()));
+ TransportConfiguration liveConnector =
+ createTransportConfiguration(isNetty(), false, generateParams(node, isNetty()));
config1.getConnectorConfigurations().put(liveConnector.getName(), liveConnector);
staticConnectors.add(liveConnector.getName());
}
- TransportConfiguration backupConnector = createTransportConfiguration(isNetty(), false, generateParams(nodeid, isNetty()));
- ClusterConnectionConfiguration ccc1 = new ClusterConnectionConfiguration("cluster1", "jms", backupConnector.getName(), -1, false, false, 1, 1, staticConnectors, false);
+ TransportConfiguration backupConnector =
+ createTransportConfiguration(isNetty(), false, generateParams(nodeid, isNetty()));
+ ClusterConnectionConfiguration ccc1 =
+ new ClusterConnectionConfiguration("cluster1", "jms", backupConnector.getName(), -1, false, false, 1, 1,
+ staticConnectors, false);
config1.getClusterConfigurations().add(ccc1);
config1.getConnectorConfigurations().put(backupConnector.getName(), backupConnector);
@@ -128,25 +134,29 @@
servers.put(nodeid, new SameProcessHornetQServer(createInVMFailoverServer(true, config1, nodeManager)));
}
- protected void createLiveConfig(int liveNode, int ... otherLiveNodes)
+ protected void createLiveConfig(int liveNode, int... otherLiveNodes)
{
- TransportConfiguration liveConnector = createTransportConfiguration(isNetty(), false, generateParams(liveNode, isNetty()));
+ TransportConfiguration liveConnector =
+ createTransportConfiguration(isNetty(), false, generateParams(liveNode, isNetty()));
Configuration config0 = super.createDefaultConfig();
config0.getAcceptorConfigurations().clear();
- config0.getAcceptorConfigurations().add(createTransportConfiguration(isNetty(), true, generateParams(liveNode, isNetty())));
+ config0.getAcceptorConfigurations().add(createTransportConfiguration(isNetty(), true,
+ generateParams(liveNode, isNetty())));
config0.setSecurityEnabled(false);
config0.setSharedStore(true);
config0.setClustered(true);
List<String> pairs = null;
for (int node : otherLiveNodes)
{
- TransportConfiguration otherLiveConnector = createTransportConfiguration(isNetty(), false, generateParams(node, isNetty()));
+ TransportConfiguration otherLiveConnector =
+ createTransportConfiguration(isNetty(), false, generateParams(node, isNetty()));
config0.getConnectorConfigurations().put(otherLiveConnector.getName(), otherLiveConnector);
- pairs.add(otherLiveConnector.getName());
+ pairs.add(otherLiveConnector.getName());
}
- ClusterConnectionConfiguration ccc0 = new ClusterConnectionConfiguration("cluster1", "jms", liveConnector.getName(), -1, false, false, 1, 1,
- pairs, false);
+ ClusterConnectionConfiguration ccc0 =
+ new ClusterConnectionConfiguration("cluster1", "jms", liveConnector.getName(), -1, false, false, 1, 1,
+ pairs, false);
config0.getClusterConfigurations().add(ccc0);
config0.getConnectorConfigurations().put(liveConnector.getName(), liveConnector);
@@ -158,12 +168,28 @@
servers.put(liveNode, new SameProcessHornetQServer(createInVMFailoverServer(true, config0, nodeManager)));
}
+ @Override
protected boolean isNetty()
{
return false;
}
+ @Override
+ protected void tearDown() throws Exception
+ {
+ for (Entry<Integer, TestableServer> entry : servers.entrySet())
+ {
+ try
+ {
+ entry.getValue().stop();
+ }
+ catch (Exception e)
+ {
+ // ignore
+ }
+ }
+ servers.clear();
+ super.tearDown();
+ }
-
-
}
13 years, 8 months
JBoss hornetq SVN: r11002 - 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-19 07:53:21 -0400 (Tue, 19 Jul 2011)
New Revision: 11002
Modified:
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/AsynchronousFailoverTest.java
Log:
remove warnings
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/AsynchronousFailoverTest.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/AsynchronousFailoverTest.java 2011-07-19 11:52:45 UTC (rev 11001)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/AsynchronousFailoverTest.java 2011-07-19 11:53:21 UTC (rev 11002)
@@ -30,10 +30,8 @@
import org.hornetq.api.core.client.ServerLocator;
import org.hornetq.api.core.client.SessionFailureListener;
import org.hornetq.core.client.impl.ClientSessionFactoryInternal;
-import org.hornetq.core.client.impl.ClientSessionInternal;
import org.hornetq.core.client.impl.DelegatingSession;
import org.hornetq.core.logging.Logger;
-import org.hornetq.spi.core.protocol.RemotingConnection;
import org.hornetq.tests.util.TransportConfigurationUtils;
/**
@@ -183,8 +181,6 @@
createSession.createQueue(FailoverTestBase.ADDRESS, FailoverTestBase.ADDRESS, null, true);
- RemotingConnection conn = ((ClientSessionInternal)createSession).getConnection();
-
Thread t = new Thread(runnable);
t.setName("MainTEST");
@@ -199,8 +195,6 @@
AsynchronousFailoverTest.log.info("Failing asynchronously");
- MyListener listener = this.listener;
-
// Simulate failure on connection
synchronized (lockFail)
{
13 years, 8 months
JBoss hornetq SVN: r11001 - branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/util.
by do-not-reply@jboss.org
Author: borges
Date: 2011-07-19 07:52:45 -0400 (Tue, 19 Jul 2011)
New Revision: 11001
Modified:
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/util/JMSTestBase.java
Log:
Make class abstract to avoid "no tests found" warning.
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/util/JMSTestBase.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/util/JMSTestBase.java 2011-07-19 02:18:46 UTC (rev 11000)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/util/JMSTestBase.java 2011-07-19 11:52:45 UTC (rev 11001)
@@ -41,13 +41,13 @@
*
*
*/
-public class JMSTestBase extends ServiceTestBase
+public abstract class JMSTestBase extends ServiceTestBase
{
protected HornetQServer server;
protected JMSServerManagerImpl jmsServer;
-
+
protected MBeanServer mbeanServer;
protected ConnectionFactory cf;
@@ -105,7 +105,7 @@
protected void setUp() throws Exception
{
super.setUp();
-
+
mbeanServer = MBeanServerFactory.createMBeanServer();
Configuration conf = createDefaultConfig(false);
@@ -122,15 +122,15 @@
registerConnectionFactory();
}
-
+
@Override
protected Configuration createDefaultConfig(boolean netty)
{
Configuration conf = super.createDefaultConfig(netty);
-
+
conf.setSecurityEnabled(false);
conf.setJMXManagementEnabled(true);
-
+
return conf;
}
13 years, 8 months
JBoss hornetq SVN: r11000 - branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-07-18 22:18:46 -0400 (Mon, 18 Jul 2011)
New Revision: 11000
Modified:
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java
Log:
tweak
Modified: branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java
===================================================================
--- branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java 2011-07-19 01:18:12 UTC (rev 10999)
+++ branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java 2011-07-19 02:18:46 UTC (rev 11000)
@@ -523,7 +523,7 @@
try
{
- // csf.cleanup();
+ csf.cleanup();
}
catch (Throwable dontCare)
{
@@ -531,7 +531,7 @@
try
{
- // session.cleanUp(false);
+ session.cleanUp(false);
}
catch (Throwable dontCare)
{
13 years, 8 months
JBoss hornetq SVN: r10999 - branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-07-18 21:18:12 -0400 (Mon, 18 Jul 2011)
New Revision: 10999
Modified:
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java
Log:
fixing a test
Modified: branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java
===================================================================
--- branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java 2011-07-19 01:14:41 UTC (rev 10998)
+++ branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java 2011-07-19 01:18:12 UTC (rev 10999)
@@ -378,15 +378,18 @@
public synchronized Map<String, String> getNodes()
{
- Map<String, String> nodes = new HashMap<String, String>();
- for (Entry<String, MessageFlowRecord> record : records.entrySet())
+ synchronized (records)
{
- if (record.getValue().getBridge().getForwardingConnection() != null)
+ Map<String, String> nodes = new HashMap<String, String>();
+ for (Entry<String, MessageFlowRecord> record : records.entrySet())
{
- nodes.put(record.getKey(), record.getValue().getBridge().getForwardingConnection().getRemoteAddress());
+ if (record.getValue().getBridge().getForwardingConnection() != null)
+ {
+ nodes.put(record.getKey(), record.getValue().getBridge().getForwardingConnection().getRemoteAddress());
+ }
}
+ return nodes;
}
- return nodes;
}
public synchronized void activate() throws Exception
13 years, 8 months
JBoss hornetq SVN: r10998 - branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-07-18 21:14:41 -0400 (Mon, 18 Jul 2011)
New Revision: 10998
Modified:
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java
Log:
tweak
Modified: branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java
===================================================================
--- branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java 2011-07-19 00:24:09 UTC (rev 10997)
+++ branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java 2011-07-19 01:14:41 UTC (rev 10998)
@@ -588,8 +588,6 @@
{
MessageFlowRecordImpl record = new MessageFlowRecordImpl(targetNodeID, connector, queueName, queue);
- records.put(targetNodeID, record);
-
Bridge bridge = createClusteredBridge(record);
if (log.isDebugEnabled())
@@ -599,6 +597,8 @@
record.setBridge(bridge);
+ records.put(targetNodeID, record);
+
if (start)
{
bridge.start();
13 years, 8 months
JBoss hornetq SVN: r10997 - branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-07-18 20:24:09 -0400 (Mon, 18 Jul 2011)
New Revision: 10997
Modified:
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java
Log:
fixing tests
Modified: branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java
===================================================================
--- branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java 2011-07-18 22:05:44 UTC (rev 10996)
+++ branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java 2011-07-19 00:24:09 UTC (rev 10997)
@@ -537,7 +537,7 @@
{
}
- fail(false);
+ fail(me.getCode() == HornetQException.DISCONNECTED);
scheduleRetryConnect();
}
13 years, 8 months