Author: borges
Date: 2011-12-08 07:41:11 -0500 (Thu, 08 Dec 2011)
New Revision: 11877
Modified:
trunk/hornetq-core/src/test/java/org/hornetq/tests/util/ServiceTestBase.java
trunk/hornetq-core/src/test/java/org/hornetq/tests/util/UnitTestCase.java
Log:
Move closing of locators from ServiceT.B. to UnitTestCase
Modified: trunk/hornetq-core/src/test/java/org/hornetq/tests/util/ServiceTestBase.java
===================================================================
---
trunk/hornetq-core/src/test/java/org/hornetq/tests/util/ServiceTestBase.java 2011-12-08
11:18:04 UTC (rev 11876)
+++
trunk/hornetq-core/src/test/java/org/hornetq/tests/util/ServiceTestBase.java 2011-12-08
12:41:11 UTC (rev 11877)
@@ -80,7 +80,6 @@
protected static final String NETTY_CONNECTOR_FACTORY =
NettyConnectorFactory.class.getCanonicalName();
- private final Collection<ServerLocator> locators = new
ArrayList<ServerLocator>();
private final Collection<ClientSessionFactory> sessionFactories = new
ArrayList<ClientSessionFactory>();
private final Collection<ClientSession> clientSessions = new
ArrayList<ClientSession>();
@@ -106,21 +105,6 @@
/**
*
*/
- protected void closeAllServerLocatorsFactories()
- {
- synchronized (locators)
- {
- for (ServerLocator locator : locators)
- {
- closeServerLocator(locator);
- }
- locators.clear();
- }
- }
-
- /**
- *
- */
protected void closeAllSessionFactories()
{
synchronized (sessionFactories)
@@ -722,15 +706,6 @@
}
- protected ServerLocator addServerLocator(ServerLocator locator)
- {
- synchronized (locators)
- {
- locators.add(locator);
- }
- return locator;
- }
-
protected ServerLocator createInVMLocator(final int serverID)
{
TransportConfiguration tnspConfig = createInVMTransportConnectorConfig(serverID,
UUIDGenerator.getInstance().generateStringUUID());
Modified: trunk/hornetq-core/src/test/java/org/hornetq/tests/util/UnitTestCase.java
===================================================================
--- trunk/hornetq-core/src/test/java/org/hornetq/tests/util/UnitTestCase.java 2011-12-08
11:18:04 UTC (rev 11876)
+++ trunk/hornetq-core/src/test/java/org/hornetq/tests/util/UnitTestCase.java 2011-12-08
12:41:11 UTC (rev 11877)
@@ -127,6 +127,7 @@
private static Set<Thread> alreadyFailedThread = new HashSet<Thread>();
private final Collection<HornetQServer> servers = new
ArrayList<HornetQServer>();
+ private final Collection<ServerLocator> locators = new
ArrayList<ServerLocator>();
private boolean checkThread = true;
@@ -1462,6 +1463,27 @@
}
}
+ protected final ServerLocator addServerLocator(ServerLocator locator)
+ {
+ synchronized (locators)
+ {
+ locators.add(locator);
+ }
+ return locator;
+ }
+
+ protected void closeAllServerLocatorsFactories()
+ {
+ synchronized (locators)
+ {
+ for (ServerLocator locator : locators)
+ {
+ closeServerLocator(locator);
+ }
+ locators.clear();
+ }
+ }
+
public static final void closeServerLocator(ServerLocator locator)
{
if (locator == null)
Show replies by date