diff options
Diffstat (limited to 'filedistribution')
7 files changed, 39 insertions, 15 deletions
diff --git a/filedistribution/src/tests/filedownloader/testfiledownloader.cpp b/filedistribution/src/tests/filedownloader/testfiledownloader.cpp index 9bf96abc1eb..56a664ea7e1 100644 --- a/filedistribution/src/tests/filedownloader/testfiledownloader.cpp +++ b/filedistribution/src/tests/filedownloader/testfiledownloader.cpp @@ -2,6 +2,7 @@ #define BOOST_TEST_DYN_LINK #define BOOST_TEST_MAIN +#include <vespa/fastos/fastos.h> #include <vespa/filedistribution/distributor/filedownloader.h> #include <vespa/filedistribution/distributor/filedistributortrackerimpl.h> @@ -11,7 +12,12 @@ #include <boost/filesystem.hpp> #include <boost/filesystem/fstream.hpp> +#include <libtorrent/session.hpp> +#include <libtorrent/tracker_manager.hpp> +#include <libtorrent/torrent.hpp> + #include <vespa/filedistribution/manager/createtorrent.h> +#include <vespa/filedistribution/model/filedistributionmodel.h> #include <vespa/filedistribution/common/componentsdeleter.h> namespace fs = boost::filesystem; @@ -41,16 +47,16 @@ createDownloader(ComponentsDeleter& deleter, } //anonymous namespace class MockFileDistributionModel : public FileDistributionModel { - FileDBModel& getFileDBModel() override { + virtual FileDBModel& getFileDBModel() override { abort(); } - std::set<std::string> getFilesToDownload() override { + virtual std::set<std::string> getFilesToDownload() override { return std::set<std::string>(); } - PeerEntries getPeers(const std::string& , size_t) override { - PeerEntries peers(2); + virtual PeerEntries getPeers(const std::string&, size_t) override { + PeerEntries peers(2); peers[0].ip = localHost; peers[0].port = uploaderPort; @@ -60,9 +66,9 @@ class MockFileDistributionModel : public FileDistributionModel { return peers; } - void addPeer(const std::string&) override {} - void removePeer(const std::string&) override {} - void peerFinished(const std::string&) override {} + virtual void addPeer(const std::string&) override {} + virtual void removePeer(const std::string&) override {} + virtual void peerFinished(const std::string&) override {} }; diff --git a/filedistribution/src/tests/rpc/mockfileprovider.h b/filedistribution/src/tests/rpc/mockfileprovider.h index fd66acfb0fc..33177d939c1 100644 --- a/filedistribution/src/tests/rpc/mockfileprovider.h +++ b/filedistribution/src/tests/rpc/mockfileprovider.h @@ -32,6 +32,7 @@ public: downloadCompleted()(fileReference, "downloaded/path/" + fileReference); } + //Overrides DownloadCompletedSignal& downloadCompleted() override { return _downloadCompleted; } diff --git a/filedistribution/src/tests/scheduler/test-scheduler.cpp b/filedistribution/src/tests/scheduler/test-scheduler.cpp index 1ce5cbb9bc2..5be60569449 100644 --- a/filedistribution/src/tests/scheduler/test-scheduler.cpp +++ b/filedistribution/src/tests/scheduler/test-scheduler.cpp @@ -1,7 +1,7 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #define BOOST_TEST_DYN_LINK #define BOOST_TEST_MAIN - +#include <vespa/fastos/fastos.h> #include <boost/test/unit_test.hpp> #include <vespa/filedistribution/distributor/scheduler.h> @@ -9,6 +9,7 @@ #include <iostream> #include <boost/thread/barrier.hpp> +#include <thread> using filedistribution::Scheduler; using namespace std::literals; diff --git a/filedistribution/src/tests/zkfacade/test-zkfacade.cpp b/filedistribution/src/tests/zkfacade/test-zkfacade.cpp index 51a3f0b40e3..46db660d452 100644 --- a/filedistribution/src/tests/zkfacade/test-zkfacade.cpp +++ b/filedistribution/src/tests/zkfacade/test-zkfacade.cpp @@ -2,10 +2,14 @@ #define BOOST_TEST_DYN_LINK #define BOOST_TEST_MAIN #define BOOST_TEST_MODULE zkfacade test - +#include <vespa/fastos/fastos.h> #include <boost/test/unit_test.hpp> + #include <iostream> + #include <boost/thread/barrier.hpp> +#include <boost/checked_delete.hpp> + #include <vespa/filedistribution/common/componentsdeleter.h> #include <vespa/filedistribution/model/zkfacade.h> diff --git a/filedistribution/src/vespa/filedistribution/distributor/filedistributortrackerimpl.cpp b/filedistribution/src/vespa/filedistribution/distributor/filedistributortrackerimpl.cpp index 9906074afc5..1db2f7c6e49 100644 --- a/filedistribution/src/vespa/filedistribution/distributor/filedistributortrackerimpl.cpp +++ b/filedistribution/src/vespa/filedistribution/distributor/filedistributortrackerimpl.cpp @@ -1,8 +1,13 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "filedistributortrackerimpl.h" -#include "filedownloader.h" +#include <cmath> +#include <libtorrent/tracker_manager.hpp> +#include <libtorrent/torrent.hpp> +#include <vespa/filedistribution/model/filedistributionmodel.h> #include <vespa/filedistribution/model/zkfacade.h> +#include "filedownloader.h" +#include "hostname.h" #include <vespa/log/log.h> LOG_SETUP(".filedistributiontrackerimpl"); diff --git a/filedistribution/src/vespa/filedistribution/model/filedistributionmodelimpl.cpp b/filedistribution/src/vespa/filedistribution/model/filedistributionmodelimpl.cpp index 3b4d043a30b..0288f3082f8 100644 --- a/filedistribution/src/vespa/filedistribution/model/filedistributionmodelimpl.cpp +++ b/filedistribution/src/vespa/filedistribution/model/filedistributionmodelimpl.cpp @@ -1,15 +1,22 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - +#include <vespa/fastos/fastos.h> #include "filedistributionmodel.h" -#include "zkfiledbmodel.h" -#include "deployedfilestodownload.h" -#include "filedistributionmodelimpl.h" + +#include <vector> +#include <set> +#include <string> +#include <cstdlib> + #include <boost/filesystem.hpp> #include <zookeeper/zookeeper.h> #include <vespa/log/log.h> LOG_SETUP(".filedistributionmodel"); +#include "zkfiledbmodel.h" +#include "deployedfilestodownload.h" +#include "filedistributionmodelimpl.h" + namespace fs = boost::filesystem; using filedistribution::ZKFileDBModel; diff --git a/filedistribution/src/vespa/filedistribution/model/filedistributionmodelimpl.h b/filedistribution/src/vespa/filedistribution/model/filedistributionmodelimpl.h index 4b2b14ea21f..e132ec8b230 100644 --- a/filedistribution/src/vespa/filedistribution/model/filedistributionmodelimpl.h +++ b/filedistribution/src/vespa/filedistribution/model/filedistributionmodelimpl.h @@ -2,7 +2,7 @@ #pragma once #include "filedistributionmodel.h" -#include "config-filereferences.h" +#include <vespa/filedistribution/model/config-filereferences.h> #include "zkfacade.h" #include "zkfiledbmodel.h" #include <vespa/config/config.h> |