[rhmessaging-commits] rhmessaging commits: r4488 - in store/trunk/cpp: tests/federation and 1 other directory.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Wed Jan 4 12:00:49 EST 2012


Author: kpvdr
Date: 2012-01-04 12:00:47 -0500 (Wed, 04 Jan 2012)
New Revision: 4488

Modified:
   store/trunk/cpp/lib/MessageStoreImpl.cpp
   store/trunk/cpp/lib/MessageStoreImpl.h
   store/trunk/cpp/tests/federation/federation_tests_env.sh
Log:
Fix python path issue for python tests. Other minor fixes and tidy-ups

Modified: store/trunk/cpp/lib/MessageStoreImpl.cpp
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.cpp	2011-12-16 15:29:51 UTC (rev 4487)
+++ store/trunk/cpp/lib/MessageStoreImpl.cpp	2012-01-04 17:00:47 UTC (rev 4488)
@@ -705,12 +705,13 @@
 
     //recover transactions:
     for (txn_list::iterator i = prepared.begin(); i != prepared.end(); i++) {
+        const PreparedTransaction pt = *i;
         if (mgmtObject != 0) {
             mgmtObject->inc_tplTransactionDepth();
             mgmtObject->inc_tplTxnPrepares();
         }
 
-        std::string xid = i->xid;
+        std::string xid = pt.xid;
 
         // Restore data token state in TxnCtxt
         TplRecoverMapCitr citr = tplRecoverMap.find(xid);
@@ -729,14 +730,14 @@
 
             qpid::broker::RecoverableTransaction::shared_ptr dtx;
             if (!incomplTplTxnFlag) dtx = registry.recoverTransaction(xid, txn);
-            if (i->enqueues.get()) {
-                for (LockedMappings::iterator j = i->enqueues->begin(); j != i->enqueues->end(); j++) {
+            if (pt.enqueues.get()) {
+                for (LockedMappings::iterator j = pt.enqueues->begin(); j != pt.enqueues->end(); j++) {
                     tpcc->addXidRecord(queues[j->first]->getExternalQueueStore());
                     if (!incomplTplTxnFlag) dtx->enqueue(queues[j->first], messages[j->second]);
                 }
             }
-            if (i->dequeues.get()) {
-                for (LockedMappings::iterator j = i->dequeues->begin(); j != i->dequeues->end(); j++) {
+            if (pt.dequeues.get()) {
+                for (LockedMappings::iterator j = pt.dequeues->begin(); j != pt.dequeues->end(); j++) {
                     tpcc->addXidRecord(queues[j->first]->getExternalQueueStore());
                     if (!incomplTplTxnFlag) dtx->dequeue(queues[j->first], messages[j->second]);
                 }
@@ -751,13 +752,13 @@
             opcc->recoverDtok(citr->second.rid, xid);
             opcc->prepare(tplStorePtr.get());
 
-            if (i->enqueues.get()) {
-                for (LockedMappings::iterator j = i->enqueues->begin(); j != i->enqueues->end(); j++) {
+            if (pt.enqueues.get()) {
+                for (LockedMappings::iterator j = pt.enqueues->begin(); j != pt.enqueues->end(); j++) {
                     opcc->addXidRecord(queues[j->first]->getExternalQueueStore());
                 }
             }
-            if (i->dequeues.get()) {
-                for (LockedMappings::iterator j = i->dequeues->begin(); j != i->dequeues->end(); j++) {
+            if (pt.dequeues.get()) {
+                for (LockedMappings::iterator j = pt.dequeues->begin(); j != pt.dequeues->end(); j++) {
                     opcc->addXidRecord(queues[j->first]->getExternalQueueStore());
                 }
             }

Modified: store/trunk/cpp/lib/MessageStoreImpl.h
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.h	2011-12-16 15:29:51 UTC (rev 4487)
+++ store/trunk/cpp/lib/MessageStoreImpl.h	2012-01-04 17:00:47 UTC (rev 4488)
@@ -334,8 +334,8 @@
     void loadContent(const qpid::broker::PersistableQueue& queue,
                      const boost::intrusive_ptr<const qpid::broker::PersistableMessage>& msg,
                      std::string& data,
-                     u_int64_t offset,
-                     u_int32_t length);
+                     uint64_t offset,
+                     uint32_t length);
 
     void enqueue(qpid::broker::TransactionContext* ctxt,
                  const boost::intrusive_ptr<qpid::broker::PersistableMessage>& msg,

Modified: store/trunk/cpp/tests/federation/federation_tests_env.sh
===================================================================
--- store/trunk/cpp/tests/federation/federation_tests_env.sh	2011-12-16 15:29:51 UTC (rev 4487)
+++ store/trunk/cpp/tests/federation/federation_tests_env.sh	2012-01-04 17:00:47 UTC (rev 4488)
@@ -114,6 +114,20 @@
 	return 0
 }
 
+func_set_python_env()
+#--------------------
+# Set up the python path
+# Params: None
+# Returns: Nothing
+{
+	if test "${QPID_DIR}" -a -d "${QPID_DIR}" ; then
+		QPID_PYTHON=${QPID_DIR}/python
+		QPID_TOOLS=${QPID_DIR}/tools/src/py
+		QMF_LIB=${QPID_DIR}/extras/qmf/src/py
+		export PYTHONPATH=${QPID_PYTHON}:${QMF_LIB}:${QPID_TOOLS}:$PYTHONPATH
+	fi
+}
+
 func_set_env ()
 #--------------
 # Set up the environment based on value of ${QPID_DIR}: if ${QPID_DIR} exists, assume a svn checkout,
@@ -277,6 +291,7 @@
 
 #--- Start of script ---
 
+func_set_python_env
 func_check_required_env || exit 1   # Cannot run, exit with error
 func_check_qpid_python || exit 1    # Cannot run, exit with error
 func_check_clustering               # Warning



More information about the rhmessaging-commits mailing list