test the AMQ Store cursors instead of Kaha

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@513919 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2007-03-02 19:57:57 +00:00
parent 4e21e15f7e
commit 819b811a2e
3 changed files with 15 additions and 12 deletions

View File

@ -17,24 +17,24 @@
*/
package org.apache.activemq.broker.region.cursors;
import java.io.File;
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.store.kahadaptor.KahaPersistenceAdapter;
import org.apache.activemq.store.amq.AMQPersistenceAdapter;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* @version $Revision: 1.3 $
*/
public class KahaCursorDurableTest extends CursorDurableTest{
public class AMQStoreCursorDurableTest extends CursorDurableTest{
protected static final Log log = LogFactory.getLog(KahaCursorDurableTest.class);
protected static final Log log = LogFactory.getLog(AMQStoreCursorDurableTest.class);
protected void configureBroker(BrokerService answer) throws Exception{
KahaPersistenceAdapter adaptor = new KahaPersistenceAdapter(new File("target/test-amq-data/durableTest"));
AMQPersistenceAdapter adaptor = new AMQPersistenceAdapter();
answer.setPersistenceAdapter(adaptor);
answer.addConnector(bindAddress);
answer.setDeleteAllMessagesOnStartup(true);
answer.addConnector(bindAddress);
}
}

View File

@ -17,32 +17,33 @@
*/
package org.apache.activemq.broker.region.cursors;
import java.io.File;
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.broker.region.policy.PolicyEntry;
import org.apache.activemq.broker.region.policy.PolicyMap;
import org.apache.activemq.broker.region.policy.StorePendingQueueMessageStoragePolicy;
import org.apache.activemq.store.kahadaptor.KahaPersistenceAdapter;
import org.apache.activemq.store.PersistenceAdapter;
import org.apache.activemq.store.amq.AMQPersistenceAdapter;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* @version $Revision: 1.3 $
*/
public class KahaQueueStoreTest extends CursorQueueStoreTest{
public class AMQStoreQueueStoreTest extends CursorQueueStoreTest{
protected static final Log log = LogFactory.getLog(KahaQueueStoreTest.class);
protected static final Log log = LogFactory.getLog(AMQStoreQueueStoreTest.class);
protected void configureBroker(BrokerService answer) throws Exception{
KahaPersistenceAdapter adaptor = new KahaPersistenceAdapter(new File("target/test-amq-data/durableTest"));
PersistenceAdapter adaptor = new AMQPersistenceAdapter();
answer.setPersistenceAdapter(adaptor);
PolicyEntry policy = new PolicyEntry();
policy.setPendingQueuePolicy(new StorePendingQueueMessageStoragePolicy());
PolicyMap pMap = new PolicyMap();
pMap.setDefaultEntry(policy);
answer.setDestinationPolicy(pMap);
answer.addConnector(bindAddress);
answer.setDeleteAllMessagesOnStartup(true);
answer.addConnector(bindAddress);
}
}

View File

@ -139,10 +139,12 @@ public abstract class CursorSupport extends TestCase{
System.err.println("BAD MATCH AT POS " + i);
System.err.println(sent);
System.err.println(consumed);
/*
System.err.println("\n\n\n\n\n");
for (int j = 0; j < consumerList.size(); j++) {
System.err.println(consumerList.get(j));
}
*/
}
assertEquals("This should be the same at pos " + i + " in the list",sent.getJMSMessageID(),consumed.getJMSMessageID());
}