[rhmessaging-commits] rhmessaging commits: r2170 - in store/trunk/cpp: tests and 1 other directories.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Mon Jun 30 09:04:03 EDT 2008


Author: kpvdr
Date: 2008-06-30 09:04:03 -0400 (Mon, 30 Jun 2008)
New Revision: 2170

Modified:
   store/trunk/cpp/lib/BdbMessageStore.cpp
   store/trunk/cpp/lib/BdbMessageStore.h
   store/trunk/cpp/tests/OrderingTest.cpp
   store/trunk/cpp/tests/SimpleTest.cpp
   store/trunk/cpp/tests/TransactionalTest.cpp
   store/trunk/cpp/tests/TwoPhaseCommitTest.cpp
   store/trunk/cpp/tests/python_tests/flow_to_disk.py
Log:
BDB cleanup - phase 1. Removed all sync tests, refactored tests (slightly) to improve layout without need for sync/async; removed async and force params from BdbMessageStore::init(...). Next phase will clean up the BdbMessageStore class itself.

Modified: store/trunk/cpp/lib/BdbMessageStore.cpp
===================================================================
--- store/trunk/cpp/lib/BdbMessageStore.cpp	2008-06-26 21:39:59 UTC (rev 2169)
+++ store/trunk/cpp/lib/BdbMessageStore.cpp	2008-06-30 13:04:03 UTC (rev 2170)
@@ -97,7 +97,7 @@
     }
 }
 
-bool BdbMessageStore::init(const std::string& dir, const bool async, const bool force, u_int16_t jfiles, u_int32_t jfileSizePgs, uint32_t wCachePageSize) 
+bool BdbMessageStore::init(const std::string& dir, u_int16_t jfiles, u_int32_t jfileSizePgs, uint32_t wCachePageSize) 
 { 
     if (isInit) return true;
 
@@ -125,7 +125,8 @@
         wcache_num_pages = defTotWCacheSize / wcache_pgsize_sblks;
     }
     
-    useAsync = async;
+    // TODO: remove
+    useAsync = true;
     if (dir.size()>0) storeDir = dir;
 
     string bdbdir = storeDir + "/rhm/dat/";
@@ -165,11 +166,14 @@
         txn.abort();
         throw;
     }
+    
+    // TODO: remove
+    bool force = false;
     ret = mode(useAsync, force);
     if (!ret) return false;
 
     isInit = true;
-    QPID_LOG(info, "BdbMessageStore module initialized: dir=" << dir << "; async=" << (async?"T":"F") << "; force=" << (force?"T":"F") << "; jfiles=" << jfiles << "; jfileSizePgs=" << jfileSizePgs << "; wCachePageSize=" << wCachePageSize);
+    QPID_LOG(info, "BdbMessageStore module initialized: dir=" << dir << "; jfiles=" << jfiles << "; jfileSizePgs=" << jfileSizePgs << "; wCachePageSize=" << wCachePageSize);
     return true;
 }
 
@@ -242,7 +246,7 @@
         }
     }
 
-    return init(opts->storeDir, opts->storeAsync, opts->storeForce, numJrnlFiles, jrnlFsizePgs, jrnlWrCachePageSize);
+    return init(opts->storeDir, numJrnlFiles, jrnlFsizePgs, jrnlWrCachePageSize);
 }
 
 // true is async
@@ -1600,8 +1604,6 @@
 
 BdbMessageStore::Options::Options(const std::string& name) :
     qpid::Options(name),
-    storeAsync(true),
-    storeForce(false),
     numJrnlFiles(8),
     jrnlFsizePgs(24),
     wCachePageSize(JRNL_WMGR_DEF_PAGE_SIZE * JRNL_DBLK_SIZE * JRNL_SBLK_SIZE / 1024)

Modified: store/trunk/cpp/lib/BdbMessageStore.h
===================================================================
--- store/trunk/cpp/lib/BdbMessageStore.h	2008-06-26 21:39:59 UTC (rev 2169)
+++ store/trunk/cpp/lib/BdbMessageStore.h	2008-06-30 13:04:03 UTC (rev 2170)
@@ -68,8 +68,6 @@
     typedef boost::ptr_list<PreparedTransaction> txn_list;
 
     // Default store settings
-    static const bool defUseAsync = false;
-    static const bool defForceStoreConversion = false;
     static const u_int16_t defNumJrnlFiles = 8;      // TODO: make configurable
     static const u_int32_t defJrnlFileSizePgs = 24;  // TODO: make configurable
     static const u_int32_t defWCachePageSize = JRNL_WMGR_DEF_PAGE_SIZE * JRNL_DBLK_SIZE * JRNL_SBLK_SIZE / 1024; // TODO: make configurable
@@ -157,7 +155,7 @@
     static inline bool usingJrnl() {return useAsync;} 
     string getJrnlBaseDir(); 
     inline void checkInit() {
-        if (!isInit) init("/var", defUseAsync, defForceStoreConversion, defNumJrnlFiles, defJrnlFileSizePgs, defWCachePageSize); isInit = true;
+        if (!isInit) init("/var", defNumJrnlFiles, defJrnlFileSizePgs, defWCachePageSize); isInit = true;
     }
 
   public:
@@ -177,7 +175,7 @@
     BdbMessageStore(const char* envpath = 0);
     virtual ~BdbMessageStore();
     bool init(const qpid::Options* options);
-    bool init(const std::string& dir, const bool async, const bool force, u_int16_t jfiles, u_int32_t jfileSizePgs, uint32_t wCachePageSize);
+    bool init(const std::string& dir, u_int16_t jfiles, u_int32_t jfileSizePgs, uint32_t wCachePageSize);
     void initManagement (qpid::broker::Broker* broker);
 
     void truncate();

Modified: store/trunk/cpp/tests/OrderingTest.cpp
===================================================================
--- store/trunk/cpp/tests/OrderingTest.cpp	2008-06-26 21:39:59 UTC (rev 2169)
+++ store/trunk/cpp/tests/OrderingTest.cpp	2008-06-30 13:04:03 UTC (rev 2170)
@@ -53,10 +53,10 @@
 std::queue<Uuid> ids;
 int counter = 1;
 
-void setup(bool async)
+void setup()
 {
     store = std::auto_ptr<BdbMessageStore>(new BdbMessageStore());
-    store->init(test_dir, async, true, 4, 1, 8);
+    store->init(test_dir, 4, 1, 8);
 	store->truncate();
 
     queue = Queue::shared_ptr(new Queue(name, 0, store.get(), 0));
@@ -88,13 +88,13 @@
     }
 }
 
-void restart(bool async)
+void restart()
 {
     queue.reset();
     store.reset();
 
     store = std::auto_ptr<BdbMessageStore>(new BdbMessageStore());
-    store->init(test_dir, async, false, 4, 1, 8);
+    store->init(test_dir, 4, 1, 8);
     ExchangeRegistry exchanges;
     LinkRegistry links(0);
     DtxManager mgr;
@@ -114,57 +114,33 @@
     BOOST_CHECK_EQUAL((size_t) 0, ids.size());
 }
 
-void testBasic(bool async = false)
+
+// === Test suite ===
+
+QPID_AUTO_TEST_CASE(Basic)
 {
-    setup(async);
+    std::cout << test_filename << ".Basic: " << std::flush;
+    setup();
     //push on 10 messages
     for (int i = 0; i < 10; i++) push();
-    restart(async);
+    restart();
     check();
+    std::cout << "ok" << std::endl;
 }
 
-void testCycle(bool async = false)
+QPID_AUTO_TEST_CASE(Cycle)
 {
-    setup(async);
+    std::cout << test_filename << ".Cycle: " << std::flush;
+    setup();
     //push on 10 messages:
     for (int i = 0; i < 10; i++) push();
     //pop 5:
     for (int i = 0; i < 5; i++) pop();
     //push on another 5:
     for (int i = 0; i < 5; i++) push();
-    restart(async);
+    restart();
     check();
-}
-
-
-// === Test suite ===
-
-QPID_AUTO_TEST_CASE(BasicSync)
-{
-    std::cout << test_filename << ".BasicSync: " << std::flush;
-    testBasic(false);
     std::cout << "ok" << std::endl;
 }
 
-QPID_AUTO_TEST_CASE(BasicAsync)
-{
-    std::cout << test_filename << ".BasicAsync: " << std::flush;
-    testBasic(true);
-    std::cout << "ok" << std::endl;
-}
-
-QPID_AUTO_TEST_CASE(CycleSync)
-{
-    std::cout << test_filename << ".CycleSync: " << std::flush;
-    testCycle(false);
-    std::cout << "ok" << std::endl;
-}
-
-QPID_AUTO_TEST_CASE(CycleAsync)
-{
-    std::cout << test_filename << ".CycleAsync: " << std::flush;
-    testCycle(true);
-    std::cout << "ok" << std::endl;
-}
-
 QPID_AUTO_TEST_SUITE_END()

Modified: store/trunk/cpp/tests/SimpleTest.cpp
===================================================================
--- store/trunk/cpp/tests/SimpleTest.cpp	2008-06-26 21:39:59 UTC (rev 2169)
+++ store/trunk/cpp/tests/SimpleTest.cpp	2008-06-30 13:04:03 UTC (rev 2170)
@@ -82,10 +82,60 @@
     recover(store, queues, exchanges, links);
 }
 
-void testCreateDelete(bool async)
+void bindAndUnbind(const string& exchangeName, const string& queueName, 
+                   const string& key, const FieldTable& args)
 {
+    {
+        BdbMessageStore store;
+        store.init(test_dir, 4, 1, 8);
+        store.truncate();//make sure it is empty to begin with
+        Exchange::shared_ptr exchange(new DirectExchange(exchangeName, true, args));
+        Queue::shared_ptr queue(new Queue(queueName, 0, &store, 0));
+        store.create(*exchange, qpid::framing::FieldTable());
+        store.create(*queue, qpid::framing::FieldTable());
+        BOOST_REQUIRE(exchange->bind(queue, key, &args));
+        store.bind(*exchange, *queue, key, args);
+    }//db will be closed
+    {
+        BdbMessageStore store;
+        store.init(test_dir, 4, 1, 8);
+        ExchangeRegistry exchanges;
+        QueueRegistry queues;
+        LinkRegistry links(0);
+
+        recover(store, queues, exchanges, links);
+
+        Exchange::shared_ptr exchange = exchanges.get(exchangeName);
+        Queue::shared_ptr queue = queues.find(queueName);
+        //check it is bound by unbinding
+        BOOST_REQUIRE(exchange->unbind(queue, key, &args));
+        store.unbind(*exchange, *queue, key, args);
+    }
+    {
+        BdbMessageStore store;
+        store.init(test_dir, 4, 1, 8);
+        ExchangeRegistry exchanges;
+        QueueRegistry queues;
+        LinkRegistry links(0);
+
+        recover(store, queues, exchanges, links);
+
+        Exchange::shared_ptr exchange = exchanges.get(exchangeName);
+        Queue::shared_ptr queue = queues.find(queueName);
+        //make sure it is no longer bound
+        BOOST_REQUIRE(!exchange->unbind(queue, key, &args));
+    }
+}
+
+
+// === Test suite ===
+
+QPID_AUTO_TEST_CASE(CreateDelete)
+{
+    cout << test_filename << ".CreateDelete: " << flush;
+
     BdbMessageStore store;
-    store.init(test_dir, async, true, 4, 1, 8);
+    store.init(test_dir, 4, 1, 8);
     store.truncate();//make sure it is empty to begin with
     string name("CreateDeleteQueue");
     Queue queue(name, 0, &store, 0);
@@ -95,26 +145,33 @@
     store.destroy(queue);
 // TODO - check dir is deleted
 
+    cout << "ok" << endl;
 }
 
-void testEmptyRecover(bool async)
+QPID_AUTO_TEST_CASE(EmptyRecover)
 {
+    cout << test_filename << ".EmptyRecover: " << flush;
+
     BdbMessageStore store;
-    store.init(test_dir, async, true, 4, 1, 8);
+    store.init(test_dir, 4, 1, 8);
     store.truncate();//make sure it is empty to begin with
     QueueRegistry registry;
     registry.setStore (&store);
     recover(store, registry);
     //nothing to assert, just testing it doesn't blow up
+
+    cout << "ok" << endl;
 }
 
-void testQueueCreate(bool async)
+QPID_AUTO_TEST_CASE(QueueCreate)
 {
+    cout << test_filename << ".QueueCreate: " << flush;
+
     uint64_t id(0);
     string name("MyDurableQueue");
     {
         BdbMessageStore store;
-        store.init(test_dir, async, true, 4, 1, 8);
+        store.init(test_dir, 4, 1, 8);
         store.truncate();//make sure it is empty to begin with
         Queue queue(name, 0, &store, 0);
         store.create(queue, qpid::framing::FieldTable());
@@ -123,7 +180,7 @@
     }//db will be closed
     {
         BdbMessageStore store;
-        store.init(test_dir, async, false, 4, 1, 8);
+        store.init(test_dir, 4, 1, 8);
         QueueRegistry registry;
         registry.setStore (&store);
         recover(store, registry);
@@ -131,15 +188,19 @@
         BOOST_REQUIRE(queue.get());
         BOOST_CHECK_EQUAL(id, queue->getPersistenceId());
     }
+
+    cout << "ok" << endl;
 }
 
-void testQueueCreateWithSettings(bool async)
+QPID_AUTO_TEST_CASE(QueueCreateWithSettings)
 {
+    cout << test_filename << ".QueueCreateWithSettings: " << flush;
+
     QueuePolicy policy(101, 202);
     string name("MyDurableQueue");
     {
         BdbMessageStore store;
-        store.init(test_dir, async, true, 4, 1, 8);
+        store.init(test_dir, 4, 1, 8);
         store.truncate();//make sure it is empty to begin with
         Queue queue(name, 0, &store, 0);
         FieldTable settings;
@@ -149,7 +210,7 @@
     }//db will be closed
     {
         BdbMessageStore store;
-        store.init(test_dir, async, false, 4, 1, 8);
+        store.init(test_dir, 4, 1, 8);
         QueueRegistry registry;
         registry.setStore (&store);
         recover(store, registry);
@@ -159,14 +220,18 @@
         BOOST_CHECK_EQUAL(policy.getMaxCount(), queue->getPolicy()->getMaxCount());
         BOOST_CHECK_EQUAL(policy.getMaxSize(), queue->getPolicy()->getMaxSize());
     }
+
+    cout << "ok" << endl;
 }
 
-void testQueueDestroy(bool async)
+QPID_AUTO_TEST_CASE(QueueDestroy)
 {
+    cout << test_filename << ".QueueDestroy: " << flush;
+
     string name("MyDurableQueue");
     {
         BdbMessageStore store;
-        store.init(test_dir, async, true, 4, 1, 8);
+        store.init(test_dir, 4, 1, 8);
         store.truncate();//make sure it is empty to begin with
         Queue queue(name, 0, &store, 0);
         store.create(queue, qpid::framing::FieldTable());
@@ -174,16 +239,20 @@
     }//db will be closed
     {
         BdbMessageStore store;
-        store.init(test_dir, async, false, 4, 1, 8);
+        store.init(test_dir, 4, 1, 8);
         QueueRegistry registry;
         registry.setStore (&store);
         recover(store, registry);
         BOOST_REQUIRE(!registry.find(name));
     }
+
+    cout << "ok" << endl;
 }
 
-void testEnqueue(bool async)
+QPID_AUTO_TEST_CASE(Enqueue)
 {
+    cout << test_filename << ".Enqueue: " << flush;
+
     //TODO: this is largely copy & paste'd from MessageTest in
     //qpid tree. ideally need some helper routines for reducing
     //this to a simpler less duplicated form
@@ -196,7 +265,7 @@
     string data2("hijklmn");
     {
         BdbMessageStore store;
-        store.init(test_dir, async, true, 4, 1, 8);
+        store.init(test_dir, 4, 1, 8);
         store.truncate();//make sure it is empty to begin with
         Queue::shared_ptr queue(new Queue(name, 0, &store, 0));
         FieldTable settings;
@@ -215,7 +284,7 @@
     }//db will be closed
     {
         BdbMessageStore store;
-        store.init(test_dir, async, false, 4, 1, 8);
+        store.init(test_dir, 4, 1, 8);
         QueueRegistry registry;
         registry.setStore (&store);
         recover(store, registry);
@@ -240,10 +309,14 @@
         BOOST_CHECK_EQUAL(data1.size() + data2.size(), contentBody->getData().size());
         BOOST_CHECK_EQUAL(data1 + data2, contentBody->getData());
     }
+
+    cout << "ok" << endl;
 }
 
-void testDequeue(bool async)
+QPID_AUTO_TEST_CASE(Dequeue)
 {
+    cout << test_filename << ".Dequeue: " << flush;
+
     //TODO: reduce the duplication in these tests
     string name("MyDurableQueue");
     {
@@ -252,7 +325,7 @@
         Uuid messageId(true);
         string data("abcdefg");
         BdbMessageStore store;
-        store.init(test_dir, async, true, 4, 1, 8);
+        store.init(test_dir, 4, 1, 8);
         store.truncate();//make sure it is empty to begin with
         Queue::shared_ptr queue(new Queue(name, 0, &store, 0));
         FieldTable settings;
@@ -267,7 +340,7 @@
     }//db will be closed
     {
         BdbMessageStore store;
-        store.init(test_dir, async, false, 4, 1, 8);
+        store.init(test_dir, 4, 1, 8);
         QueueRegistry registry;
         registry.setStore (&store);
         recover(store, registry);
@@ -275,10 +348,14 @@
         BOOST_REQUIRE(queue);
         BOOST_CHECK_EQUAL((u_int32_t) 0, queue->getMessageCount());
     }
+
+    cout << "ok" << endl;
 }
 
-void testStaging(bool async)
+QPID_AUTO_TEST_CASE(Staging)
 {
+    cout << test_filename << ".Staging: " << flush;
+
     const string name("MyDurableQueue");
     const string exchange("MyExchange");
     const string routingKey("MyRoutingKey");
@@ -287,7 +364,7 @@
     const string data2("ABCDEFGHIJKLMNOPQRSTUVWXYZ");
     {
         BdbMessageStore store;
-        store.init(test_dir, async, true, 4, 1, 8);
+        store.init(test_dir, 4, 1, 8);
         store.truncate();//make sure it is empty to begin with
 
         //create & stage a message
@@ -329,7 +406,7 @@
     {
         //recover
         BdbMessageStore store;
-        store.init(test_dir, async, false, 4, 1, 8);
+        store.init(test_dir, 4, 1, 8);
         QueueRegistry registry;
         registry.setStore (&store);
         ExchangeRegistry exchanges;
@@ -372,12 +449,16 @@
         //dequeue
         queue->dequeue(0, msg);
     }
+
+    cout << "ok" << endl;
 }
 
-void testDestroyStagedMessage(bool async)
+QPID_AUTO_TEST_CASE(DestroyStagedMessage)
 {
+    cout << test_filename << ".DestroyStagedMessage: " << flush;
+
     BdbMessageStore store;
-    store.init(test_dir, async, true, 4, 1, 8);
+    store.init(test_dir, 4, 1, 8);
     store.truncate();//make sure it is empty to begin with
     
     const string data("abcdefg");
@@ -396,12 +477,16 @@
         BOOST_FAIL("store.loadContent() did not throw StoreException as expected.");
     } catch (StoreException& e) {
     }
+
+    cout << "ok" << endl;
 }
 
-void testDestroyEnqueuedMessage(bool async)
+QPID_AUTO_TEST_CASE(DestroyEnqueuedMessage)
 {
+    cout << test_filename << ".DestroyEnqueuedMessage: " << flush;
+
     BdbMessageStore store;
-    store.init(test_dir, async, true, 4, 1, 8);
+    store.init(test_dir, 4, 1, 8);
     store.truncate();//make sure it is empty to begin with
     
     const string data("abcdefg");
@@ -422,10 +507,14 @@
 
     store.dequeue(0, pmsg, queue);
     store.destroy(queue);
+
+    cout << "ok" << endl;
 }
 
-void testExchangeCreateAndDestroy(bool async)
+QPID_AUTO_TEST_CASE(ExchangeCreateAndDestroy)
 {
+    cout << test_filename << ".ExchangeCreateAndDestroy: " << flush;
+
     uint64_t id(0);
     string name("MyDurableExchange");
     string type("direct");
@@ -433,7 +522,7 @@
     args.setString("a", "A");
     {
         BdbMessageStore store;
-        store.init(test_dir, async, true, 4, 1, 8);
+        store.init(test_dir, 4, 1, 8);
         store.truncate();//make sure it is empty to begin with
         ExchangeRegistry registry;
         Exchange::shared_ptr exchange = registry.declare(name, type, true, args).first;
@@ -443,7 +532,7 @@
     }//db will be closed
     {
         BdbMessageStore store;
-        store.init(test_dir, async, false, 4, 1, 8);
+        store.init(test_dir, 4, 1, 8);
         ExchangeRegistry registry;
 
         recover(store, registry);
@@ -457,7 +546,7 @@
     }
     {
         BdbMessageStore store;
-        store.init(test_dir, async, false, 4, 1, 8);
+        store.init(test_dir, 4, 1, 8);
         ExchangeRegistry registry;
 
         recover(store, registry);
@@ -469,68 +558,35 @@
             BOOST_CHECK_EQUAL((framing::ReplyCode) 404, e.code);
         }
     }
+
+    cout << "ok" << endl;
 }
 
-void bindAndUnbind(const string& exchangeName, const string& queueName, 
-                   const string& key, const FieldTable& args, bool async)
+QPID_AUTO_TEST_CASE(ExchangeBindAndUnbind)
 {
-    {
-        BdbMessageStore store;
-        store.init(test_dir, async, true, 4, 1, 8);
-        store.truncate();//make sure it is empty to begin with
-        Exchange::shared_ptr exchange(new DirectExchange(exchangeName, true, args));
-        Queue::shared_ptr queue(new Queue(queueName, 0, &store, 0));
-        store.create(*exchange, qpid::framing::FieldTable());
-        store.create(*queue, qpid::framing::FieldTable());
-        BOOST_REQUIRE(exchange->bind(queue, key, &args));
-        store.bind(*exchange, *queue, key, args);
-    }//db will be closed
-    {
-        BdbMessageStore store;
-        store.init(test_dir, async, false, 4, 1, 8);
-        ExchangeRegistry exchanges;
-        QueueRegistry queues;
-        LinkRegistry links(0);
+    cout << test_filename << ".ExchangeBindAndUnbind: " << flush;
 
-        recover(store, queues, exchanges, links);
+    bindAndUnbind("MyDurableExchange", "MyDurableQueue", "my-routing-key", FieldTable());
 
-        Exchange::shared_ptr exchange = exchanges.get(exchangeName);
-        Queue::shared_ptr queue = queues.find(queueName);
-        //check it is bound by unbinding
-        BOOST_REQUIRE(exchange->unbind(queue, key, &args));
-        store.unbind(*exchange, *queue, key, args);
-    }
-    {
-        BdbMessageStore store;
-        store.init(test_dir, async, false, 4, 1, 8);
-        ExchangeRegistry exchanges;
-        QueueRegistry queues;
-        LinkRegistry links(0);
-
-        recover(store, queues, exchanges, links);
-
-        Exchange::shared_ptr exchange = exchanges.get(exchangeName);
-        Queue::shared_ptr queue = queues.find(queueName);
-        //make sure it is no longer bound
-        BOOST_REQUIRE(!exchange->unbind(queue, key, &args));
-    }
+    cout << "ok" << endl;
 }
 
-void testExchangeBindAndUnbind(bool async)
+QPID_AUTO_TEST_CASE(ExchangeBindAndUnbindWithArgs)
 {
-    bindAndUnbind("MyDurableExchange", "MyDurableQueue", "my-routing-key", FieldTable(), async);
-}
+    cout << test_filename << ".ExchangeBindAndUnbindWithArgs: " << flush;
 
-void testExchangeBindAndUnbindWithArgs(bool async)
-{
     FieldTable args;
     args.setString("a", "A");
     args.setString("b", "B");
-    bindAndUnbind("MyDurableExchange", "MyDurableQueue", "my-routing-key", args, async);
+    bindAndUnbind("MyDurableExchange", "MyDurableQueue", "my-routing-key", args);
+
+    cout << "ok" << endl;
 }
 
-void testExchangeImplicitUnbind(bool async)
+QPID_AUTO_TEST_CASE(ExchangeImplicitUnbind)
 {
+    cout << test_filename << ".ExchangeImplicitUnbind: " << flush;
+
     string exchangeName("MyDurableExchange");
     string queueName1("MyDurableQueue1");
     string queueName2("MyDurableQueue2");
@@ -538,7 +594,7 @@
     FieldTable args;
     {
         BdbMessageStore store;
-        store.init(test_dir, async, true, 4, 1, 8);
+        store.init(test_dir, 4, 1, 8);
         store.truncate();//make sure it is empty to begin with
         Exchange::shared_ptr exchange(new DirectExchange(exchangeName, true, args));
         Queue::shared_ptr queue1(new Queue(queueName1, 0, &store, 0));
@@ -553,7 +609,7 @@
     }//db will be closed
     {
         BdbMessageStore store;
-        store.init(test_dir, async, false, 4, 1, 8);
+        store.init(test_dir, 4, 1, 8);
         ExchangeRegistry exchanges;
         QueueRegistry queues;
         LinkRegistry links(0);
@@ -570,7 +626,7 @@
     }
     {
         BdbMessageStore store;
-        store.init(test_dir, async, false, 4, 1, 8);
+        store.init(test_dir, 4, 1, 8);
         ExchangeRegistry exchanges;
         QueueRegistry queues;
         LinkRegistry links(0);
@@ -587,205 +643,8 @@
         Queue::shared_ptr queue = queues.find(queueName2);
         store.destroy(*queue);
     }
-}
 
-
-// === Test suite ===
-
-QPID_AUTO_TEST_CASE(CreateDeleteSync)
-{
-    cout << test_filename << ".CreateDeleteSync: " << flush;
-    testCreateDelete(false);
     cout << "ok" << endl;
 }
 
-QPID_AUTO_TEST_CASE(CreateDeleteAsync)
-{
-    cout << test_filename << ".CreateDeleteAsync: " << flush;
-    testCreateDelete(true);
-    cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_CASE(EmptyRecoverSync)
-{
-    cout << test_filename << ".EmptyRecoverSync: " << flush;
-    testEmptyRecover(false);
-    cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_CASE(EmptyRecoverAsync)
-{
-    cout << test_filename << ".EmptyRecoverAsync: " << flush;
-    testEmptyRecover(true);
-    cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_CASE(QueueCreateSync)
-{
-    cout << test_filename << ".QueueCreateSync: " << flush;
-    testQueueCreate(false);
-    cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_CASE(QueueCreateAsync)
-{
-    cout << test_filename << ".QueueCreateAsync: " << flush;
-    testQueueCreate(true);
-    cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_CASE(QueueCreateWithSettingsSync)
-{
-    cout << test_filename << ".QueueCreateWithSettingsSync: " << flush;
-    testQueueCreateWithSettings(false);
-    cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_CASE(QueueCreateWithSettingsAsync)
-{
-    cout << test_filename << ".QueueCreateWithSettingsAsync: " << flush;
-    testQueueCreateWithSettings(true);
-    cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_CASE(QueueDestroySync)
-{
-    cout << test_filename << ".QueueDestroySync: " << flush;
-    testQueueDestroy(false);
-    cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_CASE(QueueDestroyAsync)
-{
-    cout << test_filename << ".QueueDestroyAsync: " << flush;
-    testQueueDestroy(true);
-    cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_CASE(EnqueueSync)
-{
-    cout << test_filename << ".EnqueueSync: " << flush;
-    testEnqueue(false);
-    cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_CASE(EnqueueAsync)
-{
-    cout << test_filename << ".EnqueueAsync: " << flush;
-    testEnqueue(true);
-    cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_CASE(DequeueSync)
-{
-    cout << test_filename << ".DequeueSync: " << flush;
-    testDequeue(false);
-    cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_CASE(DequeueAsync)
-{
-    cout << test_filename << ".DequeueAsync: " << flush;
-    testDequeue(true);
-    cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_CASE(StagingSync)
-{
-    cout << test_filename << ".StagingSync: " << flush;
-    testStaging(false);
-    cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_CASE(StagingAsync)
-{
-    cout << test_filename << ".StagingAsync: " << flush;
-    testStaging(true);
-    cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_CASE(DestroyStagedMessageSync)
-{
-    cout << test_filename << ".DestroyStagedMessageSync: " << flush;
-    testDestroyStagedMessage(false);
-    cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_CASE(DestroyStagedMessageAsync)
-{
-    cout << test_filename << ".DestroyStagedMessageAsync: " << flush;
-    testDestroyStagedMessage(true);
-    cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_CASE(DestroyEnqueuedMessageSync)
-{
-    cout << test_filename << ".DestroyEnqueuedMessageSync: " << flush;
-    testDestroyEnqueuedMessage(false);
-    cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_CASE(DestroyEnqueuedMessageAsync)
-{
-    cout << test_filename << ".DestroyEnqueuedMessageAsync: " << flush;
-    testDestroyEnqueuedMessage(true);
-    cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_CASE(ExchangeCreateAndDestroySync)
-{
-    cout << test_filename << ".ExchangeCreateAndDestroySync: " << flush;
-    testExchangeCreateAndDestroy(false);
-    cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_CASE(ExchangeCreateAndDestroyAsync)
-{
-    cout << test_filename << ".ExchangeCreateAndDestroyAsync: " << flush;
-    testExchangeCreateAndDestroy(true);
-    cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_CASE(ExchangeBindAndUnbindSync)
-{
-    cout << test_filename << ".ExchangeBindAndUnbindSync: " << flush;
-    testExchangeBindAndUnbind(false);
-    cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_CASE(ExchangeBindAndUnbindAsync)
-{
-    cout << test_filename << ".ExchangeBindAndUnbindAsync: " << flush;
-    testExchangeBindAndUnbind(true);
-    cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_CASE(ExchangeBindAndUnbindWithArgsSync)
-{
-    cout << test_filename << ".ExchangeBindAndUnbindWithArgsSync: " << flush;
-    testExchangeBindAndUnbindWithArgs(false);
-    cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_CASE(ExchangeBindAndUnbindWithArgsAsync)
-{
-    cout << test_filename << ".ExchangeBindAndUnbindWithArgsAsync: " << flush;
-    testExchangeBindAndUnbindWithArgs(true);
-    cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_CASE(ExchangeImplicitUnbindSync)
-{
-    cout << test_filename << ".ExchangeImplicitUnbindSync: " << flush;
-    testExchangeImplicitUnbind(false);
-    cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_CASE(ExchangeImplicitUnbindAsync)
-{
-    cout << test_filename << ".ExchangeImplicitUnbindAsync: " << flush;
-    testExchangeImplicitUnbind(true);
-    cout << "ok" << endl;
-}
-
 QPID_AUTO_TEST_SUITE_END()

Modified: store/trunk/cpp/tests/TransactionalTest.cpp
===================================================================
--- store/trunk/cpp/tests/TransactionalTest.cpp	2008-06-26 21:39:59 UTC (rev 2169)
+++ store/trunk/cpp/tests/TransactionalTest.cpp	2008-06-30 13:04:03 UTC (rev 2170)
@@ -55,10 +55,10 @@
 Queue::shared_ptr queueA;
 Queue::shared_ptr queueB;
 
-void setup(bool async)
+void setup()
 {
     store = std::auto_ptr<BdbMessageStore>(new BdbMessageStore());
-    store->init(test_dir, async, true, 4, 1, 8);
+    store->init(test_dir, 4, 1, 8);
     store->truncate();
 
     //create two queues:
@@ -75,14 +75,14 @@
     queueA->deliver(msg);
 }
 
-void restart(bool async)
+void restart()
 {
     queueA.reset();
     queueB.reset();
     store.reset();
 
     store = std::auto_ptr<BdbMessageStore>(new BdbMessageStore());
-    store->init(test_dir, async, false, 4, 1, 8);
+    store->init(test_dir, 4, 1, 8);
     ExchangeRegistry exchanges;
     LinkRegistry links(0);
     DtxManager mgr;
@@ -117,9 +117,9 @@
     BOOST_CHECK_EQUAL(messageId, msg->getProperties<MessageProperties>()->getMessageId());
 }
 
-void swap(bool commit, bool async)
+void swap(bool commit)
 {
-    setup(async);
+    setup();
 
     boost::intrusive_ptr<Message> msg = queueA->dequeue().payload;
     BOOST_REQUIRE(msg);
@@ -133,39 +133,25 @@
         store->abort(*txn);
     }
 
-    restart(async);
+    restart();
     check(commit);
 }
 
 
 // === Test suite ===
 
-QPID_AUTO_TEST_CASE(CommitSync)
+QPID_AUTO_TEST_CASE(Commit)
 {
-    cout << test_filename << ".CommitSync: " << flush;
-    swap(true, false);
+    cout << test_filename << ".Commit: " << flush;
+    swap(true);
     cout << "ok" << endl;
 }
 
-QPID_AUTO_TEST_CASE(CommitAsync)
+QPID_AUTO_TEST_CASE(Abort)
 {
-    cout << test_filename << ".CommitAsync: " << flush;
-    swap(true, true);
+    cout << test_filename << ".Abort: " << flush;
+    swap(false);
     cout << "ok" << endl;
 }
 
-QPID_AUTO_TEST_CASE(AbortSync)
-{
-    cout << test_filename << ".AbortSync: " << flush;
-    swap(false, false);
-    cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_CASE(AbortAsync)
-{
-    cout << test_filename << ".AbortAsync: " << flush;
-    swap(false, true);
-    cout << "ok" << endl;
-}
-
 QPID_AUTO_TEST_SUITE_END()

Modified: store/trunk/cpp/tests/TwoPhaseCommitTest.cpp
===================================================================
--- store/trunk/cpp/tests/TwoPhaseCommitTest.cpp	2008-06-26 21:39:59 UTC (rev 2169)
+++ store/trunk/cpp/tests/TwoPhaseCommitTest.cpp	2008-06-30 13:04:03 UTC (rev 2170)
@@ -134,7 +134,6 @@
     boost::intrusive_ptr<Message> msg1;
     boost::intrusive_ptr<Message> msg2;
     boost::intrusive_ptr<Message> msg4;
-    bool async;
 
     void recoverPrepared(bool commit)
     {
@@ -221,7 +220,7 @@
     void setup()
     {
         store = std::auto_ptr<BdbMessageStore>(new BdbMessageStore());
-        store->init(test_dir, async, true, 4, 1, 8);
+        store->init(test_dir, 4, 1, 8);
         store->truncate();
 
         //create two queues:
@@ -247,7 +246,7 @@
         store.reset();
 
         store = std::auto_ptr<BdbMessageStore>(new BdbMessageStore());
-        store->init(test_dir, async, false, 4, 1, 8);
+        store->init(test_dir, 4, 1, 8);
         ExchangeRegistry exchanges;
         dtxmgr = std::auto_ptr<DtxManager>(new DtxManager);
         dtxmgr->setStore (store.get());
@@ -295,78 +294,67 @@
 public:
     TwoPhaseCommitTest() : nameA("queueA"), nameB("queueB"), links(0) {}
 
-    void testCommitSwap(bool a)
+    void testCommitSwap()
     {
-        async = a;
         Swap swap(this, "SwapMessageId");
         commit(swap);
     }
 
-    void testPrepareAndAbortSwap(bool a)
+    void testPrepareAndAbortSwap()
     {
-        async = a;
         Swap swap(this, "SwapMessageId");
         abort(swap, true);
     }
 
-    void testAbortNoPrepareSwap(bool a)
+    void testAbortNoPrepareSwap()
     {
-        async = a;
         Swap swap(this, "SwapMessageId");
         abort(swap, false);
     }
 
-    void testCommitEnqueue(bool a)
+    void testCommitEnqueue()
     {
-        async = a;
         Enqueue enqueue(this);
         commit(enqueue);
     }
 
-    void testPrepareAndAbortEnqueue(bool a)
+    void testPrepareAndAbortEnqueue()
     {
-        async = a;
         Enqueue enqueue(this);
         abort(enqueue, true);
     }
 
-    void testAbortNoPrepareEnqueue(bool a)
+    void testAbortNoPrepareEnqueue()
     {
-        async = a;
         Enqueue enqueue(this);
         abort(enqueue, false);
     }
 
-    void testCommitDequeue(bool a)
+    void testCommitDequeue()
     {
-        async = a;
         Dequeue dequeue(this);
         commit(dequeue);
     }
 
-    void testPrepareAndAbortDequeue(bool a)
+    void testPrepareAndAbortDequeue()
     {
-        async = a;
         Dequeue dequeue(this);
         abort(dequeue, true);
     }
 
-    void testAbortNoPrepareDequeue(bool a)
+    void testAbortNoPrepareDequeue()
     {
-        async = a;
         Dequeue dequeue(this);
         abort(dequeue, false);
     }
 
-    void testRecoverPreparedThenCommitted(bool a)
+    void testRecoverPreparedThenCommitted()
     {
-        async = a;
         recoverPrepared(true);
     }
 
-    void testRecoverPreparedThenAborted(bool a)
+    void testRecoverPreparedThenAborted()
     {
-        async = a;
         recoverPrepared(false);
     }
 };
@@ -375,158 +363,81 @@
 
 // === Test suite ===
 
-QPID_AUTO_TEST_CASE(CommitSwapSync)
+QPID_AUTO_TEST_CASE(PrepareAndAbortSwap)
 {
-    cout << test_filename << ".CommitSwapSync: " << flush;
-    tpct.testCommitSwap(false);
+    cout << test_filename << ".PrepareAndAbortSwap: " << flush;
+    tpct.testPrepareAndAbortSwap();
     cout << "ok" << endl;
 }
 
-QPID_AUTO_TEST_CASE(PrepareAndAbortSwapSync)
+QPID_AUTO_TEST_CASE(CommitEnqueue)
 {
-    cout << test_filename << ".PrepareAndAbortSwapSync: " << flush;
-    tpct.testPrepareAndAbortSwap(false);
+    cout << test_filename << ".CommitEnqueue: " << flush;
+    tpct.testCommitEnqueue();
     cout << "ok" << endl;
 }
 
-QPID_AUTO_TEST_CASE(AbortNoPrepareSwapSync)
+QPID_AUTO_TEST_CASE(AbortNoPrepareEnqueue)
 {
-    cout << test_filename << ".AbortNoPrepareSwapSync: " << flush;
-    tpct.testAbortNoPrepareSwap(false);
+    cout << test_filename << ".AbortNoPrepareEnqueue: " << flush;
+    tpct.testAbortNoPrepareEnqueue();
     cout << "ok" << endl;
 }
 
-QPID_AUTO_TEST_CASE(CommitEnqueueSync)
+QPID_AUTO_TEST_CASE(PrepareAndAbortDequeue)
 {
-    cout << test_filename << ".CommitEnqueueSync: " << flush;
-    tpct.testCommitEnqueue(false);
+    cout << test_filename << ".PrepareAndAbortDequeue: " << flush;
+    tpct.testPrepareAndAbortDequeue();
     cout << "ok" << endl;
 }
 
-QPID_AUTO_TEST_CASE(PrepareAndAbortEnqueueSync)
+QPID_AUTO_TEST_CASE(RecoverPreparedThenCommitted)
 {
-    cout << test_filename << ".PrepareAndAbortEnqueueSync: " << flush;
-    tpct.testPrepareAndAbortEnqueue(false);
+    cout << test_filename << ".RecoverPreparedThenCommitted: " << flush;
+    tpct.testRecoverPreparedThenCommitted();
     cout << "ok" << endl;
 }
 
-QPID_AUTO_TEST_CASE(AbortNoPrepareEnqueueSync)
+QPID_AUTO_TEST_CASE(CommitSwap)
 {
-    cout << test_filename << ".AbortNoPrepareEnqueueSync: " << flush;
-    tpct.testAbortNoPrepareEnqueue(false);
+    cout << test_filename << ".CommitSwap: " << flush;
+    tpct.testCommitSwap();
     cout << "ok" << endl;
 }
 
-QPID_AUTO_TEST_CASE(CommitDequeueSync)
+QPID_AUTO_TEST_CASE(AbortNoPrepareSwap)
 {
-    cout << test_filename << ".CommitDequeueSync: " << flush;
-    tpct.testCommitDequeue(false);
+    cout << test_filename << ".AbortNoPrepareSwap: " << flush;
+    tpct.testAbortNoPrepareSwap();
     cout << "ok" << endl;
 }
 
-QPID_AUTO_TEST_CASE(PrepareAndAbortDequeueSync)
+QPID_AUTO_TEST_CASE(PrepareAndAbortEnqueue)
 {
-    cout << test_filename << ".PrepareAndAbortDequeueSync: " << flush;
-    tpct.testPrepareAndAbortDequeue(false);
+    cout << test_filename << ".PrepareAndAbortEnqueue: " << flush;
+    tpct.testPrepareAndAbortEnqueue();
     cout << "ok" << endl;
 }
 
-QPID_AUTO_TEST_CASE(AbortNoPrepareDequeueSync)
+QPID_AUTO_TEST_CASE(CommitDequeue)
 {
-    cout << test_filename << ".AbortNoPrepareDequeueSync: " << flush;
-    tpct.testAbortNoPrepareDequeue(false);
+    cout << test_filename << ".CommitDequeue: " << flush;
+    tpct.testCommitDequeue();
     cout << "ok" << endl;
 }
 
-QPID_AUTO_TEST_CASE(RecoverPreparedThenCommittedSync)
+QPID_AUTO_TEST_CASE(AbortNoPrepareDequeue)
 {
-    cout << test_filename << ".RecoverPreparedThenCommittedSync: " << flush;
-    tpct.testRecoverPreparedThenCommitted(false);
+    cout << test_filename << ".AbortNoPrepareDequeue: " << flush;
+    tpct.testAbortNoPrepareDequeue();
     cout << "ok" << endl;
 }
 
-QPID_AUTO_TEST_CASE(RecoverPreparedThenAbortedSync)
+QPID_AUTO_TEST_CASE(RecoverPreparedThenAborted)
 {
-    cout << test_filename << ".RecoverPreparedThenAbortedSync: " << flush;
-    tpct.testRecoverPreparedThenAborted(false);
+    cout << test_filename << ".RecoverPreparedThenAborted: " << flush;
+    tpct.testRecoverPreparedThenAborted();
     cout << "ok" << endl;
 }
 
-QPID_AUTO_TEST_CASE(CommitSwapAsync)
-{
-    cout << test_filename << ".CommitSwapAsync: " << flush;
-    tpct.testCommitSwap(true);
-    cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_CASE(PrepareAndAbortSwapAsync)
-{
-    cout << test_filename << ".PrepareAndAbortSwapAsync: " << flush;
-    tpct.testPrepareAndAbortSwap(true);
-    cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_CASE(AbortNoPrepareSwapAsync)
-{
-    cout << test_filename << ".AbortNoPrepareSwapAsync: " << flush;
-    tpct.testAbortNoPrepareSwap(true);
-    cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_CASE(CommitEnqueueAsync)
-{
-    cout << test_filename << ".CommitEnqueueAsync: " << flush;
-    tpct.testCommitEnqueue(true);
-    cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_CASE(PrepareAndAbortEnqueueAsync)
-{
-    cout << test_filename << ".PrepareAndAbortEnqueueAsync: " << flush;
-    tpct.testPrepareAndAbortEnqueue(true);
-    cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_CASE(AbortNoPrepareEnqueueAsync)
-{
-    cout << test_filename << ".AbortNoPrepareEnqueueAsync: " << flush;
-    tpct.testAbortNoPrepareEnqueue(true);
-    cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_CASE(CommitDequeueAsync)
-{
-    cout << test_filename << ".CommitDequeueAsync: " << flush;
-    tpct.testCommitDequeue(true);
-    cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_CASE(PrepareAndAbortDequeueAsync)
-{
-    cout << test_filename << ".PrepareAndAbortDequeueAsync: " << flush;
-    tpct.testPrepareAndAbortDequeue(true);
-    cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_CASE(AbortNoPrepareDequeueAsync)
-{
-    cout << test_filename << ".AbortNoPrepareDequeueAsync: " << flush;
-    tpct.testAbortNoPrepareDequeue(true);
-    cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_CASE(RecoverPreparedThenCommittedAsync)
-{
-    cout << test_filename << ".RecoverPreparedThenCommittedAsync: " << flush;
-    tpct.testRecoverPreparedThenCommitted(true);
-    cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_CASE(RecoverPreparedThenAbortedAsync)
-{
-    cout << test_filename << ".RecoverPreparedThenAbortedAsync: " << flush;
-    tpct.testRecoverPreparedThenAborted(true);
-    cout << "ok" << endl;
-}
-
 QPID_AUTO_TEST_SUITE_END()

Modified: store/trunk/cpp/tests/python_tests/flow_to_disk.py
===================================================================
--- store/trunk/cpp/tests/python_tests/flow_to_disk.py	2008-06-26 21:39:59 UTC (rev 2169)
+++ store/trunk/cpp/tests/python_tests/flow_to_disk.py	2008-06-30 13:04:03 UTC (rev 2170)
@@ -22,7 +22,7 @@
 from qpid.datatypes import Message, RangedSet
 from qpid.session import SessionException
 
-class AsyncFlowToDiskTests(TestBase010):
+class FlowToDiskTests(TestBase010):
     """Tests for async store flow-to-disk"""
 
     def test_01_simple_max_count_transient(self):




More information about the rhmessaging-commits mailing list