E2AP Wrapper Implementation
[ric-app/hw.git] / test / test_db.h
1 /*
2 ==================================================================================
3
4         Copyright (c) 2019-2020 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
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         auto gnblist = hw_xapp.get_rnib_gnblist();
42         int sz = gnblist.size();
43         EXPECT_GE(sz,0);
44         std::cout << "************gnb ids retrieved using R-NIB**************" << std::endl;
45         for(int i = 0; i<sz; i++){
46                 std::cout << gnblist[i] << std::endl;
47         }
48
49 }
50
51 TEST(Xapp, SDLData){
52
53         //Xapp's SDL namespace.
54     std::string nmspace = "hw-xapp";
55         XappSDL xappsdl(nmspace);
56
57         std::unique_ptr<shareddatalayer::SyncStorage> sdl(shareddatalayer::SyncStorage::create());
58         bool res = xappsdl.set_data(sdl.get());
59         ASSERT_TRUE(res);
60
61         xappsdl.get_data(sdl.get());
62
63 }
64
65
66
67 #endif /* TEST_TEST_DB_H_ */