From 5405ec8c49d62a0b602b4b2b142e1d7b9ca14c61 Mon Sep 17 00:00:00 2001 From: Robert Davies Date: Tue, 18 May 2010 11:52:23 +0000 Subject: [PATCH] Explicitly set the PersistenceAdapterFactory git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@945600 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/activemq/bugs/DataFileNotDeletedTest.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/activemq-core/src/test/java/org/apache/activemq/bugs/DataFileNotDeletedTest.java b/activemq-core/src/test/java/org/apache/activemq/bugs/DataFileNotDeletedTest.java index b6533310a6..bf7259c749 100644 --- a/activemq-core/src/test/java/org/apache/activemq/bugs/DataFileNotDeletedTest.java +++ b/activemq-core/src/test/java/org/apache/activemq/bugs/DataFileNotDeletedTest.java @@ -17,7 +17,6 @@ package org.apache.activemq.bugs; import java.util.concurrent.CountDownLatch; - import javax.jms.Connection; import javax.jms.JMSException; import javax.jms.Message; @@ -25,9 +24,7 @@ import javax.jms.MessageConsumer; import javax.jms.MessageListener; import javax.jms.ObjectMessage; import javax.jms.Session; - import junit.framework.TestCase; - import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.broker.BrokerService; import org.apache.activemq.kaha.impl.async.AsyncDataManager; @@ -46,7 +43,7 @@ public class DataFileNotDeletedTest extends TestCase { private final CountDownLatch latch = new CountDownLatch(max_messages); private static int max_messages = 600; private static int messageCounter; - private String destinationName = getName()+"_Queue"; + private final String destinationName = getName()+"_Queue"; private BrokerService broker; private Connection receiverConnection; private Connection producerConnection; @@ -55,6 +52,7 @@ public class DataFileNotDeletedTest extends TestCase { AMQPersistenceAdapter persistentAdapter; protected static final String payload = new String(new byte[512]); + @Override public void setUp() throws Exception { messageCounter = 0; startBroker(); @@ -64,6 +62,7 @@ public class DataFileNotDeletedTest extends TestCase { producerConnection.start(); } + @Override public void tearDown() throws Exception { receiverConnection.close(); producerConnection.close(); @@ -122,7 +121,7 @@ public class DataFileNotDeletedTest extends TestCase { broker.setPersistent(true); broker.setUseJmx(true); broker.addConnector("tcp://localhost:61616").setName("Default"); - + broker.setPersistenceFactory(new AMQPersistenceAdapterFactory()); AMQPersistenceAdapterFactory factory = (AMQPersistenceAdapterFactory) broker.getPersistenceFactory(); // ensure there are a bunch of data files but multiple entries in each factory.setMaxFileLength(1024 * 20);