summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/tests
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2010-03-29 19:21:26 +0000
committerGordon Sim <gsim@apache.org>2010-03-29 19:21:26 +0000
commitbeb68a5d1b8d74f4c53299c81911a3ad85011f17 (patch)
tree2d444776e69aed493d522d3efb90990570f42f0d /qpid/cpp/src/tests
parent3d990371a345d1760cebd7dc0e47365034cfe2d4 (diff)
downloadqpid-python-beb68a5d1b8d74f4c53299c81911a3ad85011f17.tar.gz
QPID-664: renamed headers as properties (to match python); added priority
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@928878 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests')
-rw-r--r--qpid/cpp/src/tests/ClientMessage.cpp4
-rw-r--r--qpid/cpp/src/tests/MessagingSessionTests.cpp4
-rw-r--r--qpid/cpp/src/tests/qpid_recv.cpp6
-rw-r--r--qpid/cpp/src/tests/qpid_send.cpp8
-rw-r--r--qpid/cpp/src/tests/qpid_stream.cpp4
5 files changed, 13 insertions, 13 deletions
diff --git a/qpid/cpp/src/tests/ClientMessage.cpp b/qpid/cpp/src/tests/ClientMessage.cpp
index ab1cf9d102..994c46552c 100644
--- a/qpid/cpp/src/tests/ClientMessage.cpp
+++ b/qpid/cpp/src/tests/ClientMessage.cpp
@@ -34,11 +34,11 @@ QPID_AUTO_TEST_CASE(testCopyConstructor)
{
Message m("my-data");
m.setSubject("my-subject");
- m.getHeaders()["a"] = "ABC";
+ m.getProperties()["a"] = "ABC";
Message c(m);
BOOST_CHECK_EQUAL(m.getContent(), c.getContent());
BOOST_CHECK_EQUAL(m.getSubject(), c.getSubject());
- BOOST_CHECK_EQUAL(m.getHeaders()["a"], c.getHeaders()["a"]);
+ BOOST_CHECK_EQUAL(m.getProperties()["a"], c.getProperties()["a"]);
}
QPID_AUTO_TEST_SUITE_END()
diff --git a/qpid/cpp/src/tests/MessagingSessionTests.cpp b/qpid/cpp/src/tests/MessagingSessionTests.cpp
index c4659493ce..d1f7441216 100644
--- a/qpid/cpp/src/tests/MessagingSessionTests.cpp
+++ b/qpid/cpp/src/tests/MessagingSessionTests.cpp
@@ -241,7 +241,7 @@ QPID_AUTO_TEST_CASE(testSendReceiveHeaders)
Sender sender = fix.session.createSender(fix.queue);
Message out("test-message");
for (uint i = 0; i < 10; ++i) {
- out.getHeaders()["a"] = i;
+ out.getProperties()["a"] = i;
sender.send(out);
}
Receiver receiver = fix.session.createReceiver(fix.queue);
@@ -249,7 +249,7 @@ QPID_AUTO_TEST_CASE(testSendReceiveHeaders)
for (uint i = 0; i < 10; ++i) {
BOOST_CHECK(receiver.fetch(in, Duration::SECOND * 5));
BOOST_CHECK_EQUAL(in.getContent(), out.getContent());
- BOOST_CHECK_EQUAL(in.getHeaders()["a"].asUint32(), i);
+ BOOST_CHECK_EQUAL(in.getProperties()["a"].asUint32(), i);
fix.session.acknowledge();
}
}
diff --git a/qpid/cpp/src/tests/qpid_recv.cpp b/qpid/cpp/src/tests/qpid_recv.cpp
index 994ef00960..6e384e9672 100644
--- a/qpid/cpp/src/tests/qpid_recv.cpp
+++ b/qpid/cpp/src/tests/qpid_recv.cpp
@@ -131,7 +131,7 @@ class SequenceTracker
bool isDuplicate(Message& message)
{
- uint sn = message.getHeaders()["sn"];
+ uint sn = message.getProperties()["sn"];
if (lastSn < sn) {
lastSn = sn;
return false;
@@ -175,8 +175,8 @@ int main(int argc, char ** argv)
if (msg.getUserId().size()) std::cout << "UserId: " << msg.getUserId() << std::endl;
if (msg.getTtl().getMilliseconds()) std::cout << "TTL: " << msg.getTtl().getMilliseconds() << std::endl;
if (msg.getDurable()) std::cout << "Durable: true" << std::endl;
- if (msg.isRedelivered()) std::cout << "Redelivered: true" << std::endl;
- std::cout << "Headers: " << msg.getHeaders() << std::endl;
+ if (msg.getRedelivered()) std::cout << "Redelivered: true" << std::endl;
+ std::cout << "Properties: " << msg.getProperties() << std::endl;
std::cout << std::endl;
}
std::cout << msg.getContent() << std::endl;//TODO: handle map or list messages
diff --git a/qpid/cpp/src/tests/qpid_send.cpp b/qpid/cpp/src/tests/qpid_send.cpp
index a75d21e0a5..564007958e 100644
--- a/qpid/cpp/src/tests/qpid_send.cpp
+++ b/qpid/cpp/src/tests/qpid_send.cpp
@@ -145,9 +145,9 @@ struct Options : public qpid::Options
std::string name;
std::string value;
if (nameval(property, name, value)) {
- message.getHeaders()[name] = value;
+ message.getProperties()[name] = value;
} else {
- message.getHeaders()[name] = Variant();
+ message.getProperties()[name] = Variant();
}
}
@@ -203,7 +203,7 @@ int main(int argc, char ** argv)
uint txCount = 0;
while (getline(std::cin, content)) {
msg.setContent(content);
- msg.getHeaders()["sn"] = ++sent;
+ msg.getProperties()["sn"] = ++sent;
sender.send(msg);
if (opts.tx && (sent % opts.tx == 0)) {
if (opts.rollbackFrequency && (++txCount % opts.rollbackFrequency == 0)) {
@@ -214,7 +214,7 @@ int main(int argc, char ** argv)
}
}
for (uint i = opts.sendEos; i > 0; --i) {
- msg.getHeaders()["sn"] = ++sent;
+ msg.getProperties()["sn"] = ++sent;
msg.setContent(EOS);//TODO: add in ability to send digest or similar
sender.send(msg);
}
diff --git a/qpid/cpp/src/tests/qpid_stream.cpp b/qpid/cpp/src/tests/qpid_stream.cpp
index e451198ef4..642b7a821f 100644
--- a/qpid/cpp/src/tests/qpid_stream.cpp
+++ b/qpid/cpp/src/tests/qpid_stream.cpp
@@ -119,7 +119,7 @@ struct Publish : Client
qpid::sys::AbsTime start = qpid::sys::now();
while (true) {
qpid::sys::AbsTime sentAt = qpid::sys::now();
- msg.getHeaders()[TIMESTAMP] = timestamp(sentAt);
+ msg.getProperties()[TIMESTAMP] = timestamp(sentAt);
sender.send(msg);
++sent;
qpid::sys::AbsTime waitTill(start, sent*interval);
@@ -151,7 +151,7 @@ struct Consume : Client
}
//calculate latency
uint64_t receivedAt = timestamp(qpid::sys::now());
- uint64_t sentAt = msg.getHeaders()[TIMESTAMP].asUint64();
+ uint64_t sentAt = msg.getProperties()[TIMESTAMP].asUint64();
double latency = ((double) (receivedAt - sentAt)) / qpid::sys::TIME_MSEC;
//update avg, min & max