mirror of https://github.com/apache/activemq.git
Have the test store its data in the target folder to let the clean step remove it and attempt to remove the data folder between runs to avoid state derby instances.
This commit is contained in:
parent
1d0f0d541a
commit
33fb7c6096
|
@ -18,11 +18,14 @@ package org.apache.activemq.bugs;
|
|||
|
||||
import java.io.File;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.TextMessage;
|
||||
import javax.management.MalformedObjectNameException;
|
||||
import javax.management.ObjectName;
|
||||
|
||||
import junit.framework.Test;
|
||||
|
||||
import org.apache.activemq.broker.BrokerRestartTestSupport;
|
||||
import org.apache.activemq.broker.BrokerService;
|
||||
import org.apache.activemq.broker.StubConnection;
|
||||
|
@ -46,8 +49,11 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class AMQ5567Test extends BrokerRestartTestSupport {
|
||||
|
||||
protected static final Logger LOG = LoggerFactory.getLogger(AMQ5567Test.class);
|
||||
ActiveMQQueue destination = new ActiveMQQueue("Q");
|
||||
|
||||
private final ActiveMQQueue destination = new ActiveMQQueue("Q");
|
||||
private final String DATA_FOLDER = "./target/AMQ5567Test-data";
|
||||
|
||||
@Override
|
||||
protected void configureBroker(BrokerService broker) throws Exception {
|
||||
|
@ -55,12 +61,19 @@ public class AMQ5567Test extends BrokerRestartTestSupport {
|
|||
broker.setPersistenceAdapter(persistenceAdapter);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PolicyEntry getDefaultPolicy() {
|
||||
PolicyEntry policy = new PolicyEntry();
|
||||
policy.setMemoryLimit(60*1024);
|
||||
return policy;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void tearDown() throws Exception {
|
||||
super.tearDown();
|
||||
IOHelper.delete(new File(DATA_FOLDER));
|
||||
}
|
||||
|
||||
public void initCombosForTestPreparedTransactionNotDispatched() throws Exception {
|
||||
PersistenceAdapter[] persistenceAdapters = new PersistenceAdapter[]{
|
||||
new KahaDBPersistenceAdapter(),
|
||||
|
@ -68,7 +81,7 @@ public class AMQ5567Test extends BrokerRestartTestSupport {
|
|||
new JDBCPersistenceAdapter()
|
||||
};
|
||||
for (PersistenceAdapter adapter : persistenceAdapters) {
|
||||
adapter.setDirectory(new File(IOHelper.getDefaultDataDirectory()));
|
||||
adapter.setDirectory(new File(DATA_FOLDER));
|
||||
}
|
||||
addCombinationValues("persistenceAdapter", persistenceAdapters);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue