speed up tests - by deleting database directly

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@902907 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2010-01-25 18:17:17 +00:00
parent d0b5f954aa
commit 0f27c464b4
1 changed files with 4 additions and 1 deletions

View File

@ -22,6 +22,7 @@ import junit.framework.Test;
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.broker.BrokerTest;
import org.apache.activemq.util.IOHelper;
/**
* Once the wire format is completed we can test against real persistence storage.
@ -33,7 +34,9 @@ public class KahaDBStoreBrokerTest extends BrokerTest {
protected BrokerService createBroker() throws Exception {
BrokerService broker = new BrokerService();
KahaDBStore kaha = new KahaDBStore();
kaha.setDirectory(new File("target/activemq-data/kahadb"));
File directory = new File("target/activemq-data/kahadb");
IOHelper.deleteChildren(directory);
kaha.setDirectory(directory);
kaha.deleteAllMessages();
broker.setPersistenceAdapter(kaha);
return broker;