summaryrefslogtreecommitdiff
path: root/cpp/test
diff options
context:
space:
mode:
authorKim van der Riet <kpvdr@apache.org>2006-11-22 16:57:35 +0000
committerKim van der Riet <kpvdr@apache.org>2006-11-22 16:57:35 +0000
commitd46ac2955c4871c9f22067f47490095e2c5f1806 (patch)
tree7e76ef7e4ca47e4cc57c83f7950bf97c3eceb210 /cpp/test
parent018723f3889e9a1f63585dddba8eecff1d168501 (diff)
downloadqpid-python-d46ac2955c4871c9f22067f47490095e2c5f1806.tar.gz
Merged AMQP version-sensitive generated files with C++ trunk. Phase 1 of merge complete - all locations where version info is required in the framing, broker and client code, the version has been hard-coded to mahor=8, minor=0. Next step: make broker and client version-aware.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@478237 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/test')
-rw-r--r--cpp/test/unit/qpid/framing/BodyHandlerTest.cpp5
-rw-r--r--cpp/test/unit/qpid/framing/FramingTest.cpp30
2 files changed, 21 insertions, 14 deletions
diff --git a/cpp/test/unit/qpid/framing/BodyHandlerTest.cpp b/cpp/test/unit/qpid/framing/BodyHandlerTest.cpp
index f73e80b36c..2758492050 100644
--- a/cpp/test/unit/qpid/framing/BodyHandlerTest.cpp
+++ b/cpp/test/unit/qpid/framing/BodyHandlerTest.cpp
@@ -63,12 +63,15 @@ private:
CPPUNIT_ASSERT_EQUAL(heartbeat, body.get());
}
};
+ ProtocolVersion v;
public:
+
+ BodyHandlerTest() : v(8, 0) {}
void testMethod()
{
- AMQMethodBody* method = new QueueDeclareBody();
+ AMQMethodBody* method = new QueueDeclareBody(v);
AMQFrame frame(0, method);
TestBodyHandler handler(method);
handler.handleBody(frame.getBody());
diff --git a/cpp/test/unit/qpid/framing/FramingTest.cpp b/cpp/test/unit/qpid/framing/FramingTest.cpp
index 3aa0901503..aa8a9a10de 100644
--- a/cpp/test/unit/qpid/framing/FramingTest.cpp
+++ b/cpp/test/unit/qpid/framing/FramingTest.cpp
@@ -19,6 +19,7 @@
*
*/
#include <qpid/framing/ConnectionRedirectBody.h>
+#include <qpid/framing/ProtocolVersion.h>
#include <qpid/framing/amqp_framing.h>
#include <iostream>
#include <qpid_test_plugin.h>
@@ -49,17 +50,20 @@ class FramingTest : public CppUnit::TestCase
private:
Buffer buffer;
+ ProtocolVersion v;
public:
- FramingTest() : buffer(100) {}
+// AMQP version management change - kpvdr 2006-11-17
+// TODO: Make this class version-aware and link these hard-wired numbers to that version
+ FramingTest() : buffer(100), v(8, 0) {}
void testBasicQosBody()
{
- BasicQosBody in(0xCAFEBABE, 0xABBA, true);
+ BasicQosBody in(v, 0xCAFEBABE, 0xABBA, true);
in.encodeContent(buffer);
buffer.flip();
- BasicQosBody out;
+ BasicQosBody out(v);
out.decodeContent(buffer);
CPPUNIT_ASSERT_EQUAL(tostring(in), tostring(out));
}
@@ -67,10 +71,10 @@ class FramingTest : public CppUnit::TestCase
void testConnectionSecureBody()
{
std::string s = "security credential";
- ConnectionSecureBody in(s);
+ ConnectionSecureBody in(v, s);
in.encodeContent(buffer);
buffer.flip();
- ConnectionSecureBody out;
+ ConnectionSecureBody out(v);
out.decodeContent(buffer);
CPPUNIT_ASSERT_EQUAL(tostring(in), tostring(out));
}
@@ -79,10 +83,10 @@ class FramingTest : public CppUnit::TestCase
{
std::string a = "hostA";
std::string b = "hostB";
- ConnectionRedirectBody in(a, b);
+ ConnectionRedirectBody in(v, a, b);
in.encodeContent(buffer);
buffer.flip();
- ConnectionRedirectBody out;
+ ConnectionRedirectBody out(v);
out.decodeContent(buffer);
CPPUNIT_ASSERT_EQUAL(tostring(in), tostring(out));
}
@@ -90,10 +94,10 @@ class FramingTest : public CppUnit::TestCase
void testAccessRequestBody()
{
std::string s = "text";
- AccessRequestBody in(s, true, false, true, false, true);
+ AccessRequestBody in(v, s, true, false, true, false, true);
in.encodeContent(buffer);
buffer.flip();
- AccessRequestBody out;
+ AccessRequestBody out(v);
out.decodeContent(buffer);
CPPUNIT_ASSERT_EQUAL(tostring(in), tostring(out));
}
@@ -102,10 +106,10 @@ class FramingTest : public CppUnit::TestCase
{
std::string q = "queue";
std::string t = "tag";
- BasicConsumeBody in(0, q, t, false, true, false, false);
+ BasicConsumeBody in(v, 0, q, t, false, true, false, false);
in.encodeContent(buffer);
buffer.flip();
- BasicConsumeBody out;
+ BasicConsumeBody out(v);
out.decodeContent(buffer);
CPPUNIT_ASSERT_EQUAL(tostring(in), tostring(out));
}
@@ -115,7 +119,7 @@ class FramingTest : public CppUnit::TestCase
{
std::string a = "hostA";
std::string b = "hostB";
- AMQFrame in(999, new ConnectionRedirectBody(a, b));
+ AMQFrame in(999, new ConnectionRedirectBody(v, a, b));
in.encode(buffer);
buffer.flip();
AMQFrame out;
@@ -126,7 +130,7 @@ class FramingTest : public CppUnit::TestCase
void testBasicConsumeOkBodyFrame()
{
std::string s = "hostA";
- AMQFrame in(999, new BasicConsumeOkBody(s));
+ AMQFrame in(999, new BasicConsumeOkBody(v, s));
in.encode(buffer);
buffer.flip();
AMQFrame out;