summaryrefslogtreecommitdiff
path: root/java/broker/src/test/java/org/apache/qpid/server/logging/actors/CurrentActorTest.java
diff options
context:
space:
mode:
authorMartin Ritchie <ritchiem@apache.org>2009-08-06 09:26:56 +0000
committerMartin Ritchie <ritchiem@apache.org>2009-08-06 09:26:56 +0000
commit10b52f4b33fe9f0b0b77adda14121953563304ec (patch)
treec4f6dc1e0df3a528e3cc5ff3eedd07e5bdac19f6 /java/broker/src/test/java/org/apache/qpid/server/logging/actors/CurrentActorTest.java
parent9a11ac774d4012289f554dcf209223fbfb338b52 (diff)
downloadqpid-python-10b52f4b33fe9f0b0b77adda14121953563304ec.tar.gz
QPID-2028 : Ensure all Non QpidTestCase System tests correctly clean up by removing the ApplicationRegistry they create.
The biggest offenders are the broker tests which are not pure unit tests. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@801561 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/broker/src/test/java/org/apache/qpid/server/logging/actors/CurrentActorTest.java')
-rw-r--r--java/broker/src/test/java/org/apache/qpid/server/logging/actors/CurrentActorTest.java19
1 files changed, 15 insertions, 4 deletions
diff --git a/java/broker/src/test/java/org/apache/qpid/server/logging/actors/CurrentActorTest.java b/java/broker/src/test/java/org/apache/qpid/server/logging/actors/CurrentActorTest.java
index e7dc0ea5da..c1826218c8 100644
--- a/java/broker/src/test/java/org/apache/qpid/server/logging/actors/CurrentActorTest.java
+++ b/java/broker/src/test/java/org/apache/qpid/server/logging/actors/CurrentActorTest.java
@@ -62,8 +62,9 @@ public class CurrentActorTest extends TestCase
// Create a single session for this test.
AMQProtocolSession _session;
- public void setUp() throws AMQException
+ public void setUp() throws Exception
{
+ super.setUp();
// Create a single session for this test.
VirtualHost virtualHost = ApplicationRegistry.getInstance().
getVirtualHostRegistry().getVirtualHosts().iterator().next();
@@ -72,6 +73,16 @@ public class CurrentActorTest extends TestCase
_session = new InternalTestProtocolSession(virtualHost);
}
+
+ @Override
+ public void tearDown() throws Exception
+ {
+ // Correctly Close the AR we created
+ ApplicationRegistry.remove();
+ super.tearDown();
+ }
+
+
public void testFIFO() throws AMQException
{
// Create a new actor using retrieving the rootMessageLogger from
@@ -143,11 +154,11 @@ public class CurrentActorTest extends TestCase
assertEquals("Retrieved actor is not as expected ",
connectionActor, CurrentActor.get());
- // Verify that removing the last actor returns us to a null value.
+ // Verify that removing the our last actor it returns us to the test
+ // default that the ApplicationRegistry sets.
CurrentActor.remove();
- assertNull("CurrentActor should be null", CurrentActor.get());
-
+ assertEquals("CurrentActor not the Test default", TestLogActor.class ,CurrentActor.get().getClass());
}
public void testThreadLocal()