E2AP Wrapper Implementation
[ric-app/hw.git] / test / hw_unit_tests.cc
index a1bd3ca..94377f5 100644 (file)
@@ -1,7 +1,7 @@
 /*
 ==================================================================================
 
-        Copyright (c) 2018-2019 AT&T Intellectual Property.
+        Copyright (c) 2019-2020 AT&T Intellectual Property.
 
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
 #include<stdlib.h>
 #include<gtest/gtest.h>
 
+#include "xapp.hpp"
+
+#include "test_indc.h"
+#include "test_subs.h"
+#include "test_cntrl.h"
+
+#include "test_e2ap.h"
+
 #include "test_db.h"
-//#include "test_rmr.h"
+#include "test_rmr.h"
 #include "test_hc.h"
 
-#define HC_MSG_SIZE 512
 
 using namespace std;
 
 
 int main(int argc, char* argv[])
 {
-       char rmr_seed[80]="RMR_SEED_RT=../src/routes.txt";
-       putenv(rmr_seed);
+       char *aux;
+       aux=getenv("RMR_SEED_RT");
+       if (aux==NULL || *aux == '\0'){
+
+               char rmr_seed[80]="RMR_SEED_RT=../init/routes.txt";
+               putenv(rmr_seed);
+       }
+       //get configuration
+       XappSettings config;
+       //change the priority depending upon application requirement
+       config.loadDefaultSettings();
+       config.loadEnvVarSettings();
+
+       //initialize rmr
+       std::unique_ptr<XappRmr> rmr = std::make_unique<XappRmr>("38000");
+       rmr->xapp_rmr_init(true);
+
+       //create a dummy xapp
+       std::unique_ptr<Xapp> dm_xapp = std::make_unique<Xapp>(std::ref(config),std::ref(*rmr));
+       dm_xapp->Run();
 
        testing::InitGoogleTest(&argc, argv);
-       return RUN_ALL_TESTS();
+    ::testing::GTEST_FLAG(filter) = "E2AP*";
+
+       int res = RUN_ALL_TESTS();
+
+
+
+       return res;
 }