Skip to content
Snippets Groups Projects
Commit 38fe537f authored by Eric Cano's avatar Eric Cano
Browse files

Moved all name space related code to namespace directory

parent a737f9f6
No related branches found
No related tags found
No related merge requests found
......@@ -32,10 +32,8 @@ set (MIDDLE_TIER_INTERFACE_SRC_FILES
interface/LogicalLibrary.cpp
interface/MiddleTierAdmin.cpp
interface/MiddleTierUser.cpp
interface/MockNameServer.cpp
interface/Mount.cpp
interface/MountCriteria.cpp
interface/NameServer.cpp
interface/RemoteStorage.cpp
interface/RetrievalFileTransfer.cpp
interface/RetrievalJob.cpp
......@@ -60,7 +58,6 @@ add_library (ctamiddletier SHARED
${MIDDLE_TIER_INTERFACE_SRC_FILES})
set (MIDDLE_TIER_INTERFACE_UNIT_TESTS_LIB_SRC_FILES
interface/MockNameServerTest.cpp
sharedtest/MiddleTierAdminAbstractTest.cpp
sharedtest/MiddleTierUserAbstractTest.cpp)
......
/*
* The CERN Tape Archive (CTA) project
* Copyright (C) 2015 CERN
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "MiddleTierAbstractTest.hpp"
#include "ObjectStoreMiddleTierAdmin.hpp"
#include "objectstore/BackendRados.hpp"
#include "objectstore/BackendVFS.hpp"
#include "middletier/cta/SqliteDatabase.hpp"
#include "middletier/cta/Vfs.hpp"
#include "middletier/cta/SqliteMiddleTierAdmin.hpp"
#include "middletier/cta/SqliteMiddleTierUser.hpp"
#define TEST_RADOS 0
#define TEST_VFS 0
#define TEST_SQL 1
namespace unitTests {
#if TEST_RADOS
cta::objectstore::BackendRados osRados("tapetest", "tapetest");
cta::OStoreMiddleTierAdmin mtaRados(osRados);
unitTests::MiddleTierFull middleTierRados;
middleTierRados.admin = &mtaRados;
middleTierRados.user = NULL;
INSTANTIATE_TEST_CASE_P(MiddleTierRados, MiddleTierAbstractTest , ::testing::Values(middleTierRados));
#endif
#if TEST_VFS
cta::objectstore::BackendVFS osVFS;
#endif
#if TEST_SQL
class SQLiteLocalMiddleTier: public localMiddleTier {
public:
SQLiteLocalMiddleTier(): m_vfs(), m_sqLite(), m_admin(m_vfs, m_sqLite),
m_user(m_vfs, m_sqLite) {}
virtual cta::MiddleTierAdmin & admin () { return m_admin; }
virtual cta::MiddleTierUser & user () { return m_user; }
private:
cta::Vfs m_vfs;
cta::SqliteDatabase m_sqLite;
cta::SqliteMiddleTierAdmin m_admin;
cta::SqliteMiddleTierUser m_user;
};
class SQLiteMiddleTierFactory: public MiddleTierFactory {
public:
SQLiteMiddleTierFactory() {
m_localMiddleTier = allocateLocalMiddleTier();
}
virtual localMiddleTier * allocateLocalMiddleTier() {
return new SQLiteLocalMiddleTier; }
} g_SQLiteMiddleTierFactory;
// Macro chokes on implicit casting of pointer so we have to do it ourselves
INSTANTIATE_TEST_CASE_P(MiddleTierSQL, MiddleTierAbstractTest, ::testing::Values(
(MiddleTierFactory*)&g_SQLiteMiddleTierFactory));
#endif
}
\ No newline at end of file
cmake_minimum_required (VERSION 2.6)
add_library (ctanameserver SHARED
NameServer.cpp)
add_library (ctamocknameserver SHARED
MockNameServer.cpp)
add_library (ctamocknameservertest SHARED
MockNameServerTest.cpp)
add_library (ctanamespacevfs SHARED
Vfs.cpp)
......
......@@ -31,7 +31,7 @@
#include "utils/exception/Exception.hpp"
#include "utils/exception/Errnum.hpp"
#include "utils/Utils.hpp"
#include "middletier/interface/MockNameServer.hpp"
#include "namespace/MockNameServer.hpp"
using cta::exception::Exception;
//------------------------------------------------------------------------------
......
......@@ -19,7 +19,7 @@
#pragma once
#include "middletier/interface/DirIterator.hpp"
#include "middletier/interface/NameServer.hpp"
#include "namespace/NameServer.hpp"
#include "middletier/interface/SecurityIdentity.hpp"
#include <list>
......
......@@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "middletier/interface/MockNameServer.hpp"
#include "namespace/MockNameServer.hpp"
#include <gtest/gtest.h>
#include <memory>
......
......@@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "middletier/interface/NameServer.hpp"
#include "namespace/NameServer.hpp"
//------------------------------------------------------------------------------
// destructor
......
File moved
......@@ -66,8 +66,6 @@ public:
private:
std::string m_baseDir;
std::string m_fsDir;
void checkDirectoryExists(const std::string &dirPath);
......
......@@ -20,6 +20,9 @@ target_link_libraries(unittests
ctamiddletierobjectstore
ctanamespacevfs
ctanamespacevfsunittests
ctamocknameservertest
ctamocknameserver
ctanameserver
gmock
gtest
pthread)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment