qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kgiu...@apache.org
Subject svn commit: r1155095 - in /qpid/branches/qpid-3346/qpid/cpp/src: qpid/broker/ tests/
Date Mon, 08 Aug 2011 20:50:59 GMT
Author: kgiusti
Date: Mon Aug  8 20:50:59 2011
New Revision: 1155095

URL: http://svn.apache.org/viewvc?rev=1155095&view=rev
Log:
QPID-3346: incorporate review input

Modified:
    qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/DeliveryRecord.cpp
    qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/DeliveryRecord.h
    qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/LegacyLVQ.cpp
    qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/Queue.cpp
    qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/Queue.h
    qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/QueueEvents.cpp
    qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/QueueFlowLimit.cpp
    qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/QueueFlowLimit.h
    qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/QueueObserver.h
    qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/SemanticState.cpp
    qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/ThresholdAlerts.h
    qpid/branches/qpid-3346/qpid/cpp/src/tests/QueueTest.cpp

Modified: qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/DeliveryRecord.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/DeliveryRecord.cpp?rev=1155095&r1=1155094&r2=1155095&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/DeliveryRecord.cpp (original)
+++ qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/DeliveryRecord.cpp Mon Aug  8 20:50:59
2011
@@ -152,14 +152,9 @@ uint32_t DeliveryRecord::getCredit() con
     return credit;
 }
 
-void DeliveryRecord::acquire(SemanticState* const session, DeliveryIds& results) {
-    SemanticState::ConsumerImpl::shared_ptr consumer;
-
-    if (!session->find( tag, consumer )) {
-        QPID_LOG(error, "Can't acquire message " << id.getValue() << ": original
subscription no longer exists.");
-    }
-
-    if (queue->acquire(msg, consumer)) {
+void DeliveryRecord::acquire(DeliveryIds& results)
+{
+    if (queue->acquire(msg, tag)) {
         acquired = true;
         results.push_back(id);
         if (!acceptExpected) {

Modified: qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/DeliveryRecord.h
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/DeliveryRecord.h?rev=1155095&r1=1155094&r2=1155095&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/DeliveryRecord.h (original)
+++ qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/DeliveryRecord.h Mon Aug  8 20:50:59
2011
@@ -82,7 +82,7 @@ class DeliveryRecord
     void reject();
     void cancel(const std::string& tag);
     void redeliver(SemanticState* const);
-    void acquire(SemanticState* const, DeliveryIds& results);
+    void acquire(DeliveryIds& results);
     void complete();
     bool accept(TransactionContext* ctxt); // Returns isRedundant()
     bool setEnded();            // Returns isRedundant()
@@ -117,14 +117,13 @@ inline bool operator<(const DeliveryReco
 
 struct AcquireFunctor
 {
-    SemanticState* session;
     DeliveryIds& results;
 
-    AcquireFunctor(SemanticState* _session, DeliveryIds& _results) : session(_session),
results(_results) {}
+    AcquireFunctor(DeliveryIds& _results) : results(_results) {}
 
     void operator()(DeliveryRecord& record)
     {
-        record.acquire(session, results);
+        record.acquire(results);
     }
 };
 

Modified: qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/LegacyLVQ.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/LegacyLVQ.cpp?rev=1155095&r1=1155094&r2=1155095&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/LegacyLVQ.cpp (original)
+++ qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/LegacyLVQ.cpp Mon Aug  8 20:50:59 2011
@@ -35,9 +35,7 @@ void LegacyLVQ::setNoBrowse(bool b)
 bool LegacyLVQ::remove(const framing::SequenceNumber& position, QueuedMessage& message)
 {
     Ordering::iterator i = messages.find(position);
-    if (i != messages.end() &&
-        // @todo KAG: gsim? is a bug? message is a *return* value - we really shouldn't check
".payload" below:
-        i->second.payload == message.payload) {
+    if (i != messages.end() && i->second.payload == message.payload) {
         message = i->second;
         erase(i);
         return true;

Modified: qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/Queue.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/Queue.cpp?rev=1155095&r1=1155094&r2=1155095&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/Queue.cpp (original)
+++ qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/Queue.cpp Mon Aug  8 20:50:59 2011
@@ -92,19 +92,25 @@ const int ENQUEUE_AND_DEQUEUE=2;
 namespace qpid {
 namespace broker {
 
-class MessageSelector
+class MessageAllocator
 {
  protected:
     Queue *queue;
  public:
-    MessageSelector( Queue *q ) : queue(q) {}
-    virtual ~MessageSelector() {};
+    MessageAllocator( Queue *q ) : queue(q) {}
+    virtual ~MessageAllocator() {};
 
     // assumes caller holds messageLock
     virtual bool nextMessage( Consumer::shared_ptr c, QueuedMessage& next,
                               const Mutex::ScopedLock&);
-    virtual bool canAcquire(Consumer::shared_ptr consumer, const QueuedMessage& qm,
-                            const Mutex::ScopedLock&);
+    /** acquire a message previously browsed via nextMessage().  assume messageLock held
+     * @param consumer name of consumer that is attempting to acquire the message
+     * @param qm the message to be acquired
+     * @param messageLock - ensures caller is holding it!
+     * @returns true if acquire is successful, false if acquire failed.
+     */
+    virtual bool canAcquire( const std::string& consumer, const QueuedMessage& qm,
+                             const Mutex::ScopedLock&);
 };
 
 }}
@@ -134,7 +140,7 @@ Queue::Queue(const string& _name, bool _
     deleted(false),
     barrier(*this),
     autoDeleteTimeout(0),
-    selector(new MessageSelector( this ))   // KAG TODO: FIX!!
+    allocator(new MessageAllocator( this ))   // KAG TODO: FIX!!
 {
     if (parent != 0 && broker != 0) {
         ManagementAgent* agent = broker->getManagementAgent();
@@ -269,13 +275,13 @@ bool Queue::acquireMessageAt(const Seque
     }
 }
 
-bool Queue::acquire(const QueuedMessage& msg, Consumer::shared_ptr c)
+bool Queue::acquire(const QueuedMessage& msg, const std::string&  consumer)
 {
     Mutex::ScopedLock locker(messageLock);
     assertClusterSafe();
-    QPID_LOG(debug, c->getName() << " attempting to acquire message at " <<
msg.position);
+    QPID_LOG(debug, consumer << " attempting to acquire message at " << msg.position);
 
-    if (!selector->canAcquire( c, msg, locker )) {
+    if (!allocator->canAcquire( consumer, msg, locker )) {
         QPID_LOG(debug, "Not permitted to acquire msg at " << msg.position <<
" from '" << name);
         return false;
     }
@@ -327,7 +333,7 @@ Queue::ConsumeCode Queue::consumeNextMes
         Mutex::ScopedLock locker(messageLock);
         QueuedMessage msg;
 
-        if (!selector->nextMessage(c, msg, locker)) { // no next available
+        if (!allocator->nextMessage(c, msg, locker)) { // no next available
             QPID_LOG(debug, "No messages available to dispatch to consumer " <<
                      c->getName() << " on queue '" << name << "'");
             listeners.addListener(c);
@@ -346,8 +352,10 @@ Queue::ConsumeCode Queue::consumeNextMes
 
         if (c->filter(msg.payload)) {
             if (c->accept(msg.payload)) {
-                acquire( msg.position, m );
-                c->position = msg.position;
+                bool ok = acquire( msg.position, msg );
+                (void) ok; assert(ok);
+                m = msg;
+                c->position = m.position;
                 return CONSUMED;
             } else {
                 //message(s) are available but consumer hasn't got enough credit
@@ -369,7 +377,7 @@ bool Queue::browseNextMessage(QueuedMess
         Mutex::ScopedLock locker(messageLock);
         QueuedMessage msg;
 
-        if (!selector->nextMessage(c, msg, locker)) { // no next available
+        if (!allocator->nextMessage(c, msg, locker)) { // no next available
             QPID_LOG(debug, "No browsable messages available for consumer " <<
                      c->getName() << " on queue '" << name << "'");
             listeners.addListener(c);
@@ -484,7 +492,7 @@ QueuedMessage Queue::get(){
     Mutex::ScopedLock locker(messageLock);
     QueuedMessage msg(this);
     if (messages->pop(msg))
-        consumed( msg );
+        acquired( msg );
     return msg;
 }
 
@@ -520,7 +528,7 @@ void Queue::purgeExpired(qpid::sys::Dura
              i != expired.end(); ++i) {
             {
                 Mutex::ScopedLock locker(messageLock);
-                consumed( *i );   // expects messageLock held
+                acquired( *i );   // expects messageLock held
             }
             dequeue( 0, *i );
         }
@@ -596,7 +604,7 @@ void Queue::pop()
     assertClusterSafe();
     QueuedMessage msg;
     if (messages->pop(msg)) {
-        consumed( msg ); // mark it removed
+        acquired( msg ); // mark it removed
         ++dequeueSincePurge;
     }
 }
@@ -605,7 +613,7 @@ void Queue::pop()
 bool Queue::acquire(const qpid::framing::SequenceNumber& position, QueuedMessage&
msg )
 {
     if (messages->remove(position, msg)) {
-        consumed( msg );
+        acquired( msg );
         return true;
     }
     return false;
@@ -627,7 +635,7 @@ void Queue::push(boost::intrusive_ptr<Me
     }
     copy.notify();
     if (dequeueRequired) {
-        consumed( removed );  // tell observers
+        acquired( removed );  // tell observers
         if (isRecovery) {
             //can't issue new requests for the store until
             //recovery is complete
@@ -823,11 +831,11 @@ void Queue::dequeued(const QueuedMessage
 /** updates queue observers when a message has become unavailable for transfer,
  * expects messageLock to be held
  */
-void Queue::consumed(const QueuedMessage& msg)
+void Queue::acquired(const QueuedMessage& msg)
 {
     for (Observers::const_iterator i = observers.begin(); i != observers.end(); ++i) {
         try{
-            (*i)->consumed(msg);
+            (*i)->acquired(msg);
         } catch (const std::exception& e) {
             QPID_LOG(warning, "Exception on notification of message removal for queue " <<
getName() << ": " << e.what());
         }
@@ -1349,7 +1357,7 @@ void Queue::UsageBarrier::destroy()
 // KAG TBD: flesh out...
 
 
-class MessageGroupManager : public QueueObserver, public MessageSelector
+class MessageGroupManager : public QueueObserver, public MessageAllocator
 {
     const std::string groupIdHeader;    // msg header holding group identifier
     struct GroupState {
@@ -1366,7 +1374,7 @@ class MessageGroupManager : public Queue
  public:
 
     MessageGroupManager(const std::string& header, Queue *q )
-        : QueueObserver(), MessageSelector(q), groupIdHeader( header ) {}
+        : QueueObserver(), MessageAllocator(q), groupIdHeader( header ) {}
     void enqueued( const QueuedMessage& qm );
     void removed( const QueuedMessage& qm );
     void requeued( const QueuedMessage& qm );
@@ -1375,7 +1383,7 @@ class MessageGroupManager : public Queue
     void consumerRemoved( const Consumer& );
     bool nextMessage( Consumer::shared_ptr c, QueuedMessage& next,
                       const Mutex::ScopedLock&);
-    bool canAcquire(Consumer::shared_ptr consumer, const QueuedMessage& msg,
+    bool canAcquire(const std::string& consumer, const QueuedMessage& msg,
                     const Mutex::ScopedLock&);
 };
 
@@ -1469,11 +1477,11 @@ bool MessageGroupManager::nextMessage( C
                                        const Mutex::ScopedLock& l)
 {
     // KAG TODO: FIX!!!
-    return MessageSelector::nextMessage( c, next, l );
+    return MessageAllocator::nextMessage( c, next, l );
 }
 
 
-bool MessageGroupManager::canAcquire(Consumer::shared_ptr consumer, const QueuedMessage&
qm,
+bool MessageGroupManager::canAcquire(const std::string& consumer, const QueuedMessage&
qm,
                                      const Mutex::ScopedLock&)
 {
     std::string group( getGroupId(qm, groupIdHeader) );
@@ -1482,18 +1490,18 @@ bool MessageGroupManager::canAcquire(Con
     GroupState& state( gs->second );
 
     if (state.owner.empty()) {
-        state.owner = consumer->getName();
+        state.owner = consumer;
         return true;
     }
-    return state.owner == consumer->getName();
+    return state.owner == consumer;
 }
 
 
 
 
 
-// default selector - requires messageLock to be held by caller!
-bool MessageSelector::nextMessage( Consumer::shared_ptr c, QueuedMessage& next,
+// default allocator - requires messageLock to be held by caller!
+bool MessageAllocator::nextMessage( Consumer::shared_ptr c, QueuedMessage& next,
                                    const Mutex::ScopedLock& /*just to enforce locking*/)
 {
     Messages& messages(queue->getMessages());
@@ -1510,9 +1518,9 @@ bool MessageSelector::nextMessage( Consu
 }
 
 
-// default selector - requires messageLock to be held by caller!
-bool MessageSelector::canAcquire(Consumer::shared_ptr, const QueuedMessage&,
-                                 const Mutex::ScopedLock& /*just to enforce locking*/)
+// default allocator - requires messageLock to be held by caller!
+bool MessageAllocator::canAcquire(const std::string&, const QueuedMessage&,
+                                  const Mutex::ScopedLock& /*just to enforce locking*/)
 {
     return true;    // always give permission to acquire
 }

Modified: qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/Queue.h
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/Queue.h?rev=1155095&r1=1155094&r2=1155095&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/Queue.h (original)
+++ qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/Queue.h Mon Aug  8 20:50:59 2011
@@ -59,7 +59,7 @@ class MessageStore;
 class QueueEvents;
 class QueueRegistry;
 class TransactionContext;
-class MessageSelector;
+class MessageAllocator;
  
 /**
  * The brokers representation of an amqp queue. Messages are
@@ -129,7 +129,7 @@ class Queue : public boost::enable_share
     UsageBarrier barrier;
     int autoDeleteTimeout;
     boost::intrusive_ptr<qpid::sys::TimerTask> autoDeleteTask;
-    std::auto_ptr<MessageSelector> selector;
+    std::auto_ptr<MessageAllocator> allocator;
 
     void push(boost::intrusive_ptr<Message>& msg, bool isRecovery=false);
     void setPolicy(std::auto_ptr<QueuePolicy> policy);
@@ -144,7 +144,7 @@ class Queue : public boost::enable_share
 
     /** update queue observers with new message state */
     void enqueued(const QueuedMessage& msg);
-    void consumed(const QueuedMessage& msg);
+    void acquired(const QueuedMessage& msg);
     void dequeued(const QueuedMessage& msg);
 
     /** modify the Queue's message container - assumes messageLock held */
@@ -204,7 +204,7 @@ class Queue : public boost::enable_share
      * @param msg - message to be acquired.
      * @return false if message is no longer available for acquire.
      */
-    QPID_BROKER_EXTERN bool acquire(const QueuedMessage& msg, const Consumer::shared_ptr
c);
+    QPID_BROKER_EXTERN bool acquire(const QueuedMessage& msg, const std::string&
consumer);
 
     /**
      * Used to configure a new queue and create a persistent record

Modified: qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/QueueEvents.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/QueueEvents.cpp?rev=1155095&r1=1155094&r2=1155095&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/QueueEvents.cpp (original)
+++ qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/QueueEvents.cpp Mon Aug  8 20:50:59 2011
@@ -130,7 +130,7 @@ class EventGenerator : public QueueObser
         if (!enqueueOnly) manager.dequeued(m);
     }
 
-    void consumed(const QueuedMessage&) {};
+    void acquired(const QueuedMessage&) {};
     void requeued(const QueuedMessage&) {};
 
   private:

Modified: qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/QueueFlowLimit.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/QueueFlowLimit.cpp?rev=1155095&r1=1155094&r2=1155095&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/QueueFlowLimit.cpp (original)
+++ qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/QueueFlowLimit.cpp Mon Aug  8 20:50:59
2011
@@ -378,11 +378,11 @@ void QueueFlowLimit::setState(const qpid
             fcmsg.add(first, last);
             for (SequenceNumber seq = first; seq <= last; ++seq) {
                 QueuedMessage msg;
-                bool found = queue->find(seq, msg);   // fyi: msg.payload may be null
if msg is delivered & unacked
-                (void) found; assert(found);    // avoid unused variable warning when NDEBUG
set
+                queue->find(seq, msg);   // fyi: may not be found if msg is acquired &
unacked
                 bool unique;
                 unique = index.insert(std::pair<framing::SequenceNumber, boost::intrusive_ptr<Message>
>(seq, msg.payload)).second;
-                (void) unique; assert(unique);  // ditto NDEBUG warning
+                // Like this to avoid tripping up unused variable warning when NDEBUG set
+                if (!unique) assert(unique);
             }
         }
     }

Modified: qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/QueueFlowLimit.h
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/QueueFlowLimit.h?rev=1155095&r1=1155094&r2=1155095&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/QueueFlowLimit.h (original)
+++ qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/QueueFlowLimit.h Mon Aug  8 20:50:59
2011
@@ -85,7 +85,7 @@ class Broker;
     /** the queue has removed QueuedMessage.  Returns true if flow state changes */
     QPID_BROKER_EXTERN void dequeued(const QueuedMessage&);
     /** ignored */
-    QPID_BROKER_EXTERN void consumed(const QueuedMessage&) {};
+    QPID_BROKER_EXTERN void acquired(const QueuedMessage&) {};
     QPID_BROKER_EXTERN void requeued(const QueuedMessage&) {};
 
     /** for clustering: */

Modified: qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/QueueObserver.h
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/QueueObserver.h?rev=1155095&r1=1155094&r2=1155095&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/QueueObserver.h (original)
+++ qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/QueueObserver.h Mon Aug  8 20:50:59 2011
@@ -45,7 +45,7 @@ class Consumer;
  * "Enqueued" - the message is "Available" - on the queue for transfer to any consumer
  * (e.g. browse or acquire)
  *
- * "Consumed" - the message is "Locked" - a consumer has claimed exclusive access to it.
+ * "Acquired" - the message is "Locked" - a consumer has claimed exclusive access to it.
  * It is no longer available for other consumers to browse or acquire, but it is not yet
  * considered dequeued as it may be requeued by the consumer.
  *
@@ -62,9 +62,9 @@ class QueueObserver
 
     // note: the Queue will hold the messageLock while calling these methods!
     virtual void enqueued(const QueuedMessage&) = 0;
-    virtual void consumed(const QueuedMessage&) = 0;
-    virtual void requeued(const QueuedMessage&) = 0;
     virtual void dequeued(const QueuedMessage&) = 0;
+    virtual void acquired(const QueuedMessage&) = 0;
+    virtual void requeued(const QueuedMessage&) = 0;
     virtual void consumerAdded( const Consumer& ) {};
     virtual void consumerRemoved( const Consumer& ) {};
  private:

Modified: qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/SemanticState.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/SemanticState.cpp?rev=1155095&r1=1155094&r2=1155095&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/SemanticState.cpp (original)
+++ qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/SemanticState.cpp Mon Aug  8 20:50:59
2011
@@ -691,7 +691,7 @@ AckRange SemanticState::findRange(Delive
 void SemanticState::acquire(DeliveryId first, DeliveryId last, DeliveryIds& acquired)
 {
     AckRange range = findRange(first, last);
-    for_each(range.start, range.end, AcquireFunctor(this, acquired));
+    for_each(range.start, range.end, AcquireFunctor(acquired));
 }
 
 void SemanticState::release(DeliveryId first, DeliveryId last, bool setRedelivered)

Modified: qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/ThresholdAlerts.h
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/ThresholdAlerts.h?rev=1155095&r1=1155094&r2=1155095&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/ThresholdAlerts.h (original)
+++ qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/ThresholdAlerts.h Mon Aug  8 20:50:59
2011
@@ -50,7 +50,7 @@ class ThresholdAlerts : public QueueObse
                     const long repeatInterval);
     void enqueued(const QueuedMessage&);
     void dequeued(const QueuedMessage&);
-    void consumed(const QueuedMessage&) {};
+    void acquired(const QueuedMessage&) {};
     void requeued(const QueuedMessage&) {};
 
     static void observe(Queue& queue, qpid::management::ManagementAgent& agent,

Modified: qpid/branches/qpid-3346/qpid/cpp/src/tests/QueueTest.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/src/tests/QueueTest.cpp?rev=1155095&r1=1155094&r2=1155095&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/src/tests/QueueTest.cpp (original)
+++ qpid/branches/qpid-3346/qpid/cpp/src/tests/QueueTest.cpp Mon Aug  8 20:50:59 2011
@@ -331,7 +331,7 @@ QPID_AUTO_TEST_CASE(testSearch){
 
     BOOST_CHECK_EQUAL(seq.getValue(), qm.position.getValue());
 
-    queue->acquire(qm, c1);
+    queue->acquire(qm, c1->getName());
     BOOST_CHECK_EQUAL(queue->getMessageCount(), 2u);
     SequenceNumber seq1(3);
     QueuedMessage qm1;
@@ -557,11 +557,11 @@ QPID_AUTO_TEST_CASE(testLVQAcquire){
     QueuedMessage qmsg3(queue.get(), 0, sequence1);
     TestConsumer::shared_ptr dummy(new TestConsumer());
 
-    BOOST_CHECK(!queue->acquire(qmsg, dummy));
-    BOOST_CHECK(queue->acquire(qmsg2, dummy));
+    BOOST_CHECK(!queue->acquire(qmsg, dummy->getName()));
+    BOOST_CHECK(queue->acquire(qmsg2, dummy->getName()));
     // Acquire the massage again to test failure case.
-    BOOST_CHECK(!queue->acquire(qmsg2, dummy));
-    BOOST_CHECK(!queue->acquire(qmsg3, dummy));
+    BOOST_CHECK(!queue->acquire(qmsg2, dummy->getName()));
+    BOOST_CHECK(!queue->acquire(qmsg3, dummy->getName()));
 
     BOOST_CHECK_EQUAL(queue->getMessageCount(), 2u);
 



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message