qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From astitc...@apache.org
Subject svn commit: r1530300 - in /qpid/trunk/qpid/cpp/src: ./ tests/legacystore/
Date Tue, 08 Oct 2013 15:08:45 GMT
Author: astitcher
Date: Tue Oct  8 15:08:44 2013
New Revision: 1530300

URL: http://svn.apache.org/r1530300
Log:
QPID-4582: Get legacystore unit tests working

Removed:
    qpid/trunk/qpid/cpp/src/tests/legacystore/run_test
Modified:
    qpid/trunk/qpid/cpp/src/CMakeLists.txt
    qpid/trunk/qpid/cpp/src/legacystore.cmake
    qpid/trunk/qpid/cpp/src/tests/legacystore/CMakeLists.txt
    qpid/trunk/qpid/cpp/src/tests/legacystore/OrderingTest.cpp
    qpid/trunk/qpid/cpp/src/tests/legacystore/SimpleTest.cpp
    qpid/trunk/qpid/cpp/src/tests/legacystore/TransactionalTest.cpp
    qpid/trunk/qpid/cpp/src/tests/legacystore/TwoPhaseCommitTest.cpp

Modified: qpid/trunk/qpid/cpp/src/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/CMakeLists.txt?rev=1530300&r1=1530299&r2=1530300&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/CMakeLists.txt (original)
+++ qpid/trunk/qpid/cpp/src/CMakeLists.txt Tue Oct  8 15:08:44 2013
@@ -1513,6 +1513,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DI
                ${CMAKE_CURRENT_BINARY_DIR}/config.h)
 add_subdirectory(qpid/store)
 add_subdirectory(tests)
+add_subdirectory(tests/legacystore)
 
 # Support for pkg-config
 

Modified: qpid/trunk/qpid/cpp/src/legacystore.cmake
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/legacystore.cmake?rev=1530300&r1=1530299&r2=1530300&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/legacystore.cmake (original)
+++ qpid/trunk/qpid/cpp/src/legacystore.cmake Tue Oct  8 15:08:44 2013
@@ -152,6 +152,26 @@ if (BUILD_LEGACYSTORE)
         ${DB_LIBRARY}
     )
 
+    # For use in the store tests only
+    add_library (legacystore_shared SHARED
+        ${legacy_jrnl_SOURCES}
+        ${legacy_store_SOURCES}
+        ${legacy_qmf_SOURCES}
+    )
+
+    set_target_properties (legacystore_shared PROPERTIES
+        COMPILE_DEFINITIONS _IN_QPID_BROKER
+        INCLUDE_DIRECTORIES "${legacy_include_DIRECTORIES}"
+    )
+
+    target_link_libraries (legacystore_shared
+        aio
+        uuid
+        qpidcommon qpidtypes qpidbroker
+        ${Boost_PROGRAM_OPTIONS_LIBRARY}
+        ${DB_LIBRARY}
+    )
+
 install(TARGETS legacystore
         DESTINATION ${QPIDD_MODULE_DIR}
         COMPONENT ${QPID_COMPONENT_BROKER})

Modified: qpid/trunk/qpid/cpp/src/tests/legacystore/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/legacystore/CMakeLists.txt?rev=1530300&r1=1530299&r2=1530300&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/legacystore/CMakeLists.txt (original)
+++ qpid/trunk/qpid/cpp/src/tests/legacystore/CMakeLists.txt Tue Oct  8 15:08:44 2013
@@ -70,36 +70,28 @@ set (qpid_test_boost_libs
 # womp on each other's store directory.
 
 #
-# define_selftest
+# define_legacystore_test
 # macro to accept the name of a single source file and to create a
 #  unit test executable that runs the source.
 #
-MACRO (define_selftest theSourceFile)
+MACRO (define_legacystore_test theSourceFile)
 add_executable (legacystore_${theSourceFile}
-            unit_test
             ${theSourceFile}
+            unit_test
             ${platform_test_additions})
 target_link_libraries (legacystore_${theSourceFile}
                        ${qpid_test_boost_libs}
-                       qpidmessaging qpidbroker qmfconsole legacystore)
-get_property(ls_include TARGET legacystore_${theSourceFile} PROPERTY INCLUDE_DIRECTORIES)
-list(APPEND  ls_include ${abs_top_srcdir}/src/qpid/legacystore)
-list(APPEND  ls_include ${abs_top_srcdir}/src/tests)
-set_target_properties (legacystore_${theSourceFile} PROPERTIES
-            INCLUDE_DIRECTORIES "${ls_include}"
-            COMPILE_DEFINITIONS _IN_QPID_BROKER)
+                       qpidmessaging qpidtypes qpidbroker qpidcommon legacystore_shared)
+set_target_properties (legacystore_${theSourceFile} PROPERTIES COMPILE_DEFINITIONS _IN_QPID_BROKER)
 remember_location(legacystore_${theSourceFile})
-set(test_wrap ${shell} ${CMAKE_CURRENT_SOURCE_DIR}/run_test${test_script_suffix})
 
 add_test (legacystore_${theSourceFile} ${test_wrap} ${legacystore_${theSourceFile}_LOCATION})
-ENDMACRO (define_selftest)
-
-# add_definitions(-H)
+ENDMACRO (define_legacystore_test)
 
-define_selftest (SimpleTest)
-define_selftest (OrderingTest)
-define_selftest (TransactionalTest)
-define_selftest (TwoPhaseCommitTest)
+define_legacystore_test (SimpleTest)
+define_legacystore_test (OrderingTest)
+define_legacystore_test (TransactionalTest)
+define_legacystore_test (TwoPhaseCommitTest)
 
 #
 # Other test programs

Modified: qpid/trunk/qpid/cpp/src/tests/legacystore/OrderingTest.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/legacystore/OrderingTest.cpp?rev=1530300&r1=1530299&r2=1530300&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/legacystore/OrderingTest.cpp (original)
+++ qpid/trunk/qpid/cpp/src/tests/legacystore/OrderingTest.cpp Tue Oct  8 15:08:44 2013
@@ -20,16 +20,18 @@
  */
 
 #include "unit_test.h"
+#include "MessageUtils.h"
 
+#include "qpid/broker/Queue.h"
+#include "qpid/broker/RecoveryManagerImpl.h"
+#include "qpid/broker/PersistableObject.h"
+#include "qpid/framing/AMQHeaderBody.h"
 #include "qpid/legacystore/MessageStoreImpl.h"
-#include <iostream>
-#include "MessageUtils.h"
-#include <qpid/broker/Queue.h>
-#include <qpid/broker/RecoveryManagerImpl.h>
-#include <qpid/framing/AMQHeaderBody.h>
 #include "qpid/log/Logger.h"
 #include "qpid/sys/Timer.h"
 
+#include <iostream>
+
 using namespace qpid;
 using namespace qpid::broker;
 using namespace qpid::framing;
@@ -48,7 +50,7 @@ QPID_AUTO_TEST_SUITE(OrderingTest)
 
 const std::string test_filename("OrderingTest");
 const char* tdp = getenv("TMP_DATA_DIR");
-const std::string test_dir(tdp && strlen(tdp) > 0 ? tdp : "/tmp/OrderingTest");
+const std::string test_dir(tdp && strlen(tdp) > 0 ? tdp : "/var/tmp/OrderingTest");
 
 // === Helper fns ===
 
@@ -118,7 +120,8 @@ void restart()
     sys::Timer t;
     DtxManager mgr(t);
     mgr.setStore (store.get());
-    RecoveryManagerImpl recoveryMgr(queues, exchanges, links, mgr, br.getProtocolRegistry());
+    RecoveredObjects ro;
+    RecoveryManagerImpl recoveryMgr(queues, exchanges, links, mgr, br.getProtocolRegistry(),
ro);
     store->recover(recoveryMgr);
 
     queue = queues.find(name);

Modified: qpid/trunk/qpid/cpp/src/tests/legacystore/SimpleTest.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/legacystore/SimpleTest.cpp?rev=1530300&r1=1530299&r2=1530300&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/legacystore/SimpleTest.cpp (original)
+++ qpid/trunk/qpid/cpp/src/tests/legacystore/SimpleTest.cpp Tue Oct  8 15:08:44 2013
@@ -20,21 +20,23 @@
  */
 
 #include "unit_test.h"
+#include "MessageUtils.h"
 
+#include "qpid/broker/DirectExchange.h"
+#include "qpid/broker/Queue.h"
+#include "qpid/broker/QueueSettings.h"
+#include "qpid/broker/RecoveryManagerImpl.h"
+#include "qpid/broker/PersistableObject.h"
+#include "qpid/framing/AMQHeaderBody.h"
+#include "qpid/framing/FieldTable.h"
+#include "qpid/framing/FieldValue.h"
 #include "qpid/legacystore/MessageStoreImpl.h"
-#include <iostream>
-#include "tests/legacystore/MessageUtils.h"
 #include "qpid/legacystore/StoreException.h"
-#include "qpid/broker/DirectExchange.h"
-#include <qpid/broker/Queue.h>
-#include <qpid/broker/QueueSettings.h>
-#include <qpid/broker/RecoveryManagerImpl.h>
-#include <qpid/framing/AMQHeaderBody.h>
-#include <qpid/framing/FieldTable.h>
-#include <qpid/framing/FieldValue.h>
 #include "qpid/log/Logger.h"
 #include "qpid/sys/Timer.h"
 
+#include <iostream>
+
 qpid::broker::Broker::Options opts;
 qpid::broker::Broker br(opts);
 
@@ -57,15 +59,15 @@ QPID_AUTO_TEST_SUITE(SimpleTest)
 
 const string test_filename("SimpleTest");
 const char* tdp = getenv("TMP_DATA_DIR");
-const string test_dir(tdp && strlen(tdp) > 0 ? tdp : "/tmp/SimpleTest");
+const string test_dir(tdp && strlen(tdp) > 0 ? tdp : "/var/tmp/SimpleTest");
 
 // === Helper fns ===
 
-struct DummyHandler : OutputHandler
+struct DummyHandler : FrameHandler
 {
     std::vector<AMQFrame> frames;
 
-    virtual void send(AMQFrame& frame){
+    virtual void handle(AMQFrame& frame){
         frames.push_back(frame);
     }
 };
@@ -75,7 +77,8 @@ void recover(MessageStoreImpl& store, Qu
     sys::Timer t;
     DtxManager mgr(t);
     mgr.setStore (&store);
-    RecoveryManagerImpl recovery(queues, exchanges, links, mgr, br.getProtocolRegistry());
+    RecoveredObjects ro;
+    RecoveryManagerImpl recovery(queues, exchanges, links, mgr, br.getProtocolRegistry(),
ro);
     store.recover(recovery);
 }
 
@@ -307,7 +310,7 @@ QPID_AUTO_TEST_CASE(Enqueue)
         BOOST_CHECK_EQUAL(routingKey, msg.getRoutingKey());
         BOOST_CHECK_EQUAL(messageId, MessageUtils::getMessageId(msg));
         BOOST_CHECK_EQUAL(std::string("xyz"), msg.getAnnotation("abc"));
-        BOOST_CHECK_EQUAL((u_int64_t) 14, msg.getContentSize());
+        BOOST_CHECK_EQUAL((u_int64_t) 14, msg.getContent().size());
 
         DummyHandler handler;
         MessageUtils::deliver(msg, handler, 100);

Modified: qpid/trunk/qpid/cpp/src/tests/legacystore/TransactionalTest.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/legacystore/TransactionalTest.cpp?rev=1530300&r1=1530299&r2=1530300&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/legacystore/TransactionalTest.cpp (original)
+++ qpid/trunk/qpid/cpp/src/tests/legacystore/TransactionalTest.cpp Tue Oct  8 15:08:44 2013
@@ -20,18 +20,20 @@
  */
 
 #include "unit_test.h"
-
-#include "qpid/legacystore/MessageStoreImpl.h"
-#include <iostream>
 #include "MessageUtils.h"
-#include "qpid/legacystore/StoreException.h"
+
 #include "qpid/broker/Queue.h"
 #include "qpid/broker/RecoveryManagerImpl.h"
+#include "qpid/broker/PersistableObject.h"
 #include "qpid/framing/AMQHeaderBody.h"
+#include "qpid/legacystore/MessageStoreImpl.h"
+#include "qpid/legacystore/StoreException.h"
 #include "qpid/log/Statement.h"
 #include "qpid/log/Logger.h"
 #include "qpid/sys/Timer.h"
 
+#include <iostream>
+
 using namespace mrg::msgstore;
 using namespace qpid;
 using namespace qpid::broker;
@@ -53,7 +55,7 @@ QPID_AUTO_TEST_SUITE(TransactionalTest)
 
 const string test_filename("TransactionalTest");
 const char* tdp = getenv("TMP_DATA_DIR");
-const string test_dir(tdp && strlen(tdp) > 0 ? tdp : "/tmp/TransactionalTest");
+const string test_dir(tdp && strlen(tdp) > 0 ? tdp : "/var/tmp/TransactionalTest");
 
 // Test txn context which has special setCompleteFailure() method which prevents entire "txn
complete" process from hapenning
 class TestTxnCtxt : public TxnCtxt
@@ -141,7 +143,8 @@ void restart()
     sys::Timer t;
     DtxManager mgr(t);
     mgr.setStore (store.get());
-    RecoveryManagerImpl recovery(*queues, exchanges, links, mgr, br.getProtocolRegistry());
+    RecoveredObjects ro;
+    RecoveryManagerImpl recovery(*queues, exchanges, links, mgr, br.getProtocolRegistry(),
ro);
     store->recover(recovery);
 
     queueA = queues->find(nameA);

Modified: qpid/trunk/qpid/cpp/src/tests/legacystore/TwoPhaseCommitTest.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/legacystore/TwoPhaseCommitTest.cpp?rev=1530300&r1=1530299&r2=1530300&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/legacystore/TwoPhaseCommitTest.cpp (original)
+++ qpid/trunk/qpid/cpp/src/tests/legacystore/TwoPhaseCommitTest.cpp Tue Oct  8 15:08:44 2013
@@ -20,18 +20,20 @@
  */
 
 #include "unit_test.h"
-
-#include "qpid/legacystore/MessageStoreImpl.h"
-#include <iostream>
 #include "MessageUtils.h"
+
 #include "qpid/broker/Queue.h"
 #include "qpid/broker/RecoveryManagerImpl.h"
+#include "qpid/broker/PersistableObject.h"
 #include "qpid/framing/AMQHeaderBody.h"
-#include "qpid/log/Statement.h"
+#include "qpid/legacystore/MessageStoreImpl.h"
 #include "qpid/legacystore/TxnCtxt.h"
 #include "qpid/log/Logger.h"
+#include "qpid/log/Statement.h"
 #include "qpid/sys/Timer.h"
 
+#include <iostream>
+
 using namespace mrg::msgstore;
 using namespace qpid;
 using namespace qpid::broker;
@@ -54,7 +56,7 @@ QPID_AUTO_TEST_SUITE(TwoPhaseCommitTest)
 
 const string test_filename("TwoPhaseCommitTest");
 const char* tdp = getenv("TMP_DATA_DIR");
-string test_dir(tdp && strlen(tdp) > 0 ? tdp : "/tmp/TwoPhaseCommitTest");
+string test_dir(tdp && strlen(tdp) > 0 ? tdp : "/var/tmp/TwoPhaseCommitTest");
 
 // === Helper fns ===
 
@@ -386,7 +388,8 @@ class TwoPhaseCommitTest
         links = std::auto_ptr<LinkRegistry>(new LinkRegistry);
         dtxmgr = std::auto_ptr<DtxManager>(new DtxManager(t));
         dtxmgr->setStore (store.get());
-        RecoveryManagerImpl recovery(*queues, exchanges, *links, *dtxmgr, br.getProtocolRegistry());
+        RecoveredObjects ro;
+        RecoveryManagerImpl recovery(*queues, exchanges, *links, *dtxmgr, br.getProtocolRegistry(),
ro);
         store->recover(recovery);
 
         queueA = queues->find(nameA);



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message