sjana | 65ac2f8 | 2020-03-31 12:20:25 -0400 | [diff] [blame^] | 1 | /* |
| 2 | ================================================================================== |
| 3 | |
| 4 | Copyright (c) 2018-2019 AT&T Intellectual Property. |
| 5 | |
| 6 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | you may not use this file except in compliance with the License. |
| 8 | You may obtain a copy of the License at |
| 9 | |
| 10 | http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | |
| 12 | Unless required by applicable law or agreed to in writing, software |
| 13 | distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | See the License for the specific language governing permissions and |
| 16 | limitations under the License. |
| 17 | ================================================================================== |
| 18 | /* |
| 19 | * test_rnib.h |
| 20 | * |
| 21 | * Created on: Mar 23, 2020 |
| 22 | * Author: Shraboni Jana |
| 23 | */ |
| 24 | |
| 25 | #ifndef TEST_TEST_DB_H_ |
| 26 | #define TEST_TEST_DB_H_ |
| 27 | |
| 28 | #include<iostream> |
| 29 | #include<gtest/gtest.h> |
| 30 | #include "xapp.hpp" |
| 31 | |
| 32 | using namespace std; |
| 33 | |
| 34 | TEST(Xapp, getGNBlist) |
| 35 | { |
| 36 | XappSettings config; |
| 37 | XappRmr rmr("7001"); |
| 38 | |
| 39 | Xapp hw_xapp(std::ref(config),rmr); |
| 40 | hw_xapp.set_rnib_gnblist(); |
| 41 | |
| 42 | auto gnblist = hw_xapp.get_rnib_gnblist(); |
| 43 | int sz = gnblist.size(); |
| 44 | EXPECT_GE(sz,0); |
| 45 | std::cout << "************gnb ids retrieved using R-NIB**************" << std::endl; |
| 46 | for(int i = 0; i<sz; i++){ |
| 47 | std::cout << gnblist[i] << std::endl; |
| 48 | } |
| 49 | |
| 50 | } |
| 51 | |
| 52 | TEST(Xapp, SDLData){ |
| 53 | |
| 54 | //Xapp's SDL namespace. |
| 55 | std::string nmspace = "hw-xapp"; |
| 56 | XappSDL xappsdl(nmspace); |
| 57 | |
| 58 | std::unique_ptr<shareddatalayer::SyncStorage> sdl(shareddatalayer::SyncStorage::create()); |
| 59 | bool res = xappsdl.set_data(sdl.get()); |
| 60 | ASSERT_TRUE(res); |
| 61 | |
| 62 | xappsdl.get_data(sdl.get()); |
| 63 | |
| 64 | } |
| 65 | |
| 66 | |
| 67 | |
| 68 | #endif /* TEST_TEST_DB_H_ */ |