Commit 9ba6e2dc authored by Steven Murray's avatar Steven Murray
Browse files

Removed NameServer and RemoteNS from Scheduler.

parent 1040a1ba
......@@ -37,9 +37,6 @@ namespace archiveRoute {
class ArchiveToFileRequest;
class ArchiveToTapeCopyRequest;
class LogicalLibrary;
class NameServer;
class RemoteNS;
class RemotePathAndStatus;
class RetrieveRequestDump;
class RetrieveToFileRequest;
class SchedulerDatabase;
......@@ -50,4 +47,4 @@ class TapeMount;
class TapeSession;
class TapePool;
class UserIdentity;
} /// cta
\ No newline at end of file
} /// cta
......@@ -33,9 +33,7 @@
//------------------------------------------------------------------------------
cta::Scheduler::Scheduler(
catalogue::Catalogue &catalogue,
NameServer &ns,
SchedulerDatabase &db,
RemoteNS &remoteNS): m_catalogue(catalogue), m_db(db) {
SchedulerDatabase &db): m_catalogue(catalogue), m_db(db) {
}
//------------------------------------------------------------------------------
......
......@@ -81,9 +81,7 @@ public:
*/
Scheduler(
cta::catalogue::Catalogue &catalogue,
NameServer &ns,
SchedulerDatabase &db,
RemoteNS &remoteNS);
SchedulerDatabase &db);
/**
* Destructor.
......
......@@ -16,9 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "nameserver/mockNS/MockNameServerFactory.hpp"
#include "nameserver/NameServer.hpp"
#include "remotens/MockRemoteNS.hpp"
#include "common/admin/AdminUser.hpp"
#include "common/admin/AdminHost.hpp"
#include "common/archiveRoutes/ArchiveRoute.hpp"
......@@ -49,13 +46,10 @@ namespace unitTests {
* This structure is used to parameterize scheduler tests.
*/
struct SchedulerTestParam {
cta::NameServerFactory &nsFactory;
cta::SchedulerDatabaseFactory &dbFactory;
SchedulerTestParam(
cta::NameServerFactory &nsFactory,
cta::SchedulerDatabaseFactory &dbFactory):
nsFactory(nsFactory),
dbFactory(dbFactory) {
}
}; // struct SchedulerTestParam
......@@ -70,13 +64,6 @@ public:
SchedulerTest() throw() {
}
class FailedToGetMockRemoteNS: public std::exception {
public:
const char *what() const throw() {
return "Failed to get mock remote NS";
}
};
class FailedToGetScheduler: public std::exception {
public:
const char *what() const throw() {
......@@ -88,27 +75,15 @@ public:
using namespace cta;
const SchedulerTestParam &param = GetParam();
m_ns = param.nsFactory.create();
m_db = param.dbFactory.create();
m_mockRemoteNS.reset(new MockRemoteNS());
m_catalogue.reset(new cta::catalogue::SqliteCatalogue());
m_scheduler.reset(new cta::Scheduler(*(m_catalogue.get()), *(m_ns.get()), *(m_db.get()), *(m_mockRemoteNS.get())));
m_scheduler.reset(new cta::Scheduler(*(m_catalogue.get()), *(m_db.get())));
}
virtual void TearDown() {
m_scheduler.reset();
m_mockRemoteNS.reset();
m_db.reset();
m_ns.reset();
}
cta::MockRemoteNS &getMockRemoteNs() {
cta::MockRemoteNS *const ptr = m_mockRemoteNS.get();
if(NULL == ptr) {
throw FailedToGetMockRemoteNS();
}
return *ptr;
}
cta::Scheduler &getScheduler() {
......@@ -127,9 +102,7 @@ private:
// Prevent assignment
SchedulerTest & operator= (const SchedulerTest &);
std::unique_ptr<cta::NameServer> m_ns;
std::unique_ptr<cta::SchedulerDatabase> m_db;
std::unique_ptr<cta::MockRemoteNS> m_mockRemoteNS;
std::unique_ptr<cta::catalogue::Catalogue> m_catalogue;
std::unique_ptr<cta::Scheduler> m_scheduler;
......@@ -2572,13 +2545,11 @@ TEST_P(SchedulerTest, setOwner_statFile_top_level) {
}
}
*/
static cta::MockNameServerFactory mockNsFactory;
#undef TEST_MOCK_DB
#ifdef TEST_MOCK_DB
static cta::MockSchedulerDatabaseFactory mockDbFactory;
INSTANTIATE_TEST_CASE_P(MockSchedulerTest, SchedulerTest,
::testing::Values(SchedulerTestParam(mockNsFactory, mockDbFactory)));
::testing::Values(SchedulerTestParam(mockDbFactory)));
#endif
#define TEST_VFS
......@@ -2586,7 +2557,7 @@ INSTANTIATE_TEST_CASE_P(MockSchedulerTest, SchedulerTest,
static cta::OStoreDBFactory<cta::objectstore::BackendVFS> OStoreDBFactoryVFS;
INSTANTIATE_TEST_CASE_P(OStoreDBPlusMockSchedulerTestVFS, SchedulerTest,
::testing::Values(SchedulerTestParam(mockNsFactory, OStoreDBFactoryVFS)));
::testing::Values(SchedulerTestParam(OStoreDBFactoryVFS)));
#endif
#undef TEST_RADOS
......@@ -2594,7 +2565,7 @@ INSTANTIATE_TEST_CASE_P(OStoreDBPlusMockSchedulerTestVFS, SchedulerTest,
static cta::OStoreDBFactory<cta::objectstore::BackendRados> OStoreDBFactoryRados("rados://tapetest@tapetest");
INSTANTIATE_TEST_CASE_P(OStoreDBPlusMockSchedulerTestRados, SchedulerTest,
::testing::Values(SchedulerTestParam(mockNsFactory, OStoreDBFactoryRados)));
::testing::Values(SchedulerTestParam(OStoreDBFactoryRados)));
#endif
} // namespace unitTests
......@@ -570,7 +570,7 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
cta::objectstore::BackendPopulator backendPopulator(*backend);
cta::OStoreDBWithAgent osdb(*backend, backendPopulator.getAgent());
cta::catalogue::DummyCatalogue catalogue;
cta::Scheduler scheduler(catalogue, mockNs, osdb, eosNs);
cta::Scheduler scheduler(catalogue, osdb);
castor::tape::System::realWrapper sysWrapper;
......
......@@ -264,7 +264,7 @@ XrdProFilesystem::XrdProFilesystem():
.release()),
m_backendPopulator(*m_backend),
m_scheddb(*m_backend, m_backendPopulator.getAgent()),
m_scheduler(m_catalogue, m_ns, m_scheddb, m_remoteStorage)
m_scheduler(m_catalogue, m_scheddb)
{
// If the backend is a VFS, make sure we don't delete it on exit.
// If not, nevermind.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment