Author: borges
Date: 2011-11-24 07:26:17 -0500 (Thu, 24 Nov 2011)
New Revision: 11757
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java
Log:
Every ServerLocator created to be closed at tearDown().
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java
===================================================================
---
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java 2011-11-24
12:26:05 UTC (rev 11756)
+++
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java 2011-11-24
12:26:17 UTC (rev 11757)
@@ -16,6 +16,7 @@
import java.io.IOException;
import java.net.ServerSocket;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -81,6 +82,7 @@
protected NodeManager nodeManager;
protected boolean startBackupServer = true;
+ private final Collection<ServerLocator> serverLocators = new
ArrayList<ServerLocator>();
// Static --------------------------------------------------------
@@ -234,6 +236,15 @@
stopComponent(backupServer);
stopComponent(liveServer);
+ synchronized (serverLocators)
+ {
+ for (ServerLocator locator : serverLocators)
+ {
+ closeServerLocator(locator);
+ }
+ serverLocators.clear();
+ }
+
Assert.assertEquals(0, InVMRegistry.instance.size());
backupServer = null;
@@ -371,6 +382,10 @@
protected ServerLocatorInternal getServerLocator() throws Exception
{
ServerLocator locator =
HornetQClient.createServerLocatorWithHA(getConnectorTransportConfiguration(true),
getConnectorTransportConfiguration(false));
+ synchronized (serverLocators)
+ {
+ serverLocators.add(locator);
+ }
return (ServerLocatorInternal) locator;
}
Show replies by date