diff options
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.java | 19 |
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() |