InMemoryCatalogueTest.cpp 1.54 KB
Newer Older
Steven Murray's avatar
WIP    
Steven Murray committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*
 * 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/>.
 */

19
#include "catalogue/CatalogueTest.hpp"
20
21
22

namespace unitTests {

23
namespace {
24

25
26
27
/**
 * Creates DbLogin objects for in-memory catalogue databases.
 */
28
class InMemoryDbLoginFactory: public cta::rdbms::DbLoginFactory {
29
public:
30
31

  /**
32
   * Destructor.
33
   */
34
  virtual ~InMemoryDbLoginFactory() {
35
  }
36
37

  /**
38
   * Returns a newly created DbLogin object.
39
   *
40
   * @return A newly created DbLogin object.
41
   */
42
  virtual cta::rdbms::DbLogin create() {
43
    using namespace cta::catalogue;
44
    return cta::rdbms::DbLogin(cta::rdbms::DbLogin::DBTYPE_IN_MEMORY, "", "", "");
45
  }
46
}; // class InMemoryDbLoginFactory
47

48
InMemoryDbLoginFactory g_inMemoryDbLoginFactory;
49

50
} // anonymous namespace
51

52
INSTANTIATE_TEST_CASE_P(InMemory, cta_catalogue_CatalogueTest,
53
  ::testing::Values(dynamic_cast<cta::rdbms::DbLoginFactory*>(&g_inMemoryDbLoginFactory)));
54

55
} // namespace unitTests