activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r692333 - in /activemq/sandbox/kahadb/src/test/java/org/apache/kahadb/store: KahaLoadTester.java KahaStoreBrokerTest.java KahaStoreXARecoveryBrokerTest.java
Date Fri, 05 Sep 2008 04:12:58 GMT
Author: chirino
Date: Thu Sep  4 21:12:55 2008
New Revision: 692333

URL: http://svn.apache.org/viewvc?rev=692333&view=rev
Log:
Setting up these test to test against the new KahaDB

Modified:
    activemq/sandbox/kahadb/src/test/java/org/apache/kahadb/store/KahaLoadTester.java
    activemq/sandbox/kahadb/src/test/java/org/apache/kahadb/store/KahaStoreBrokerTest.java
    activemq/sandbox/kahadb/src/test/java/org/apache/kahadb/store/KahaStoreXARecoveryBrokerTest.java

Modified: activemq/sandbox/kahadb/src/test/java/org/apache/kahadb/store/KahaLoadTester.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/kahadb/src/test/java/org/apache/kahadb/store/KahaLoadTester.java?rev=692333&r1=692332&r2=692333&view=diff
==============================================================================
--- activemq/sandbox/kahadb/src/test/java/org/apache/kahadb/store/KahaLoadTester.java (original)
+++ activemq/sandbox/kahadb/src/test/java/org/apache/kahadb/store/KahaLoadTester.java Thu
Sep  4 21:12:55 2008
@@ -16,6 +16,7 @@
  */
 package org.apache.kahadb.store;
 
+import java.io.File;
 import java.io.IOException;
 import java.net.URI;
 import java.net.URISyntaxException;
@@ -52,7 +53,13 @@
     protected int produceCount = 10000;
 
     protected BrokerService createBroker() throws Exception {
-        return BrokerFactory.createBroker(new URI("xbean:org/apache/activemq/broker/store/loadtester.xml"));
+        BrokerService broker = new BrokerService();
+        KahaDBPersistenceAdaptor kaha = new KahaDBPersistenceAdaptor();
+        kaha.setDirectory(new File("target/activemq-data/kahadb"));
+        kaha.deleteAllMessages();
+        broker.setPersistenceAdapter(kaha);
+        broker.addConnector("tcp://localhost:0");
+        return broker;
     }
 
     protected ConnectionFactory createConnectionFactory() throws URISyntaxException, IOException
{

Modified: activemq/sandbox/kahadb/src/test/java/org/apache/kahadb/store/KahaStoreBrokerTest.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/kahadb/src/test/java/org/apache/kahadb/store/KahaStoreBrokerTest.java?rev=692333&r1=692332&r2=692333&view=diff
==============================================================================
--- activemq/sandbox/kahadb/src/test/java/org/apache/kahadb/store/KahaStoreBrokerTest.java
(original)
+++ activemq/sandbox/kahadb/src/test/java/org/apache/kahadb/store/KahaStoreBrokerTest.java
Thu Sep  4 21:12:55 2008
@@ -16,6 +16,7 @@
  */
 package org.apache.kahadb.store;
 
+import java.io.File;
 import java.net.URI;
 
 import junit.framework.Test;
@@ -32,13 +33,23 @@
 public class KahaStoreBrokerTest extends BrokerTest {
 
     protected BrokerService createBroker() throws Exception {
-        return BrokerFactory.createBroker(new URI("broker://()/localhost?deleteAllMessagesOnStartup=true"));
+        BrokerService broker = new BrokerService();
+        KahaDBPersistenceAdaptor kaha = new KahaDBPersistenceAdaptor();
+        kaha.setDirectory(new File("target/activemq-data/kahadb"));
+        kaha.deleteAllMessages();
+        broker.setPersistenceAdapter(kaha);
+        return broker;
     }
     
     protected BrokerService createRestartedBroker() throws Exception {
-        return BrokerFactory.createBroker(new URI("broker://()/localhost"));
+        BrokerService broker = new BrokerService();
+        KahaDBPersistenceAdaptor kaha = new KahaDBPersistenceAdaptor();
+        kaha.setDirectory(new File("target/activemq-data/kahadb"));
+        broker.setPersistenceAdapter(kaha);
+        return broker;
     }
     
+    
     public static Test suite() {
         return suite(KahaStoreBrokerTest.class);
     }

Modified: activemq/sandbox/kahadb/src/test/java/org/apache/kahadb/store/KahaStoreXARecoveryBrokerTest.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/kahadb/src/test/java/org/apache/kahadb/store/KahaStoreXARecoveryBrokerTest.java?rev=692333&r1=692332&r2=692333&view=diff
==============================================================================
--- activemq/sandbox/kahadb/src/test/java/org/apache/kahadb/store/KahaStoreXARecoveryBrokerTest.java
(original)
+++ activemq/sandbox/kahadb/src/test/java/org/apache/kahadb/store/KahaStoreXARecoveryBrokerTest.java
Thu Sep  4 21:12:55 2008
@@ -16,6 +16,7 @@
  */
 package org.apache.kahadb.store;
 
+import java.io.File;
 import java.net.URI;
 
 import junit.framework.Test;
@@ -40,11 +41,20 @@
     }
 
     protected BrokerService createBroker() throws Exception {
-        return BrokerFactory.createBroker(new URI("broker://()/localhost?deleteAllMessagesOnStartup=true"));
+        BrokerService broker = new BrokerService();
+        KahaDBPersistenceAdaptor kaha = new KahaDBPersistenceAdaptor();
+        kaha.setDirectory(new File("target/activemq-data/kahadb"));
+        kaha.deleteAllMessages();
+        broker.setPersistenceAdapter(kaha);
+        return broker;
     }
     
     protected BrokerService createRestartedBroker() throws Exception {
-        return BrokerFactory.createBroker(new URI("broker://()/localhost"));
+        BrokerService broker = new BrokerService();
+        KahaDBPersistenceAdaptor kaha = new KahaDBPersistenceAdaptor();
+        kaha.setDirectory(new File("target/activemq-data/kahadb"));
+        broker.setPersistenceAdapter(kaha);
+        return broker;
     }
     
 }



Mime
View raw message