From 6f9cfad67b7056879facf98f0f842281ccb7caa2 Mon Sep 17 00:00:00 2001 From: "Hiram R. Chirino" Date: Sat, 1 Jul 2006 04:22:58 +0000 Subject: [PATCH] Changed tests so that the data files are under the target directory git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@418437 13f79535-47bb-0310-9956-ffa450edef68 --- .../activemq/broker/store/KahaRecoveryBrokerTest.java | 3 +-- .../activemq/broker/store/KahaXARecoveryBrokerTest.java | 2 +- .../java/org/apache/activemq/kaha/ListContainerTest.java | 3 ++- .../src/test/java/org/apache/activemq/kaha/LoadTest.java | 1 + .../java/org/apache/activemq/kaha/MapContainerTest.java | 3 ++- .../src/test/java/org/apache/activemq/kaha/StoreTest.java | 8 +++----- .../org/apache/activemq/broker/store/kahabroker.xml | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/activemq-core/src/test/java/org/apache/activemq/broker/store/KahaRecoveryBrokerTest.java b/activemq-core/src/test/java/org/apache/activemq/broker/store/KahaRecoveryBrokerTest.java index 01c8bce8aa..bba244b949 100644 --- a/activemq-core/src/test/java/org/apache/activemq/broker/store/KahaRecoveryBrokerTest.java +++ b/activemq-core/src/test/java/org/apache/activemq/broker/store/KahaRecoveryBrokerTest.java @@ -40,8 +40,7 @@ public class KahaRecoveryBrokerTest extends RecoveryBrokerTest { protected BrokerService createRestartedBroker() throws Exception { BrokerService broker = new BrokerService(); - - KahaPersistentAdaptor adaptor = new KahaPersistentAdaptor(new File("activemq-data/storetest")); + KahaPersistentAdaptor adaptor = new KahaPersistentAdaptor(new File( System.getProperty("basedir", ".")+"/target/activemq-data/kaha-store.db")); broker.setPersistenceAdapter(adaptor); broker.addConnector("tcp://localhost:0"); return broker; diff --git a/activemq-core/src/test/java/org/apache/activemq/broker/store/KahaXARecoveryBrokerTest.java b/activemq-core/src/test/java/org/apache/activemq/broker/store/KahaXARecoveryBrokerTest.java index 47a0b7b603..9aad6b4d88 100644 --- a/activemq-core/src/test/java/org/apache/activemq/broker/store/KahaXARecoveryBrokerTest.java +++ b/activemq-core/src/test/java/org/apache/activemq/broker/store/KahaXARecoveryBrokerTest.java @@ -49,7 +49,7 @@ public class KahaXARecoveryBrokerTest extends XARecoveryBrokerTest { protected BrokerService createRestartedBroker() throws Exception { BrokerService broker = new BrokerService(); - KahaPersistentAdaptor adaptor = new KahaPersistentAdaptor(new File("activemq-data/storetest")); + KahaPersistentAdaptor adaptor = new KahaPersistentAdaptor(new File( System.getProperty("basedir", ".")+"/target/activemq-data/kaha-store.db")); broker.setPersistenceAdapter(adaptor); broker.addConnector("tcp://localhost:0"); return broker; diff --git a/activemq-core/src/test/java/org/apache/activemq/kaha/ListContainerTest.java b/activemq-core/src/test/java/org/apache/activemq/kaha/ListContainerTest.java index 9425776eff..b833e205b9 100644 --- a/activemq-core/src/test/java/org/apache/activemq/kaha/ListContainerTest.java +++ b/activemq-core/src/test/java/org/apache/activemq/kaha/ListContainerTest.java @@ -10,7 +10,7 @@ import junit.framework.TestCase; public class ListContainerTest extends TestCase{ - protected String name = "test"; + protected String name; protected Store store; protected ListContainer container; protected LinkedList testList; @@ -291,6 +291,7 @@ public class ListContainerTest extends TestCase{ protected void setUp() throws Exception{ super.setUp(); + name = System.getProperty("basedir", ".")+"/target/activemq-data/list-container.db"; StoreFactory.delete(name); store = getStore(); store.deleteListContainer(name); diff --git a/activemq-core/src/test/java/org/apache/activemq/kaha/LoadTest.java b/activemq-core/src/test/java/org/apache/activemq/kaha/LoadTest.java index a0307d1bfd..cc5d92dc84 100644 --- a/activemq-core/src/test/java/org/apache/activemq/kaha/LoadTest.java +++ b/activemq-core/src/test/java/org/apache/activemq/kaha/LoadTest.java @@ -48,6 +48,7 @@ public class LoadTest extends TestCase{ protected void setUp() throws Exception{ super.setUp(); + name = System.getProperty("basedir", ".")+"/target/activemq-data/load.db"; StoreFactory.delete(name); store=getStore(); } diff --git a/activemq-core/src/test/java/org/apache/activemq/kaha/MapContainerTest.java b/activemq-core/src/test/java/org/apache/activemq/kaha/MapContainerTest.java index ea793d12fc..b19902af30 100644 --- a/activemq-core/src/test/java/org/apache/activemq/kaha/MapContainerTest.java +++ b/activemq-core/src/test/java/org/apache/activemq/kaha/MapContainerTest.java @@ -15,7 +15,7 @@ import junit.framework.TestCase; public class MapContainerTest extends TestCase{ - protected String name = "test"; + protected String name; protected Store store; protected MapContainer container; protected Map testMap; @@ -158,6 +158,7 @@ public class MapContainerTest extends TestCase{ protected void setUp() throws Exception{ super.setUp(); + name = System.getProperty("basedir", ".")+"/target/activemq-data/map-container.db"; store = getStore(); store.deleteListContainer(name); container = store.getMapContainer(name); diff --git a/activemq-core/src/test/java/org/apache/activemq/kaha/StoreTest.java b/activemq-core/src/test/java/org/apache/activemq/kaha/StoreTest.java index c06c710d02..b4e3580571 100644 --- a/activemq-core/src/test/java/org/apache/activemq/kaha/StoreTest.java +++ b/activemq-core/src/test/java/org/apache/activemq/kaha/StoreTest.java @@ -25,10 +25,7 @@ import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; -import org.apache.activemq.kaha.ListContainer; -import org.apache.activemq.kaha.MapContainer; -import org.apache.activemq.kaha.Store; -import org.apache.activemq.kaha.StoreFactory; + import junit.framework.TestCase; /** @@ -38,7 +35,7 @@ import junit.framework.TestCase; */ public class StoreTest extends TestCase{ - protected String name = "sdbStoreTest.db"; + protected String name; protected Store store; @@ -197,6 +194,7 @@ public class StoreTest extends TestCase{ protected void setUp() throws Exception{ super.setUp(); + name = System.getProperty("basedir", ".")+"/target/activemq-data/store-test.db"; store = getStore(); } diff --git a/activemq-core/src/test/resources/org/apache/activemq/broker/store/kahabroker.xml b/activemq-core/src/test/resources/org/apache/activemq/broker/store/kahabroker.xml index 47a1516c30..49d40e8a06 100755 --- a/activemq-core/src/test/resources/org/apache/activemq/broker/store/kahabroker.xml +++ b/activemq-core/src/test/resources/org/apache/activemq/broker/store/kahabroker.xml @@ -23,7 +23,7 @@ - +