Author: gordonsim
Date: 2008-09-22 11:29:40 -0400 (Mon, 22 Sep 2008)
New Revision: 2517
Modified:
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:
Changes for tests to match with signature changes in qpids Queue.h
Modified: store/trunk/cpp/tests/OrderingTest.cpp
===================================================================
--- store/trunk/cpp/tests/OrderingTest.cpp 2008-09-22 11:36:16 UTC (rev 2516)
+++ store/trunk/cpp/tests/OrderingTest.cpp 2008-09-22 15:29:40 UTC (rev 2517)
@@ -79,7 +79,9 @@
{
boost::intrusive_ptr<Message> msg = queue->get().payload;
if (msg) {
- queue->dequeue(0, msg);
+ QueuedMessage qm;
+ qm.payload = msg;
+ queue->dequeue(0, qm);
BOOST_CHECK_EQUAL(ids.front(),
msg->getProperties<MessageProperties>()->getMessageId());
ids.pop();
return true;
Modified: store/trunk/cpp/tests/SimpleTest.cpp
===================================================================
--- store/trunk/cpp/tests/SimpleTest.cpp 2008-09-22 11:36:16 UTC (rev 2516)
+++ store/trunk/cpp/tests/SimpleTest.cpp 2008-09-22 15:29:40 UTC (rev 2517)
@@ -196,7 +196,7 @@
{
cout << test_filename << ".QueueCreateWithSettings: " <<
flush;
- QueuePolicy policy(101, 202);
+ std::auto_ptr<QueuePolicy> policy( QueuePolicy::createQueuePolicy(101, 202));
string name("MyDurableQueue");
{
MessageStoreImpl store;
@@ -204,7 +204,7 @@
store.truncate();//make sure it is empty to begin with
Queue queue(name, 0, &store, 0);
FieldTable settings;
- policy.update(settings);
+ policy->update(settings);
queue.create(settings);
BOOST_REQUIRE(queue.getPersistenceId());
}//db will be closed
@@ -217,8 +217,8 @@
Queue::shared_ptr queue = registry.find(name);
BOOST_REQUIRE(queue);
BOOST_REQUIRE(queue->getPolicy());
- BOOST_CHECK_EQUAL(policy.getMaxCount(),
queue->getPolicy()->getMaxCount());
- BOOST_CHECK_EQUAL(policy.getMaxSize(), queue->getPolicy()->getMaxSize());
+ BOOST_CHECK_EQUAL(policy->getMaxCount(),
queue->getPolicy()->getMaxCount());
+ BOOST_CHECK_EQUAL(policy->getMaxSize(),
queue->getPolicy()->getMaxSize());
}
cout << "ok" << endl;
@@ -335,8 +335,10 @@
MessageUtils::addContent(msg, data);
msg->getProperties<DeliveryProperties>()->setDeliveryMode(PERSISTENT);
+ QueuedMessage qm;
+ qm.payload = msg;
queue->enqueue(0, msg);
- queue->dequeue(0, msg);
+ queue->dequeue(0, qm);
}//db will be closed
{
MessageStoreImpl store;
@@ -434,8 +436,8 @@
//load lazily
DummyHandler handler;
- QueuedMessage qm(queue.get(),msg,0);
- MessageDelivery::deliver(qm, handler, 0,
MessageDelivery::getMessageDeliveryToken("ignore", 0, 0), 20);//52 chars of
data, i.e. 2 chunks of 20 and one of 12
+ QueuedMessage qm(queue.get(),msg,0);
+ MessageDelivery::deliver(qm, handler, 0,
MessageDelivery::getMessageDeliveryToken("ignore", 0, 0), 20);//52 chars of
data, i.e. 2 chunks of 20 and one of 12
BOOST_REQUIRE(handler.frames.size() > 2);
string loaded;
@@ -447,7 +449,7 @@
BOOST_CHECK_EQUAL(data1 + data2, loaded);
//dequeue
- queue->dequeue(0, msg);
+ queue->dequeue(0, qm);
}
cout << "ok" << endl;
Modified: store/trunk/cpp/tests/TransactionalTest.cpp
===================================================================
--- store/trunk/cpp/tests/TransactionalTest.cpp 2008-09-22 11:36:16 UTC (rev 2516)
+++ store/trunk/cpp/tests/TransactionalTest.cpp 2008-09-22 15:29:40 UTC (rev 2517)
@@ -170,7 +170,9 @@
//move the message from one queue to the other as a transaction
std::auto_ptr<TransactionContext> txn = store->begin();
queueB->enqueue(txn.get(), msgB);//note: need to enqueue it first to avoid message
being deleted
- queueA->dequeue(txn.get(), msgB);
+ QueuedMessage qmB;
+ qmB.payload = msgB;
+ queueA->dequeue(txn.get(), qmB);
if (commit) {
store->commit(*txn);
} else {
Modified: store/trunk/cpp/tests/TwoPhaseCommitTest.cpp
===================================================================
--- store/trunk/cpp/tests/TwoPhaseCommitTest.cpp 2008-09-22 11:36:16 UTC (rev 2516)
+++ store/trunk/cpp/tests/TwoPhaseCommitTest.cpp 2008-09-22 15:29:40 UTC (rev 2517)
@@ -282,16 +282,16 @@
void swap(TPCTransactionContext* txn, Queue::shared_ptr& from,
Queue::shared_ptr& to)
{
- msg1 = from->get().payload;//just dequeues in memory
+ QueuedMessage msg1 = from->get();//just dequeues in memory
//move the message from one queue to the other as part of a
//distributed transaction
- to->enqueue(txn, msg1);//note: need to enqueue it first to avoid message being
deleted
+ to->enqueue(txn, msg1.payload);//note: need to enqueue it first to avoid
message being deleted
from->dequeue(txn, msg1);
}
void dequeue(TPCTransactionContext* txn, Queue::shared_ptr& queue)
{
- msg2 = queue->get().payload;//just dequeues in memory
+ QueuedMessage msg2 = queue->get();//just dequeues in memory
queue->dequeue(txn, msg2);
}
Modified: store/trunk/cpp/tests/python_tests/flow_to_disk.py
===================================================================
--- store/trunk/cpp/tests/python_tests/flow_to_disk.py 2008-09-22 11:36:16 UTC (rev 2516)
+++ store/trunk/cpp/tests/python_tests/flow_to_disk.py 2008-09-22 15:29:40 UTC (rev 2517)
@@ -26,35 +26,35 @@
"""Tests for async store flow-to-disk"""
def test_01_simple_max_count_transient(self):
- queue_args = {'qpid.max_count': 10}
+ queue_args = {'qpid.policy_type':'flow_to_disk',
'qpid.max_count': 10}
self.simple_limit("test_simple_max_count_transient", queue_args,
self.session.delivery_mode.non_persistent, self.session.acquire_mode.pre_acquired)
def test_02_simple_max_count_persistent(self):
- queue_args = {'qpid.max_count': 10}
+ queue_args = {'qpid.policy_type':'flow_to_disk',
'qpid.max_count': 10}
self.simple_limit("test_simple_max_count_persistent", queue_args,
self.session.delivery_mode.persistent, self.session.acquire_mode.pre_acquired)
def test_03_simple_max_size_transient(self):
- queue_args = {'qpid.max_size': 100}
+ queue_args = {'qpid.policy_type':'flow_to_disk',
'qpid.max_size': 100}
self.simple_limit("test_simple_max_size_transient", queue_args,
self.session.delivery_mode.non_persistent, self.session.acquire_mode.pre_acquired)
def test_04_simple_max_size_persistent(self):
- queue_args = {'qpid.max_size': 100}
+ queue_args = {'qpid.policy_type':'flow_to_disk',
'qpid.max_size': 100}
self.simple_limit("test_simple_max_size_persistent", queue_args,
self.session.delivery_mode.persistent, self.session.acquire_mode.pre_acquired)
def test_05_simple_max_count_transient_not_acquired(self):
- queue_args = {'qpid.max_count': 10}
+ queue_args = {'qpid.policy_type':'flow_to_disk',
'qpid.max_count': 10}
self.simple_limit("test_simple_max_count_transient_not_acquired",
queue_args, self.session.delivery_mode.non_persistent,
self.session.acquire_mode.not_acquired)
def test_06_simple_max_count_persistent_not_acquired(self):
- queue_args = {'qpid.max_count': 10}
+ queue_args = {'qpid.policy_type':'flow_to_disk',
'qpid.max_count': 10}
self.simple_limit("test_simple_max_count_persistent_not_acquired",
queue_args, self.session.delivery_mode.persistent,
self.session.acquire_mode.not_acquired)
def test_07_simple_max_size_transient_not_acquired(self):
- queue_args = {'qpid.max_size': 100}
+ queue_args = {'qpid.policy_type':'flow_to_disk',
'qpid.max_size': 100}
self.simple_limit("test_simple_max_size_transient_not_acquired",
queue_args, self.session.delivery_mode.non_persistent,
self.session.acquire_mode.not_acquired)
def test_08_simple_max_size_persistent_not_acquired(self):
- queue_args = {'qpid.max_size': 100}
+ queue_args = {'qpid.policy_type':'flow_to_disk',
'qpid.max_size': 100}
self.simple_limit("test_simple_max_size_persistent_not_acquired",
queue_args, self.session.delivery_mode.persistent,
self.session.acquire_mode.not_acquired)
def simple_limit(self, queue_name, queue_args, delivery_mode, acquire_mode):
@@ -102,19 +102,19 @@
def test_09_max_count_browse_consume_transient(self):
- queue_args = {'qpid.max_count': 10}
+ queue_args = {'qpid.policy_type':'flow_to_disk',
'qpid.max_count': 10}
self.not_acquired_browse_consume_limit("test_max_count_browse_consume_transient",
queue_args, self.session.delivery_mode.non_persistent)
def test_10_max_count_browse_consume_persistent(self):
- queue_args = {'qpid.max_count': 10}
+ queue_args = {'qpid.policy_type':'flow_to_disk',
'qpid.max_count': 10}
self.not_acquired_browse_consume_limit("test_max_count_browse_consume_persistent",
queue_args, self.session.delivery_mode.persistent)
def test_11_max_size_browse_consume_transient(self):
- queue_args = {'qpid.max_size': 100}
+ queue_args = {'qpid.policy_type':'flow_to_disk',
'qpid.max_size': 100}
self.not_acquired_browse_consume_limit("test_max_size_browse_consume_transient",
queue_args, self.session.delivery_mode.non_persistent)
def test_12_max_size_browse_consume_persistent(self):
- queue_args = {'qpid.max_size': 100}
+ queue_args = {'qpid.policy_type':'flow_to_disk',
'qpid.max_size': 100}
self.not_acquired_browse_consume_limit("test_max_size_browse_consume_persistent",
queue_args, self.session.delivery_mode.persistent)