Author: ataylor
Date: 2010-11-26 06:28:20 -0500 (Fri, 26 Nov 2010)
New Revision: 9931
Modified:
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/String64KLimitTest.java
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/client/DurableQueueTest.java
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/client/MessageGroupingTest.java
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/client/TemporaryQueueTest.java
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/client/TransactionDurabilityTest.java
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/client/WildCardRoutingTest.java
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/divert/PersistentDivertTest.java
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/http/CoreClientOverHttpTest.java
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/jms/HornetQConnectionFactoryTest.java
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/server/ExpiryRunnerTest.java
Log:
make sure tests close all resources
Modified:
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/String64KLimitTest.java
===================================================================
---
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/String64KLimitTest.java 2010-11-26
10:55:02 UTC (rev 9930)
+++
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/String64KLimitTest.java 2010-11-26
11:28:20 UTC (rev 9931)
@@ -52,6 +52,7 @@
private HornetQServer server;
private ClientSession session;
+ private ServerLocator locator;
// Constructors --------------------------------------------------
@@ -206,7 +207,7 @@
config.getAcceptorConfigurations().add(new
TransportConfiguration(InVMAcceptorFactory.class.getName()));
server = HornetQServers.newHornetQServer(config, false);
server.start();
- ServerLocator locator = HornetQClient.createServerLocatorWithoutHA(new
TransportConfiguration(ServiceTestBase.INVM_CONNECTOR_FACTORY));
+ locator = HornetQClient.createServerLocatorWithoutHA(new
TransportConfiguration(ServiceTestBase.INVM_CONNECTOR_FACTORY));
sf = locator.createSessionFactory();
session = sf.createSession();
}
@@ -218,6 +219,8 @@
sf.close();
+ locator.close();
+
server.stop();
server = null;
Modified:
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/client/DurableQueueTest.java
===================================================================
---
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/client/DurableQueueTest.java 2010-11-26
10:55:02 UTC (rev 9930)
+++
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/client/DurableQueueTest.java 2010-11-26
11:28:20 UTC (rev 9931)
@@ -85,8 +85,6 @@
server.stop();
server.start();
- ServerLocator locator = HornetQClient.createServerLocatorWithoutHA(new
TransportConfiguration(ServiceTestBase.INVM_CONNECTOR_FACTORY));
-
sf = locator.createSessionFactory();
session = sf.createSession(false, true, true);
@@ -114,8 +112,6 @@
server.stop();
server.start();
- ServerLocator locator = HornetQClient.createServerLocatorWithoutHA(new
TransportConfiguration(ServiceTestBase.INVM_CONNECTOR_FACTORY));
-
sf = locator.createSessionFactory();
session = sf.createSession(false, true, true);
Modified:
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/client/MessageGroupingTest.java
===================================================================
---
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/client/MessageGroupingTest.java 2010-11-26
10:55:02 UTC (rev 9930)
+++
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/client/MessageGroupingTest.java 2010-11-26
11:28:20 UTC (rev 9931)
@@ -45,6 +45,7 @@
private ClientSession clientSession;
private final SimpleString qName = new
SimpleString("MessageGroupingTestQueue");
+ private ServerLocator locator;
public void testBasicGrouping() throws Exception
{
@@ -258,11 +259,13 @@
consumer = this.clientSession.createConsumer(qName);
Assert.assertNull(consumer.receiveImmediate());
clientSession.close();
+ locator.close();
}
private void doTestMultipleGroupingTXRollback() throws Exception
{
- log.info("*** starting test");ServerLocator locator =
HornetQClient.createServerLocatorWithoutHA(new
TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+ log.info("*** starting test");
+ ServerLocator locator = HornetQClient.createServerLocatorWithoutHA(new
TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
locator.setBlockOnAcknowledge(true);
ClientSessionFactory sessionFactory = locator.createSessionFactory();
ClientSession clientSession = sessionFactory.createSession(false, false, false);
@@ -333,6 +336,7 @@
consumer = this.clientSession.createConsumer(qName);
Assert.assertNull(consumer.receiveImmediate());
clientSession.close();
+ locator.close();
}
private void dotestMultipleGroupingXACommit() throws Exception
@@ -392,6 +396,7 @@
consumer = this.clientSession.createConsumer(qName);
Assert.assertNull(consumer.receiveImmediate());
clientSession.close();
+ locator.close();
}
private void doTestMultipleGroupingXARollback() throws Exception
@@ -472,6 +477,7 @@
consumer = this.clientSession.createConsumer(qName);
Assert.assertNull(consumer.receiveImmediate());
clientSession.close();
+ locator.close();
}
private void doTestMultipleGrouping() throws Exception
@@ -547,6 +553,7 @@
//
}
}
+ locator.close();
server = null;
clientSession = null;
@@ -567,7 +574,7 @@
server.start();
// then we create a client as normal
- ServerLocator locator = HornetQClient.createServerLocatorWithoutHA(new
TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+ locator = HornetQClient.createServerLocatorWithoutHA(new
TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
ClientSessionFactory sessionFactory = locator.createSessionFactory();
clientSession = sessionFactory.createSession(false, true, true);
clientSession.createQueue(qName, qName, null, false);
Modified:
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/client/TemporaryQueueTest.java
===================================================================
---
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/client/TemporaryQueueTest.java 2010-11-26
10:55:02 UTC (rev 9930)
+++
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/client/TemporaryQueueTest.java 2010-11-26
11:28:20 UTC (rev 9931)
@@ -375,6 +375,8 @@
});
session.close();
+
+ locator2.close();
}
// Package protected ---------------------------------------------
Modified:
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/client/TransactionDurabilityTest.java
===================================================================
---
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/client/TransactionDurabilityTest.java 2010-11-26
10:55:02 UTC (rev 9930)
+++
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/client/TransactionDurabilityTest.java 2010-11-26
11:28:20 UTC (rev 9931)
@@ -173,6 +173,8 @@
session2.close();
+ locator.close();
+
server.stop();
}
Modified:
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/client/WildCardRoutingTest.java
===================================================================
---
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/client/WildCardRoutingTest.java 2010-11-26
10:55:02 UTC (rev 9930)
+++
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/client/WildCardRoutingTest.java 2010-11-26
11:28:20 UTC (rev 9931)
@@ -31,6 +31,7 @@
private HornetQServer server;
private ClientSession clientSession;
+ private ServerLocator locator;
public void testBasicWildcardRouting() throws Exception
{
@@ -763,7 +764,7 @@
server.start();
server.getManagementService().enableNotifications(false);
// then we create a client as normal
- ServerLocator locator = HornetQClient.createServerLocatorWithoutHA(new
TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
+ locator = HornetQClient.createServerLocatorWithoutHA(new
TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
ClientSessionFactory sessionFactory = locator.createSessionFactory();
clientSession = sessionFactory.createSession(false, true, true);
}
@@ -795,7 +796,7 @@
}
server = null;
clientSession = null;
-
+ locator.close();
super.tearDown();
}
}
Modified:
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/divert/PersistentDivertTest.java
===================================================================
---
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/divert/PersistentDivertTest.java 2010-11-26
10:55:02 UTC (rev 9930)
+++
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/divert/PersistentDivertTest.java 2010-11-26
11:28:20 UTC (rev 9931)
@@ -485,6 +485,12 @@
sf.close();
+ locator3.close();
+
+ locator2.close();
+
+ locator.close();
+
messagingService.stop();
}
Modified:
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/http/CoreClientOverHttpTest.java
===================================================================
---
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/http/CoreClientOverHttpTest.java 2010-11-26
10:55:02 UTC (rev 9930)
+++
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/http/CoreClientOverHttpTest.java 2010-11-26
11:28:20 UTC (rev 9931)
@@ -87,6 +87,9 @@
session.close();
+ locator.close();
+
+
server.stop();
}
@@ -120,6 +123,8 @@
session.close();
+ locator.close();
+
server.stop();
}
}
Modified:
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/jms/HornetQConnectionFactoryTest.java
===================================================================
---
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/jms/HornetQConnectionFactoryTest.java 2010-11-26
10:55:02 UTC (rev 9930)
+++
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/jms/HornetQConnectionFactoryTest.java 2010-11-26
11:28:20 UTC (rev 9931)
@@ -278,6 +278,8 @@
testSettersThrowException(cf);
+ cf.close();
+
conn.close();
}
@@ -647,6 +649,8 @@
cf.getRetryInterval();
cf.getRetryIntervalMultiplier();
cf.getReconnectAttempts();
+
+ cf.close();
}
private void assertFactoryParams(final HornetQConnectionFactory cf,
Modified:
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/server/ExpiryRunnerTest.java
===================================================================
---
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/server/ExpiryRunnerTest.java 2010-11-26
10:55:02 UTC (rev 9930)
+++
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/server/ExpiryRunnerTest.java 2010-11-26
11:28:20 UTC (rev 9931)
@@ -50,6 +50,7 @@
private SimpleString expiryQueue;
private SimpleString expiryAddress;
+ private ServerLocator locator;
public void testBasicExpire() throws Exception
{
@@ -256,7 +257,7 @@
// start the server
server.start();
// then we create a client as normal
- ServerLocator locator = HornetQClient.createServerLocatorWithoutHA(new
TransportConfiguration(ServiceTestBase.INVM_CONNECTOR_FACTORY));
+ locator = HornetQClient.createServerLocatorWithoutHA(new
TransportConfiguration(ServiceTestBase.INVM_CONNECTOR_FACTORY));
locator.setBlockOnAcknowledge(true);
ClientSessionFactory sessionFactory = locator.createSessionFactory();
@@ -285,6 +286,7 @@
//
}
}
+ locator.close();
if (server != null && server.isStarted())
{
try