summaryrefslogtreecommitdiff
path: root/cpp/src/tests
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2009-11-16 15:57:43 +0000
committerGordon Sim <gsim@apache.org>2009-11-16 15:57:43 +0000
commitacc0362ec2fcf9a7894bdc71f438444ab249f35d (patch)
tree4432d210f14dcf279c2285cf26d3f505763f6f20 /cpp/src/tests
parent86b0bb439db4290350e16013e17dd97791e2a5dc (diff)
downloadqpid-python-acc0362ec2fcf9a7894bdc71f438444ab249f35d.tar.gz
QPID-664: Introduce ';' as delimiter bewteen name (and optionally subject) and the options map in address syntax.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@880819 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests')
-rw-r--r--cpp/src/tests/Address.cpp8
-rw-r--r--cpp/src/tests/MessagingSessionTests.cpp28
2 files changed, 18 insertions, 18 deletions
diff --git a/cpp/src/tests/Address.cpp b/cpp/src/tests/Address.cpp
index ab4017a788..319710ec24 100644
--- a/cpp/src/tests/Address.cpp
+++ b/cpp/src/tests/Address.cpp
@@ -46,7 +46,7 @@ QPID_AUTO_TEST_CASE(testParseSubject)
QPID_AUTO_TEST_CASE(testParseOptions)
{
- Address address("my-topic {a:bc, x:101, y:'a string'}");
+ Address address("my-topic; {a:bc, x:101, y:'a string'}");
BOOST_CHECK_EQUAL(std::string("my-topic"), address.getName());
BOOST_CHECK_EQUAL(std::string("bc"), address.getOption("a").asString());
BOOST_CHECK_EQUAL((uint16_t) 101, address.getOption("x").asInt64());
@@ -55,7 +55,7 @@ QPID_AUTO_TEST_CASE(testParseOptions)
QPID_AUTO_TEST_CASE(testParseSubjectAndOptions)
{
- Address address("my-topic/my-subject {a:bc, x:101, y:'a string'}");
+ Address address("my-topic/my-subject; {a:bc, x:101, y:'a string'}");
BOOST_CHECK_EQUAL(std::string("my-topic"), address.getName());
BOOST_CHECK_EQUAL(std::string("my-subject"), address.getSubject());
BOOST_CHECK_EQUAL(std::string("bc"), address.getOption("a").asString());
@@ -65,7 +65,7 @@ QPID_AUTO_TEST_CASE(testParseSubjectAndOptions)
QPID_AUTO_TEST_CASE(testParseNestedOptions)
{
- Address address("my-topic {a:{p:202, q:'another string'}, x:101, y:'a string'}");
+ Address address("my-topic; {a:{p:202, q:'another string'}, x:101, y:'a string'}");
BOOST_CHECK_EQUAL(std::string("my-topic"), address.getName());
BOOST_CHECK_EQUAL((uint16_t) 202, address.getOptions()["a"].asMap()["p"].asInt64());
BOOST_CHECK_EQUAL(std::string("another string"), address.getOptions()["a"].asMap()["q"].asString());
@@ -75,7 +75,7 @@ QPID_AUTO_TEST_CASE(testParseNestedOptions)
QPID_AUTO_TEST_CASE(testParseOptionsWithList)
{
- Address address("my-topic {a:[202, 'another string'], x:101}");
+ Address address("my-topic; {a:[202, 'another string'], x:101}");
BOOST_CHECK_EQUAL(std::string("my-topic"), address.getName());
Variant::List& list = address.getOptions()["a"].asList();
Variant::List::const_iterator i = list.begin();
diff --git a/cpp/src/tests/MessagingSessionTests.cpp b/cpp/src/tests/MessagingSessionTests.cpp
index 00a8481c93..6d7f45bc0a 100644
--- a/cpp/src/tests/MessagingSessionTests.cpp
+++ b/cpp/src/tests/MessagingSessionTests.cpp
@@ -248,7 +248,7 @@ QPID_AUTO_TEST_CASE(testSenderError)
MessagingFixture fix;
ScopedSuppressLogging sl;
BOOST_CHECK_THROW(fix.session.createSender("NonExistentAddress"), qpid::messaging::InvalidAddress);
- BOOST_CHECK_THROW(fix.session.createSender("NonExistentAddress {create:receiver, type:queue}"),
+ BOOST_CHECK_THROW(fix.session.createSender("NonExistentAddress; {create:receiver, type:queue}"),
qpid::messaging::InvalidAddress);
}
@@ -257,7 +257,7 @@ QPID_AUTO_TEST_CASE(testReceiverError)
MessagingFixture fix;
ScopedSuppressLogging sl;
BOOST_CHECK_THROW(fix.session.createReceiver("NonExistentAddress"), qpid::messaging::InvalidAddress);
- BOOST_CHECK_THROW(fix.session.createReceiver("NonExistentAddress {create:sender, type:queue}"),
+ BOOST_CHECK_THROW(fix.session.createReceiver("NonExistentAddress; {create:sender, type:queue}"),
qpid::messaging::InvalidAddress);
}
@@ -466,9 +466,9 @@ QPID_AUTO_TEST_CASE(testBrowse)
QueueFixture fix;
Sender sender = fix.session.createSender(fix.queue);
send(sender, 10);
- Receiver browser1 = fix.session.createReceiver(fix.queue + " {browse:true}");
+ Receiver browser1 = fix.session.createReceiver(fix.queue + "; {browse:true}");
receive(browser1, 10);
- Receiver browser2 = fix.session.createReceiver(fix.queue + " {browse:true}");
+ Receiver browser2 = fix.session.createReceiver(fix.queue + "; {browse:true}");
receive(browser2, 10);
Receiver consumer = fix.session.createReceiver(fix.queue);
receive(consumer, 10);
@@ -495,13 +495,13 @@ struct QueueCreatePolicyFixture : public MessagingFixture
QPID_AUTO_TEST_CASE(testCreatePolicyQueueAlways)
{
- QueueCreatePolicyFixture fix("# {create:always, type:queue}");
+ QueueCreatePolicyFixture fix("#; {create:always, type:queue}");
fix.test();
}
QPID_AUTO_TEST_CASE(testCreatePolicyQueueReceiver)
{
- QueueCreatePolicyFixture fix("# {create:receiver, type:queue}");
+ QueueCreatePolicyFixture fix("#; {create:receiver, type:queue}");
Receiver r = fix.session.createReceiver(fix.address);
fix.test();
r.cancel();
@@ -509,7 +509,7 @@ QPID_AUTO_TEST_CASE(testCreatePolicyQueueReceiver)
QPID_AUTO_TEST_CASE(testCreatePolicyQueueSender)
{
- QueueCreatePolicyFixture fix("# {create:sender, type:queue}");
+ QueueCreatePolicyFixture fix("#; {create:sender, type:queue}");
Sender s = fix.session.createSender(fix.address);
fix.test();
s.cancel();
@@ -539,14 +539,14 @@ struct ExchangeCreatePolicyFixture : public MessagingFixture
QPID_AUTO_TEST_CASE(testCreatePolicyTopic)
{
- ExchangeCreatePolicyFixture fix("# {create:always, type:topic, node-properties:{x-amqp0-10-exchange-type:topic}}",
+ ExchangeCreatePolicyFixture fix("#; {create:always, type:topic, node-properties:{x-amqp0-10-exchange-type:topic}}",
"topic");
fix.test();
}
QPID_AUTO_TEST_CASE(testCreatePolicyTopicReceiverFanout)
{
- ExchangeCreatePolicyFixture fix("#/my-subject {create:receiver, type:topic, node-properties:{x-amqp0-10-exchange-type:fanout}}", "fanout");
+ ExchangeCreatePolicyFixture fix("#/my-subject; {create:receiver, type:topic, node-properties:{x-amqp0-10-exchange-type:fanout}}", "fanout");
Receiver r = fix.session.createReceiver(fix.address);
fix.test();
r.cancel();
@@ -554,7 +554,7 @@ QPID_AUTO_TEST_CASE(testCreatePolicyTopicReceiverFanout)
QPID_AUTO_TEST_CASE(testCreatePolicyTopicSenderDirect)
{
- ExchangeCreatePolicyFixture fix("#/my-subject {create:sender, type:topic, node-properties:{x-amqp0-10-exchange-type:direct}}", "direct");
+ ExchangeCreatePolicyFixture fix("#/my-subject; {create:sender, type:topic, node-properties:{x-amqp0-10-exchange-type:direct}}", "direct");
Sender s = fix.session.createSender(fix.address);
fix.test();
s.cancel();
@@ -594,7 +594,7 @@ struct DeletePolicyFixture : public MessagingFixture
void test(Mode mode)
{
- qpid::messaging::Address address("# " + getPolicy(mode));
+ qpid::messaging::Address address("#; " + getPolicy(mode));
create(address);
Sender s = session.createSender(address);
@@ -681,18 +681,18 @@ QPID_AUTO_TEST_CASE(testDeletePolicyExchange)
QPID_AUTO_TEST_CASE(testAssertPolicyQueue)
{
MessagingFixture fix;
- std::string a1 = "q {create:always, assert:always, type:queue, node-properties:{durable:false, x-amqp0-10-arguments:{qpid.max-count:100}}}";
+ std::string a1 = "q; {create:always, assert:always, type:queue, node-properties:{durable:false, x-amqp0-10-arguments:{qpid.max-count:100}}}";
Sender s1 = fix.session.createSender(a1);
s1.cancel();
Receiver r1 = fix.session.createReceiver(a1);
r1.cancel();
- std::string a2 = "q {assert:receiver, node-properties:{durable:true, x-amqp0-10-arguments:{qpid.max-count:100}}}";
+ std::string a2 = "q; {assert:receiver, node-properties:{durable:true, x-amqp0-10-arguments:{qpid.max-count:100}}}";
Sender s2 = fix.session.createSender(a2);
s2.cancel();
BOOST_CHECK_THROW(fix.session.createReceiver(a2), qpid::messaging::InvalidAddress);
- std::string a3 = "q {assert:sender, node-properties:{x-amqp0-10-arguments:{qpid.max-count:99}}}";
+ std::string a3 = "q; {assert:sender, node-properties:{x-amqp0-10-arguments:{qpid.max-count:99}}}";
BOOST_CHECK_THROW(fix.session.createSender(a3), qpid::messaging::InvalidAddress);
Receiver r3 = fix.session.createReceiver(a3);
r3.cancel();