activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r740344 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/VerifySteadyEnqueueRate.java
Date Tue, 03 Feb 2009 16:36:49 GMT
Author: chirino
Date: Tue Feb  3 16:36:48 2009
New Revision: 740344

URL: http://svn.apache.org/viewvc?rev=740344&view=rev
Log:
Added a option to be able to test againt the new kahadb store

Modified:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/VerifySteadyEnqueueRate.java

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/VerifySteadyEnqueueRate.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/VerifySteadyEnqueueRate.java?rev=740344&r1=740343&r2=740344&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/VerifySteadyEnqueueRate.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/VerifySteadyEnqueueRate.java
Tue Feb  3 16:36:48 2009
@@ -16,6 +16,7 @@
  */
 package org.apache.activemq.bugs;
 
+import java.io.File;
 import java.text.DateFormat;
 import java.util.Date;
 import java.util.concurrent.CountDownLatch;
@@ -33,6 +34,7 @@
 import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.store.amq.AMQPersistenceAdapter;
 import org.apache.activemq.store.amq.AMQPersistenceAdapterFactory;
+import org.apache.activemq.store.kahadb.KahaDBStore;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -50,7 +52,7 @@
     private Connection producerConnection;
     final boolean useTopic = false;
     
-    AMQPersistenceAdapter persistentAdapter;
+    private boolean useAMQPStore=true;
     protected static final String payload = new String(new byte[24]);
 
     public void setUp() throws Exception {
@@ -118,22 +120,29 @@
         broker.setDeleteAllMessagesOnStartup(true);
         broker.setPersistent(true);
         broker.setUseJmx(true);
-        broker.addConnector("tcp://localhost:0").setName("Default");
-           
-        AMQPersistenceAdapterFactory factory = (AMQPersistenceAdapterFactory) broker.getPersistenceFactory();
-        // ensure there are a bunch of data files but multiple entries in each
-        //factory.setMaxFileLength(1024 * 20);
-        // speed up the test case, checkpoint an cleanup early and often
-        //factory.setCheckpointInterval(500);
-        factory.setCleanupInterval(1000*60*30);
-        factory.setSyncOnWrite(false);
         
-        //int indexBinSize=262144; // good for 6M
-        int indexBinSize=1024;
-        factory.setIndexMaxBinSize(indexBinSize * 2);
-        factory.setIndexBinSize(indexBinSize);
-        factory.setIndexPageSize(192*20);
-        persistentAdapter = (AMQPersistenceAdapter) broker.getPersistenceAdapter();
+        if( useAMQPStore ) {
+            AMQPersistenceAdapterFactory factory = (AMQPersistenceAdapterFactory) broker.getPersistenceFactory();
+            // ensure there are a bunch of data files but multiple entries in each
+            //factory.setMaxFileLength(1024 * 20);
+            // speed up the test case, checkpoint an cleanup early and often
+            //factory.setCheckpointInterval(500);
+            factory.setCleanupInterval(1000*60*30);
+            factory.setSyncOnWrite(false);
+            
+            //int indexBinSize=262144; // good for 6M
+            int indexBinSize=1024;
+            factory.setIndexMaxBinSize(indexBinSize * 2);
+            factory.setIndexBinSize(indexBinSize);
+            factory.setIndexPageSize(192*20);
+        } else {
+            KahaDBStore kaha = new KahaDBStore();
+            kaha.setDirectory(new File("target/activemq-data/kahadb"));
+            kaha.deleteAllMessages();
+            broker.setPersistenceAdapter(kaha);
+        }
+
+        broker.addConnector("tcp://localhost:0").setName("Default");
         broker.start();
         LOG.info("Starting broker..");
     }



Mime
View raw message