mirror of https://github.com/apache/activemq.git
[minor] Use MemoryPersistenceAdapter for testing when choice of persistence adapter is indifferent
This commit is contained in:
parent
d793db4440
commit
570dbb4372
|
@ -17,6 +17,7 @@
|
|||
package org.apache.activemq.usecases;
|
||||
|
||||
import junit.framework.Test;
|
||||
|
||||
import org.apache.activemq.ActiveMQConnectionFactory;
|
||||
import org.apache.activemq.CombinationTestSupport;
|
||||
import org.apache.activemq.broker.BrokerService;
|
||||
|
@ -26,12 +27,13 @@ import org.apache.activemq.broker.region.policy.PolicyMap;
|
|||
import org.apache.activemq.broker.region.policy.VMPendingQueueMessageStoragePolicy;
|
||||
import org.apache.activemq.command.ActiveMQDestination;
|
||||
import org.apache.activemq.command.ActiveMQQueue;
|
||||
import org.apache.activemq.leveldb.LevelDBStore;
|
||||
import org.apache.activemq.store.memory.MemoryPersistenceAdapter;
|
||||
import org.apache.activemq.util.Wait;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.jms.*;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
|
@ -68,6 +70,13 @@ public class ExpiredMessagesTest extends CombinationTestSupport {
|
|||
brokerUri = broker.getTransportConnectors().get(0).getPublishableConnectString();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void tearDown() throws Exception {
|
||||
connection.stop();
|
||||
broker.stop();
|
||||
broker.waitUntilStopped();
|
||||
}
|
||||
|
||||
public void testExpiredMessages() throws Exception {
|
||||
|
||||
ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(brokerUri);
|
||||
|
@ -291,9 +300,7 @@ public class ExpiredMessagesTest extends CombinationTestSupport {
|
|||
BrokerService broker = new BrokerService();
|
||||
broker.setBrokerName("localhost");
|
||||
broker.setDestinations(new ActiveMQDestination[]{destination});
|
||||
LevelDBStore adaptor = new LevelDBStore();
|
||||
adaptor.setDirectory(new File("target/expiredtest-data/"));
|
||||
broker.setPersistenceAdapter(adaptor);
|
||||
broker.setPersistenceAdapter(new MemoryPersistenceAdapter());
|
||||
|
||||
PolicyEntry defaultPolicy = new PolicyEntry();
|
||||
if (useVMCursor) {
|
||||
|
@ -311,12 +318,4 @@ public class ExpiredMessagesTest extends CombinationTestSupport {
|
|||
return broker;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected void tearDown() throws Exception {
|
||||
connection.stop();
|
||||
broker.stop();
|
||||
broker.waitUntilStopped();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue