activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1457943 - /activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/leveldb/LevelDBXARecoveryBrokerTest.java
Date Mon, 18 Mar 2013 19:53:39 GMT
Author: tabish
Date: Mon Mar 18 19:53:39 2013
New Revision: 1457943

URL: http://svn.apache.org/r1457943
Log:
fix for: https://issues.apache.org/jira/browse/AMQ-4385

Modified:
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/leveldb/LevelDBXARecoveryBrokerTest.java

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/leveldb/LevelDBXARecoveryBrokerTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/leveldb/LevelDBXARecoveryBrokerTest.java?rev=1457943&r1=1457942&r2=1457943&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/leveldb/LevelDBXARecoveryBrokerTest.java
(original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/leveldb/LevelDBXARecoveryBrokerTest.java
Mon Mar 18 19:53:39 2013
@@ -17,16 +17,37 @@
 package org.apache.activemq.leveldb;
 
 import java.io.File;
+import java.io.IOException;
 
 import junit.framework.Test;
 
 import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.broker.XARecoveryBrokerTest;
+import org.apache.commons.io.FileUtils;
 
 /**
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
 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() {
         return suite(LevelDBXARecoveryBrokerTest.class);
@@ -40,7 +61,7 @@ public class LevelDBXARecoveryBrokerTest
     protected void configureBroker(BrokerService broker) throws Exception {
         super.configureBroker(broker);
         LevelDBStore store = new LevelDBStore();
-        store.setDirectory(new File("target/activemq-data/xahaleveldb"));
+        store.setDirectory(new File(levelDbDirectoryName));
         broker.setPersistenceAdapter(store);
     }
 



Mime
View raw message