From 0a3bf38ac2fb5ae5d268f7cfe56765e726758e18 Mon Sep 17 00:00:00 2001 From: Martin Ritchie Date: Wed, 2 Jun 2010 16:44:36 +0000 Subject: QPID-2632 : Updated as per other tests for IBBC, with setUp/tearDown This test also required a change to record the number of queues created during IBBC broker startup and ensure the test added one more test. Previously it checked for 0 queues then 1 queue now it is n and n+1. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@950646 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/qpid/server/queue/AMQQueueFactoryTest.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'java/broker/src') diff --git a/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java b/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java index 393ffdeaac..27891289fb 100644 --- a/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java +++ b/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java @@ -20,32 +20,36 @@ */ package org.apache.qpid.server.queue; -import junit.framework.TestCase; import org.apache.qpid.server.registry.ApplicationRegistry; +import org.apache.qpid.server.util.InternalBrokerBaseCase; import org.apache.qpid.server.virtualhost.VirtualHost; import org.apache.qpid.framing.AMQShortString; import org.apache.qpid.framing.FieldTable; -public class AMQQueueFactoryTest extends TestCase +public class AMQQueueFactoryTest extends InternalBrokerBaseCase { QueueRegistry _queueRegistry; VirtualHost _virtualHost; + int _defaultQueueCount; - public void setUp() + @Override + public void setUp() throws Exception { + super.setUp(); ApplicationRegistry registry = (ApplicationRegistry) ApplicationRegistry.getInstance(); _virtualHost = registry.getVirtualHostRegistry().getVirtualHost("test"); _queueRegistry = _virtualHost.getQueueRegistry(); - assertEquals("Queues registered on an empty virtualhost", 0, _queueRegistry.getQueues().size()); + _defaultQueueCount = _queueRegistry.getQueues().size(); } - public void tearDown() + @Override + public void tearDown() throws Exception { - assertEquals("Queue was not registered in virtualhost", 1, _queueRegistry.getQueues().size()); - ApplicationRegistry.remove(); + assertEquals("Queue was not registered in virtualhost", _defaultQueueCount + 1, _queueRegistry.getQueues().size()); + super.tearDown(); } -- cgit v1.2.1