[rhmessaging-commits] rhmessaging commits: r2032 - in store/trunk/cpp: lib and 2 other directories.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Fri May 9 13:58:50 EDT 2008


Author: kpvdr
Date: 2008-05-09 13:58:50 -0400 (Fri, 09 May 2008)
New Revision: 2032

Modified:
   store/trunk/cpp/configure.ac
   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/jrnl/jtt/args.cpp
   store/trunk/cpp/tests/jrnl/jtt/jfile_chk.py
Log:
Patch from Michael Goulish: Changes to allow compilation of store module on RHEL4

Modified: store/trunk/cpp/configure.ac
===================================================================
--- store/trunk/cpp/configure.ac	2008-05-09 16:14:57 UTC (rev 2031)
+++ store/trunk/cpp/configure.ac	2008-05-09 17:58:50 UTC (rev 2032)
@@ -117,17 +117,17 @@
 AC_SUBST([LIB_DLOPEN])
 LIBS=$gl_saved_libs
 
-# Require libdb_cxx-4.3, for the library, and for db_cxx.h.
+# Require libdb_cxx (any version between 4.2 and 4.6), for the library, and for db_cxx.h.
 db4_devel_fail=0
 AC_CHECK_HEADER([db_cxx.h], ,[db4_devel_fail=1])
 test $db4_devel_fail == 1 && \
   AC_MSG_ERROR([db4-devel package missing. Please ensure both db4 and db4-devel are installed. (hint: "yum install db4-devel" should do it...)])
 
 gl_saved_libs=$LIBS
-AC_SEARCH_LIBS([__db_open], [db_cxx-4.6 db_cxx-4.5 db_cxx-4.4 db_cxx-4.3],
+AC_SEARCH_LIBS([__db_open], [db_cxx-4.6 db_cxx-4.5 db_cxx-4.4 db_cxx-4.3 db_cxx-4.2],
 		 [test "$ac_cv_search___db_open" = "none required" ||
 		  LIB_BERKELEY_DB=$ac_cv_search___db_open],
-		  AC_MSG_ERROR([Couldn't find required library in range db_cxx-4.3 through db_cxx-4.6]))
+		  AC_MSG_ERROR([Couldn't find required library in range db_cxx-4.2 through db_cxx-4.6]))
 AC_SUBST([LIB_BERKELEY_DB])
 LIBS=$gl_saved_libs
 

Modified: store/trunk/cpp/lib/BdbMessageStore.h
===================================================================
--- store/trunk/cpp/lib/BdbMessageStore.h	2008-05-09 16:14:57 UTC (rev 2031)
+++ store/trunk/cpp/lib/BdbMessageStore.h	2008-05-09 17:58:50 UTC (rev 2032)
@@ -45,6 +45,12 @@
 #include <boost/ptr_container/ptr_list.hpp>
 #include "qpid/management/Store.h"
 
+// Assume DB_VERSION_MAJOR == 4
+#if (DB_VERSION_MINOR == 2)
+#include <errno.h>
+#define DB_BUFFER_SMALL ENOMEM
+#endif
+
 namespace rhm {
     namespace bdbstore {
         using std::string;

Modified: store/trunk/cpp/tests/OrderingTest.cpp
===================================================================
--- store/trunk/cpp/tests/OrderingTest.cpp	2008-05-09 16:14:57 UTC (rev 2031)
+++ store/trunk/cpp/tests/OrderingTest.cpp	2008-05-09 17:58:50 UTC (rev 2032)
@@ -80,7 +80,7 @@
     Message::shared_ptr msg = queue->dequeue().payload;
     if (msg) {
         queue->dequeue(0, msg);
-        BOOST_REQUIRE_EQUAL(ids.front(), msg->getProperties<MessageProperties>()->getMessageId());
+        BOOST_CHECK_EQUAL(ids.front(), msg->getProperties<MessageProperties>()->getMessageId());
         ids.pop();
         return true;
     } else {
@@ -107,10 +107,10 @@
 void check()
 {        
     BOOST_REQUIRE(queue);
-    BOOST_REQUIRE_EQUAL((u_int32_t) ids.size(), queue->getMessageCount());
+    BOOST_CHECK_EQUAL((u_int32_t) ids.size(), queue->getMessageCount());
     while (pop()) ;//keeping popping 'till all messages are dequeued
-    BOOST_REQUIRE_EQUAL((u_int32_t) 0, queue->getMessageCount());        
-    BOOST_REQUIRE_EQUAL((size_t) 0, ids.size());
+    BOOST_CHECK_EQUAL((u_int32_t) 0, queue->getMessageCount());        
+    BOOST_CHECK_EQUAL((size_t) 0, ids.size());
 }
 
 void testBasic(bool async = false)

Modified: store/trunk/cpp/tests/SimpleTest.cpp
===================================================================
--- store/trunk/cpp/tests/SimpleTest.cpp	2008-05-09 16:14:57 UTC (rev 2031)
+++ store/trunk/cpp/tests/SimpleTest.cpp	2008-05-09 17:58:50 UTC (rev 2032)
@@ -127,7 +127,7 @@
         recover(store, registry);
         Queue::shared_ptr queue = registry.find(name);
         BOOST_REQUIRE(queue.get());
-        BOOST_REQUIRE_EQUAL(id, queue->getPersistenceId());
+        BOOST_CHECK_EQUAL(id, queue->getPersistenceId());
     }
 }
 
@@ -154,8 +154,8 @@
         Queue::shared_ptr queue = registry.find(name);
         BOOST_REQUIRE(queue);
         BOOST_REQUIRE(queue->getPolicy());
-        BOOST_REQUIRE_EQUAL(policy.getMaxCount(), queue->getPolicy()->getMaxCount());
-        BOOST_REQUIRE_EQUAL(policy.getMaxSize(), queue->getPolicy()->getMaxSize());
+        BOOST_CHECK_EQUAL(policy.getMaxCount(), queue->getPolicy()->getMaxCount());
+        BOOST_CHECK_EQUAL(policy.getMaxSize(), queue->getPolicy()->getMaxSize());
     }
 }
 
@@ -219,24 +219,24 @@
         recover(store, registry);
         Queue::shared_ptr queue = registry.find(name);
         BOOST_REQUIRE(queue);
-        BOOST_REQUIRE_EQUAL((u_int32_t) 1, queue->getMessageCount());
+        BOOST_CHECK_EQUAL((u_int32_t) 1, queue->getMessageCount());
         Message::shared_ptr msg = queue->dequeue().payload;
 
-        BOOST_REQUIRE_EQUAL(exchange, msg->getExchangeName());
-        BOOST_REQUIRE_EQUAL(routingKey, msg->getRoutingKey());
-        BOOST_REQUIRE_EQUAL(messageId, msg->getProperties<MessageProperties>()->getMessageId());
-        BOOST_REQUIRE_EQUAL((uint8_t) PERSISTENT, msg->getProperties<DeliveryProperties>()->getDeliveryMode());
+        BOOST_CHECK_EQUAL(exchange, msg->getExchangeName());
+        BOOST_CHECK_EQUAL(routingKey, msg->getRoutingKey());
+        BOOST_CHECK_EQUAL(messageId, msg->getProperties<MessageProperties>()->getMessageId());
+        BOOST_CHECK_EQUAL((uint8_t) PERSISTENT, msg->getProperties<DeliveryProperties>()->getDeliveryMode());
         BOOST_REQUIRE(Str16Value("xyz") == *msg->getProperties<MessageProperties>()->getApplicationHeaders().get("abc"));
-        BOOST_REQUIRE_EQUAL((u_int64_t) 14, msg->contentSize());
+        BOOST_CHECK_EQUAL((u_int64_t) 14, msg->contentSize());
     
         DummyHandler handler;
         QueuedMessage qm(queue.get(),msg,0);
         MessageDelivery::deliver(qm, handler, 0, MessageDelivery::getMessageDeliveryToken("ignore", 0, 0), 100); 
-        BOOST_REQUIRE_EQUAL((size_t) 3, handler.frames.size());
+        BOOST_CHECK_EQUAL((size_t) 3, handler.frames.size());
         AMQContentBody* contentBody(dynamic_cast<AMQContentBody*>(handler.frames[2].getBody()));
         BOOST_REQUIRE(contentBody);
-        BOOST_REQUIRE_EQUAL(data1.size() + data2.size(), contentBody->getData().size());
-        BOOST_REQUIRE_EQUAL(data1 + data2, contentBody->getData());
+        BOOST_CHECK_EQUAL(data1.size() + data2.size(), contentBody->getData().size());
+        BOOST_CHECK_EQUAL(data1 + data2, contentBody->getData());
     }
 }
 
@@ -271,7 +271,7 @@
         recover(store, registry);
         Queue::shared_ptr queue = registry.find(name);
         BOOST_REQUIRE(queue);
-        BOOST_REQUIRE_EQUAL((u_int32_t) 0, queue->getMessageCount());
+        BOOST_CHECK_EQUAL((u_int32_t) 0, queue->getMessageCount());
     }
 }
 
@@ -321,7 +321,7 @@
             BOOST_REQUIRE(contentBody);
             loaded += contentBody->getData();
         }
-        BOOST_REQUIRE_EQUAL(data1 + data2, loaded);
+        BOOST_CHECK_EQUAL(data1 + data2, loaded);
 
     }//db will be closed
     {
@@ -339,18 +339,18 @@
         //get message instance from queue
         Queue::shared_ptr queue = registry.find(name);
         BOOST_REQUIRE(queue);
-        BOOST_REQUIRE_EQUAL((u_int32_t) 1, queue->getMessageCount());
+        BOOST_CHECK_EQUAL((u_int32_t) 1, queue->getMessageCount());
         Message::shared_ptr msg = queue->dequeue().payload;
 
         //check headers
-        BOOST_REQUIRE_EQUAL(exchange, msg->getExchangeName());
-        BOOST_REQUIRE_EQUAL(routingKey, msg->getRoutingKey());
-        BOOST_REQUIRE_EQUAL(messageId, msg->getProperties<MessageProperties>()->getMessageId());
-        BOOST_REQUIRE_EQUAL((uint8_t) PERSISTENT, msg->getProperties<DeliveryProperties>()->getDeliveryMode());
+        BOOST_CHECK_EQUAL(exchange, msg->getExchangeName());
+        BOOST_CHECK_EQUAL(routingKey, msg->getRoutingKey());
+        BOOST_CHECK_EQUAL(messageId, msg->getProperties<MessageProperties>()->getMessageId());
+        BOOST_CHECK_EQUAL((uint8_t) PERSISTENT, msg->getProperties<DeliveryProperties>()->getDeliveryMode());
         BOOST_REQUIRE(Str16Value("xyz") == *msg->getProperties<MessageProperties>()->getApplicationHeaders().get("abc"));
-        BOOST_REQUIRE_EQUAL((u_int64_t) (data1.size() + data2.size()), msg->getFrames().getHeaders()->getContentLength());
+        BOOST_CHECK_EQUAL((u_int64_t) (data1.size() + data2.size()), msg->getFrames().getHeaders()->getContentLength());
 
-        BOOST_REQUIRE_EQUAL((u_int64_t) 0, msg->contentSize());//ensure it is being lazily loaded 
+        BOOST_CHECK_EQUAL((u_int64_t) 0, msg->contentSize());//ensure it is being lazily loaded 
 
         //load lazily
         DummyHandler handler;
@@ -364,7 +364,7 @@
             BOOST_REQUIRE(contentBody);
             loaded += contentBody->getData();
         }
-        BOOST_REQUIRE_EQUAL(data1 + data2, loaded);
+        BOOST_CHECK_EQUAL(data1 + data2, loaded);
 
         //dequeue
         queue->dequeue(0, msg);
@@ -415,7 +415,7 @@
 
     string loaded;
     store.loadContent(queue, cpmsg, loaded, 0, data.length());
-    BOOST_REQUIRE_EQUAL(data, loaded);
+    BOOST_CHECK_EQUAL(data, loaded);
 
     store.dequeue(0, pmsg, queue);
     store.destroy(queue);
@@ -446,10 +446,10 @@
         recover(store, registry);
 
         Exchange::shared_ptr exchange = registry.get(name);
-        BOOST_REQUIRE_EQUAL(id, exchange->getPersistenceId());
-        BOOST_REQUIRE_EQUAL(type, exchange->getType());
+        BOOST_CHECK_EQUAL(id, exchange->getPersistenceId());
+        BOOST_CHECK_EQUAL(type, exchange->getType());
         BOOST_REQUIRE(exchange->isDurable());
-        BOOST_REQUIRE_EQUAL(*args.get("a"), *exchange->getArgs().get("a"));
+        BOOST_CHECK_EQUAL(*args.get("a"), *exchange->getArgs().get("a"));
         store.destroy(*exchange);
     }
     {
@@ -463,7 +463,7 @@
             Exchange::shared_ptr exchange = registry.get(name);
             BOOST_FAIL("Expected exchange not to be found");
         } catch (const SessionException& e) {
-            BOOST_REQUIRE_EQUAL((framing::ReplyCode) 404, e.code);
+            BOOST_CHECK_EQUAL((framing::ReplyCode) 404, e.code);
         }
     }
 }
@@ -575,7 +575,7 @@
             Exchange::shared_ptr exchange = exchanges.get(exchangeName);
             BOOST_FAIL("Expected exchange not to be found");
         } catch (const SessionException& e) {
-            BOOST_REQUIRE_EQUAL((framing::ReplyCode) 404, e.code);
+            BOOST_CHECK_EQUAL((framing::ReplyCode) 404, e.code);
         }
         Queue::shared_ptr queue = queues.find(queueName2);
         store.destroy(*queue);

Modified: store/trunk/cpp/tests/TransactionalTest.cpp
===================================================================
--- store/trunk/cpp/tests/TransactionalTest.cpp	2008-05-09 16:14:57 UTC (rev 2031)
+++ store/trunk/cpp/tests/TransactionalTest.cpp	2008-05-09 17:58:50 UTC (rev 2032)
@@ -109,11 +109,11 @@
         y = queueA;
     }
 
-    BOOST_REQUIRE_EQUAL((u_int32_t) 0, x->getMessageCount());
-    BOOST_REQUIRE_EQUAL((u_int32_t) 1, y->getMessageCount());
+    BOOST_CHECK_EQUAL((u_int32_t) 0, x->getMessageCount());
+    BOOST_CHECK_EQUAL((u_int32_t) 1, y->getMessageCount());
     Message::shared_ptr msg = y->dequeue().payload;
     BOOST_REQUIRE(msg);
-    BOOST_REQUIRE_EQUAL(messageId, msg->getProperties<MessageProperties>()->getMessageId());
+    BOOST_CHECK_EQUAL(messageId, msg->getProperties<MessageProperties>()->getMessageId());
 }
 
 void swap(bool commit, bool async)

Modified: store/trunk/cpp/tests/TwoPhaseCommitTest.cpp
===================================================================
--- store/trunk/cpp/tests/TwoPhaseCommitTest.cpp	2008-05-09 16:14:57 UTC (rev 2031)
+++ store/trunk/cpp/tests/TwoPhaseCommitTest.cpp	2008-05-09 17:58:50 UTC (rev 2032)
@@ -147,8 +147,8 @@
         restart();
 
         //check that the message is not available from either queue
-        BOOST_REQUIRE_EQUAL((u_int32_t) 0, queueA->getMessageCount());
-        BOOST_REQUIRE_EQUAL((u_int32_t) 0, queueB->getMessageCount());
+        BOOST_CHECK_EQUAL((u_int32_t) 0, queueA->getMessageCount());
+        BOOST_CHECK_EQUAL((u_int32_t) 0, queueB->getMessageCount());
 
         //commit/abort the txn - through the dtx manager, not directly on the store
         if (commit) {
@@ -273,21 +273,21 @@
             y = queueA;
         }
 
-        BOOST_REQUIRE_EQUAL((u_int32_t) 0, x->getMessageCount());
-        BOOST_REQUIRE_EQUAL((u_int32_t) 1, y->getMessageCount());
+        BOOST_CHECK_EQUAL((u_int32_t) 0, x->getMessageCount());
+        BOOST_CHECK_EQUAL((u_int32_t) 1, y->getMessageCount());
         Message::shared_ptr msg = y->dequeue().payload;
         BOOST_REQUIRE(msg);
-        BOOST_REQUIRE_EQUAL(msgid, msg->getProperties<MessageProperties>()->getCorrelationId());        
+        BOOST_CHECK_EQUAL(msgid, msg->getProperties<MessageProperties>()->getCorrelationId());        
     }
 
     void checkA(u_int32_t size, const string& msgid = "<none>")
     {        
         BOOST_REQUIRE(queueA);
-        BOOST_REQUIRE_EQUAL(size, queueA->getMessageCount());
+        BOOST_CHECK_EQUAL(size, queueA->getMessageCount());
         if (size > 0) {
             Message::shared_ptr msg = queueA->dequeue().payload;
             BOOST_REQUIRE(msg);
-            BOOST_REQUIRE_EQUAL(msgid, msg->getProperties<MessageProperties>()->getCorrelationId());
+            BOOST_CHECK_EQUAL(msgid, msg->getProperties<MessageProperties>()->getCorrelationId());
         }
     }
 

Modified: store/trunk/cpp/tests/jrnl/jtt/args.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/jtt/args.cpp	2008-05-09 16:14:57 UTC (rev 2031)
+++ store/trunk/cpp/tests/jrnl/jtt/args.cpp	2008-05-09 17:58:50 UTC (rev 2032)
@@ -34,7 +34,7 @@
 {
 
 args::args(std::string opt_title):
-    _options_descr(opt_title, 100),
+    _options_descr(opt_title),
     format_chk(false),
     keep_jrnls(false),
     lld_rd_num(10),

Modified: store/trunk/cpp/tests/jrnl/jtt/jfile_chk.py
===================================================================
--- store/trunk/cpp/tests/jrnl/jtt/jfile_chk.py	2008-05-09 16:14:57 UTC (rev 2031)
+++ store/trunk/cpp/tests/jrnl/jtt/jfile_chk.py	2008-05-09 17:58:50 UTC (rev 2032)
@@ -177,9 +177,9 @@
  
     format = '=4sBBHQ'
     
-    @staticmethod
     def descriminate(args):
         return CLASSES.get(args[1][-1], Hdr)
+    descriminate = staticmethod(descriminate)
 
     def __init__(self, foffs, magic, ver, end, flags, rid):
         self.foffs = foffs




More information about the rhmessaging-commits mailing list