summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-12-22 15:46:23 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-12-22 16:53:18 (GMT)
commit732253a9b3e88b99b36dd3298157cf502f743294 (patch)
tree3471f2d999dfe3cb2ae8f5aec5bdd7b3d1465078 /Swiften/Network/UnitTest
parent6c1e7d8a8339a849896566464bd9f1db33e3b3da (diff)
downloadswift-732253a9b3e88b99b36dd3298157cf502f743294.zip
swift-732253a9b3e88b99b36dd3298157cf502f743294.tar.bz2
BOSH Refactoring.
Diffstat (limited to 'Swiften/Network/UnitTest')
-rw-r--r--Swiften/Network/UnitTest/BOSHConnectionPoolTest.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/Swiften/Network/UnitTest/BOSHConnectionPoolTest.cpp b/Swiften/Network/UnitTest/BOSHConnectionPoolTest.cpp
index 978bf3b..1bfee10 100644
--- a/Swiften/Network/UnitTest/BOSHConnectionPoolTest.cpp
+++ b/Swiften/Network/UnitTest/BOSHConnectionPoolTest.cpp
@@ -19,7 +19,6 @@
#include <Swiften/Network/Connection.h>
#include <Swiften/Network/ConnectionFactory.h>
#include <Swiften/Network/BOSHConnection.h>
-#include <Swiften/Network/BOSHConnectionFactory.h>
#include <Swiften/Network/BOSHConnectionPool.h>
#include <Swiften/Network/HostAddressPort.h>
#include <Swiften/EventLoop/DummyEventLoop.h>
@@ -58,7 +57,7 @@ class BOSHConnectionPoolTest : public CppUnit::TestFixture {
"xmlns='http://jabber.org/protocol/httpbind'/>";
eventLoop = new DummyEventLoop();
connectionFactory = new MockConnectionFactory(eventLoop);
- factory = boost::make_shared<BOSHConnectionFactory>(URL("http", to, 5280, path), connectionFactory, &parserFactory, static_cast<TLSContextFactory*>(NULL));
+ boshURL = URL("http", to, 5280, path);
sessionTerminated = 0;
sessionStarted = 0;
initialRID = 2349876;
@@ -216,8 +215,7 @@ class BOSHConnectionPoolTest : public CppUnit::TestFixture {
void testSession() {
to = "prosody.doomsong.co.uk";
path = "http-bind/";
- factory = boost::make_shared<BOSHConnectionFactory>(URL("http", to, 5280, path), connectionFactory, &parserFactory, static_cast<TLSContextFactory*>(NULL));
-
+ boshURL = URL("http", to, 5280, path);
PoolRef testling = createTestling();
CPPUNIT_ASSERT_EQUAL(st(1), connectionFactory->connections.size());
@@ -281,7 +279,7 @@ class BOSHConnectionPoolTest : public CppUnit::TestFixture {
private:
PoolRef createTestling() {
- PoolRef pool = boost::make_shared<BOSHConnectionPool>(factory, to, initialRID, URL(), "", "");
+ PoolRef pool = boost::make_shared<BOSHConnectionPool>(boshURL, connectionFactory, &parserFactory, static_cast<TLSContextFactory*>(NULL), to, initialRID, URL(), "", "");
pool->onXMPPDataRead.connect(boost::bind(&BOSHConnectionPoolTest::handleXMPPDataRead, this, _1));
pool->onBOSHDataRead.connect(boost::bind(&BOSHConnectionPoolTest::handleBOSHDataRead, this, _1));
pool->onBOSHDataWritten.connect(boost::bind(&BOSHConnectionPoolTest::handleBOSHDataWritten, this, _1));
@@ -401,6 +399,7 @@ class BOSHConnectionPoolTest : public CppUnit::TestFixture {
}
private:
+ URL boshURL;
DummyEventLoop* eventLoop;
MockConnectionFactory* connectionFactory;
std::vector<std::string> xmppDataRead;
@@ -413,7 +412,6 @@ class BOSHConnectionPoolTest : public CppUnit::TestFixture {
std::string sid;
std::string initial;
long initialRID;
- boost::shared_ptr<BOSHConnectionFactory> factory;
int sessionStarted;
int sessionTerminated;