| /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| /* |
| * Copyright (c) 2014-2020, Regents of the University of California. |
| * |
| * This file is part of NDNS (Named Data Networking Domain Name Service). |
| * See AUTHORS.md for complete list of NDNS authors and contributors. |
| * |
| * NDNS 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. |
| * |
| * NDNS 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 |
| * NDNS, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>. |
| */ |
| |
| #ifndef NDNS_TESTS_UNIT_DATABASE_TEST_DATA_HPP |
| #define NDNS_TESTS_UNIT_DATABASE_TEST_DATA_HPP |
| |
| #include "daemon/db-mgr.hpp" |
| #include "clients/response.hpp" |
| #include "clients/query.hpp" |
| #include "validator/validator.hpp" |
| |
| #include "io-fixture.hpp" |
| #include "key-chain-fixture.hpp" |
| |
| namespace ndn { |
| namespace ndns { |
| namespace tests { |
| |
| class DbTestData : public IoFixture, public KeyChainFixture |
| { |
| public: |
| static const boost::filesystem::path TEST_DATABASE; |
| static const Name TEST_IDENTITY_NAME; |
| static const boost::filesystem::path TEST_CERT; |
| static const boost::filesystem::path TEST_DKEY_CERT; |
| |
| DbTestData(); |
| |
| ~DbTestData() override; |
| |
| private: |
| void |
| addRrset(Zone& zone, const Name& label, const name::Component& type, |
| const time::seconds& ttl, const name::Component& version, |
| const name::Component& qType, NdnsContentType contentType, const std::string& msg); |
| |
| public: |
| class PreviousStateCleaner |
| { |
| public: |
| PreviousStateCleaner(); |
| }; |
| |
| PreviousStateCleaner m_cleaner; |
| Name m_certName; |
| std::vector<Zone> m_zones; |
| std::vector<Rrset> m_rrsets; |
| std::vector<Link> m_links; |
| |
| Zone m_test; |
| Zone m_net; |
| Zone m_ndnsim; |
| DbMgr m_session; |
| |
| // test zone identity |
| Identity m_identity; |
| |
| // test zone dsk |
| Certificate m_cert; |
| |
| Name m_testName; |
| Name m_netName; |
| Name m_ndnsimName; |
| }; |
| |
| } // namespace tests |
| } // namespace ndns |
| } // namespace ndn |
| |
| #endif // NDNS_TESTS_UNIT_DATABASE_TEST_DATA_HPP |