diff options
Diffstat (limited to 'Swiften/FileTransfer/UnitTest/IncomingJingleFileTransferTest.cpp')
-rw-r--r-- | Swiften/FileTransfer/UnitTest/IncomingJingleFileTransferTest.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Swiften/FileTransfer/UnitTest/IncomingJingleFileTransferTest.cpp b/Swiften/FileTransfer/UnitTest/IncomingJingleFileTransferTest.cpp index 207f590..aaf90ea 100644 --- a/Swiften/FileTransfer/UnitTest/IncomingJingleFileTransferTest.cpp +++ b/Swiften/FileTransfer/UnitTest/IncomingJingleFileTransferTest.cpp @@ -2,13 +2,13 @@ * Copyright (c) 2011 Tobias Markmann * Licensed under the simplified BSD license. * See Documentation/Licenses/BSD-simplified.txt for more information. */ /* - * Copyright (c) 2013-2014 Isode Limited. + * Copyright (c) 2013-2015 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include <cppunit/extensions/HelperMacros.h> #include <cppunit/extensions/TestFactoryRegistry.h> @@ -25,12 +25,13 @@ #include <Swiften/Elements/JingleFileTransferDescription.h> #include <Swiften/FileTransfer/DefaultFileTransferTransporterFactory.h> #include <Swiften/FileTransfer/ByteArrayWriteBytestream.h> #include <Swiften/FileTransfer/IncomingJingleFileTransfer.h> #include <Swiften/FileTransfer/SOCKS5BytestreamRegistry.h> #include <Swiften/Network/PlatformNetworkEnvironment.h> +#include <Swiften/Network/StaticDomainNameResolver.h> #include <Swiften/FileTransfer/SOCKS5BytestreamProxiesManager.h> #include <Swiften/FileTransfer/SOCKS5BytestreamServerManager.h> #include <Swiften/Jingle/FakeJingleSession.h> #include <Swiften/Network/NATTraverser.h> #include <Swiften/Network/DummyTimerFactory.h> #include <Swiften/EventLoop/DummyEventLoop.h> @@ -64,12 +65,13 @@ public: return request; } void setUp() { crypto = boost::shared_ptr<CryptoProvider>(PlatformCryptoProvider::create()); eventLoop = new DummyEventLoop(); + resolver = new StaticDomainNameResolver(eventLoop); session = boost::make_shared<FakeJingleSession>("foo@bar.com/baz", "mysession"); jingleContentPayload = make_shared<JingleContentPayload>(); // fakeRJTCSF = make_shared<FakeRemoteJingleTransportCandidateSelectorFactory>(); // fakeLJTCF = make_shared<FakeLocalJingleTransportCandidateGeneratorFactory>(); stanzaChannel = new DummyStanzaChannel(); connectionFactory = new DummyConnectionFactory(eventLoop); @@ -78,25 +80,26 @@ public: bytestreamRegistry = new SOCKS5BytestreamRegistry(); networkEnvironment = new PlatformNetworkEnvironment(); natTraverser = new PlatformNATTraversalWorker(eventLoop); bytestreamServerManager = new SOCKS5BytestreamServerManager(bytestreamRegistry, serverConnectionFactory, networkEnvironment, natTraverser); idGenerator = new SimpleIDGenerator(); timerFactory = new DummyTimerFactory(); - bytestreamProxy = new SOCKS5BytestreamProxiesManager(connectionFactory, timerFactory); + bytestreamProxy = new SOCKS5BytestreamProxiesManager(connectionFactory, timerFactory, resolver, iqRouter, "bar.com"); ftTransporterFactory = new DefaultFileTransferTransporterFactory(bytestreamRegistry, bytestreamServerManager, bytestreamProxy, idGenerator, connectionFactory, timerFactory, crypto.get(), iqRouter); } void tearDown() { delete ftTransporterFactory; delete bytestreamServerManager; delete bytestreamProxy; delete connectionFactory; delete timerFactory; delete bytestreamRegistry; delete iqRouter; delete stanzaChannel; + delete resolver; delete eventLoop; Log::setLogLevel(Log::error); } // Tests whether IncomingJingleFileTransfer would accept a IBB only file transfer. void test_AcceptOnyIBBSendsSessionAccept() { @@ -229,9 +232,10 @@ private: DummyConnectionServerFactory* serverConnectionFactory; SOCKS5BytestreamProxiesManager* bytestreamProxy; DummyTimerFactory* timerFactory; NetworkEnvironment* networkEnvironment; NATTraverser* natTraverser; IDGenerator* idGenerator; + DomainNameResolver* resolver; }; CPPUNIT_TEST_SUITE_REGISTRATION(IncomingJingleFileTransferTest); |