refactor test to cleanup persistence adapter creation for combos - fix ci

This commit is contained in:
gtully 2018-05-23 11:56:57 +01:00
parent db8c771b2a
commit 20ec044c41
1 changed files with 9 additions and 19 deletions

View File

@ -16,10 +16,8 @@
*/
package org.apache.activemq.broker.store;
import java.io.File;
import java.util.ArrayList;
import java.util.concurrent.TimeUnit;
import junit.framework.Test;
import org.apache.activemq.TestSupport;
import org.apache.activemq.broker.BrokerRestartTestSupport;
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.broker.StubConnection;
@ -35,16 +33,15 @@ import org.apache.activemq.command.Message;
import org.apache.activemq.command.MessageAck;
import org.apache.activemq.command.ProducerInfo;
import org.apache.activemq.command.SessionInfo;
import org.apache.activemq.openwire.OpenWireFormat;
import org.apache.activemq.store.PersistenceAdapter;
import org.apache.activemq.store.jdbc.JDBCPersistenceAdapter;
import org.apache.activemq.store.kahadb.KahaDBPersistenceAdapter;
import org.apache.activemq.util.IOHelper;
import java.util.ArrayList;
import java.util.concurrent.TimeUnit;
public class RecoverExpiredMessagesTest extends BrokerRestartTestSupport {
final ArrayList<String> expected = new ArrayList<String>();
final ActiveMQDestination destination = new ActiveMQQueue("TEST");
public PendingQueueMessageStoragePolicy queuePendingPolicy;
public TestSupport.PersistenceAdapterChoice persistenceAdapterChoice;
@Override
protected void setUp() throws Exception {
@ -54,14 +51,10 @@ public class RecoverExpiredMessagesTest extends BrokerRestartTestSupport {
public void initCombosForTestRecovery() throws Exception {
addCombinationValues("queuePendingPolicy", new PendingQueueMessageStoragePolicy[] {new FilePendingQueueMessageStoragePolicy(), new VMPendingQueueMessageStoragePolicy()});
PersistenceAdapter[] persistenceAdapters = new PersistenceAdapter[] {
new KahaDBPersistenceAdapter(),
new JDBCPersistenceAdapter()
TestSupport.PersistenceAdapterChoice[] persistenceAdapters = new TestSupport.PersistenceAdapterChoice[] {
TestSupport.PersistenceAdapterChoice.JDBC, TestSupport.PersistenceAdapterChoice.KahaDB
};
for (PersistenceAdapter adapter : persistenceAdapters) {
adapter.setDirectory(new File(IOHelper.getDefaultDataDirectory()));
}
addCombinationValues("persistenceAdapter", persistenceAdapters);
addCombinationValues("persistenceAdapterChoice", persistenceAdapters);
}
public void testRecovery() throws Exception {
@ -134,10 +127,7 @@ public class RecoverExpiredMessagesTest extends BrokerRestartTestSupport {
@Override
protected void configureBroker(BrokerService broker) throws Exception {
super.configureBroker(broker);
if (persistenceAdapter instanceof JDBCPersistenceAdapter) {
((JDBCPersistenceAdapter) persistenceAdapter).setLockDataSource(null);
}
broker.setPersistenceAdapter(persistenceAdapter);
TestSupport.setPersistenceAdapter(broker, persistenceAdapterChoice);
}
public static Test suite() {