Yanbiao Li | c17de83 | 2014-11-21 17:51:45 -0800 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 | /** |
Junxiao Shi | 38f4ce9 | 2016-08-04 10:01:52 +0000 | [diff] [blame] | 3 | * Copyright (c) 2014-2016, Regents of the University of California, |
| 4 | * Arizona Board of Regents, |
| 5 | * Colorado State University, |
| 6 | * University Pierre & Marie Curie, Sorbonne University, |
| 7 | * Washington University in St. Louis, |
| 8 | * Beijing Institute of Technology, |
| 9 | * The University of Memphis. |
Yanbiao Li | c17de83 | 2014-11-21 17:51:45 -0800 | [diff] [blame] | 10 | * |
Junxiao Shi | 38f4ce9 | 2016-08-04 10:01:52 +0000 | [diff] [blame] | 11 | * This file is part of NFD (Named Data Networking Forwarding Daemon). |
| 12 | * See AUTHORS.md for complete list of NFD authors and contributors. |
Yanbiao Li | c17de83 | 2014-11-21 17:51:45 -0800 | [diff] [blame] | 13 | * |
Junxiao Shi | 38f4ce9 | 2016-08-04 10:01:52 +0000 | [diff] [blame] | 14 | * NFD is free software: you can redistribute it and/or modify it under the terms |
| 15 | * of the GNU General Public License as published by the Free Software Foundation, |
| 16 | * either version 3 of the License, or (at your option) any later version. |
Yanbiao Li | c17de83 | 2014-11-21 17:51:45 -0800 | [diff] [blame] | 17 | * |
Junxiao Shi | 38f4ce9 | 2016-08-04 10:01:52 +0000 | [diff] [blame] | 18 | * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
| 19 | * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
| 20 | * PURPOSE. See the GNU General Public License for more details. |
Yanbiao Li | c17de83 | 2014-11-21 17:51:45 -0800 | [diff] [blame] | 21 | * |
Junxiao Shi | 38f4ce9 | 2016-08-04 10:01:52 +0000 | [diff] [blame] | 22 | * You should have received a copy of the GNU General Public License along with |
| 23 | * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>. |
Yanbiao Li | c17de83 | 2014-11-21 17:51:45 -0800 | [diff] [blame] | 24 | */ |
| 25 | |
Yukai Tu | 0a49d34 | 2015-09-13 12:54:22 +0800 | [diff] [blame] | 26 | #ifndef NFD_TESTS_IDENTITY_MANAGEMENT_FIXTURE_HPP |
| 27 | #define NFD_TESTS_IDENTITY_MANAGEMENT_FIXTURE_HPP |
| 28 | |
Yanbiao Li | c17de83 | 2014-11-21 17:51:45 -0800 | [diff] [blame] | 29 | #include "tests/test-common.hpp" |
| 30 | #include <ndn-cxx/security/key-chain.hpp> |
| 31 | #include <vector> |
| 32 | |
| 33 | #include "boost-test.hpp" |
| 34 | |
| 35 | namespace nfd { |
| 36 | namespace tests { |
| 37 | |
| 38 | /** |
| 39 | * @brief IdentityManagementFixture is a test suite level fixture. |
| 40 | * |
| 41 | * Test cases in the suite can use this fixture to create identities. |
| 42 | * Identities added via addIdentity method are automatically deleted |
| 43 | * during test teardown. |
| 44 | */ |
Yukai Tu | 0a49d34 | 2015-09-13 12:54:22 +0800 | [diff] [blame] | 45 | class IdentityManagementFixture : public virtual BaseFixture |
Yanbiao Li | c17de83 | 2014-11-21 17:51:45 -0800 | [diff] [blame] | 46 | { |
| 47 | public: |
| 48 | IdentityManagementFixture(); |
| 49 | |
| 50 | ~IdentityManagementFixture(); |
| 51 | |
| 52 | // @brief add identity, return true if succeed. |
| 53 | bool |
| 54 | addIdentity(const ndn::Name& identity, |
| 55 | const ndn::KeyParams& params = ndn::KeyChain::DEFAULT_KEY_PARAMS); |
| 56 | |
| 57 | protected: |
| 58 | ndn::KeyChain m_keyChain; |
| 59 | std::vector<ndn::Name> m_identities; |
| 60 | }; |
| 61 | |
Junxiao Shi | 38f4ce9 | 2016-08-04 10:01:52 +0000 | [diff] [blame] | 62 | class IdentityManagementTimeFixture : public UnitTestTimeFixture |
| 63 | , public IdentityManagementFixture |
| 64 | { |
| 65 | }; |
| 66 | |
Yanbiao Li | c17de83 | 2014-11-21 17:51:45 -0800 | [diff] [blame] | 67 | } // namespace tests |
| 68 | } // namespace nfd |
Yukai Tu | 0a49d34 | 2015-09-13 12:54:22 +0800 | [diff] [blame] | 69 | |
| 70 | #endif // NFD_TESTS_IDENTITY_MANAGEMENT_FIXTURE_HPP |