Author: ataylor
Date: 2010-11-23 10:35:31 -0500 (Tue, 23 Nov 2010)
New Revision: 9921
Modified:
branches/2_2_0_HA_Improvements_preMerge/build-hornetq.xml
branches/2_2_0_HA_Improvements_preMerge/build.xml
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/client/impl/ClientSessionFactoryInternal.java
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/client/impl/ServerLocatorInternal.java
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/client/impl/Topology.java
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/server/cluster/impl/ClusterManagerImpl.java
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/cluster/distribution/SymmetricClusterWithDiscoveryTest.java
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/cluster/distribution/TwoWayTwoNodeClusterWithDiscoveryTest.java
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/cluster/failover/ClusterWithBackupFailoverTestBase.java
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/cluster/failover/DiscoveryClusterWithBackupFailoverTest.java
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTest.java
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/cluster/topology/HAClientTopologyWithDiscoveryTest.java
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/util/ServiceTestBase.java
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/util/UnitTestCase.java
Log:
close locators for bridges and cluster connections at cluster manager + test fixes
Modified: branches/2_2_0_HA_Improvements_preMerge/build-hornetq.xml
===================================================================
--- branches/2_2_0_HA_Improvements_preMerge/build-hornetq.xml 2010-11-22 20:21:51 UTC (rev
9920)
+++ branches/2_2_0_HA_Improvements_preMerge/build-hornetq.xml 2010-11-23 15:35:31 UTC (rev
9921)
@@ -1672,6 +1672,12 @@
</antcall>
</target>
+ <target name="cluster-tests" depends="jar,
compile-unit-tests">
+ <antcall inheritall="true" inheritrefs="true"
target="tests">
+ <param name="tests.param"
value="**/org/hornetq/tests/integration/cluster/**/*${test-mask}.class"/>
+ </antcall>
+ </target>
+
<target name="concurrent-tests" depends="jar,
compile-unit-tests">
<antcall inheritall="true" inheritrefs="true"
target="tests">
<param name="tests.param"
value="**/org/hornetq/tests/concurrent/**/*${test-mask}.class"/>
@@ -1720,9 +1726,7 @@
<jvmarg value="-XX:+PrintClassHistogram"/>
<jvmarg value="-Xmx1024M"/>
<jvmarg value="-verbose:gc"/>
- <!--
<jvmarg line="-Xmx512M -Xdebug -Xnoagent -Djava.compiler=NONE
-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"/>
- -->
<!--<jvmarg value="-ea"/>-->
<classpath refid="unit.test.execution.classpath"/>
<formatter type="xml"
usefile="${junit.formatter.usefile}"/>
@@ -1734,6 +1738,21 @@
<fileset dir="${test.classes.dir}">
<!-- excluded because of
https://jira.jboss.org/jira/browse/HORNETQ-65
-->
<exclude
name="**/cluster/failover/*StaticClusterWithBackupFailoverTest.class" />
+
+ <!--exclude any replication tests for now-->
+ <exclude
name="**/cluster/failover/*ClusterWithBackupFailoverTestBase.class"/>
+
+ <exclude
name="**/cluster/failover/*DiscoveryClusterWithBackupFailoverTest.class"/>
+ <exclude
name="**/cluster/failover/*GroupingFailoverReplicationTest.class"/>
+ <exclude name="**/cluster/failover/*Replicated*.class"/>
+ <exclude name="**/cluster/replication/**.class"/>
+ <exclude
name="**/cluster/failover/*ReplicatedDistributionTest.class"/>
+ <exclude
name="**/cluster/failover/*SharedStoreDistributionTest.class"/>
+ <exclude
name="**/cluster/failover/*ReplicatedNettyAsynchronousFailoverTest.class"/>
+ <exclude
name="**/cluster/*ReplicatedJMSFailoverTest.class"/>
+ <exclude name="**/integration/replication/*.class"/>
+ <exclude name="**/cluster/failover/Remote*.class"/>
+ <exclude name="**/failover/remote/**.class"/>
<include name="${tests.param}"/>
</fileset>
</batchtest>
Modified: branches/2_2_0_HA_Improvements_preMerge/build.xml
===================================================================
--- branches/2_2_0_HA_Improvements_preMerge/build.xml 2010-11-22 20:21:51 UTC (rev 9920)
+++ branches/2_2_0_HA_Improvements_preMerge/build.xml 2010-11-23 15:35:31 UTC (rev 9921)
@@ -250,6 +250,12 @@
<ant antfile="build-hornetq.xml"
target="compile-reports"/>
</target>
+
+ <target name="cluster-tests" depends="createthirdparty">
+ <ant antfile="build-hornetq.xml"
target="cluster-tests"/>
+ <ant antfile="build-hornetq.xml"
target="compile-reports"/>
+ </target>
+
<target name="spring-tests" depends="createthirdparty">
<ant antfile="build-hornetq.xml" target="spring-tests"/>
<ant antfile="build-hornetq.xml"
target="compile-reports"/>
Modified:
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
===================================================================
---
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java 2010-11-22
20:21:51 UTC (rev 9920)
+++
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java 2010-11-23
15:35:31 UTC (rev 9921)
@@ -63,7 +63,7 @@
/**
* A ClientSessionFactoryImpl
- *
+ *
* Encapsulates a connection to a server
*
* @author Tim Fox
@@ -147,8 +147,6 @@
private final Object waitLock = new Object();
- public static List<ClientSessionFactoryImpl> factories = new
ArrayList<ClientSessionFactoryImpl>();
-
// Static
//
---------------------------------------------------------------------------------------
@@ -215,8 +213,6 @@
if (connection == null && failoverOnInitialConnection)
{
- TransportConfiguration backupConfig = serverLocator.getBackup(connectorConfig);
-
if (backupConfig != null)
{
// Try and connect to the backup
@@ -241,6 +237,19 @@
}
+ public TransportConfiguration getConnectorConfiguration()
+ {
+ return connectorConfig;
+ }
+
+ public void setBackupConnector(TransportConfiguration live, TransportConfiguration
backUp)
+ {
+ if(live.equals(connectorConfig))
+ {
+ backupConfig = backUp;
+ }
+ }
+
public ClientSession createSession(final String username,
final String password,
final boolean xa,
@@ -887,69 +896,62 @@
long interval = retryInterval;
int count = 0;
- factories.add(this);
- try
+
+ synchronized (waitLock)
{
- synchronized (waitLock)
+ while (true)
{
- while (true)
+ if (exitLoop)
{
- if (exitLoop)
- {
- return;
- }
+ return;
+ }
- getConnection();
+ getConnection();
- if (connection == null)
+ if (connection == null)
+ {
+ // Failed to get connection
+
+ if (reconnectAttempts != 0)
{
- // Failed to get connection
+ count++;
- if (reconnectAttempts != 0)
+ if (reconnectAttempts != -1 && count == reconnectAttempts)
{
- count++;
+ log.warn("Tried " + reconnectAttempts + " times to
connect. Now giving up.");
- if (reconnectAttempts != -1 && count == reconnectAttempts)
- {
- log.warn("Tried " + reconnectAttempts + " times to
connect. Now giving up.");
+ return;
+ }
- return;
- }
+ try
+ {
+ waitLock.wait(interval);
+ }
+ catch (InterruptedException ignore)
+ {
+ }
- try
- {
- waitLock.wait(interval);
- }
- catch (InterruptedException ignore)
- {
- }
+ // Exponential back-off
+ long newInterval = (long)(interval * retryIntervalMultiplier);
- // Exponential back-off
- long newInterval = (long)(interval * retryIntervalMultiplier);
-
- if (newInterval > maxRetryInterval)
- {
- newInterval = maxRetryInterval;
- }
-
- interval = newInterval;
- }
- else
+ if (newInterval > maxRetryInterval)
{
- return;
+ newInterval = maxRetryInterval;
}
+
+ interval = newInterval;
}
else
{
return;
}
}
+ else
+ {
+ return;
+ }
}
}
- finally
- {
- factories.remove(this);
- }
}
private void cancelScheduledTasks()
@@ -1221,7 +1223,6 @@
SimpleString nodeID = msg.getNodeID();
if (nodeID != null)
{
- backupConfig = serverLocator.getBackup(connectorConfig);
serverLocator.notifyNodeDown(msg.getNodeID().toString());
}
Modified:
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/client/impl/ClientSessionFactoryInternal.java
===================================================================
---
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/client/impl/ClientSessionFactoryInternal.java 2010-11-22
20:21:51 UTC (rev 9920)
+++
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/client/impl/ClientSessionFactoryInternal.java 2010-11-23
15:35:31 UTC (rev 9921)
@@ -13,6 +13,7 @@
package org.hornetq.core.client.impl;
import org.hornetq.api.core.HornetQException;
+import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.core.client.ClientSessionFactory;
import org.hornetq.api.core.client.SessionFailureListener;
@@ -39,4 +40,8 @@
void removeSession(final ClientSessionInternal session, boolean failingOver);
void connect(int reconnectAttempts, boolean failoverOnInitialConnection) throws
HornetQException;
+
+ TransportConfiguration getConnectorConfiguration();
+
+ void setBackupConnector(TransportConfiguration live, TransportConfiguration backUp);
}
Modified:
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java
===================================================================
---
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java 2010-11-22
20:21:51 UTC (rev 9920)
+++
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java 2010-11-23
15:35:31 UTC (rev 9921)
@@ -68,8 +68,6 @@
private Pair<TransportConfiguration, TransportConfiguration>[] topologyArray;
- private Map<TransportConfiguration, TransportConfiguration> pairs = new
HashMap<TransportConfiguration, TransportConfiguration>();
-
private boolean receivedTopology;
private ExecutorService threadPool;
@@ -159,6 +157,7 @@
private TransportConfiguration clusterTransportConfiguration;
private boolean backup;
+
private final Exception e = new Exception();
private static synchronized ExecutorService getGlobalThreadPool()
@@ -305,7 +304,6 @@
final TransportConfiguration[] transportConfigs)
{
e.fillInStackTrace();
-
this.ha = useHA;
this.discoveryAddress = discoveryAddress;
@@ -425,18 +423,18 @@
public ClientSessionFactory connect() throws Exception
{
- ClientSessionFactory sf;
+ ClientSessionFactoryInternal sf;
// static list of initial connectors
if (initialConnectors != null && discoveryGroup == null)
{
- sf = staticConnector.connect();
+ sf = (ClientSessionFactoryInternal) staticConnector.connect();
}
// wait for discovery group to get the list of initial connectors
else
{
- sf = createSessionFactory();
+ sf = (ClientSessionFactoryInternal) createSessionFactory();
}
- factories.add(sf);
+ addFactory(sf);
return sf;
}
@@ -471,7 +469,7 @@
factory.connect(reconnectAttempts, failoverOnInitialConnection);
- factories.add(factory);
+ addFactory(factory);
return factory;
}
@@ -537,6 +535,8 @@
}
catch (HornetQException e)
{
+ factory.close();
+ factory = null;
if (e.getCode() == HornetQException.NOT_CONNECTED)
{
attempts++;
@@ -591,7 +591,7 @@
}
}
- factories.add(factory);
+ addFactory(factory);
return factory;
}
@@ -1108,8 +1108,6 @@
}
else
{
- pairs.clear();
-
topologyArray = null;
receivedTopology = false;
@@ -1137,8 +1135,21 @@
topology.addMember(nodeID, new TopologyMember(connectorPair, distance));
- updateArraysAndPairs();
+ TopologyMember actMember = topology.getMember(nodeID);
+ if (actMember.getConnector().a != null && actMember.getConnector().b !=
null)
+ {
+ for (ClientSessionFactory factory : factories)
+ {
+ ((ClientSessionFactoryInternal)
factory).setBackupConnector(actMember.getConnector().a, actMember.getConnector().b);
+ }
+ }
+
+ if (connectorPair.a != null)
+ {
+ updateArraysAndPairs();
+ }
+
if (last)
{
receivedTopology = true;
@@ -1161,11 +1172,6 @@
int count = 0;
for (TopologyMember pair : topology.getMembers())
{
- if (pair.getConnector().b != null)
- {
- pairs.put(pair.getConnector().a, pair.getConnector().b);
- }
-
topologyArray[count++] = pair.getConnector();
}
}
@@ -1227,11 +1233,15 @@
topologyListeners.remove(listener);
}
- public synchronized TransportConfiguration getBackup(final TransportConfiguration
live)
+ public synchronized void addFactory(ClientSessionFactoryInternal factory)
{
- return pairs.get(live);
+ if (factory != null)
+ {
+ TransportConfiguration backup =
topology.getBackupForConnector(factory.getConnectorConfiguration());
+ factory.setBackupConnector(factory.getConnectorConfiguration(), backup);
+ factories.add(factory);
+ }
}
-
public static void shutdown()
{
if (globalScheduledThreadPool != null)
Modified:
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/client/impl/ServerLocatorInternal.java
===================================================================
---
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/client/impl/ServerLocatorInternal.java 2010-11-22
20:21:51 UTC (rev 9920)
+++
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/client/impl/ServerLocatorInternal.java 2010-11-23
15:35:31 UTC (rev 9921)
@@ -32,8 +32,6 @@
void factoryClosed(final ClientSessionFactory factory);
- TransportConfiguration getBackup( TransportConfiguration live);
-
void setNodeID(String nodeID);
String getNodeID();
Modified:
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/client/impl/Topology.java
===================================================================
---
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/client/impl/Topology.java 2010-11-22
20:21:51 UTC (rev 9920)
+++
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/client/impl/Topology.java 2010-11-23
15:35:31 UTC (rev 9921)
@@ -137,4 +137,16 @@
{
return (currentConnector == null && connector != null) || (currentConnector
!= null && !currentConnector.equals(connector));
}
+
+ public TransportConfiguration getBackupForConnector(TransportConfiguration
connectorConfiguration)
+ {
+ for (TopologyMember member : topology.values())
+ {
+ if(member.getConnector().a != null &&
member.getConnector().a.equals(connectorConfiguration))
+ {
+ return member.getConnector().b;
+ }
+ }
+ return null;
+ }
}
Modified:
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java
===================================================================
---
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java 2010-11-22
20:21:51 UTC (rev 9920)
+++
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java 2010-11-23
15:35:31 UTC (rev 9921)
@@ -210,11 +210,6 @@
{
csf.close();
}
-
- if(serverLocator != null)
- {
- serverLocator.close();
- }
}
executor.execute(new StopRunnable());
Modified:
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java
===================================================================
---
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java 2010-11-22
20:21:51 UTC (rev 9920)
+++
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java 2010-11-23
15:35:31 UTC (rev 9921)
@@ -257,12 +257,6 @@
}
}
- if (serverLocator != null)
- {
- //serverLocator.removeClusterTopologyListener(this);
- serverLocator.close();
- }
-
if (managementService != null)
{
TypedProperties props = new TypedProperties();
Modified:
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/server/cluster/impl/ClusterManagerImpl.java
===================================================================
---
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/server/cluster/impl/ClusterManagerImpl.java 2010-11-22
20:21:51 UTC (rev 9920)
+++
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/server/cluster/impl/ClusterManagerImpl.java 2010-11-23
15:35:31 UTC (rev 9921)
@@ -17,11 +17,7 @@
import java.lang.reflect.Array;
import java.net.InetAddress;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
@@ -103,8 +99,11 @@
private Set<ClusterTopologyListener> clusterConnectionListeners = new
ConcurrentHashSet<ClusterTopologyListener>();
private Topology topology = new Topology();
- private ClientSessionFactory backupSessionFactory;
+ private ServerLocatorInternal backupServerLocator;
+
+ private final List<ServerLocatorInternal> clusterLocators = new
ArrayList<ServerLocatorInternal>();
+
public ClusterManagerImpl(final ExecutorFactory executorFactory,
final HornetQServer server,
final PostOffice postOffice,
@@ -214,13 +213,16 @@
bridges.clear();
- if(backupSessionFactory != null)
+ if(backupServerLocator != null)
{
- backupSessionFactory.close();
- backupSessionFactory.getServerLocator().close();
- backupSessionFactory = null;
+ backupServerLocator.close();
}
+ for (ServerLocatorInternal clusterLocator : clusterLocators)
+ {
+ clusterLocator.close();
+ }
+ clusterLocators.clear();
started = false;
}
@@ -350,19 +352,18 @@
member.getConnector().b = null;
}
- if(backupSessionFactory != null)
+ if(backupServerLocator != null)
{
//todo we could use the topology of this to preempt it arriving from the cc
try
{
- backupSessionFactory.close();
- backupSessionFactory.getServerLocator().close();
+ backupServerLocator.close();
}
catch (Exception e)
{
log.warn("problem closing backup session factory", e);
}
- backupSessionFactory = null;
+ backupServerLocator = null;
}
for (BroadcastGroup broadcastGroup : broadcastGroups.values())
@@ -670,7 +671,7 @@
serverLocator.setRetryIntervalMultiplier(config.getRetryIntervalMultiplier());
serverLocator.setClientFailureCheckPeriod(config.getClientFailureCheckPeriod());
serverLocator.setInitialConnectAttempts(config.getReconnectAttempts());
-
+ clusterLocators.add(serverLocator);
Bridge bridge = new BridgeImpl(serverLocator,
nodeUUID,
new SimpleString(config.getName()),
@@ -740,6 +741,7 @@
serverLocator =
(ServerLocatorInternal)HornetQClient.createServerLocatorWithHA(tcConfigs);
serverLocator.setNodeID(nodeUUID.toString());
serverLocator.setReconnectAttempts(-1);
+ clusterLocators.add(serverLocator);
}
else if (config.getDiscoveryGroupName() != null)
{
@@ -755,6 +757,7 @@
serverLocator =
(ServerLocatorInternal)HornetQClient.createServerLocatorWithHA(dg.getGroupAddress(),
dg.getGroupPort());
serverLocator.setNodeID(nodeUUID.toString());
serverLocator.setReconnectAttempts(-1);
+ clusterLocators.add(serverLocator);
}
else
{
@@ -796,16 +799,14 @@
}
}
- private void announceBackup(ClusterConnectionConfiguration config,
TransportConfiguration connector) throws Exception
+ private void announceBackup(final ClusterConnectionConfiguration config, final
TransportConfiguration connector) throws Exception
{
- ServerLocatorInternal locator;
-
if (config.getStaticConnectors() != null)
{
TransportConfiguration[] tcConfigs =
connectorNameListToArray(config.getStaticConnectors());
- locator =
(ServerLocatorInternal)HornetQClient.createServerLocatorWithoutHA(tcConfigs);
- locator.setReconnectAttempts(-1);
+ backupServerLocator =
(ServerLocatorInternal)HornetQClient.createServerLocatorWithoutHA(tcConfigs);
+ backupServerLocator.setReconnectAttempts(-1);
}
else if (config.getDiscoveryGroupName() != null)
{
@@ -818,17 +819,30 @@
"'. The cluster connection will not be
deployed.");
}
- locator =
(ServerLocatorInternal)HornetQClient.createServerLocatorWithoutHA(dg.getGroupAddress(),
dg.getGroupPort());
- locator.setReconnectAttempts(-1);
- locator.setDiscoveryInitialWaitTimeout(0);
+ backupServerLocator =
(ServerLocatorInternal)HornetQClient.createServerLocatorWithoutHA(dg.getGroupAddress(),
dg.getGroupPort());
+ backupServerLocator.setReconnectAttempts(-1);
+ backupServerLocator.setDiscoveryInitialWaitTimeout(0);
}
else
{
return;
}
log.info("announcing backup");
- backupSessionFactory = locator.connect();
- backupSessionFactory.getConnection().getChannel(0, -1).send(new
NodeAnnounceMessage(nodeUUID.toString(), nodeUUID.toString(), true, connector));
+ this.executorFactory.getExecutor().execute(new Runnable()
+ {
+ public void run()
+ {
+ try
+ {
+ ClientSessionFactory backupSessionFactory =
backupServerLocator.connect();
+ backupSessionFactory.getConnection().getChannel(0, -1).send(new
NodeAnnounceMessage(nodeUUID.toString(), nodeUUID.toString(), true, connector));
+ }
+ catch (Exception e)
+ {
+ log.warn("Unable to announce backup", e);
+ }
+ }
+ });
}
private Transformer instantiateTransformer(final String transformerClassName)
Modified:
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
===================================================================
---
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java 2010-11-22
20:21:51 UTC (rev 9920)
+++
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java 2010-11-23
15:35:31 UTC (rev 9921)
@@ -565,10 +565,6 @@
// start connector service
connectorsService = new ConnectorsService(configuration, storageManager,
scheduledPool, postOffice);
connectorsService.start();
-
- started = true;
-
-
}
@Override
Modified:
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
===================================================================
---
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2010-11-22
20:21:51 UTC (rev 9920)
+++
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2010-11-23
15:35:31 UTC (rev 9921)
@@ -29,6 +29,7 @@
import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.core.client.*;
import org.hornetq.core.client.impl.ClientSessionFactoryImpl;
+import org.hornetq.core.client.impl.ServerLocatorImpl;
import org.hornetq.core.config.*;
import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.logging.Logger;
@@ -105,16 +106,6 @@
@Override
protected void tearDown() throws Exception
{
- UnitTestCase.checkFreePort(ClusterTestBase.PORTS);
-
- servers = null;
-
- sfs = null;
-
- consumers = null;
-
- consumers = new ConsumerHolder[ClusterTestBase.MAX_CONSUMERS];
-
for (ServerLocator locator : locators)
{
try
@@ -127,9 +118,26 @@
}
}
+ locators = null;
+
+ locators = new ServerLocator[ClusterTestBase.MAX_SERVERS];
+ UnitTestCase.checkFreePort(ClusterTestBase.PORTS);
+
+ servers = null;
+
+ sfs = null;
+
+ consumers = null;
+
+ consumers = new ConsumerHolder[ClusterTestBase.MAX_CONSUMERS];
+
+
+
nodeManagers = null;
super.tearDown();
+
+ // ServerLocatorImpl.shutdown();
}
// Private
-------------------------------------------------------------------------------------------------------
@@ -426,7 +434,7 @@
if (holder != null)
{
holder.consumer.close();
- holder.session.close();
+ // holder.session.close();
consumers[i] = null;
}
@@ -1468,92 +1476,173 @@
}
servers[node] = server;
}
- protected void setupServerWithDiscovery(final int node,
- final String groupAddress,
- final int port,
- final boolean fileStorage,
- final boolean netty,
- final boolean backup)
- {
- setupServerWithDiscovery(node, groupAddress, port, fileStorage, netty, backup,
-1);
- }
- protected void setupServerWithDiscovery(final int node,
- final String groupAddress,
- final int port,
- final boolean fileStorage,
- final boolean netty,
- final int backupNode)
- {
- setupServerWithDiscovery(node, groupAddress, port, fileStorage, netty, false,
backupNode);
- }
+ protected void setupLiveServerWithDiscovery(final int node,
+ final String groupAddress,
+ final int port,
+ final boolean fileStorage,
+ final boolean netty,
+ final boolean sharedStorage)
+ {
+ if (servers[node] != null)
+ {
+ throw new IllegalArgumentException("Already a server at node " +
node);
+ }
- protected void setupServerWithDiscovery(final int node,
- final String groupAddress,
- final int port,
- final boolean fileStorage,
- final boolean netty,
- final boolean backup,
- final int backupNode)
- {
- if (servers[node] != null)
- {
- throw new IllegalArgumentException("Already a server at node " +
node);
- }
+ Configuration configuration = new ConfigurationImpl();
- Configuration configuration = new ConfigurationImpl();
+ configuration.setSecurityEnabled(false);
+ configuration.setBindingsDirectory(getBindingsDir(node, false));
+ configuration.setJournalMinFiles(2);
+ configuration.setJournalDirectory(getJournalDir(node, false));
+ configuration.setJournalFileSize(100 * 1024);
+ configuration.setJournalType(getDefaultJournalType());
+ configuration.setJournalMaxIO_AIO(1000);
+ configuration.setPagingDirectory(getPageDir(node, false));
+ configuration.setLargeMessagesDirectory(getLargeMessagesDir(node, false));
+ configuration.setClustered(true);
+ configuration.setBackup(false);
- configuration.setSecurityEnabled(false);
- configuration.setBindingsDirectory(getBindingsDir(node, false));
- configuration.setJournalMinFiles(2);
- configuration.setJournalDirectory(getJournalDir(node, false));
- configuration.setJournalFileSize(100 * 1024);
- configuration.setJournalType(getDefaultJournalType());
- configuration.setJournalMaxIO_AIO(1000);
- configuration.setPagingDirectory(getPageDir(node, false));
- configuration.setLargeMessagesDirectory(getLargeMessagesDir(node, false));
- configuration.setClustered(true);
- configuration.setBackup(backup);
+ configuration.getAcceptorConfigurations().clear();
- configuration.getAcceptorConfigurations().clear();
+ Map<String, Object> params = generateParams(node, netty);
- Map<String, Object> params = generateParams(node, netty);
+ configuration.getAcceptorConfigurations().add(createTransportConfiguration(netty,
true, params));
- configuration.getAcceptorConfigurations().add(createTransportConfiguration(netty,
true, params));
+ TransportConfiguration connector = createTransportConfiguration(netty, false,
params);
+ configuration.getConnectorConfigurations().put(connector.getName(), connector);
- TransportConfiguration connector = createTransportConfiguration(netty, false,
params);
- configuration.getConnectorConfigurations().put(connector.getName(), connector);
+ List<String> connectorPairs = new ArrayList<String>();
+ connectorPairs.add(connector.getName());
- List<String> connectorPairs = new ArrayList<String>();
- connectorPairs.add(connector.getName());
+ BroadcastGroupConfiguration bcConfig = new
BroadcastGroupConfiguration("bg1",
+ null,
+ -1,
+
groupAddress,
+ port,
+ 1000,
+
connectorPairs);
- BroadcastGroupConfiguration bcConfig = new
BroadcastGroupConfiguration("bg1",
- null,
- -1,
-
groupAddress,
- port,
- 1000,
-
connectorPairs);
+ configuration.getBroadcastGroupConfigurations().add(bcConfig);
- configuration.getBroadcastGroupConfigurations().add(bcConfig);
+ DiscoveryGroupConfiguration dcConfig = new
DiscoveryGroupConfiguration("dg1", null, groupAddress, port, 5000, 5000);
- DiscoveryGroupConfiguration dcConfig = new
DiscoveryGroupConfiguration("dg1", null, groupAddress, port, 5000, 5000);
+ configuration.getDiscoveryGroupConfigurations().put(dcConfig.getName(),
dcConfig);
- configuration.getDiscoveryGroupConfigurations().put(dcConfig.getName(), dcConfig);
+ HornetQServer server;
+ if (fileStorage)
+ {
+ if (sharedStorage)
+ {
+ server = createInVMFailoverServer(true, configuration,
nodeManagers[node]);
+ }
+ else
+ {
+ server = HornetQServers.newHornetQServer(configuration);
+ }
+ }
+ else
+ {
+ if (sharedStorage)
+ {
+ server = createInVMFailoverServer(false, configuration,
nodeManagers[node]);
+ }
+ else
+ {
+ server = HornetQServers.newHornetQServer(configuration, false);
+ }
+ }
+ servers[node] = server;
+ }
- HornetQServer server;
+ protected void setupBackupServerWithDiscovery(final int node,
+ final int liveNode,
+ final String groupAddress,
+ final int port,
+ final boolean fileStorage,
+ final boolean netty,
+ final boolean sharedStorage)
+ {
+ if (servers[node] != null)
+ {
+ throw new IllegalArgumentException("Already a server at node " +
node);
+ }
- if (fileStorage)
- {
- server = HornetQServers.newHornetQServer(configuration);
- }
- else
- {
- server = HornetQServers.newHornetQServer(configuration, false);
- }
- servers[node] = server;
- }
+ Configuration configuration = new ConfigurationImpl();
+ configuration.setSecurityEnabled(false);
+ configuration.setSharedStore(sharedStorage);
+ if (sharedStorage)
+ {
+ // Shared storage will share the node between the backup and live node
+ configuration.setBindingsDirectory(getBindingsDir(liveNode, false));
+ configuration.setJournalDirectory(getJournalDir(liveNode, false));
+ configuration.setPagingDirectory(getPageDir(liveNode, false));
+ configuration.setLargeMessagesDirectory(getLargeMessagesDir(liveNode,
false));
+ }
+ else
+ {
+ configuration.setBindingsDirectory(getBindingsDir(node, true));
+ configuration.setJournalDirectory(getJournalDir(node, true));
+ configuration.setPagingDirectory(getPageDir(node, true));
+ configuration.setLargeMessagesDirectory(getLargeMessagesDir(node, true));
+ }
+ configuration.setClustered(true);
+ configuration.setBackup(true);
+
+ configuration.getAcceptorConfigurations().clear();
+
+ Map<String, Object> params = generateParams(node, netty);
+
+ configuration.getAcceptorConfigurations().add(createTransportConfiguration(netty,
true, params));
+
+ TransportConfiguration connector = createTransportConfiguration(netty, false,
params);
+ configuration.getConnectorConfigurations().put(connector.getName(), connector);
+
+ List<String> connectorPairs = new ArrayList<String>();
+ connectorPairs.add(connector.getName());
+
+ BroadcastGroupConfiguration bcConfig = new
BroadcastGroupConfiguration("bg1",
+ null,
+ -1,
+
groupAddress,
+ port,
+ 1000,
+
connectorPairs);
+
+ configuration.getBroadcastGroupConfigurations().add(bcConfig);
+
+ DiscoveryGroupConfiguration dcConfig = new
DiscoveryGroupConfiguration("dg1", null, groupAddress, port, 5000, 5000);
+
+ configuration.getDiscoveryGroupConfigurations().put(dcConfig.getName(),
dcConfig);
+
+ HornetQServer server;
+ if (fileStorage)
+ {
+ if (sharedStorage)
+ {
+ server = createInVMFailoverServer(true, configuration,
nodeManagers[liveNode]);
+ }
+ else
+ {
+ server = HornetQServers.newHornetQServer(configuration);
+ }
+ }
+ else
+ {
+ if (sharedStorage)
+ {
+ server = createInVMFailoverServer(false, configuration,
nodeManagers[liveNode]);
+ }
+ else
+ {
+ server = HornetQServers.newHornetQServer(configuration, false);
+ }
+ }
+ servers[node] = server;
+ }
+
+
protected void clearServer(final int... nodes)
{
for (int i = 0; i < nodes.length; i++)
Modified:
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/cluster/distribution/SymmetricClusterWithDiscoveryTest.java
===================================================================
---
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/cluster/distribution/SymmetricClusterWithDiscoveryTest.java 2010-11-22
20:21:51 UTC (rev 9920)
+++
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/cluster/distribution/SymmetricClusterWithDiscoveryTest.java 2010-11-23
15:35:31 UTC (rev 9921)
@@ -60,31 +60,31 @@
@Override
protected void setupServers() throws Exception
{
- setupServerWithDiscovery(0,
+ setupLiveServerWithDiscovery(0,
SymmetricClusterWithDiscoveryTest.groupAddress,
SymmetricClusterWithDiscoveryTest.groupPort,
isFileStorage(),
isNetty(),
false);
- setupServerWithDiscovery(1,
+ setupLiveServerWithDiscovery(1,
SymmetricClusterWithDiscoveryTest.groupAddress,
SymmetricClusterWithDiscoveryTest.groupPort,
isFileStorage(),
isNetty(),
false);
- setupServerWithDiscovery(2,
+ setupLiveServerWithDiscovery(2,
SymmetricClusterWithDiscoveryTest.groupAddress,
SymmetricClusterWithDiscoveryTest.groupPort,
isFileStorage(),
isNetty(),
false);
- setupServerWithDiscovery(3,
+ setupLiveServerWithDiscovery(3,
SymmetricClusterWithDiscoveryTest.groupAddress,
SymmetricClusterWithDiscoveryTest.groupPort,
isFileStorage(),
isNetty(),
false);
- setupServerWithDiscovery(4,
+ setupLiveServerWithDiscovery(4,
SymmetricClusterWithDiscoveryTest.groupAddress,
SymmetricClusterWithDiscoveryTest.groupPort,
isFileStorage(),
Modified:
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/cluster/distribution/TwoWayTwoNodeClusterWithDiscoveryTest.java
===================================================================
---
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/cluster/distribution/TwoWayTwoNodeClusterWithDiscoveryTest.java 2010-11-22
20:21:51 UTC (rev 9920)
+++
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/cluster/distribution/TwoWayTwoNodeClusterWithDiscoveryTest.java 2010-11-23
15:35:31 UTC (rev 9921)
@@ -51,8 +51,8 @@
@Override
protected void setupServers()
{
- setupServerWithDiscovery(0, groupAddress, groupPort, isFileStorage(), isNetty(),
false);
- setupServerWithDiscovery(1, groupAddress, groupPort, isFileStorage(), isNetty(),
false);
+ setupLiveServerWithDiscovery(0, groupAddress, groupPort, isFileStorage(),
isNetty(), false);
+ setupLiveServerWithDiscovery(1, groupAddress, groupPort, isFileStorage(),
isNetty(), false);
}
// Private -------------------------------------------------------
Modified:
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/cluster/failover/ClusterWithBackupFailoverTestBase.java
===================================================================
---
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/cluster/failover/ClusterWithBackupFailoverTestBase.java 2010-11-22
20:21:51 UTC (rev 9920)
+++
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/cluster/failover/ClusterWithBackupFailoverTestBase.java 2010-11-23
15:35:31 UTC (rev 9921)
@@ -79,8 +79,6 @@
public void testFailLiveNodes() throws Exception
{
- try
- {
setupCluster();
startServers(3, 4, 5, 0, 1, 2);
@@ -190,10 +188,6 @@
stopServers();
ClusterWithBackupFailoverTestBase.log.info("*** test done");
- } catch (Exception e)
- {
- e.printStackTrace(); //To change body of catch statement use File | Settings |
File Templates.
- }
}
public void testFailBackupNodes() throws Exception
@@ -306,12 +300,12 @@
protected void stopServers() throws Exception
{
+
+ closeAllServerLocatorsFactories();
closeAllConsumers();
closeAllSessionFactories();
- closeAllServerLocatorsFactories();
-
stopServers(0, 1, 2, 3, 4, 5);
}
Modified:
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/cluster/failover/DiscoveryClusterWithBackupFailoverTest.java
===================================================================
---
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/cluster/failover/DiscoveryClusterWithBackupFailoverTest.java 2010-11-22
20:21:51 UTC (rev 9920)
+++
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/cluster/failover/DiscoveryClusterWithBackupFailoverTest.java 2010-11-23
15:35:31 UTC (rev 9921)
@@ -63,39 +63,39 @@
protected void setupServers() throws Exception
{
// The lives
- setupServerWithDiscovery(0,
+ setupLiveServerWithDiscovery(0,
DiscoveryClusterWithBackupFailoverTest.groupAddress,
DiscoveryClusterWithBackupFailoverTest.groupPort,
isFileStorage(),
isNetty(),
- 3);
- setupServerWithDiscovery(1,
+ true);
+ setupLiveServerWithDiscovery(1,
DiscoveryClusterWithBackupFailoverTest.groupAddress,
DiscoveryClusterWithBackupFailoverTest.groupPort,
isFileStorage(),
isNetty(),
- 4);
- setupServerWithDiscovery(2,
+ true);
+ setupLiveServerWithDiscovery(2,
DiscoveryClusterWithBackupFailoverTest.groupAddress,
DiscoveryClusterWithBackupFailoverTest.groupPort,
isFileStorage(),
isNetty(),
- 5);
+ true);
// The backups
- setupServerWithDiscovery(3,
+ setupBackupServerWithDiscovery(3,0,
DiscoveryClusterWithBackupFailoverTest.groupAddress,
DiscoveryClusterWithBackupFailoverTest.groupPort,
isFileStorage(),
isNetty(),
true);
- setupServerWithDiscovery(4,
+ setupBackupServerWithDiscovery(4,1,
DiscoveryClusterWithBackupFailoverTest.groupAddress,
DiscoveryClusterWithBackupFailoverTest.groupPort,
isFileStorage(),
isNetty(),
true);
- setupServerWithDiscovery(5,
+ setupBackupServerWithDiscovery(5,2,
DiscoveryClusterWithBackupFailoverTest.groupAddress,
DiscoveryClusterWithBackupFailoverTest.groupPort,
isFileStorage(),
Modified:
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTest.java
===================================================================
---
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTest.java 2010-11-22
20:21:51 UTC (rev 9920)
+++
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTest.java 2010-11-23
15:35:31 UTC (rev 9921)
@@ -54,6 +54,7 @@
public class FailoverTest extends FailoverTestBase
{
private static final Logger log = Logger.getLogger(FailoverTest.class);
+ private ServerLocator locator;
// Constants -----------------------------------------------------
@@ -84,11 +85,23 @@
}
}
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ locator = getServerLocator();
+ }
+
+ @Override
+ protected void tearDown() throws Exception
+ {
+ locator.close();
+ super.tearDown();
+ }
+
//https://jira.jboss.org/browse/HORNETQ-522
public void testNonTransactedWithZeroConsumerWindowSize() throws Exception
{
- ServerLocator locator = getServerLocator();
-
locator.setBlockOnNonDurableSend(true);
locator.setBlockOnDurableSend(true);
@@ -176,8 +189,6 @@
{
ClientSessionFactoryInternal sf;
- ServerLocator locator = getServerLocator();
-
locator.setBlockOnNonDurableSend(true);
locator.setBlockOnDurableSend(true);
locator.setReconnectAttempts(-1);
@@ -238,8 +249,6 @@
public void testConsumeTransacted() throws Exception
{
- ServerLocator locator = getServerLocator();
-
locator.setBlockOnNonDurableSend(true);
locator.setBlockOnDurableSend(true);
locator.setReconnectAttempts(-1);
@@ -327,13 +336,12 @@
//
https://jira.jboss.org/jira/browse/HORNETQ-285
public void testFailoverOnInitialConnection() throws Exception
{
- ServerLocator locator = getServerLocator();
-
locator.setBlockOnNonDurableSend(true);
locator.setBlockOnDurableSend(true);
locator.setFailoverOnInitialConnection(true);
locator.setReconnectAttempts(-1);
+
ClientSessionFactoryInternal sf = createSessionFactoryAndWaitForTopology(locator,
2);
// Crash live server
@@ -386,8 +394,6 @@
public void testTransactedMessagesSentSoRollback() throws Exception
{
- ServerLocator locator = getServerLocator();
-
locator.setBlockOnNonDurableSend(true);
locator.setBlockOnDurableSend(true);
locator.setReconnectAttempts(-1);
@@ -451,8 +457,6 @@
*/
public void testTransactedMessagesSentSoRollbackAndContinueWork() throws Exception
{
- ServerLocator locator = getServerLocator();
-
locator.setBlockOnNonDurableSend(true);
locator.setBlockOnDurableSend(true);
locator.setReconnectAttempts(-1);
@@ -524,8 +528,6 @@
public void testTransactedMessagesNotSentSoNoRollback() throws Exception
{
- ServerLocator locator = getServerLocator();
-
locator.setBlockOnNonDurableSend(true);
locator.setBlockOnDurableSend(true);
locator.setReconnectAttempts(-1);
@@ -598,8 +600,6 @@
public void testTransactedMessagesWithConsumerStartedBeforeFailover() throws
Exception
{
- ServerLocator locator = getServerLocator();
-
locator.setBlockOnNonDurableSend(true);
locator.setBlockOnDurableSend(true);
locator.setReconnectAttempts(-1);
@@ -680,8 +680,6 @@
public void testTransactedMessagesConsumedSoRollback() throws Exception
{
- ServerLocator locator = getServerLocator();
-
locator.setBlockOnNonDurableSend(true);
locator.setBlockOnDurableSend(true);
locator.setReconnectAttempts(-1);
@@ -756,8 +754,6 @@
public void testTransactedMessagesNotConsumedSoNoRollback() throws Exception
{
- ServerLocator locator = getServerLocator();
-
locator.setBlockOnNonDurableSend(true);
locator.setBlockOnDurableSend(true);
locator.setReconnectAttempts(-1);
@@ -844,8 +840,6 @@
public void testXAMessagesSentSoRollbackOnEnd() throws Exception
{
- ServerLocator locator = getServerLocator();
-
locator.setBlockOnNonDurableSend(true);
locator.setBlockOnDurableSend(true);
locator.setReconnectAttempts(-1);
@@ -907,8 +901,6 @@
public void testXAMessagesSentSoRollbackOnPrepare() throws Exception
{
- ServerLocator locator = getServerLocator();
-
locator.setBlockOnNonDurableSend(true);
locator.setBlockOnDurableSend(true);
locator.setReconnectAttempts(-1);
@@ -973,8 +965,6 @@
// This might happen if 1PC optimisation kicks in
public void testXAMessagesSentSoRollbackOnCommit() throws Exception
{
- ServerLocator locator = getServerLocator();
-
locator.setBlockOnNonDurableSend(true);
locator.setBlockOnDurableSend(true);
locator.setReconnectAttempts(-1);
@@ -1040,8 +1030,6 @@
public void testXAMessagesNotSentSoNoRollbackOnCommit() throws Exception
{
- ServerLocator locator = getServerLocator();
-
locator.setBlockOnNonDurableSend(true);
locator.setBlockOnDurableSend(true);
locator.setReconnectAttempts(-1);
@@ -1122,8 +1110,6 @@
public void testXAMessagesConsumedSoRollbackOnEnd() throws Exception
{
- ServerLocator locator = getServerLocator();
-
locator.setBlockOnNonDurableSend(true);
locator.setBlockOnDurableSend(true);
locator.setReconnectAttempts(-1);
@@ -1200,8 +1186,6 @@
public void testXAMessagesConsumedSoRollbackOnPrepare() throws Exception
{
- ServerLocator locator = getServerLocator();
-
locator.setBlockOnNonDurableSend(true);
locator.setBlockOnDurableSend(true);
locator.setReconnectAttempts(-1);
@@ -1281,8 +1265,6 @@
// 1PC optimisation
public void testXAMessagesConsumedSoRollbackOnCommit() throws Exception
{
- ServerLocator locator = getServerLocator();
-
locator.setBlockOnNonDurableSend(true);
locator.setBlockOnDurableSend(true);
locator.setReconnectAttempts(-1);
@@ -1362,8 +1344,6 @@
public void testCreateNewFactoryAfterFailover() throws Exception
{
- ServerLocator locator = getServerLocator();
-
locator.setBlockOnNonDurableSend(true);
locator.setBlockOnDurableSend(true);
locator.setFailoverOnInitialConnection(true);
@@ -1392,8 +1372,6 @@
public void testFailoverMultipleSessionsWithConsumers() throws Exception
{
- ServerLocator locator = getServerLocator();
-
locator.setBlockOnNonDurableSend(true);
locator.setBlockOnDurableSend(true);
locator.setReconnectAttempts(-1);
@@ -1492,8 +1470,6 @@
*/
public void testFailWithBrowser() throws Exception
{
- ServerLocator locator = getServerLocator();
-
locator.setBlockOnNonDurableSend(true);
locator.setBlockOnDurableSend(true);
locator.setReconnectAttempts(-1);
@@ -1564,8 +1540,6 @@
public void testFailThenReceiveMoreMessagesAfterFailover() throws Exception
{
- ServerLocator locator = getServerLocator();
-
locator.setBlockOnNonDurableSend(true);
locator.setBlockOnDurableSend(true);
locator.setReconnectAttempts(-1);
@@ -1639,8 +1613,6 @@
public void testFailThenReceiveMoreMessagesAfterFailover2() throws Exception
{
- ServerLocator locator = getServerLocator();
-
locator.setBlockOnNonDurableSend(true);
locator.setBlockOnDurableSend(true);
locator.setBlockOnAcknowledge(true);
@@ -1744,8 +1716,6 @@
private void testSimpleSendAfterFailover(final boolean durable, final boolean
temporary) throws Exception
{
- ServerLocator locator = getServerLocator();
-
locator.setBlockOnNonDurableSend(true);
locator.setBlockOnDurableSend(true);
locator.setBlockOnAcknowledge(true);
@@ -1809,7 +1779,6 @@
public void _testForceBlockingReturn() throws Exception
{
- ServerLocator locator = getServerLocator();
locator.setBlockOnNonDurableSend(true);
locator.setBlockOnDurableSend(true);
locator.setBlockOnAcknowledge(true);
@@ -1875,8 +1844,6 @@
public void testCommitOccurredUnblockedAndResendNoDuplicates() throws Exception
{
- ServerLocator locator = getServerLocator();
-
locator.setBlockOnNonDurableSend(true);
locator.setBlockOnDurableSend(true);
locator.setReconnectAttempts(-1);
@@ -2028,8 +1995,6 @@
public void testCommitDidNotOccurUnblockedAndResend() throws Exception
{
- ServerLocator locator = getServerLocator();
-
locator.setBlockOnNonDurableSend(true);
locator.setBlockOnDurableSend(true);
locator.setBlockOnAcknowledge(true);
Modified:
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/cluster/topology/HAClientTopologyWithDiscoveryTest.java
===================================================================
---
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/cluster/topology/HAClientTopologyWithDiscoveryTest.java 2010-11-22
20:21:51 UTC (rev 9920)
+++
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/cluster/topology/HAClientTopologyWithDiscoveryTest.java 2010-11-23
15:35:31 UTC (rev 9921)
@@ -49,11 +49,11 @@
protected void setupServers() throws Exception
{
- setupServerWithDiscovery(0, groupAddress, groupPort, isFileStorage(), isNetty(),
false);
- setupServerWithDiscovery(1, groupAddress, groupPort, isFileStorage(), isNetty(),
false);
- setupServerWithDiscovery(2, groupAddress, groupPort, isFileStorage(), isNetty(),
false);
- setupServerWithDiscovery(3, groupAddress, groupPort, isFileStorage(), isNetty(),
false);
- setupServerWithDiscovery(4, groupAddress, groupPort, isFileStorage(), isNetty(),
false);
+ setupLiveServerWithDiscovery(0, groupAddress, groupPort, isFileStorage(),
isNetty(), false);
+ setupLiveServerWithDiscovery(1, groupAddress, groupPort, isFileStorage(),
isNetty(), false);
+ setupLiveServerWithDiscovery(2, groupAddress, groupPort, isFileStorage(),
isNetty(), false);
+ setupLiveServerWithDiscovery(3, groupAddress, groupPort, isFileStorage(),
isNetty(), false);
+ setupLiveServerWithDiscovery(4, groupAddress, groupPort, isFileStorage(),
isNetty(), false);
}
@Override
Modified:
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/util/ServiceTestBase.java
===================================================================
---
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/util/ServiceTestBase.java 2010-11-22
20:21:51 UTC (rev 9920)
+++
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/util/ServiceTestBase.java 2010-11-23
15:35:31 UTC (rev 9921)
@@ -86,20 +86,11 @@
}
catch (Exception e)
{
- e.printStackTrace(); //To change body of catch statement use File | Settings
| File Templates.
+ e.printStackTrace();
}
}
locators.clear();
- if(!ClientSessionFactoryImpl.factories.isEmpty())
- {
- for (ClientSessionFactoryImpl factory : ClientSessionFactoryImpl.factories)
- {
- // System.out.println(threadDump("oops"));
- //factory.e.printStackTrace();
- // System.exit(0);
- }
- }
- super.tearDown(); //To change body of overridden methods use File | Settings |
File Templates.
+ super.tearDown();
checkFreePort(5445);
checkFreePort(5446);
checkFreePort(5447);
Modified:
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/util/UnitTestCase.java
===================================================================
---
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/util/UnitTestCase.java 2010-11-22
20:21:51 UTC (rev 9920)
+++
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/util/UnitTestCase.java 2010-11-23
15:35:31 UTC (rev 9921)
@@ -776,6 +776,21 @@
Assert.fail("test did not close all its files " +
AsynchronousFileImpl.getTotalMaxIO());
}
+ /*Map<Thread, StackTraceElement[]> threads = Thread.getAllStackTraces();
+ for (Thread thread : threads.keySet())
+ {
+ if(thread.isAlive())
+ {
+ StackTraceElement[] elements = threads.get(thread);
+ for (StackTraceElement element : elements)
+ {
+ if(element.getMethodName().contains("getConnectionWithRetry"))
+ {
+ System.out.println("UnitTestCase.tearDown");
+ }
+ }
+ }
+ }*/
super.tearDown();
}