summaryrefslogtreecommitdiff
path: root/cpp/src/tests
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2007-08-05 13:25:36 +0000
committerGordon Sim <gsim@apache.org>2007-08-05 13:25:36 +0000
commitb2efcb6ed3e1e2104836928cda81ed69f2f24559 (patch)
tree392ae403dcb0d32da3edaeaf8a1f497679d9102c /cpp/src/tests
parentb2fadec5d86e278d96112e915e67aec934e91046 (diff)
downloadqpid-python-b2efcb6ed3e1e2104836928cda81ed69f2f24559.tar.gz
Added first cut of generated client interface.
Old channel interface still supported; shares SessionCore with the new interface. Todo: allow applications to signal completion of received commands; keywrod args for interface. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@562866 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests')
-rw-r--r--cpp/src/tests/FramingTest.cpp10
-rw-r--r--cpp/src/tests/InProcessBroker.h25
2 files changed, 7 insertions, 28 deletions
diff --git a/cpp/src/tests/FramingTest.cpp b/cpp/src/tests/FramingTest.cpp
index 582c7d6e55..f172d1765e 100644
--- a/cpp/src/tests/FramingTest.cpp
+++ b/cpp/src/tests/FramingTest.cpp
@@ -33,6 +33,7 @@
#include "qpid/framing/Responder.h"
#include "InProcessBroker.h"
#include "qpid/client/Connection.h"
+#include "qpid/client/Connector.h"
#include "qpid/client/ClientExchange.h"
#include "qpid/client/ClientQueue.h"
#include "qpid/framing/Correlator.h"
@@ -386,9 +387,8 @@ class FramingTest : public CppUnit::TestCase
CPPUNIT_ASSERT_EQUAL(string(expect, sizeof(expect)-1), boost::lexical_cast<string>(frame))
void testRequestResponseRoundtrip() {
- broker::InProcessBroker ibroker(version);
- client::Connection clientConnection;
- clientConnection.setConnector(ibroker);
+ boost::shared_ptr<broker::InProcessBroker> ibroker(new broker::InProcessBroker(version));
+ client::Connection clientConnection(boost::static_pointer_cast<client::Connector>(ibroker));
clientConnection.open("");
client::Channel c;
clientConnection.openChannel(c);
@@ -399,7 +399,9 @@ class FramingTest : public CppUnit::TestCase
c.declareExchange(exchange);
c.declareQueue(queue);
c.bind(exchange, queue, "MyTopic", framing::FieldTable());
- broker::InProcessBroker::Conversation::const_iterator i = ibroker.conversation.begin();
+ c.close();
+ clientConnection.close();
+ broker::InProcessBroker::Conversation::const_iterator i = ibroker->conversation.begin();
ASSERT_FRAME("BROKER: Frame[channel=0; ConnectionStart: versionMajor=0; versionMinor=10; serverProperties={}; mechanisms=PLAIN; locales=en_US]", *i++);
ASSERT_FRAME("CLIENT: Frame[channel=0; ConnectionStartOk: clientProperties={}; mechanism=PLAIN; response=\000guest\000guest; locale=en_US]", *i++);
ASSERT_FRAME("BROKER: Frame[channel=0; ConnectionTune: channelMax=32767; frameMax=65536; heartbeat=0]", *i++);
diff --git a/cpp/src/tests/InProcessBroker.h b/cpp/src/tests/InProcessBroker.h
index 48ac80d30a..9f30ee584d 100644
--- a/cpp/src/tests/InProcessBroker.h
+++ b/cpp/src/tests/InProcessBroker.h
@@ -134,30 +134,7 @@ std::ostream& operator<<(
}
} // namespace broker
-
-
-namespace client {
-/** An in-process client+broker all in one. */
-class InProcessBrokerClient : public client::Connection {
- public:
- broker::InProcessBroker broker;
- broker::InProcessBroker::Conversation& conversation;
-
- /** Constructor creates broker and opens client connection. */
- InProcessBrokerClient(
- u_int32_t max_frame_size=65536,
- framing::ProtocolVersion version= framing::highestProtocolVersion
- ) : client::Connection(false, max_frame_size, version),
- broker(version),
- conversation(broker.conversation)
- {
- setConnector(broker);
- open("");
- }
-};
-
-
-}} // namespace qpid::client
+} // namespace qpid
#endif // _tests_InProcessBroker_h