summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2012-12-30 12:45:03 (GMT)
committerSwift Review <review@swift.im>2013-04-12 09:27:55 (GMT)
commit16f7c07cfce1879fa0319b4304bb6e11f9a6dd9a (patch)
treef991914e6e7e9648eb0bec3eba6af9e4444c36de /Swiften/FileTransfer/UnitTest
parent7aa4d8e04244d76e8f237f739c99a4e98e4ae5b8 (diff)
downloadswift-16f7c07cfce1879fa0319b4304bb6e11f9a6dd9a.zip
swift-16f7c07cfce1879fa0319b4304bb6e11f9a6dd9a.tar.bz2
File Transfer refactoring.
Rename run() to start(), and provide stop() placeholder. Change-Id: I44257a0fca89c9345054a5d6fa3c1b4768995081
Diffstat (limited to 'Swiften/FileTransfer/UnitTest')
-rw-r--r--Swiften/FileTransfer/UnitTest/IncomingJingleFileTransferTest.cpp15
-rw-r--r--Swiften/FileTransfer/UnitTest/OutgoingJingleFileTransferTest.cpp19
2 files changed, 20 insertions, 14 deletions
diff --git a/Swiften/FileTransfer/UnitTest/IncomingJingleFileTransferTest.cpp b/Swiften/FileTransfer/UnitTest/IncomingJingleFileTransferTest.cpp
index 4c6ae72..9d180a0 100644
--- a/Swiften/FileTransfer/UnitTest/IncomingJingleFileTransferTest.cpp
+++ b/Swiften/FileTransfer/UnitTest/IncomingJingleFileTransferTest.cpp
@@ -10,6 +10,7 @@
#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Base/ByteArray.h>
+#include <Swiften/Base/Override.h>
#include <Swiften/Base/Log.h>
#include <Swiften/Client/DummyStanzaChannel.h>
#include <Swiften/Elements/IBB.h>
@@ -80,12 +81,6 @@ public:
class FakeLocalJingleTransportCandidateGenerator : public LocalJingleTransportCandidateGenerator {
public:
- virtual void generateLocalTransportCandidates(JingleTransportPayload::ref payload) {
- JingleS5BTransportPayload::ref payL = make_shared<JingleS5BTransportPayload>();
- payL->setSessionID(payload->getSessionID());
- onLocalTransportCandidatesGenerated(payL);
- }
-
void emitonLocalTransportCandidatesGenerated(JingleTransportPayload::ref payload) {
onLocalTransportCandidatesGenerated(payload);
}
@@ -101,6 +96,14 @@ public:
virtual JingleTransport::ref selectTransport(JingleTransportPayload::ref) {
return JingleTransport::ref();
}
+
+ virtual void start(JingleTransportPayload::ref payload) SWIFTEN_OVERRIDE {
+ JingleS5BTransportPayload::ref payL = make_shared<JingleS5BTransportPayload>();
+ payL->setSessionID(payload->getSessionID());
+ onLocalTransportCandidatesGenerated(payL);
+ }
+
+ virtual void stop() SWIFTEN_OVERRIDE {}
};
class FakeLocalJingleTransportCandidateGeneratorFactory : public LocalJingleTransportCandidateGeneratorFactory {
diff --git a/Swiften/FileTransfer/UnitTest/OutgoingJingleFileTransferTest.cpp b/Swiften/FileTransfer/UnitTest/OutgoingJingleFileTransferTest.cpp
index 0c324bf..73b496a 100644
--- a/Swiften/FileTransfer/UnitTest/OutgoingJingleFileTransferTest.cpp
+++ b/Swiften/FileTransfer/UnitTest/OutgoingJingleFileTransferTest.cpp
@@ -28,6 +28,7 @@
#include <Swiften/Elements/JingleFileTransferDescription.h>
#include <Swiften/Elements/IBB.h>
#include <Swiften/Base/ByteArray.h>
+#include <Swiften/Base/Override.h>
#include <Swiften/Base/IDGenerator.h>
#include <Swiften/EventLoop/DummyEventLoop.h>
#include <Swiften/Network/PlatformNATTraversalWorker.h>
@@ -87,14 +88,6 @@ public:
class OFakeLocalJingleTransportCandidateGenerator : public LocalJingleTransportCandidateGenerator {
public:
- virtual void generateLocalTransportCandidates(JingleTransportPayload::ref /* payload */) {
- //JingleTransportPayload::ref payL = make_shared<JingleTransportPayload>();
- //payL->setSessionID(payload->getSessionID());
- JingleS5BTransportPayload::ref payL = boost::make_shared<JingleS5BTransportPayload>();
-
- onLocalTransportCandidatesGenerated(payL);
- }
-
void emitonLocalTransportCandidatesGenerated(JingleTransportPayload::ref payload) {
onLocalTransportCandidatesGenerated(payload);
}
@@ -110,6 +103,16 @@ public:
virtual JingleTransport::ref selectTransport(JingleTransportPayload::ref) {
return JingleTransport::ref();
}
+
+ virtual void start(JingleTransportPayload::ref /* payload */) SWIFTEN_OVERRIDE {
+ //JingleTransportPayload::ref payL = make_shared<JingleTransportPayload>();
+ //payL->setSessionID(payload->getSessionID());
+ JingleS5BTransportPayload::ref payL = boost::make_shared<JingleS5BTransportPayload>();
+
+ onLocalTransportCandidatesGenerated(payL);
+ }
+
+ virtual void stop() SWIFTEN_OVERRIDE {}
};
class OFakeLocalJingleTransportCandidateGeneratorFactory : public LocalJingleTransportCandidateGeneratorFactory {