Explicitly set the PersistenceAdapterFactory

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@945600 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2010-05-18 11:52:23 +00:00
parent 8cf566b4ca
commit 5405ec8c49
1 changed files with 4 additions and 5 deletions

View File

@ -17,7 +17,6 @@
package org.apache.activemq.bugs; package org.apache.activemq.bugs;
import java.util.concurrent.CountDownLatch; import java.util.concurrent.CountDownLatch;
import javax.jms.Connection; import javax.jms.Connection;
import javax.jms.JMSException; import javax.jms.JMSException;
import javax.jms.Message; import javax.jms.Message;
@ -25,9 +24,7 @@ import javax.jms.MessageConsumer;
import javax.jms.MessageListener; import javax.jms.MessageListener;
import javax.jms.ObjectMessage; import javax.jms.ObjectMessage;
import javax.jms.Session; import javax.jms.Session;
import junit.framework.TestCase; import junit.framework.TestCase;
import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.broker.BrokerService; import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.kaha.impl.async.AsyncDataManager; 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 final CountDownLatch latch = new CountDownLatch(max_messages);
private static int max_messages = 600; private static int max_messages = 600;
private static int messageCounter; private static int messageCounter;
private String destinationName = getName()+"_Queue"; private final String destinationName = getName()+"_Queue";
private BrokerService broker; private BrokerService broker;
private Connection receiverConnection; private Connection receiverConnection;
private Connection producerConnection; private Connection producerConnection;
@ -55,6 +52,7 @@ public class DataFileNotDeletedTest extends TestCase {
AMQPersistenceAdapter persistentAdapter; AMQPersistenceAdapter persistentAdapter;
protected static final String payload = new String(new byte[512]); protected static final String payload = new String(new byte[512]);
@Override
public void setUp() throws Exception { public void setUp() throws Exception {
messageCounter = 0; messageCounter = 0;
startBroker(); startBroker();
@ -64,6 +62,7 @@ public class DataFileNotDeletedTest extends TestCase {
producerConnection.start(); producerConnection.start();
} }
@Override
public void tearDown() throws Exception { public void tearDown() throws Exception {
receiverConnection.close(); receiverConnection.close();
producerConnection.close(); producerConnection.close();
@ -122,7 +121,7 @@ public class DataFileNotDeletedTest extends TestCase {
broker.setPersistent(true); broker.setPersistent(true);
broker.setUseJmx(true); broker.setUseJmx(true);
broker.addConnector("tcp://localhost:61616").setName("Default"); broker.addConnector("tcp://localhost:61616").setName("Default");
broker.setPersistenceFactory(new AMQPersistenceAdapterFactory());
AMQPersistenceAdapterFactory factory = (AMQPersistenceAdapterFactory) broker.getPersistenceFactory(); AMQPersistenceAdapterFactory factory = (AMQPersistenceAdapterFactory) broker.getPersistenceFactory();
// ensure there are a bunch of data files but multiple entries in each // ensure there are a bunch of data files but multiple entries in each
factory.setMaxFileLength(1024 * 20); factory.setMaxFileLength(1024 * 20);