summaryrefslogtreecommitdiff
path: root/test/poi-service
diff options
context:
space:
mode:
authorasanoaozora <fifitaneki@hotmail.com>2016-06-21 14:43:16 +0200
committerasanoaozora <fifitaneki@hotmail.com>2016-06-21 14:43:16 +0200
commit9bbc028781d58dbfd29bb77cf6e1892307964d35 (patch)
treea13ecafae920db4fe7876004f2bd24fb3379cbe7 /test/poi-service
parentafd74c2978de340727b7890027acbe855def5821 (diff)
downloadpoi-service-9bbc028781d58dbfd29bb77cf6e1892307964d35.tar.gz
poi add/remove POC migrated and tested
Diffstat (limited to 'test/poi-service')
-rw-r--r--test/poi-service/poi-manager-client/CMakeLists.txt39
-rw-r--r--test/poi-service/poi-manager-client/README.md53
-rw-r--r--test/poi-service/poi-manager-client/main.cpp17
-rwxr-xr-xtest/poi-service/poi-manager-client/run.sh (renamed from test/poi-service/poi-manager-client/run)15
-rw-r--r--test/poi-service/resource/commonapi-dbus.ini4
5 files changed, 51 insertions, 77 deletions
diff --git a/test/poi-service/poi-manager-client/CMakeLists.txt b/test/poi-service/poi-manager-client/CMakeLists.txt
index b2973b3..4ca7451 100644
--- a/test/poi-service/poi-manager-client/CMakeLists.txt
+++ b/test/poi-service/poi-manager-client/CMakeLists.txt
@@ -16,19 +16,13 @@
# @licence end@
###########################################################################
project(poi-manager-client)
+cmake_minimum_required(VERSION 2.8)
+
message(STATUS ${PROJECT_NAME})
set(CMAKE_VERBOSE_MAKEFILE on)
set(CMAKE_CXX_FLAGS "-Wall -std=c++0x")
-set(PARENT_API poiservice)
-set(ROOT_API navigation)
-set(API_VERSION_MAJOR 0)
-set(API_VERSION "v${API_VERSION_MAJOR}")
-set(COMMONAPI_GEN_DIR "${CMAKE_CURRENT_BINARY_DIR}/src-gen")
-set(PRJ_SRC_GEN_PATH ${COMMONAPI_GEN_DIR}/${API_VERSION}/org/genivi/${ROOT_API}/${PARENT_API})
-set(PRJ_SRC_GEN_NAVIGATION_TYPES_PATH ${COMMONAPI_GEN_DIR}/${API_VERSION}/org/genivi/${ROOT_API})
-set(PRJ_SRC_GEN_POISERVICE_TYPES_PATH ${COMMONAPI_GEN_DIR}/${API_VERSION}/org/genivi/${ROOT_API}/${PARENT_API})
set(API_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../api")
set(FRANCA_DIR "${API_DIR}/franca")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib)
@@ -44,7 +38,7 @@ if (DBUS_LIB_PATH)
set(DBUS_LIBDIR ${DBUS_LIB_PATH}/lib)
set(DBUS_LIBRARIES ${DBUS_LIB_PATH}/lib/libdbus-1.so)
else()
- message(FATAL_ERROR "Please specify the path to your patched DBus library using -D DBUS_LIB_PATH=yourPath")
+ message(FATAL_ERROR "Please specify the path to your patched DBus library using -DDBUS_LIB_PATH=yourPath")
endif()
# Packages
@@ -61,19 +55,32 @@ pkg_check_modules(GOBJECT gobject-2.0)
pkg_check_modules(GLIB REQUIRED glib-2.0)
pkg_check_modules(GTK gtk+-3.0)
-# Source Files
-FILE(GLOB PRJ_LOCAL_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
-
+# Add the Franca files (that will generate the CommonAPI stuff)
+set(COMMONAPI_GEN_DIR "${CMAKE_CURRENT_BINARY_DIR}/src-gen")
add_subdirectory(${FRANCA_DIR}/navigation/poiservice "${CMAKE_CURRENT_BINARY_DIR}/franca")
-FILE(GLOB PRJ_PROXY_GEN_SRCS ${PRJ_SRC_GEN_PATH}/*Proxy.cpp)
-FILE(GLOB PRJ_STUB_GEN_TYPES ${PRJ_SRC_GEN_NAVIGATION_TYPES_PATH}/*Types*.cpp ${PRJ_SRC_GEN_POISERVICE_TYPES_PATH}/*Types*.cpp)
-set(PRJ_SRCS ${PRJ_LOCAL_SRCS} ${PRJ_COMMON_SRCS} ${PRJ_PROXY_GEN_SRCS} ${PRJ_STUB_GEN_TYPES})
+# Path to the generated files
+set(API_VERSION_MAJOR 4)
+set(API_VERSION "v${API_VERSION_MAJOR}")
+set(PRJ_SRC_GEN_ROOT_PATH ${COMMONAPI_GEN_DIR}/${API_VERSION}/org/genivi) #files shared by all the APIs
+set(PRJ_SRC_GEN_NAVIGATION_PATH ${PRJ_SRC_GEN_ROOT_PATH}/navigation) #files shared by the navigation APIs
+set(PRJ_SRC_GEN_POISERVICE_PATH ${PRJ_SRC_GEN_NAVIGATION_PATH}/poiservice) #files shared by the poiservice APIs
+
+# Source Files
+FILE(GLOB PRJ_LOCAL_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
+FILE(GLOB PRJ_PROXY_GEN_SRCS
+ ${PRJ_SRC_GEN_ROOT_PATH}/*DBusProxy.cpp ${PRJ_SRC_GEN_ROOT_PATH}/*Types.cpp ${PRJ_SRC_GEN_ROOT_PATH}/*DBusDeployment.cpp
+ ${PRJ_SRC_GEN_NAVIGATION_PATH}/*DBusProxy.cpp ${PRJ_SRC_GEN_NAVIGATION_PATH}/*Types.cpp ${PRJ_SRC_GEN_NAVIGATION_PATH}/*DBusDeployment.cpp
+ ${PRJ_SRC_GEN_POISERVICE_PATH}/*DBusProxy.cpp ${PRJ_SRC_GEN_POISERVICE_PATH}/*Types.cpp ${PRJ_SRC_GEN_POISERVICE_PATH}/*DBusDeployment.cpp
+ )
+set(PRJ_SRCS ${PRJ_LOCAL_SRCS} ${PRJ_PROXY_GEN_SRCS})
include_directories(
${COMMON_DIR}
- ${PRJ_SRC_GEN_PATH}
${COMMONAPI_GEN_DIR}
+ ${PRJ_SRC_GEN_ROOT_PATH}
+ ${PRJ_SRC_GEN_NAVIGATION_PATH}
+ ${PRJ_SRC_GEN_POISERVICE_PATH}
${DBUS_INCLUDE_DIRS}
${COMMONAPI_INCLUDE_DIRS}
${COMMONAPI_DBUS_INCLUDE_DIRS}
diff --git a/test/poi-service/poi-manager-client/README.md b/test/poi-service/poi-manager-client/README.md
index 381fd1c..ff729dc 100644
--- a/test/poi-service/poi-manager-client/README.md
+++ b/test/poi-service/poi-manager-client/README.md
@@ -28,70 +28,37 @@ or to build updated parts
## How To Run
-First it's required to set a config file:
-Copy the configuration file ../resource/commonapi-dbus.ini in a directory of your choice
-
-Set the environment variable COMMONAPI_DBUS_DEFAULT_CONFIG before starting the poi-manager-server.
-
-Example:
-```export COMMONAPI_DBUS_DEFAULT_CONFIG=<your path>/commonapi-dbus.ini```
-
-./run
+```./run.sh```
## How to test
---Test sequence can be---
-NB: no DLT started
-
-DLT| WARNING: Loging disabled, FIFO /tmp/dlt cannot be opened with open()!
-[CAPI][INFO] Using default binding 'dbus'
-[CAPI][INFO] Using default shared library folder '/usr/local/lib/commonapi'
-[CAPI][INFO] Using default configuration file '/etc/commonapi.ini'
-[CAPI][DEBUG] Registering factory for binding=dbus
-poi manager server started
-
-DLT| WARNING: Loging disabled, FIFO /tmp/dlt cannot be opened with open()!
-[CAPI][INFO] Using default binding 'dbus'
-[CAPI][INFO] Using default shared library folder '/usr/local/lib/commonapi'
-[CAPI][INFO] Using default configuration file '/etc/commonapi.ini'
-[CAPI][DEBUG] Registering factory for binding=dbus
+```./run.sh```
poi manager client started
-Version 1.0.0
+languageCode: Version eng countryCode: USA scriptCode: Latn
+1.0.0
Date 19-03-2015
-languageCode: eng countryCode: USA scriptCode: Latn
Configuration changed: 0
Change locales
languageCode: fra countryCode: FRA scriptCode: Latn
id: 0 name: all categories top level: 1
-
-Create category
-
+**--> Push button Create category**
Category 1 created
id: 0 name: all categories top level: 1
id: 1 name: recreation top level: 1
-
-Create POI
-
+**--> Push button Create POI**
POI 1 added
-
-Search
-
+**--> Push button Search**
Search state 1298
Result list size 1
POI id 1
-
-Delete POI
-
+**--> Push button Delete POI**
POI 1 removed
-
-Delete category
-
+**--> Push button Delete category**
Category 1 removed
id: 0 name: all categories top level: 1
-
-Exit
+**-> Stop it**
poi manager client closed
-DLT| ERROR: Lost log messages in user buffer when exiting: 2
## License
diff --git a/test/poi-service/poi-manager-client/main.cpp b/test/poi-service/poi-manager-client/main.cpp
index e75e685..2b54576 100644
--- a/test/poi-service/poi-manager-client/main.cpp
+++ b/test/poi-service/poi-manager-client/main.cpp
@@ -40,10 +40,10 @@
#include <functional>
#include <CommonAPI/CommonAPI.hpp> //Defined in the Common API Runtime library
-#include <v4/org/genivi/CommonTypes.hpp>
-#include <v4/org/genivi/navigation/NavigationTypes.hpp>
-#include <v4/org/genivi/navigation/poiservice/POIServiceTypes.hpp>
-#include <v4/org/genivi/navigation/poiservice/POIContentAccessModuleProxy.hpp>
+#include <CommonTypes.hpp>
+#include <NavigationTypes.hpp>
+#include <POIServiceTypes.hpp>
+#include <POIContentAccessModuleProxy.hpp>
#include "poi-common-data-model.h"
@@ -586,15 +586,16 @@ int main(int argc , char** argv )
std::shared_ptr < CommonAPI::Runtime > runtime = CommonAPI::Runtime::get();
- const std::string &domain = "local";
- const std::string &instance = "POIContentManager";
+ const std::string domain = "local";
+ const std::string instance = "POIContentAccessModuleService";
+ const std::string connection = "POIContentAccessModuleClient";
- std::shared_ptr<POIContentAccessModuleProxyDefault> myProxy = runtime->buildProxy<POIContentAccessModuleProxy>(domain,instance);
+ std::shared_ptr<POIContentAccessModuleProxyDefault> myProxy =
+ runtime->buildProxy<POIContentAccessModuleProxy>(domain,instance);
while (!myProxy->isAvailable()) {
usleep(10);
}
- cout << "poi manager client started" << endl;
//index used for argument analysis
int next_option;
diff --git a/test/poi-service/poi-manager-client/run b/test/poi-service/poi-manager-client/run.sh
index 4ade761..f978a93 100755
--- a/test/poi-service/poi-manager-client/run
+++ b/test/poi-service/poi-manager-client/run.sh
@@ -32,13 +32,16 @@ POI_MANAGER_CLIENT_DIR=$CURDIR
POI_MANAGER_CLIENT_BIN_DIR=$POI_MANAGER_CLIENT_DIR/bin
POI_MANAGER_SERVER_DIR=$CURDIR/../../../src/poi-service/poi-manager-server
POI_MANAGER_SERVER_BIN_DIR=$POI_MANAGER_SERVER_DIR/bin
-
-cp $POI_MANAGER_CLIENT_DIR/../resource/commonapi-dbus.ini $HOME
-export COMMONAPI_DBUS_DEFAULT_CONFIG=$HOME/commonapi-dbus.ini
-cp $POI_MANAGER_SERVER_DIR/../resource/poi-database-managed.db $POI_MANAGER_SERVER_BIN_DIR
-
+RESOURCE=$POI_MANAGER_SERVER_DIR/../resource
echo '------------------------start the proof of concept------------------------'
+cp $RESOURCE/poi-database-managed.db ./bin
+COMMONAPI_DEFAULT_CONFIG=$RESOURCE/commonapi4dbus.ini \
+COMMONAPI_DBUS_DEFAULT_CONFIG=$RESOURCE/commonapi-dbus.ini \
$POI_MANAGER_SERVER_BIN_DIR/poi-manager-server -f $POI_MANAGER_SERVER_BIN_DIR/poi-database-managed.db &
-$POI_MANAGER_CLIENT_BIN_DIR/poi-manager-client -t &
+COMMONAPI_DEFAULT_CONFIG=$RESOURCE/commonapi4dbus.ini \
+COMMONAPI_DBUS_DEFAULT_CONFIG=$RESOURCE/commonapi-dbus.ini \
+$POI_MANAGER_CLIENT_BIN_DIR/poi-manager-client -t
+kill -9 `ps -ef | egrep poi-manager-server | grep -v grep | awk '{print $2}'`
+
diff --git a/test/poi-service/resource/commonapi-dbus.ini b/test/poi-service/resource/commonapi-dbus.ini
deleted file mode 100644
index 4cddb07..0000000
--- a/test/poi-service/resource/commonapi-dbus.ini
+++ /dev/null
@@ -1,4 +0,0 @@
-[local:org.genivi.poiservice.POIContentManager:org.genivi.poiservice.POIContentManager]
-service=org.genivi.poiservice.POIContentManager
-path=/org/genivi/poiservice/POIContentManager
-interface=org.genivi.poiservice.POIContentManager