E2AP Wrapper Implementation
[ric-app/hw.git] / test / hw_unit_tests.cc
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  * hw_unit_tests.cc
20  *
21  *  Created on: Mar, 2020
22  *  Author: Shraboni Jana
23  */
24
25 #include<iostream>
26 #include<stdlib.h>
27 #include<gtest/gtest.h>
28
29 #include "xapp.hpp"
30
31 #include "test_indc.h"
32 #include "test_subs.h"
33 #include "test_cntrl.h"
34
35 #include "test_e2ap.h"
36
37 #include "test_db.h"
38 #include "test_rmr.h"
39 #include "test_hc.h"
40
41
42 using namespace std;
43
44
45 int main(int argc, char* argv[])
46 {
47         char *aux;
48         aux=getenv("RMR_SEED_RT");
49         if (aux==NULL || *aux == '\0'){
50
51                 char rmr_seed[80]="RMR_SEED_RT=../init/routes.txt";
52                 putenv(rmr_seed);
53         }
54         //get configuration
55         XappSettings config;
56         //change the priority depending upon application requirement
57         config.loadDefaultSettings();
58         config.loadEnvVarSettings();
59
60         //initialize rmr
61         std::unique_ptr<XappRmr> rmr = std::make_unique<XappRmr>("38000");
62         rmr->xapp_rmr_init(true);
63
64         //create a dummy xapp
65         std::unique_ptr<Xapp> dm_xapp = std::make_unique<Xapp>(std::ref(config),std::ref(*rmr));
66         dm_xapp->Run();
67
68         testing::InitGoogleTest(&argc, argv);
69     ::testing::GTEST_FLAG(filter) = "E2AP*";
70
71         int res = RUN_ALL_TESTS();
72
73
74
75         return res;
76 }