mirror of https://github.com/apache/activemq.git
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1457943 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
95f17c2040
commit
4cbfbbb10c
|
@ -17,16 +17,37 @@
|
||||||
package org.apache.activemq.leveldb;
|
package org.apache.activemq.leveldb;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
|
|
||||||
import org.apache.activemq.broker.BrokerService;
|
import org.apache.activemq.broker.BrokerService;
|
||||||
import org.apache.activemq.broker.XARecoveryBrokerTest;
|
import org.apache.activemq.broker.XARecoveryBrokerTest;
|
||||||
|
import org.apache.commons.io.FileUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author <a href="http://hiramchirino.com">Hiram Chirino</a>
|
* @author <a href="http://hiramchirino.com">Hiram Chirino</a>
|
||||||
*/
|
*/
|
||||||
public class LevelDBXARecoveryBrokerTest extends XARecoveryBrokerTest {
|
public class LevelDBXARecoveryBrokerTest extends XARecoveryBrokerTest {
|
||||||
|
public static final String LEVELDB_DIR_BASE = "target/activemq-data/xahaleveldb";
|
||||||
|
public static String levelDbDirectoryName;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void setUp() throws Exception {
|
||||||
|
levelDbDirectoryName = LEVELDB_DIR_BASE + "/" + System.currentTimeMillis();
|
||||||
|
super.setUp();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void tearDown() throws Exception {
|
||||||
|
super.tearDown();
|
||||||
|
try {
|
||||||
|
File levelDbDir = new File(levelDbDirectoryName);
|
||||||
|
FileUtils.deleteDirectory(levelDbDir);
|
||||||
|
} catch (IOException e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static Test suite() {
|
public static Test suite() {
|
||||||
return suite(LevelDBXARecoveryBrokerTest.class);
|
return suite(LevelDBXARecoveryBrokerTest.class);
|
||||||
|
@ -40,7 +61,7 @@ public class LevelDBXARecoveryBrokerTest extends XARecoveryBrokerTest {
|
||||||
protected void configureBroker(BrokerService broker) throws Exception {
|
protected void configureBroker(BrokerService broker) throws Exception {
|
||||||
super.configureBroker(broker);
|
super.configureBroker(broker);
|
||||||
LevelDBStore store = new LevelDBStore();
|
LevelDBStore store = new LevelDBStore();
|
||||||
store.setDirectory(new File("target/activemq-data/xahaleveldb"));
|
store.setDirectory(new File(levelDbDirectoryName));
|
||||||
broker.setPersistenceAdapter(store);
|
broker.setPersistenceAdapter(store);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue