file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/hmi_capabilities.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/wp1_policy_table.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+if (BUILD_TESTS)
+ file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/wp1_policy_table.json DESTINATION ${CMAKE_BINARY_DIR}/test/)
+ file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/log4cxx.properties DESTINATION ${CMAKE_BINARY_DIR}/test/)
+ file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/smartDeviceLink.ini DESTINATION ${CMAKE_BINARY_DIR}/test/)
+endif()
+
if (${QT_HMI})
set(main_qml "hmi/MainWindow.qml")
set(plugins_dir "hmi/plugins")
find_package(Gstreamer-1.0 REQUIRED)
find_package(Glib-2.0 REQUIRED)
+find_package(LibXML2 REQUIRED)
# --- GoogleTest example
#add_subdirectory(./gtest-example)
# --- components tests
add_subdirectory(./components)
add_subdirectory(./thirdPartyLibs)
-add_subdirectory(./tools)
+
+#add_subdirectory(./tools)
+
include_directories (
../src/thirdPartyLibs/gmock-1.6.0/include
../src/thirdPartyLibs/jsoncpp/include/
../src/thirdPartyLibs/gmock-1.6.0/gtest/include
../src/thirdPartyLibs/MessageBroker/include
+ ../src/appMain
../src/components/application_manager/include
+ ../src/components/policies/include
../src/components/hmi_message_handler/include
../src/components/request_watchdog/include
../src/components/media_manager/include
../src/components/formatters/include
../src/components/smart_objects/include
../src/components/formatters/include
- ../src/components/resumption/include
../src/components/utils/include/
+ ../src/components/resumption/include/
../test/components/mobile_message_handler/include/
../test/components/request_watchdog/include/
../test/components/media_manager/include
../test/components/application_manager/rpc/include
${CMAKE_BINARY_DIR}/src/components/
${CMAKE_BINARY_DIR}
+ ${LibXML2_INCLUDE_DIR}
# /usr/lib/i386-linux-gnu/glib-2.0/include
# /usr/lib/x86_64-linux-gnu/glib-2.0/include/
# ${GSTREAMER_gst_INCLUDE_DIR}
)
set(LIBRARIES
-
test_App_Manager
-
ApplicationManager
MediaManager
-
- Resumption
gtest
gtest_main
gmock
gmock_main
-
formatters
HMI_API
-
-
v4_protocol_v1_2_no_extra
-
SmartObjects
-
RequestWatchdog
-
policies
ProtocolHandler
Utils
#test_ProtocolHandlerTest
#test_JSONCPPTest
#test_MobileMessageHandlerTest
-
-
-
connectionHandler
MOBILE_API
jsoncpp
-
-#################################################
+#################################################
TransportManager
HMIMessageHandler
MessageBroker
MessageBrokerClient
MessageBrokerServer
-
encryption
bluetooth
pthread
avahi-client
avahi-common
-# rt
- # ${GSTREAMER_gstreamer_LIBRARY}
+ ${LibXML2_LIBRARIES} -lxml2
+ # rt
+ # ${GSTREAMER_gstreamer_LIBRARY}
+ Resumption
)
if (BUILD_USB_SUPPORT)
find_package(Gstreamer-1.0 REQUIRED)
find_package(Glib-2.0 REQUIRED)
-#find_package(LibXML2 REQUIRED)
+find_package(LibXML2 REQUIRED)
# required to find 'glibconfig.h'
find_package(PkgConfig)
../../../../src/thirdPartyLibs/gmock-1.6.0/gtest/include
../../../../src/thirdPartyLibs/MessageBroker/include
../../../../src/thirdPartyLibs/jsoncpp/include
+ ../../../../src/appMain
../../../../src/components/application_manager/include
../../../../src/components/protocol_handler/include
../../../../src/components/hmi_message_handler/include
- #../../../../src/components/mobile_message_handler/include/
../../../../src/components/transport_manager/include
../../../../src/components/connection_handler/include
../../../../src/components/utils/include
../../../../src/components/formatters/include
../../../../src/components/config_profile/include
../../../../src/components/policies/include
- #../../../../test/components/application_manager/rpc/include
${GSTREAMER_gst_INCLUDE_DIR}
${GLIB_glib_2_INCLUDE_DIR}
${CMAKE_SOURCE_DIR}/src/components/
${CMAKE_BINARY_DIR}/src/components/
- #${LibXML2_INCLUDE_DIR}
+ ${LibXML2_INCLUDE_DIR}
${CMAKE_SOURCE_DIR}/src/components/dbus/include
)
bluetooth
pthread
rt
- avahi-client
- avahi-common
ConfigProfile
- #MobileMessageHandler
RequestWatchdog
MediaManager
- Libusb-1.0.16
- #${LibXML2_LIBRARIES} -lxml2
+ ${LibXML2_LIBRARIES} -lxml2
)
-
-#file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/log4cxx.properties DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-#file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/XmlTests/ DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/XmlTests/)
-#file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/hmi_link DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-
-
-
-#add_library("test_App_Manager" "./src/app_manager_test.cc")
-
-#add_library("test_Admin_App_Test" "./src/AdminAppTest.cc")
-#add_library("test_G_Mock_Class_Container" "./src/GMockClassContainer.cc")
-#add_library("test_G_Test_Ford" "./src/GTestFord.cc")
-#add_library("test_Init_HMI" "./src/InitHMI.cc")
-#add_library("test_HMI_Message_Handler_Tester" "./src/HMIMessageHandlerTester.cc")
-#add_library("test_Mobile_Message_Handler_Tester" "./src/MobileMessageHandlerTester.cc")
-#add_library("test_Check_Mobile_Message_Handler" "./src/CkeckMobileMessageHandler.cc")
-#add_library("test_XmlParser" "./src/xmlParser.cc")
+file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/XmlTests/ DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/XmlTests/)
+file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/SyncProxyTester/ DESTINATION ${CMAKE_BINARY_DIR}/test/SyncProxyTester/)
add_library("test_App_Manager"
- "./src/AdminAppTest.cc"
- "./src/GMockClassContainer.cc"
- "./src/GTestFord.cc"
- "./src/ICheckClass.cc"
- "./src/InitHMI.cc"
- "./src/HMIMessageHandlerTester.cc"
- #"./src/MobileMessageHandlerTester.cc"
- #"./src/CkeckMobileMessageHandler.cc"
- #"./src/testMobile.cc"
- #"./src/xmlParser.cc"
- #"./src/too_many_request_test_case.cc"
- #"./src/too_many_pending_requests_test_case.cc"
- "./src/addTest.cc"
- "./src/initStartData.cc"
- "./src/testHMI.cc")
+ "./src/admin_app_test.cc"
+ "./src/gmock_class_container.cc"
+ "./src/gtest_ford.cc"
+ "./src/itest_argument.cc"
+ "./src/init_hmi.cc"
+ "./src/hmi_message_handler_tester.cc"
+ "./src/xml_parser.cc"
+ "./src/smoke_test_exp_media.cc"
+ "./src/protocol_handler_mockup.cc"
+ "./src/init_start_data.cc"
+ "./src/test_hmi.cc")
+
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<file>
- <type type="unit"/>
-
- <test testName="RegisterAppInterface_WithConditionalParams" pause="2000">
-
- <params>
- <Integer function_id = "1" />
- <Integer correlation_id = "1" />
- <Integer message_type = "0" />
- <Integer protocol_type = "0" />
- <Integer protocol_version = "2" />
- </params>
- <message_params>
- <syncMsgVersion>
- <Integer majorVersion="2" />
- <Integer minorVersion="2" />
- </syncMsgVersion>
- <String appName="SyncProxyTester" />
- <Vector name="ttsName">
- <TTSChunk>
- <String text="SyncProxyTester"/>
- <String type="TEXT"/>
- </TTSChunk>
- </Vector>
- <String ngnMediaScreenAppName="SPT" />
- <Vector name="vrSynonyms">
- <String add="VR SyncProxyTester"/>
- </Vector>
- <Boolean isMediaApplication="true" />
- <String languageDesired="EN-US" />
- <String hmiDisplayLanguageDesired="EN-US" />
- <Vector name="appHMIType">
- <String add="DEFAULT"/>
- </Vector>
- <String appID="123456" />
- </message_params>
-
- <response>
- <params>
- <Integer function_id = "1" />
- <Integer correlation_id = "1" />
- <Integer message_type = "0" />
- <Integer protocol_type = "0" />
- <Integer protocol_version = "2" />
- </params>
- <message_params>
- <Boolean success = "true" />
- <String resultCode = "SUCCESS" />
- </message_params>
- </response>
- </test>
-<!--
- <test testName="AddCommand_withParams" pause="2000">
-
- <params>
- <Integer function_id = "5" />
- <Integer correlation_id = "1" />
- <Integer message_type = "0" />
- <Integer protocol_type = "0" />
- <Integer protocol_version = "2" />
- </params>
- <message_params>
- <Integer cmdId="1234" />
-
- <menuParams>
- <Integer parentID = "0" />
- <String menuName = "Example" />
- </menuParams>
-
- <String appID="123456" />
- </message_params>
-
- <response>
- <params>
- <Integer function_id = "5" />
- <Integer correlation_id = "1" />
- <Integer message_type = "0" />
- <Integer protocol_type = "0" />
- <Integer protocol_version = "2" />
- </params>
- <message_params>
- <Boolean success = "true" />
- <String resultCode = "SUCCESS" />
- </message_params>
- </response>
-
- </test>
--->
-</file>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<file>\r
+ <type type = "unit"/>\r
+ <!-- AddSubMenu: Only mandatory -->\r
+ <test testName="AddSubMenu_MandatoryOnly" pause="1000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "7"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <Integer menuID="10"/>\r
+ <String menuName="Smoke SubMenu10"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "52" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "UI.AddSubMenu" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Integer menuID="10"/>\r
+ <menuParams>\r
+ <String menuName="Smoke SubMenu10"/>\r
+ </menuParams>\r
+ </params>\r
+\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ </test>\r
+ <!-- AddSubMenu: Mandatory missing -->\r
+ <!-- menuID is missing -->\r
+ <test testName="AddSubMenu_mandatoryMissing" pause="1000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "7"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String menuName="SmokeSubMenu123"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_DATA" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <!-- menuName is missing -->\r
+ <test testName="AddSubMenu_mandatoryMissing" pause="1000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "7"/>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <Integer menuID="100"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_DATA" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <!-- menuID and menuName are missing -->\r
+ <test testName="AddSubMenu_mandatoryMissing" pause="1000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "7"/>\r
+ <Integer correlation_id = "3" />\r
+ </params>\r
+ <message_params>\r
+ <Integer position="101"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "3" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_DATA" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <!-- all are missing -->\r
+ <test testName="AddSubMenu_mandatoryMissing" pause="1000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "7"/>\r
+ <Integer correlation_id = "4" />\r
+ </params>\r
+ <message_params>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "4" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_DATA" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <!-- AddSubMenu: All parameters -->\r
+ <!-- Min id = 0, position = 1 -->\r
+ <test testName="AddSubMenu_AllParams" pause="1000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "7"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <Integer menuID="1"/>\r
+ <Integer position="1"/>\r
+ <String menuName="Smoke SubMenu0"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "52" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "UI.AddSubMenu" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Integer menuID="1"/>\r
+ <menuParams>\r
+ <Integer position="1"/>\r
+ <String menuName="Smoke SubMenu0"/>\r
+ </menuParams>\r
+ </params>\r
+\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ </test>\r
+\r
+ <!-- AddCommand: All parameters -->\r
+ <!-- cmdID = 0 (lower bound) and parentID = 0 -->\r
+ <test testName="AddCommand_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "5"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <Integer cmdID="0" />\r
+ <Vector name="vrCommands">\r
+ <String add="Smoke command 0" />\r
+ </Vector>\r
+ <menuParams>\r
+ <Integer parentID="1" />\r
+ <Integer position="1" />\r
+ <String menuName="Smoke command 0" />\r
+ </menuParams>\r
+ <cmdIcon>\r
+ <String value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </cmdIcon>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "50" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "UI.AddCommand" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Integer cmdID="0" />\r
+ <menuParams>\r
+ <Integer parentID="1" />\r
+ <Integer position="1" />\r
+ <String menuName="Smoke command 0" />\r
+ </menuParams>\r
+ <cmdIcon>\r
+ <Patch value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </cmdIcon>\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ <HMIRequestSecond>\r
+ <params>\r
+ <Integer function_id = "27" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "VR.AddCommand" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Integer cmdID="0" />\r
+ <String type="Command"/>\r
+ <Vector name="vrCommands">\r
+ <String add="Smoke command 0" />\r
+ </Vector>\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestSecond>\r
+ </test>\r
+ <!-- Max id = 2000000000, position = 1000 -->\r
+ <test testName="AddSubMenu_AllParams" pause="1000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "7"/>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <Integer menuID="2000000000"/>\r
+ <Integer position="1000"/>\r
+ <String menuName="Smoke SubMenu2000000000"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "52" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "UI.AddSubMenu" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Integer menuID="2000000000"/>\r
+ <menuParams>\r
+ <Integer position="1000"/>\r
+ <String menuName="Smoke SubMenu2000000000"/>\r
+ </menuParams>\r
+ </params>\r
+\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ </test>\r
+ <!-- cmdID = 2000000000 (upper bound) and parentID = 2000000000 -->\r
+ <test testName="AddCommand_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "5"/>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <Integer cmdID="2000000000" />\r
+ <Vector name="vrCommands">\r
+ <String add="Smoke command 2000000000" />\r
+ </Vector>\r
+ <menuParams>\r
+ <Integer parentID="2000000000" />\r
+ <Integer position="1000" />\r
+ <String menuName="Smoke command 2000000000" />\r
+ </menuParams>\r
+ <cmdIcon>\r
+ <String value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </cmdIcon>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "50" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "UI.AddCommand" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Integer cmdID= "2000000000" />\r
+ <cmdIcon>\r
+ <Patch value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </cmdIcon>\r
+ <menuParams>\r
+ <Integer parentID="2000000000" />\r
+ <Integer position="1000" />\r
+ <String menuName="Smoke command 2000000000" />\r
+ </menuParams>\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ <HMIRequestSecond>\r
+ <params>\r
+ <Integer function_id = "27" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "VR.AddCommand" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Integer cmdID="2000000000" />\r
+ <String type="Command"/>\r
+ <Vector name="vrCommands">\r
+ <String add="Smoke command 2000000000" />\r
+ </Vector>\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestSecond>\r
+ </test>\r
+ <!-- AddCommand: Only mandatory -->\r
+ <!-- VR only -->\r
+ <test testName="AddCommand_MandatoryOnly" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "5"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <Integer cmdID="1000" />\r
+ <Vector name="vrCommands">\r
+ <String add="Smoke command 1000" />\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "27" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "VR.AddCommand" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Integer cmdID="1000" />\r
+ <String type="Command"/>\r
+ <Vector name="vrCommands">\r
+ <String add="Smoke command 1000" />\r
+ </Vector>\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ </test>\r
+ <!-- UI only with parentID -->\r
+ <test testName="AddCommand_MandatoryOnly" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "5"/>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <Integer cmdID="1001" />\r
+ <menuParams>\r
+ <Integer parentID="1" />\r
+ <String menuName="Smoke command 2000" />\r
+ </menuParams>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "50" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "UI.AddCommand" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Integer cmdID="1001" />\r
+ <menuParams>\r
+ <Integer parentID="1" />\r
+ <String menuName="Smoke command 2000" />\r
+ </menuParams>\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ </test>\r
+ <!-- UI only without parentID -->\r
+ <test testName="AddCommand_MandatoryOnly" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "5"/>\r
+ <Integer correlation_id = "3" />\r
+ </params>\r
+ <message_params>\r
+ <Integer cmdID="1002" />\r
+ <menuParams>\r
+ <String menuName="Smoke command 3000" />\r
+ </menuParams>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "3" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "50" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "UI.AddCommand" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Integer cmdID="1002" />\r
+ <menuParams>\r
+ <String menuName="Smoke command 3000" />\r
+ </menuParams>\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ </test>\r
+ <!-- AddCommand: Mandatory missing -->\r
+ <!-- Missing cmdID -->\r
+ <test testName="AddCommand_MandatoryMissing" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "5"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <Vector name="vrCommands">\r
+ <String add="Smoke command missing" />\r
+ </Vector>\r
+ <menuParams>\r
+ <Integer parentID="0" />\r
+ <Integer position="0" />\r
+ <String menuName="Smoke command missing" />\r
+ </menuParams>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_DATA" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <!-- Missing both UI and VR -->\r
+ <test testName="AddCommand_MandatoryMissing" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "5"/>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <Integer cmdID="2000" />\r
+ <cmdIcon>\r
+ <String value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </cmdIcon>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_DATA" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <!-- Missing menuName -->\r
+ <test testName="AddCommand_MandatoryMissing" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "5"/>\r
+ <Integer correlation_id = "3" />\r
+ </params>\r
+ <message_params>\r
+ <Integer cmdID="2001" />\r
+ <Vector name="vrCommands">\r
+ <String add="Smoke command 2001" />\r
+ </Vector>\r
+ <menuParams>\r
+ <Integer parentID="0" />\r
+ <Integer position="0" />\r
+ </menuParams>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "3" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_DATA" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <!-- Missing all -->\r
+ <test testName="AddCommand_MandatoryMissing" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "5"/>\r
+ <Integer correlation_id = "4" />\r
+ </params>\r
+ <message_params>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "4" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_DATA" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <!-- AddCommand: Different image types -->\r
+ <!-- DYNAMIC image type -->\r
+ <test testName="AddCommand_ImageTypes" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "5"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <Integer cmdID="3000" />\r
+ <Vector name="vrCommands">\r
+ <String add="Smoke command with dynamic image type" />\r
+ </Vector>\r
+ <menuParams>\r
+ <Integer parentID="1" />\r
+ <Integer position="1" />\r
+ <String menuName="Smoke command with dynamic image type" />\r
+ </menuParams>\r
+ <cmdIcon>\r
+ <String value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </cmdIcon>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "50" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "UI.AddCommand" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Integer cmdID="3000" />\r
+ <menuParams>\r
+ <Integer parentID="1" />\r
+ <Integer position="1" />\r
+ <String menuName="Smoke command with dynamic image type" />\r
+ </menuParams>\r
+ <cmdIcon>\r
+ <Patch value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </cmdIcon>\r
+\r
+ </params>\r
+\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ <HMIRequestSecond>\r
+ <params>\r
+ <Integer function_id = "27" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "VR.AddCommand" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Integer cmdID = "3000" />\r
+ <String type="Command"/>\r
+ <Vector name="vrCommands">\r
+ <String add="Smoke command with dynamic image type" />\r
+ </Vector>\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestSecond>\r
+ </test>\r
+ <!-- STATIC image type -->\r
+ <test testName="AddCommand_ImageTypes" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "5"/>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <Integer cmdID="3001" />\r
+ <Vector name="vrCommands">\r
+ <String add="Smoke command with static image type" />\r
+ </Vector>\r
+ <menuParams>\r
+ <Integer parentID="10" />\r
+ <Integer position="2" />\r
+ <String menuName="Smoke command with static image type" />\r
+ </menuParams>\r
+ <cmdIcon>\r
+ <String value="icon.png" />\r
+ <String imageType="STATIC" />\r
+ </cmdIcon>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "UNSUPPORTED_RESOURCE" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+\r
+ <!-- AddCommand: Duplicates -->\r
+ <!-- Duplicate cmdID -->\r
+ <test testName="AddCommand_Duplicates" pause="2000">\r
+\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "5"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <Integer cmdID="0" />\r
+ <Vector name="vrCommands">\r
+ <String add="Smoke command 0 duplicate" />\r
+ </Vector>\r
+ <menuParams>\r
+ <Integer parentID="0" />\r
+ <Integer position="1" />\r
+ <String menuName="Smoke command 0 duplicate" />\r
+ </menuParams>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_ID" />\r
+ </message_params>\r
+ </response>\r
+\r
+ </test>\r
+ <!-- Duplicate vrSynonym -->\r
+ <test testName="AddCommand_Duplicates" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "5"/>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <Integer cmdID="4000" />\r
+ <Vector name="vrCommands">\r
+ <String add="Smoke command 0" />\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "DUPLICATE_NAME" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <!-- Duplicate menuName within the same subMenu -->\r
+ <test testName="AddCommand_Duplicates" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "5"/>\r
+ <Integer correlation_id = "3" />\r
+ </params>\r
+ <message_params>\r
+ <Integer cmdID="4001" />\r
+ <menuParams>\r
+ <Integer parentID="0" />\r
+ <Integer position="2" />\r
+ <String menuName="Smoke command 0" />\r
+ </menuParams>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "3" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "DUPLICATE_NAME" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <!-- Duplicate menuName within different subMenu -->\r
+ <test testName="AddCommand_Duplicates" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "5"/>\r
+ <Integer correlation_id = "4" />\r
+ </params>\r
+ <message_params>\r
+ <Integer cmdID="4002" />\r
+ <menuParams>\r
+ <Integer parentID="10" />\r
+ <Integer position="3" />\r
+ <String menuName="Smoke command 0" />\r
+ </menuParams>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "4" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "DUPLICATE_NAME" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+\r
+ <!-- AddCommand: SubMenu does not exist -->\r
+ <test testName="AddCommand_SubMenuNotExist" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "5"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <Integer cmdID="5000" />\r
+ <menuParams>\r
+ <Integer parentID="123" />\r
+ <Integer position="1" />\r
+ <String menuName="Smoke command 123" />\r
+ </menuParams>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_ID" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+\r
+\r
+ <!--//////////-->\r
+ <!-- DeleteCommand -->\r
+ <!--//////////-->\r
+\r
+ <!-- DeleteCommand: All parameters -->\r
+ <!-- With cmdID lower bound = 0 and within subMenu -->\r
+ <test testName="DeleteCommand_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "6"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <Integer cmdID="0"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "51" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "UI.DeleteCommand" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Integer cmdID = "0"/>\r
+ </params>\r
+\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ <HMIRequestSecond>\r
+ <params>\r
+ <Integer function_id = "28" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "VR.DeleteCommand" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Integer cmdID="0"/> >\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestSecond>\r
+ </test>\r
+ <!-- With cmdID upper bound = 2000000000 and within subMenu -->\r
+ <test testName="DeleteCommand_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "6"/>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <Integer cmdID="2000000000"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "51" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "UI.DeleteCommand" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Integer cmdID="2000000000"/>\r
+ </params>\r
+\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ <HMIRequestSecond>\r
+ <params>\r
+ <Integer function_id = "28" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "VR.DeleteCommand" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Integer cmdID="2000000000"/> >\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestSecond>\r
+ </test>\r
+ <!-- Within top application menu -->\r
+ <test testName="DeleteCommand_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "6"/>\r
+ <Integer correlation_id = "3" />\r
+ </params>\r
+ <message_params>\r
+ <Integer cmdID="1000"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "3" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "28" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "VR.DeleteCommand" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Integer cmdID = "1000"/>\r
+ </params>\r
+\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ </test>\r
+\r
+ <!-- DeleteCommand: Missing mandatory -->\r
+ <test testName="DeleteCommand_MissingMandatory" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "6"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_DATA" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+\r
+ <!-- DeleteCommand: Command does not exist -->\r
+ <test testName="DeleteCommand_CmdNotExist" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "6"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <Integer cmdID="555"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_ID" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+\r
+\r
+ <!--//////////-->\r
+ <!-- DeleteSubMenu -->\r
+ <!--//////////-->\r
+\r
+ <!-- DeleteSubMenu: All parameters -->\r
+ <!-- With menuID lower bound = 0 and without commands -->\r
+ <test testName="DeleteSubMenu_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "8"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <Integer menuID="1"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "53" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "UI.DeleteSubMenu" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Integer menuID = "1"/>\r
+ </params>\r
+\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ <HMIRequestSecond>\r
+ <params>\r
+ <Integer function_id = "28" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "VR.DeleteCommand" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Integer cmdID = "3000"/>\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestSecond>\r
+ <HMIRequestThird>\r
+ <params>\r
+ <Integer function_id = "51" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "UI.DeleteCommand" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Integer cmdID = "1001"/>\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestThird>\r
+ <HMIRequestFourth>\r
+ <params>\r
+ <Integer function_id = "51" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "UI.DeleteCommand" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Integer cmdID = "3000"/>\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestFourth>\r
+ </test>\r
+ <!-- With menuID upper bound = 2000000000 and without commands -->\r
+ <test testName="DeleteSubMenu_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "8"/>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <Integer menuID="2000000000"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "53" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "UI.DeleteSubMenu" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Integer menuID="2000000000"/>\r
+ </params>\r
+\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ </test>\r
+ <!-- DeleteSubMenu: Missing mandatory -->\r
+ <test testName="DeleteSubMenu_MissingMandatory" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "8"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_DATA" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+\r
+ <!-- DeleteSubMenu: SubMenu does not exist -->\r
+ <test testName="DeleteSubMenu_MenuIDNotExist" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "8"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <Integer menuID="123"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_ID" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+\r
+</file>\r
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<file>\r
+ <type type = "unit"/>\r
+ <!--//////////-->\r
+ <!-- AlertManeuver -->\r
+ <!--//////////-->\r
+\r
+ <!-- AlertManeuver: All parameters -->\r
+ <!-- TTSChunks and SoftButtons -->\r
+ <test testName="AlertManeuver_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "28"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <Vector name="ttsChunks">\r
+ <TTSChunk>\r
+ <String text="First Alert"/>\r
+ <String type="TEXT"/>\r
+ </TTSChunk>\r
+ <TTSChunk>\r
+ <String text="Second Alert"/>\r
+ <String type="TEXT"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ <Vector name="softButtons">\r
+ <SoftButton>\r
+ <String type="BOTH" />\r
+ <String text="Close" />\r
+ <image>\r
+ <String value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </image>\r
+ <Boolean isHighlighted="true" />\r
+ <Integer softButtonID="44" />\r
+ <String systemAction="DEFAULT_ACTION" />\r
+ </SoftButton>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "81" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "Navigation.AlertManeuver" />\r
+ <params>\r
+ <Vector name="softButtons">\r
+ <SoftButton>\r
+ <String type="BOTH" />\r
+ <String text="Close" />\r
+ <image>\r
+ <Patch value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </image>\r
+ <Boolean isHighlighted="true" />\r
+ <Integer softButtonID="44" />\r
+ <String systemAction="DEFAULT_ACTION" />\r
+ </SoftButton>\r
+ </Vector>\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ <HMIRequestSecond>\r
+ <params>\r
+ <Integer function_id = "40" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "TTS.Speak" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name = "ttsChunks" >\r
+ <TTSChunk>\r
+ <String text = "First Alert" />\r
+ <String type = "TEXT" />\r
+ </TTSChunk>\r
+ <TTSChunk>\r
+ <String text = "Second Alert" />\r
+ <String type = "TEXT" />\r
+ </TTSChunk>\r
+ </Vector>\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestSecond>\r
+ </test>\r
+ <!-- TTSChunks only -->\r
+ <test testName="AlertManeuver_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "28"/>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <Vector name="ttsChunks">\r
+ <TTSChunk>\r
+ <String text="First Alert"/>\r
+ <String type="TEXT"/>\r
+ </TTSChunk>\r
+ <TTSChunk>\r
+ <String text="Second Alert"/>\r
+ <String type="TEXT"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "81" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "Navigation.AlertManeuver" />\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ <HMIRequestSecond>\r
+ <params>\r
+ <Integer function_id = "40" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "TTS.Speak" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name = "ttsChunks" >\r
+ <TTSChunk>\r
+ <String text = "First Alert" />\r
+ <String type = "TEXT" />\r
+ </TTSChunk>\r
+ <TTSChunk>\r
+ <String text = "Second Alert" />\r
+ <String type = "TEXT" />\r
+ </TTSChunk>\r
+ </Vector>\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestSecond>\r
+ </test>\r
+ <test testName="AlertManeuver_AllParams" pause="2000">\r
+ <!-- SoftButtons only -->\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "28"/>\r
+ <Integer correlation_id = "3" />\r
+ </params>\r
+ <message_params>\r
+ <Vector name="softButtons">\r
+ <SoftButton>\r
+ <String type="BOTH" />\r
+ <String text="Close" />\r
+ <image>\r
+ <String value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </image>\r
+ <Boolean isHighlighted="true" />\r
+ <Integer softButtonID="44" />\r
+ <String systemAction="DEFAULT_ACTION" />\r
+ </SoftButton>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "3" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "81" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "Navigation.AlertManeuver" />\r
+ <params>\r
+ <Vector name="softButtons">\r
+ <SoftButton>\r
+ <String type="BOTH" />\r
+ <String text="Close" />\r
+ <image>\r
+ <Patch value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </image>\r
+ <Boolean isHighlighted="true" />\r
+ <Integer softButtonID="44" />\r
+ <String systemAction="DEFAULT_ACTION" />\r
+ </SoftButton>\r
+ </Vector>\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ </test>\r
+ <!-- AlertManeuver: Missing parameters -->\r
+ <test testName="AlertManeuver_MissingParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "28"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_DATA" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+\r
+ <!-- AlertManeuver: Different image types -->\r
+ <!-- DYNAMIC -->\r
+ <test testName="AlertManeuver_DiffImageTypes" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "28"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <Vector name="ttsChunks">\r
+ <TTSChunk>\r
+ <String text="First Alert"/>\r
+ <String type="TEXT"/>\r
+ </TTSChunk>\r
+ <TTSChunk>\r
+ <String text="Second Alert"/>\r
+ <String type="TEXT"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ <Vector name="softButtons">\r
+ <SoftButton>\r
+ <String type="BOTH" />\r
+ <String text="Close" />\r
+ <image>\r
+ <String value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </image>\r
+ <Boolean isHighlighted="true" />\r
+ <Integer softButtonID="44" />\r
+ <String systemAction="DEFAULT_ACTION" />\r
+ </SoftButton>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "81" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "Navigation.AlertManeuver" />\r
+ <params>\r
+ <Vector name="softButtons">\r
+ <SoftButton>\r
+ <String type="BOTH" />\r
+ <String text="Close" />\r
+ <image>\r
+ <Patch value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </image>\r
+ <Boolean isHighlighted="true" />\r
+ <Integer softButtonID="44" />\r
+ <String systemAction="DEFAULT_ACTION" />\r
+ </SoftButton>\r
+ </Vector>\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ <HMIRequestSecond>\r
+ <params>\r
+ <Integer function_id = "40" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "TTS.Speak" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name = "ttsChunks" >\r
+ <TTSChunk>\r
+ <String text = "First Alert" />\r
+ <String type = "TEXT" />\r
+ </TTSChunk>\r
+ <TTSChunk>\r
+ <String text = "Second Alert" />\r
+ <String type = "TEXT" />\r
+ </TTSChunk>\r
+ </Vector>\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestSecond>\r
+ </test>\r
+ <!-- STATIC -->\r
+ <test testName="AlertManeuver_DiffImageTypes" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "28"/>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <Vector name="softButtons">\r
+ <SoftButton>\r
+ <String type="BOTH" />\r
+ <String text="Close" />\r
+ <image>\r
+ <String value="icon.png" />\r
+ <String imageType="STATIC" />\r
+ </image>\r
+ <Boolean isHighlighted="true" />\r
+ <Integer softButtonID="44" />\r
+ <String systemAction="DEFAULT_ACTION" />\r
+ </SoftButton>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "UNSUPPORTED_RESOURCE" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "81" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "Navigation.AlertManeuver" />\r
+ <params>\r
+ <Vector name="softButtons">\r
+ <SoftButton>\r
+ <String type="BOTH" />\r
+ <String text="Close" />\r
+ <Boolean isHighlighted="true" />\r
+ <Integer softButtonID="44" />\r
+ <String systemAction="DEFAULT_ACTION" />\r
+ </SoftButton>\r
+ </Vector>\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ </test>\r
+ <!-- AlertManeuver: Different speechCapabilities -->\r
+ <!-- TEXT -->\r
+ <test testName="AlertManeuver_DiffSpeechCapabilities" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "28"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <Vector name="ttsChunks">\r
+ <TTSChunk>\r
+ <String text="First Alert"/>\r
+ <String type="TEXT"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "81" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "Navigation.AlertManeuver" />\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ <HMIRequestSecond>\r
+ <params>\r
+ <Integer function_id = "40" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "TTS.Speak" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name = "ttsChunks" >\r
+ <TTSChunk>\r
+ <String text = "First Alert" />\r
+ <String type = "TEXT" />\r
+ </TTSChunk>\r
+ </Vector>\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestSecond>\r
+ </test>\r
+ <!-- PRE_RECORDED -->\r
+ <test testName="AlertManeuver_DiffSpeechCapabilities" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "28"/>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <Vector name="ttsChunks">\r
+ <TTSChunk>\r
+ <String text="First Alert"/>\r
+ <String type="PRE_RECORDED"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "81" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "Navigation.AlertManeuver" />\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ <HMIRequestSecond>\r
+ <params>\r
+ <Integer function_id = "40" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "TTS.Speak" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name = "ttsChunks" >\r
+ <TTSChunk>\r
+ <String text = "First Alert" />\r
+ <String type = "PRE_RECORDED" />\r
+ </TTSChunk>\r
+ </Vector>\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestSecond>\r
+ </test>\r
+ <!-- SAPI_PHONEMES -->\r
+ <test testName="AlertManeuver_DiffSpeechCapabilities" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "28"/>\r
+ <Integer correlation_id = "3" />\r
+ </params>\r
+ <message_params>\r
+ <Vector name="ttsChunks">\r
+ <TTSChunk>\r
+ <String text="First Alert"/>\r
+ <String type="SAPI_PHONEMES"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "3" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "81" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "Navigation.AlertManeuver" />\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ <HMIRequestSecond>\r
+ <params>\r
+ <Integer function_id = "40" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "TTS.Speak" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name = "ttsChunks" >\r
+ <TTSChunk>\r
+ <String text = "First Alert" />\r
+ <String type = "SAPI_PHONEMES" />\r
+ </TTSChunk>\r
+ </Vector>\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestSecond>\r
+ </test>\r
+ <!-- LHPLUS_PHONEMES -->\r
+ <test testName="AlertManeuver_DiffSpeechCapabilities" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "28"/>\r
+ <Integer correlation_id = "4" />\r
+ </params>\r
+ <message_params>\r
+ <Vector name="ttsChunks">\r
+ <TTSChunk>\r
+ <String text="First Alert"/>\r
+ <String type="LHPLUS_PHONEMES"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "4" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "81" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "Navigation.AlertManeuver" />\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ <HMIRequestSecond>\r
+ <params>\r
+ <Integer function_id = "40" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "TTS.Speak" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name = "ttsChunks" >\r
+ <TTSChunk>\r
+ <String text = "First Alert" />\r
+ <String type = "LHPLUS_PHONEMES" />\r
+ </TTSChunk>\r
+ </Vector>\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestSecond>\r
+ </test>\r
+ <!-- SILENCE -->\r
+ <test testName="AlertManeuver_DiffSpeechCapabilities" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "28"/>\r
+ <Integer correlation_id = "5" />\r
+ </params>\r
+ <message_params>\r
+ <Vector name="ttsChunks">\r
+ <TTSChunk>\r
+ <String text="First Alert"/>\r
+ <String type="SILENCE"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "5" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "81" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "Navigation.AlertManeuver" />\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ <HMIRequestSecond>\r
+ <params>\r
+ <Integer function_id = "40" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "TTS.Speak" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name = "ttsChunks" >\r
+ <TTSChunk>\r
+ <String text = "First Alert" />\r
+ <String type = "SILENCE" />\r
+ </TTSChunk>\r
+ </Vector>\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestSecond>\r
+ </test>\r
+\r
+</file>\r
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<file>\r
+ <type type = "unit"/>\r
+ <!--//////////-->\r
+ <!-- PerformAudioPassThru -->\r
+ <!--//////////-->\r
+\r
+ <!-- PerformAudioPassThru: All parameters -->\r
+ <test testName="PerformAudioPassThru_AllParams" pause="5000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "16"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <Vector name="initialPrompt">\r
+ <TTSChunk>\r
+ <String text="Make your choice"/>\r
+ <String type="TEXT"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ <String audioPassThruDisplayText1="DisplayText1" />\r
+ <String audioPassThruDisplayText2="DisplayText2" />\r
+ <String samplingRate="8KHZ" />\r
+ <Integer maxDuration="3000" />\r
+ <String bitsPerSample="8_BIT" />\r
+ <String audioType="PCM" />\r
+ <Boolean muteAudio="true" />\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "40" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "TTS.Speak" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name="ttsChunks">\r
+ <String text="Make your choice"/>\r
+ </Vector>\r
+ </params>\r
+\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ <HMIRequestSecond>\r
+ <params>\r
+ <Integer function_id = "73" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "UI.PerformAudioPassThru" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name = "audioPassThruDisplayTexts" >\r
+ <TTSChunk>\r
+ <String fieldName = "audioPassThruDisplayText1" />\r
+ <String fieldText = "DisplayText1" />\r
+ </TTSChunk>\r
+ <TTSChunk>\r
+ <String fieldName = "audioPassThruDisplayText2" />\r
+ <String fieldText = "DisplayText2" />\r
+ </TTSChunk>\r
+ </Vector>\r
+ <Integer maxDuration="3000" />\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestSecond>\r
+ <HMIRequestThird>\r
+ <params>\r
+ <Integer function_id = "78" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "UI.OnRecordStart" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestThird>\r
+ </test>\r
+\r
+ <!-- PerformAudioPassThru: Only mandatory -->\r
+ <test testName="PerformAudioPassThru_OnlyMandatory" pause="3000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "16"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String samplingRate="8KHZ" />\r
+ <Integer maxDuration="2000" />\r
+ <String bitsPerSample="8_BIT" />\r
+ <String audioType="PCM" />\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "73" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "UI.PerformAudioPassThru" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name = "audioPassThruDisplayTexts" >\r
+ <String />\r
+ </Vector>\r
+ <Integer maxDuration="2000" />\r
+ </params>\r
+\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ <HMIRequestSecond>\r
+ <params>\r
+ <Integer function_id = "78" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "UI.OnRecordStart" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestSecond>\r
+ </test>\r
+ <!-- PerformAudioPassThru: Missing mandatory -->\r
+ <!-- Missing samplingRate -->\r
+ <test testName="PerformAudioPassThru_MissingMandatory">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "16"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <Vector name="initialPrompt">\r
+ <TTSChunk>\r
+ <String text="Make your choice"/>\r
+ <String type="TEXT"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ <String audioPassThruDisplayText1="DisplayText1" />\r
+ <String audioPassThruDisplayText2="DisplayText2" />\r
+ <Integer maxDuration="2000" />\r
+ <String bitsPerSample="8_BIT" />\r
+ <String audioType="PCM" />\r
+ <Boolean muteAudio="true" />\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_DATA" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <!-- Missing maxDuration -->\r
+ <test testName="PerformAudioPassThru_MissingMandatory">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "16"/>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <Vector name="initialPrompt">\r
+ <TTSChunk>\r
+ <String text="Make your choice"/>\r
+ <String type="TEXT"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ <String audioPassThruDisplayText1="DisplayText1" />\r
+ <String audioPassThruDisplayText2="DisplayText2" />\r
+ <String samplingRate="8KHZ" />\r
+ <String bitsPerSample="8_BIT" />\r
+ <String audioType="PCM" />\r
+ <Boolean muteAudio="true" />\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_DATA" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <!-- Missing bitsPerSample -->\r
+ <test testName="PerformAudioPassThru_MissingMandatory">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "16"/>\r
+ <Integer correlation_id = "3" />\r
+ </params>\r
+ <message_params>\r
+ <Vector name="initialPrompt">\r
+ <TTSChunk>\r
+ <String text="Make your choice"/>\r
+ <String type="TEXT"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ <String audioPassThruDisplayText1="DisplayText1" />\r
+ <String audioPassThruDisplayText2="DisplayText2" />\r
+ <String samplingRate="8KHZ" />\r
+ <Integer maxDuration="2000" />\r
+ <String audioType="PCM" />\r
+ <Boolean muteAudio="true" />\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "3" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_DATA" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <!-- Missing audioType -->\r
+ <test testName="PerformAudioPassThru_MissingMandatory">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "16"/>\r
+ <Integer correlation_id = "4" />\r
+ </params>\r
+ <message_params>\r
+ <Vector name="initialPrompt">\r
+ <TTSChunk>\r
+ <String text="Make your choice"/>\r
+ <String type="TEXT"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ <String audioPassThruDisplayText1="DisplayText1" />\r
+ <String audioPassThruDisplayText2="DisplayText2" />\r
+ <String samplingRate="8KHZ" />\r
+ <Integer maxDuration="2000" />\r
+ <String bitsPerSample="8_BIT" />\r
+ <Boolean muteAudio="true" />\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "4" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_DATA" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+\r
+ <!-- PerformAudioPassThru: when another PerformAudioPassThru is active -->\r
+ <test testName="PerformAudioPassThru_ActiveAnotherPerform" pause="5000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "16"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String samplingRate="8KHZ" />\r
+ <Integer maxDuration="5000" />\r
+ <String bitsPerSample="8_BIT" />\r
+ <String audioType="PCM" />\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "73" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "UI.PerformAudioPassThru" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name = "audioPassThruDisplayTexts" >\r
+ <String />\r
+ </Vector>\r
+ <Integer maxDuration="5000" />\r
+ </params>\r
+\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ <HMIRequestSecond>\r
+ <params>\r
+ <Integer function_id = "78" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "UI.OnRecordStart" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestSecond>\r
+ </test>\r
+ <!-- PerformAudioPassThru: different speechCapabilities -->\r
+ <!-- TEXT -->\r
+ <test testName="PerformAudioPassThru_DiffSpeechCapabilities" >\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "16"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <Vector name="initialPrompt">\r
+ <TTSChunk>\r
+ <String text="Make your choice"/>\r
+ <String type="TEXT"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ <String samplingRate="8KHZ" />\r
+ <Integer maxDuration="1000" />\r
+ <String bitsPerSample="8_BIT" />\r
+ <String audioType="PCM" />\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "40" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "TTS.Speak" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name="ttsChunks">\r
+ <String text="Make your choice"/>\r
+ </Vector>\r
+ </params>\r
+\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ <HMIRequestSecond>\r
+ <params>\r
+ <Integer function_id = "73" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "UI.PerformAudioPassThru" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name = "audioPassThruDisplayTexts" >\r
+ <String />\r
+ </Vector>\r
+ <Integer maxDuration="1000" />\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestSecond>\r
+ </test>\r
+ <!-- PRE_RECORDED -->\r
+ <test testName="PerformAudioPassThru_DiffSpeechCapabilities" >\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "16"/>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <Vector name="initialPrompt">\r
+ <TTSChunk>\r
+ <String text="Make your choice"/>\r
+ <String type="PRE_RECORDED"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ <String samplingRate="8KHZ" />\r
+ <Integer maxDuration="1000" />\r
+ <String bitsPerSample="8_BIT" />\r
+ <String audioType="PCM" />\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "40" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "TTS.Speak" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name="ttsChunks">\r
+ <String text="Make your choice"/>\r
+ </Vector>\r
+ </params>\r
+\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ <HMIRequestSecond>\r
+ <params>\r
+ <Integer function_id = "73" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "UI.PerformAudioPassThru" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name = "audioPassThruDisplayTexts" >\r
+ <String />\r
+ </Vector>\r
+ <Integer maxDuration="1000" />\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestSecond>\r
+ </test>\r
+ <!-- SAPI_PHONEMES -->\r
+ <test testName="PerformAudioPassThru_DiffSpeechCapabilities" >\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "16"/>\r
+ <Integer correlation_id = "3" />\r
+ </params>\r
+ <message_params>\r
+ <Vector name="initialPrompt">\r
+ <TTSChunk>\r
+ <String text="Make your choice"/>\r
+ <String type="SAPI_PHONEMES"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ <String samplingRate="8KHZ" />\r
+ <Integer maxDuration="1000" />\r
+ <String bitsPerSample="8_BIT" />\r
+ <String audioType="PCM" />\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "3" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "40" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "TTS.Speak" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name = "ttsChunks" >\r
+ <String text="Make your choice"/>\r
+ </Vector>\r
+ </params>\r
+\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ <HMIRequestSecond>\r
+ <params>\r
+ <Integer function_id = "73" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "UI.PerformAudioPassThru" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name = "audioPassThruDisplayTexts" >\r
+ <String />\r
+ </Vector>\r
+ <Integer maxDuration="1000" />\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestSecond>\r
+ </test>\r
+ <!-- LHPLUS_PHONEMES -->\r
+ <test testName="PerformAudioPassThru_DiffSpeechCapabilities" >\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "16"/>\r
+ <Integer correlation_id = "4" />\r
+ </params>\r
+ <message_params>\r
+ <Vector name="initialPrompt">\r
+ <TTSChunk>\r
+ <String text="Make your choice"/>\r
+ <String type="LHPLUS_PHONEMES"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ <String samplingRate="8KHZ" />\r
+ <Integer maxDuration="1000" />\r
+ <String bitsPerSample="8_BIT" />\r
+ <String audioType="PCM" />\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "4" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "40" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "TTS.Speak" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name = "ttsChunks" >\r
+ <String text="Make your choice"/>\r
+ </Vector>\r
+ </params>\r
+\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ <HMIRequestSecond>\r
+ <params>\r
+ <Integer function_id = "73" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "UI.PerformAudioPassThru" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name = "audioPassThruDisplayTexts" >\r
+ <String />\r
+ </Vector>\r
+ <Integer maxDuration="1000" />\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestSecond>\r
+ </test>\r
+ <!-- SILENCE -->\r
+ <test testName="PerformAudioPassThru_DiffSpeechCapabilities" >\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "16"/>\r
+ <Integer correlation_id = "5" />\r
+ </params>\r
+ <message_params>\r
+ <Vector name="initialPrompt">\r
+ <TTSChunk>\r
+ <String text="Make your choice"/>\r
+ <String type="SILENCE"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ <String samplingRate="8KHZ" />\r
+ <Integer maxDuration="1000" />\r
+ <String bitsPerSample="8_BIT" />\r
+ <String audioType="PCM" />\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "5" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "40" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "TTS.Speak" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name = "ttsChunks" >\r
+ <String text="Make your choice"/>\r
+ </Vector>\r
+ </params>\r
+\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ <HMIRequestSecond>\r
+ <params>\r
+ <Integer function_id = "73" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "UI.PerformAudioPassThru" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name = "audioPassThruDisplayTexts" >\r
+ <String />\r
+ </Vector>\r
+ <Integer maxDuration="1000" />\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestSecond>\r
+ </test>\r
+\r
+\r
+ <!--//////////-->\r
+ <!-- EndAudioPassThru -->\r
+ <!--//////////-->\r
+\r
+\r
+\r
+ <!-- EndAudioPassThru: No active PerformAudioPassThru -->\r
+ <test testName="EndAudioPassThru_NoActiveSession" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "17"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_DATA" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+\r
+\r
+</file>\r
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<file>\r
+\r
+ <!--//////////-->\r
+ <!-- CreateInteractionChoiceSet -->\r
+ <!--//////////-->\r
+\r
+ <!-- CreateInteractionChoiceSet: All parameters -->\r
+ <test testName="CreateInteractionChoiceSet_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "9"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <Integer interactionChoiceSetID="10"/>\r
+ <Vector name="choiceSet">\r
+ <Choice>\r
+ <Integer choiceID="101"/>\r
+ <String menuName="Choice101"/>\r
+ <Vector name="vrCommands">\r
+ <String add="Choice 101"/>\r
+ </Vector>\r
+ <image>\r
+ <String value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </image>\r
+ </Choice>\r
+ <Choice>\r
+ <Integer choiceID="102"/>\r
+ <String menuName="Choice102"/>\r
+ <Vector name="vrCommands">\r
+ <String add="Choice 102"/>\r
+ </Vector>\r
+ <image>\r
+ <String value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </image>\r
+ </Choice>\r
+ <Choice>\r
+ <Integer choiceID="103"/>\r
+ <String menuName="Choice103"/>\r
+ <Vector name="vrCommands">\r
+ <String add="Choice 103"/>\r
+ </Vector>\r
+ <image>\r
+ <String value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </image>\r
+ </Choice>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+\r
+ <!-- CreateInteractionChoiceSet: Only mandatory -->\r
+ <test testName="CreateInteractionChoiceSet_OnlyMandatory" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "9"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <Integer interactionChoiceSetID="20"/>\r
+ <Vector name="choiceSet">\r
+ <Choice>\r
+ <Integer choiceID="201"/>\r
+ <String menuName="Choice101"/>\r
+ <Vector name="vrCommands">\r
+ <String add="Choice 201"/>\r
+ </Vector>\r
+ </Choice>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <test testName="CreateInteractionChoiceSet_OnlyMandatory" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "9"/>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <Integer interactionChoiceSetID="21"/>\r
+ <Vector name="choiceSet">\r
+ <Choice>\r
+ <Integer choiceID="211"/>\r
+ <String menuName="Choice211"/>\r
+ <Vector name="vrCommands">\r
+ <String add="Choice 101"/>\r
+ </Vector>\r
+ </Choice>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+\r
+ <!-- CreateInteractionChoiceSet: Missing mandatory -->\r
+ <test testName="CreateInteractionChoiceSet_MissingMandatory">\r
+ <!-- Missing interactionChoiceSetID -->\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "9"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <Vector name="choiceSet">\r
+ <Choice>\r
+ <Integer choiceID="301"/>\r
+ <String menuName="Choice301"/>\r
+ <Vector name="vrCommands">\r
+ <String add="Choice 301"/>\r
+ </Vector>\r
+ <image>\r
+ <String value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </image>\r
+ </Choice>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_DATA" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <!-- Missing choiceID -->\r
+ <test testName="CreateInteractionChoiceSet_MissingMandatory">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "9"/>\r
+ <Integer correlation_id = "3" />\r
+ </params>\r
+ <message_params>\r
+ <Integer interactionChoiceSetID="32"/>\r
+ <Vector name="choiceSet">\r
+ <Choice>\r
+ <String menuName="Choice321"/>\r
+ <Vector name="vrCommands">\r
+ <String add="Choice 321"/>\r
+ </Vector>\r
+ <image>\r
+ <String value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </image>\r
+ </Choice>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "3" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_DATA" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <!-- Missing menuName -->\r
+ <test testName="CreateInteractionChoiceSet_MissingMandatory">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "9"/>\r
+ <Integer correlation_id = "4" />\r
+ </params>\r
+ <message_params>\r
+ <Integer interactionChoiceSetID="33"/>\r
+ <Vector name="choiceSet">\r
+ <Choice>\r
+ <Integer choiceID="331"/>\r
+ <Vector name="vrCommands">\r
+ <String add="Choice 331"/>\r
+ </Vector>\r
+ </Choice>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "4" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_DATA" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <!-- Missing vrCommand -->\r
+ <!-- Missing all -->\r
+ <test testName="CreateInteractionChoiceSet_MissingMandatory">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "9"/>\r
+ <Integer correlation_id = "6" />\r
+ </params>\r
+ <message_params>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "6" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_DATA" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+\r
+ <!-- CreateInteractionChoiceSet: Invalid ID -->\r
+ <!-- interactionChoiceSetID already exists -->\r
+ <test testName="CreateInteractionChoiceSet_InvalidID" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "9"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <Integer interactionChoiceSetID="10"/>\r
+ <Vector name="choiceSet">\r
+ <Choice>\r
+ <Integer choiceID="401"/>\r
+ <String menuName="Choice401"/>\r
+ <Vector name="vrCommands">\r
+ <String add="Choice 401"/>\r
+ </Vector>\r
+ </Choice>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_ID" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <!-- ChoiceID already exists in different ChoiceSet -->\r
+ <test testName="CreateInteractionChoiceSet_InvalidID" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "9"/>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <Integer interactionChoiceSetID="41"/>\r
+ <Vector name="choiceSet">\r
+ <Choice>\r
+ <Integer choiceID="101"/>\r
+ <String menuName="Choice411"/>\r
+ <Vector name="vrCommands">\r
+ <String add="Choice 411"/>\r
+ </Vector>\r
+ </Choice>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_ID" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <!-- ChoiceID already exists in the same ChoiceSet -->\r
+ <test testName="CreateInteractionChoiceSet_InvalidID" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "9"/>\r
+ <Integer correlation_id = "3" />\r
+ </params>\r
+ <message_params>\r
+ <Integer interactionChoiceSetID="42"/>\r
+ <Vector name="choiceSet">\r
+ <Choice>\r
+ <Integer choiceID="421"/>\r
+ <String menuName="Choice421"/>\r
+ <Vector name="vrCommands">\r
+ <String add="Choice 421"/>\r
+ </Vector>\r
+ </Choice>\r
+ <Choice>\r
+ <Integer choiceID="421"/>\r
+ <String menuName="Choice422"/>\r
+ <Vector name="vrCommands">\r
+ <String add="Choice 422"/>\r
+ </Vector>\r
+ </Choice>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "3" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_ID" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+\r
+</file>\r
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<file>\r
+ <type type = "unit"/>\r
+\r
+ <!--//////////-->\r
+ <!-- PutFile -->\r
+ <!--//////////-->\r
+ \r
+ <!-- PutFile: All parameters -->\r
+ <test testName="PutFile_AllParamsDiffPersistent" pause="1000">\r
+ <!-- Persistent = false -->\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "32"/>\r
+ <Integer correlation_id = "1" />\r
+ <Binary bulkData="/test_data/icon.png" />\r
+ </params>\r
+ <message_params>\r
+\r
+ <String syncFileName="persistent_false.png"/>\r
+ <String fileType="GRAPHIC_PNG" />\r
+ <Boolean persistentFile="false" />\r
+\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <!-- PutFile: All parameters -->\r
+ <test testName="PutFile_AllParamsDiffPersistent" pause="1000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "32"/>\r
+ <Integer correlation_id = "2" />\r
+ <Binary bulkData="test_data/icon.png" />\r
+ </params>\r
+ <message_params>\r
+ <String syncFileName="persistent_false.png"/>\r
+ <String fileType="GRAPHIC_PNG" />\r
+ <Boolean persistentFile="true" />\r
+\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+\r
+ <!-- png -->\r
+ <test testName = "PutFile_AllMandatoryAllTypes" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "32"/>\r
+ <Integer correlation_id = "1" />\r
+ <Binary bulkData="/test_data/icon.png" />\r
+ </params>\r
+ <message_params>\r
+ <String syncFileName="icon.png"/>\r
+ <String fileType="GRAPHIC_PNG" />\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <!-- bmp -->\r
+ <test testName = "PutFile_AllMandatoryAllTypes" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "32"/>\r
+ <Integer correlation_id = "2" />\r
+ <Binary bulkData="/test_data/clock.bmp" />\r
+ </params>\r
+ <message_params>\r
+ <String syncFileName="clock.bmp"/>\r
+ <String fileType="GRAPHIC_BMP" />\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <!-- jpeg -->\r
+ <test testName = "PutFile_AllMandatoryAllTypes" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "32"/>\r
+ <Integer correlation_id = "3" />\r
+ <Binary bulkData="/test_data/earth.jpg" />\r
+ </params>\r
+ <message_params>\r
+ <String syncFileName="earth.jpeg"/>\r
+ <String fileType="GRAPHIC_JPEG" />\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "3" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <!-- mp3 -->\r
+ <test testName = "PutFile_AllMandatoryAllTypes" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "32"/>\r
+ <Integer correlation_id = "4" />\r
+ <Binary bulkData="/test_data/music_mp3.mp3" />\r
+ </params>\r
+ <message_params>\r
+ <String syncFileName="music_mp3.mp3"/>\r
+ <String fileType="AUDIO_MP3" />\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "4" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <!-- wave -->\r
+ <test testName = "PutFile_AllMandatoryAllTypes" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "32"/>\r
+ <Integer correlation_id = "5" />\r
+ <Binary bulkData="/test_data/music_wave.wav" />\r
+ </params>\r
+ <message_params>\r
+ <String syncFileName="music_wave.wav"/>\r
+ <String fileType="AUDIO_WAVE" />\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "5" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+\r
+ <!-- PutFile: Mandatory missing -->\r
+ <test testName="PutFile_MandatoryMissing">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "32"/>\r
+ <Integer correlation_id = "1" />\r
+ <Binary bulkData="/test_data/icon.png" />\r
+ </params>\r
+ <message_params>\r
+ <String fileType="GRAPHIC_PNG" />\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_DATA" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <!-- Missing fileType -->\r
+ <test testName="PutFile_MandatoryMissing">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "32"/>\r
+ <Integer correlation_id = "2" />\r
+ <Binary bulkData="/test_data/icon.png" />\r
+ </params>\r
+ <message_params>\r
+ <String syncFileName="missing_mandatory.png"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_DATA" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+\r
+\r
+</file>\r
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<file>\r
+ <type type = "unit"/>\r
+ <!--//////////-->\r
+ <!-- ReadDID -->\r
+ <!--//////////-->\r
+\r
+ <!-- ReadDID: All parameters -->\r
+\r
+\r
+ <!-- Missing didLocation -->\r
+ <test testName="ReadDID_MissingMandatory" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "23"/>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <Integer ecuName="2000" />\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_DATA" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <!-- Missing all -->\r
+ <test testName="ReadDID_MissingMandatory" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "23"/>\r
+ <Integer correlation_id = "3" />\r
+ </params>\r
+ <message_params>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "3" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_DATA" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+\r
+\r
+ <!--//////////-->\r
+ <!-- GetDTCs -->\r
+ <!--//////////-->\r
+\r
+ <!-- GetDTCs: All parameters -->\r
+ <test testName="GetDTCs_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "24"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <Integer ecuName="2000" />\r
+ <Integer dtcMask="125" />\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "91" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "VehicleInfo.GetDTCs" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Integer ecuName="2000" />\r
+ <Integer dtcMask="125" />\r
+ </params>\r
+\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ </test>\r
+ <!-- GetDTCs: Only mandatory -->\r
+ <test testName="GetDTCs_OnlyMandatory" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "24"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <Integer ecuName="2000" />\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "91" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "VehicleInfo.GetDTCs" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Integer ecuName="2000" />\r
+ <Garbage dtcMask="" />\r
+ </params>\r
+\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ </test>\r
+\r
+ <!-- GetDTCs: Missing mandatory -->\r
+\r
+ <!-- Missing ecuName -->\r
+ <test testName="GetDTCs_MissingMandatory" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "24"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <Integer dtcMask="125" />\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_DATA" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <!-- Missing all -->\r
+ <test testName="GetDTCs_MissingMandatory" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "24"/>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_DATA" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+\r
+</file>\r
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<file>\r
+ <type type = "unit"/>\r
+ <!--//////////-->\r
+ <!-- ScrollableMessage -->\r
+ <!--//////////-->\r
+\r
+ <!-- ScrollableMessage: All parameters -->\r
+ <test testName="ScrollableMessage_AllParams" pause="5000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "25"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String scrollableMessageBody="messageBody"/>\r
+ <Integer timeout="3000"/>\r
+ <Vector name="softButtons">\r
+ <SoftButton>\r
+ <String type="BOTH" />\r
+ <String text="Close" />\r
+ <image>\r
+ <String value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </image>\r
+ <Boolean isHighlighted="true" />\r
+ <Integer softButtonID="32" />\r
+ <String systemAction="DEFAULT_ACTION" />\r
+ </SoftButton>\r
+ <SoftButton>\r
+ <String type="BOTH" />\r
+ <String text="Keep" />\r
+ <image>\r
+ <String value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </image>\r
+ <Boolean isHighlighted="true" />\r
+ <Integer softButtonID="33" />\r
+ <String systemAction="KEEP_CONTEXT" />\r
+ </SoftButton>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "72" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "UI.ScrollableMessage" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <messageText>\r
+ <String fieldName="scrollableMessageBody" />\r
+ <String fieldText="messageBody" />\r
+ </messageText>\r
+ <Vector name="softButtons">\r
+ <SoftButton>\r
+ <String type="BOTH" />\r
+ <String text="Close" />\r
+ <image>\r
+ <Patch value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </image>\r
+ <Boolean isHighlighted="true" />\r
+ <Integer softButtonID="32" />\r
+ <String systemAction="DEFAULT_ACTION" />\r
+ </SoftButton>\r
+ <SoftButton>\r
+ <String type="BOTH" />\r
+ <String text="Keep" />\r
+ <image>\r
+ <Patch value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </image>\r
+ <Boolean isHighlighted="true" />\r
+ <Integer softButtonID="33" />\r
+ <String systemAction="KEEP_CONTEXT" />\r
+ </SoftButton>\r
+ </Vector>\r
+ <Integer timeout="3000"/>\r
+ </params>\r
+\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ </test>\r
+\r
+ <!-- ScrollableMessage: Only mandatory (and timeout) -->\r
+ <test testName="ScrollableMessage_OnlyMandatory" pause="5000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "25"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String scrollableMessageBody="messageBody"/>\r
+ <Integer timeout="3000"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "72" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "UI.ScrollableMessage" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <messageText>\r
+ <String fieldName="scrollableMessageBody" />\r
+ <String fieldText="messageBody" />\r
+ </messageText>\r
+ <Integer timeout="3000"/>\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ </test>\r
+\r
+ <!-- ScrollableMessage: Missing mandatory -->\r
+ <!-- Missing scrollableMessageBody -->\r
+ <test testName="ScrollableMessage_MissingMandatory" pause="5000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "25"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <Integer timeout="3000"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_DATA" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <!-- Missing all -->\r
+ <test testName="ScrollableMessage_MissingMandatory" pause="5000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "25"/>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_DATA" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+\r
+ <!-- ScrollableMessage: Different image types -->\r
+ <!-- DYNAMIC -->\r
+ <test testName="ScrollableMessage_DiffImageTypes" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "25"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String scrollableMessageBody="messageBody"/>\r
+ <Integer timeout="3000"/>\r
+ <Vector name="softButtons">\r
+ <SoftButton>\r
+ <String type="BOTH" />\r
+ <String text="Close" />\r
+ <image>\r
+ <String value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </image>\r
+ <Boolean isHighlighted="true" />\r
+ <Integer softButtonID="32" />\r
+ <String systemAction="DEFAULT_ACTION" />\r
+ </SoftButton>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "72" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "UI.ScrollableMessage" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <messageText>\r
+ <String fieldName="scrollableMessageBody" />\r
+ <String fieldText="messageBody" />\r
+ </messageText>\r
+ <Vector name="softButtons">\r
+ <SoftButton>\r
+ <String type="BOTH" />\r
+ <String text="Close" />\r
+ <image>\r
+ <Patch value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </image>\r
+ <Boolean isHighlighted="true" />\r
+ <Integer softButtonID="32" />\r
+ <String systemAction="DEFAULT_ACTION" />\r
+ </SoftButton>\r
+ </Vector>\r
+ <Integer timeout="3000"/>\r
+ </params>\r
+\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ </test>\r
+ <!-- STATIC -->\r
+ <test testName="ScrollableMessage_DiffImageTypes" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "25"/>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <String scrollableMessageBody="messageBody"/>\r
+ <Integer timeout="3000"/>\r
+ <Vector name="softButtons">\r
+ <SoftButton>\r
+ <String type="BOTH" />\r
+ <String text="Keep" />\r
+ <image>\r
+ <String value="icon.png" />\r
+ <String imageType="STATIC" />\r
+ </image>\r
+ <Boolean isHighlighted="true" />\r
+ <Integer softButtonID="33" />\r
+ <String systemAction="KEEP_CONTEXT" />\r
+ </SoftButton>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "UNSUPPORTED_RESOURCE" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "72" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "UI.ScrollableMessage" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <messageText>\r
+ <String fieldName="scrollableMessageBody" />\r
+ <String fieldText="messageBody" />\r
+ </messageText>\r
+ <Vector name="softButtons">\r
+ <SoftButton>\r
+ <String type="BOTH" />\r
+ <String text="Keep" />\r
+ <Boolean isHighlighted="true" />\r
+ <Integer softButtonID="33" />\r
+ <String systemAction="KEEP_CONTEXT" />\r
+ </SoftButton>\r
+ </Vector>\r
+ <Integer timeout="3000"/>\r
+ </params>\r
+\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ </test>\r
+</file>\r
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<file>\r
+ <type type = "unit"/>\r
+ <!--//////////-->\r
+ <!-- SetAppIcon -->\r
+ <!--//////////-->35\r
+\r
+ <!-- SetAppIcon: All parameters -->\r
+ <test testName="SetAppIcon_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "35"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String syncFileName="icon.png"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "65" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "UI.SetAppIcon" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Array name="syncFileName">\r
+ <String imageType="DYNAMIC"/>\r
+ <Patch value="icon.png" />\r
+ </Array>\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ </test>\r
+\r
+ <!-- SetAppIcon: Missing mandatory -->\r
+ <test testName="SetAppIcon_MissingMandatory" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "35"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_DATA" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+\r
+ <!-- SetAppIcon: Image does not exist -->\r
+ <test testName="SetAppIcon_ImageNotExist" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "35"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String syncFileName="aaa.png"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_DATA" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+</file>\r
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<file>\r
+ <type type = "unit"/>\r
+ <!--//////////-->\r
+ <!-- SetDisplayLayout -->\r
+ <!--//////////-->\r
+\r
+ <!-- SetDisplayLayout: Missing mandatory -->\r
+ <test testName="SetDisplayLayout_MissingMandatory" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "36"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_DATA" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+\r
+\r
+ <!--//////////-->\r
+ <!-- DeleteFile -->\r
+ <!--//////////-->\r
+\r
+ <!-- DeleteFile: Missing mandatory -->\r
+ <test testName="DeleteFile_MissingMandatory" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "33"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_DATA" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+\r
+ <!-- DeleteFile: Wrong file name -->\r
+ <test testName="DeleteFile_WrongFileName" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "33"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String syncFileName="aaa.png"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_DATA" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+\r
+\r
+</file>\r
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<file>\r
+ <type type = "unit"/>\r
+\r
+ <test testName="SetGlobalProperties_AllParams">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "3"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <Vector name="helpPrompt">\r
+ <TTSChunk>\r
+ <String text="helpPrompt first"/>\r
+ <String type="TEXT"/>\r
+ </TTSChunk>\r
+ <TTSChunk>\r
+ <String text="helpPrompt second"/>\r
+ <String type="TEXT"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ <Vector name="timeoutPrompt">\r
+ <TTSChunk>\r
+ <String text="timeoutPrompt first"/>\r
+ <String type="TEXT"/>\r
+ </TTSChunk>\r
+ <TTSChunk>\r
+ <String text="timeoutPrompt second"/>\r
+ <String type="TEXT"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ <String vrHelpTitle="vrHelpTitle updated"/>\r
+ <Vector name="vrHelp">\r
+ <vrHelpItem>\r
+ <String text="VRHelpItem1"/>\r
+ <Integer position="1"/>\r
+ <image>\r
+ <String value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </image>\r
+ </vrHelpItem>\r
+ <vrHelpItem>\r
+ <String text="VRHelpItem2"/>\r
+ <Integer position="2"/>\r
+ <image>\r
+ <String value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </image>\r
+ </vrHelpItem>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "56" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "UI.SetGlobalProperties" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name="vrHelp">\r
+ <vrHelpItem>\r
+ <String text="VRHelpItem1"/>\r
+ <Integer position="1"/>\r
+ <image>\r
+ <Patch value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </image>\r
+ </vrHelpItem>\r
+ <vrHelpItem>\r
+ <String text="VRHelpItem2"/>\r
+ <Integer position="2"/>\r
+ <image>\r
+ <Patch value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </image>\r
+ </vrHelpItem>\r
+ </Vector>\r
+ <String vrHelpTitle="vrHelpTitle updated"/>\r
+ </params>\r
+\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ <HMIRequestSecond>\r
+ <params>\r
+ <Integer function_id = "46" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "TTS.SetGlobalProperties" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name="helpPrompt">\r
+ <TTSChunk>\r
+ <String text="helpPrompt first"/>\r
+ <String type="TEXT"/>\r
+ </TTSChunk>\r
+ <TTSChunk>\r
+ <String text="helpPrompt second"/>\r
+ <String type="TEXT"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ <Vector name="timeoutPrompt">\r
+ <TTSChunk>\r
+ <String text="timeoutPrompt first"/>\r
+ <String type="TEXT"/>\r
+ </TTSChunk>\r
+ <TTSChunk>\r
+ <String text="timeoutPrompt second"/>\r
+ <String type="TEXT"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestSecond>\r
+ </test>\r
+\r
+ <!-- SetGlobalProperties: Only mandatory -->\r
+ <test testName="SetGlobalProperties_OnlyMandatory">\r
+ <!-- helpPrompt only -->\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "3"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <Vector name="helpPrompt">\r
+ <TTSChunk>\r
+ <String text="Help Prompt update only"/>\r
+ <String type="TEXT"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "56" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "UI.SetGlobalProperties" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name = "vrHelp" >\r
+\r
+ </Vector>\r
+ <String vrHelpTitle = "SyncProxyTester" />\r
+ </params>\r
+\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ <HMIRequestSecond>\r
+ <params>\r
+ <Integer function_id = "46" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "TTS.SetGlobalProperties" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name = "helpPrompt" >\r
+ <TTSChunk>\r
+ <String text = "Help Prompt update only" />\r
+ <String type = "TEXT" />\r
+ </TTSChunk>\r
+ </Vector>\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestSecond>\r
+ </test>\r
+ <test testName="SetGlobalProperties_OnlyMandatory">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "3"/>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <Vector name="timeoutPrompt">\r
+ <TTSChunk>\r
+ <String text="timeoutPrompt update only"/>\r
+ <String type="TEXT"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "56" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "UI.SetGlobalProperties" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name = "vrHelp" >\r
+\r
+ </Vector>\r
+ <String vrHelpTitle = "SyncProxyTester" />\r
+ </params>\r
+\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ <HMIRequestSecond>\r
+ <params>\r
+ <Integer function_id = "46" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "TTS.SetGlobalProperties" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name = "timeoutPrompt" >\r
+ <TTSChunk>\r
+ <String text = "timeoutPrompt update only" />\r
+ <String type = "TEXT" />\r
+ </TTSChunk>\r
+ </Vector>\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestSecond>\r
+ </test>\r
+ <test testName="SetGlobalProperties_OnlyMandatory">\r
+ <!-- vrHelpTitle and vrHelpItems only -->\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "3"/>\r
+ <Integer correlation_id = "3" />\r
+ </params>\r
+ <message_params>\r
+ <String vrHelpTitle="vrHelpTitle only"/>\r
+ <Vector name="vrHelp">\r
+ <vrHelpItem>\r
+ <String text="VRHelpItem1 new"/>\r
+ <Integer position="1"/>\r
+ <image>\r
+ <String value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </image>\r
+ </vrHelpItem>\r
+ <vrHelpItem>\r
+ <String text="VRHelpItem2 new"/>\r
+ <Integer position="2"/>\r
+ <image>\r
+ <String value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </image>\r
+ </vrHelpItem>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "3" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "56" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "UI.SetGlobalProperties" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <String vrHelpTitle="vrHelpTitle only"/>\r
+ <Vector name="vrHelp">\r
+ <vrHelpItem>\r
+ <String text="VRHelpItem1 new"/>\r
+ <Integer position="1"/>\r
+ <image>\r
+ <Patch value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </image>\r
+ </vrHelpItem>\r
+ <vrHelpItem>\r
+ <String text="VRHelpItem2 new"/>\r
+ <Integer position="2"/>\r
+ <image>\r
+ <Patch value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </image>\r
+ </vrHelpItem>\r
+ </Vector>\r
+ </params>\r
+\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ </test>\r
+\r
+ <!-- SetGlobalProperties: Mandatory missing -->\r
+ <test testName="SetGlobalProperties_MandatoryMissing" pause="2000">\r
+ <!-- Missing all -->\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "3"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_DATA" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <!-- vrHelpTitle is missing -->\r
+ <test testName="SetGlobalProperties_MandatoryMissing" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "3"/>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <Vector name="helpPrompt">\r
+ <TTSChunk>\r
+ <String text="newhelpPrompt"/>\r
+ <String type="TEXT"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ <Vector name="timeoutPrompt">\r
+ <TTSChunk>\r
+ <String text="newtimeoutPrompt"/>\r
+ <String type="TEXT"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ <Vector name="vrHelp">\r
+ <vrHelpItem>\r
+ <String text="NewVRHelp"/>\r
+ <Integer position="1"/>\r
+ <image>\r
+ <String value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </image>\r
+ </vrHelpItem>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "REJECTED" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <!-- vrHelp is missing -->\r
+ <test testName="SetGlobalProperties_MandatoryMissing" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "3"/>\r
+ <Integer correlation_id = "3" />\r
+ </params>\r
+ <message_params>\r
+ <Vector name="helpPrompt">\r
+ <TTSChunk>\r
+ <String text="newhelpPrompt"/>\r
+ <String type="TEXT"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ <Vector name="timeoutPrompt">\r
+ <TTSChunk>\r
+ <String text="newtimeoutPrompt"/>\r
+ <String type="TEXT"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ <String vrHelpTitle="vrHelpTitle"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "3" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "REJECTED" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <!-- SetGlobalProperties: Different speechCapabilities -->\r
+ <!-- TEXT -->\r
+ <test testName="SetGlobalProperties_DiffCapabilities" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "3"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <Vector name="helpPrompt">\r
+ <TTSChunk>\r
+ <String text="help Prompt text"/>\r
+ <String type="TEXT"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "56" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "UI.SetGlobalProperties" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name = "vrHelp" >\r
+\r
+ </Vector>\r
+ <String vrHelpTitle = "SyncProxyTester" />\r
+ </params>\r
+\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ <HMIRequestSecond>\r
+ <params>\r
+ <Integer function_id = "46" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "TTS.SetGlobalProperties" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name = "helpPrompt" >\r
+ <TTSChunk>\r
+ <String text = "help Prompt text" />\r
+ <String type = "TEXT" />\r
+ </TTSChunk>\r
+ </Vector>\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestSecond>\r
+ </test>\r
+ <!-- PRE_RECORDED -->\r
+ <test testName="SetGlobalProperties_DiffCapabilities" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "3"/>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <Vector name="timeoutPrompt">\r
+ <TTSChunk>\r
+ <String text="timeout Prompt pre_recorded"/>\r
+ <String type="PRE_RECORDED"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "56" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "UI.SetGlobalProperties" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name = "vrHelp" >\r
+\r
+ </Vector>\r
+ <String vrHelpTitle = "SyncProxyTester" />\r
+ </params>\r
+\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ <HMIRequestSecond>\r
+ <params>\r
+ <Integer function_id = "46" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "TTS.SetGlobalProperties" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name = "timeoutPrompt" >\r
+ <TTSChunk>\r
+ <String text = "timeout Prompt pre_recorded" />\r
+ <String type = "PRE_RECORDED" />\r
+ </TTSChunk>\r
+ </Vector>\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestSecond>\r
+ </test>\r
+ <!-- SAPI_PHONEMES -->\r
+ <test testName="SetGlobalProperties_DiffCapabilities" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "3"/>\r
+ <Integer correlation_id = "3" />\r
+ </params>\r
+ <message_params>\r
+ <Vector name="helpPrompt">\r
+ <TTSChunk>\r
+ <String text="help Prompt sapi"/>\r
+ <String type="SAPI_PHONEMES"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "3" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "56" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "UI.SetGlobalProperties" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name = "vrHelp" >\r
+\r
+ </Vector>\r
+ <String vrHelpTitle = "SyncProxyTester" />\r
+ </params>\r
+\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ <HMIRequestSecond>\r
+ <params>\r
+ <Integer function_id = "46" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "TTS.SetGlobalProperties" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name = "helpPrompt" >\r
+ <TTSChunk>\r
+ <String text = "help Prompt sapi" />\r
+ <String type = "SAPI_PHONEMES" />\r
+ </TTSChunk>\r
+ </Vector>\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestSecond>\r
+ </test>\r
+ <!-- LHPLUS_PHONEMES -->\r
+ <test testName="SetGlobalProperties_DiffCapabilities" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "3"/>\r
+ <Integer correlation_id = "4" />\r
+ </params>\r
+ <message_params>\r
+ <Vector name="timeoutPrompt">\r
+ <TTSChunk>\r
+ <String text="timeout Prompt lhplus"/>\r
+ <String type="LHPLUS_PHONEMES"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "4" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "56" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "UI.SetGlobalProperties" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name = "vrHelp" >\r
+\r
+ </Vector>\r
+ <String vrHelpTitle = "SyncProxyTester" />\r
+ </params>\r
+\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ <HMIRequestSecond>\r
+ <params>\r
+ <Integer function_id = "46" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "TTS.SetGlobalProperties" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name = "timeoutPrompt" >\r
+ <TTSChunk>\r
+ <String text = "timeout Prompt lhplus" />\r
+ <String type = "LHPLUS_PHONEMES" />\r
+ </TTSChunk>\r
+ </Vector>\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestSecond>\r
+ </test>\r
+ <!-- SILENCE -->\r
+ <test testName="SetGlobalProperties_DiffCapabilities" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "3"/>\r
+ <Integer correlation_id = "5" />\r
+ </params>\r
+ <message_params>\r
+ <Vector name="helpPrompt">\r
+ <TTSChunk>\r
+ <String text="help Prompt silence"/>\r
+ <String type="SILENCE"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "5" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "56" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "UI.SetGlobalProperties" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name = "vrHelp" >\r
+\r
+ </Vector>\r
+ <String vrHelpTitle = "SyncProxyTester" />\r
+ </params>\r
+\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ <HMIRequestSecond>\r
+ <params>\r
+ <Integer function_id = "46" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "TTS.SetGlobalProperties" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name = "helpPrompt" >\r
+ <TTSChunk>\r
+ <String text = "help Prompt silence" />\r
+ <String type = "SILENCE" />\r
+ </TTSChunk>\r
+ </Vector>\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestSecond>\r
+ </test>\r
+ <!-- SetGlobalProperties: Non-sequential positions of vrHelpItems -->\r
+ <!-- Non-sequential -->\r
+ <test testName="SetGlobalProperties_NonseqPositions" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "3"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String vrHelpTitle="vrHelpTitle"/>\r
+ <Vector name="vrHelp">\r
+ <vrHelpItem>\r
+ <String text="NewVRHelp1"/>\r
+ <Integer position="1"/>\r
+ <image>\r
+ <String value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </image>\r
+ </vrHelpItem>\r
+ <vrHelpItem>\r
+ <String text="NewVRHelp2"/>\r
+ <Integer position="3"/>\r
+ <image>\r
+ <String value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </image>\r
+ </vrHelpItem>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "REJECTED" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <!-- Sequential but not started from 1 -->\r
+ <test testName="SetGlobalProperties_NonseqPositions" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "3"/>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <String vrHelpTitle="vrHelpTitle"/>\r
+ <Vector name="vrHelp">\r
+ <vrHelpItem>\r
+ <String text="NewVRHelp1"/>\r
+ <Integer position="10"/>\r
+ <image>\r
+ <String value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </image>\r
+ </vrHelpItem>\r
+ <vrHelpItem>\r
+ <String text="NewVRHelp2"/>\r
+ <Integer position="11"/>\r
+ <image>\r
+ <String value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </image>\r
+ </vrHelpItem>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "REJECTED" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <!-- SetGlobalProperties: Different image types -->\r
+ <test testName="SetGlobalProperties_DiffImageTypes">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "3"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String vrHelpTitle="vrHelpTitle"/>\r
+ <Vector name="vrHelp">\r
+ <vrHelpItem>\r
+ <String text="NewVRHelp Static"/>\r
+ <Integer position="1"/>\r
+ <image>\r
+ <String value="icon.png" />\r
+ <String imageType="STATIC" />\r
+ </image>\r
+ </vrHelpItem>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "UNSUPPORTED_RESOURCE" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+\r
+\r
+</file>\r
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<file>\r
+ <type type = "unit"/>\r
+ <!--//////////-->\r
+ <!-- Show -->\r
+ <!--//////////-->\r
+\r
+ <!-- Show: Missing all parameters -->\r
+ <test testName="Show_MissingAllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "13"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_DATA" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+\r
+ <!-- Show: Empty parameters -->\r
+ <test testName="Show_EmptyParameters" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "13"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String mainField1=""/>\r
+ <String mainField2=""/>\r
+ <String mainField3=""/>\r
+ <String mainField4=""/>\r
+ <String mediaTrack=""/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "49" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "UI.Show" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name = "showStrings" >\r
+ <mainField1>\r
+ <String fieldName= "mainField1" />\r
+ <String fieldText= "" />\r
+ </mainField1>\r
+ <mainField2>\r
+ <String fieldName= "mainField2" />\r
+ <String fieldText= "" />\r
+ </mainField2>\r
+ <mainField3>\r
+ <String fieldName= "mainField3" />\r
+ <String fieldText= "" />\r
+ </mainField3>\r
+ <mainField4>\r
+ <String fieldName= "mainField4" />\r
+ <String fieldText= "" />\r
+ </mainField4>\r
+ <mainField5>\r
+ <String fieldName= "mediaTrack" />\r
+ <String fieldText= "" />\r
+ </mainField5>\r
+ </Vector>\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ </test>\r
+ <!-- Show: Different image type -->\r
+ <!-- DYNAMIC -->\r
+ <test testName="Show_DiffImageType">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "13"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <graphic>\r
+ <String value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </graphic>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "49" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "UI.Show" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <graphic>\r
+ <Patch value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </graphic>\r
+ <Array name="showStrings" >\r
+ </Array>\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ </test>\r
+ <!-- STATIC -->\r
+ <test testName="Show_DiffImageType">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "13"/>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <graphic>\r
+ <String value="icon.png" />\r
+ <String imageType="STATIC" />\r
+ </graphic>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "UNSUPPORTED_RESOURCE" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "49" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "UI.Show" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <graphic>\r
+ <String value="icon.png" />\r
+ <String imageType="STATIC" />\r
+ </graphic>\r
+ <Array name="showStrings" >\r
+ </Array>\r
+ </params>\r
+\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ </test>\r
+\r
+</file>\r
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<file>\r
+ <type type = "unit"/>\r
+ <!--//////////-->\r
+ <!-- ShowConstantTBT -->\r
+ <!--//////////-->\r
+\r
+ <!-- ShowConstantTBT: All parameters -->\r
+ <test testName="ShowConstantTBT_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "27"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String navigationText1="navigation Text 1" />\r
+ <String navigationText2="navigation Text 2" />\r
+ <String eta="12:34" />\r
+ <turnIcon>\r
+ <String value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </turnIcon>\r
+ <Float distanceToManeuver="50.5" />\r
+ <Float distanceToManeuverScale="100" />\r
+ <Boolean maneuverComplete="false" />\r
+ <Vector name="softButtons">\r
+ <SoftButton>\r
+ <String type="BOTH" />\r
+ <String text="Close" />\r
+ <image>\r
+ <String value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </image>\r
+ <Boolean isHighlighted="true" />\r
+ <Integer softButtonID="44" />\r
+ <String systemAction="DEFAULT_ACTION" />\r
+ </SoftButton>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "80" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "Navigation.ShowConstantTBT" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Float distanceToManeuver="50.5" />\r
+ <Float distanceToManeuverScale="100" />\r
+ <Boolean maneuverComplete="false" />\r
+ <Vector name="navigationTexts">\r
+ <navigation>\r
+ <String fieldName="navigationText1" />\r
+ <String fieldText="navigation Text 1" />\r
+ </navigation>\r
+ <navigation>\r
+ <String fieldName="navigationText2" />\r
+ <String fieldText="navigation Text 2" />\r
+ </navigation>\r
+ <navigation>\r
+ <String fieldName="ETA" />\r
+ <String fieldText="12:34" />\r
+ </navigation>\r
+ </Vector>\r
+ <Vector name="softButtons">\r
+ <SoftButton>\r
+ <String type="BOTH" />\r
+ <String text="Close" />\r
+ <image>\r
+ <Patch value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </image>\r
+ <Boolean isHighlighted="true" />\r
+ <Integer softButtonID="44" />\r
+ <String systemAction="DEFAULT_ACTION" />\r
+ </SoftButton>\r
+ </Vector>\r
+ <turnIcon>\r
+ <Patch value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </turnIcon>\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ </test>\r
+\r
+ <!-- ShowConstantTBT: Without parameters -->\r
+ <test testName="ShowConstantTBT_WithoutParameters" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "27"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_DATA" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+\r
+ <!-- ShowConstantTBT: Empty parameters -->\r
+ <test testName="ShowConstantTBT_EmptyParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "27"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String navigationText1="" />\r
+ <String navigationText2="" />\r
+ <String eta="" />\r
+ <Vector name="softButtons">\r
+ <SoftButton>\r
+ <String type="BOTH" />\r
+ <String text="Close" />\r
+ <image>\r
+ <String value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </image>\r
+ <Boolean isHighlighted="true" />\r
+ <Integer softButtonID="44" />\r
+ <String systemAction="DEFAULT_ACTION" />\r
+ </SoftButton>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "80" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "Navigation.ShowConstantTBT" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name="navigationTexts">\r
+ <navigation>\r
+ <String fieldName="navigationText1" />\r
+ <String fieldText="" />\r
+ </navigation>\r
+ <navigation>\r
+ <String fieldName="navigationText2" />\r
+ <String fieldText="" />\r
+ </navigation>\r
+ <navigation>\r
+ <String fieldName="ETA" />\r
+ <String fieldText="" />\r
+ </navigation>\r
+ </Vector>\r
+ <Vector name="softButtons">\r
+ <SoftButton>\r
+ <String type="BOTH" />\r
+ <String text="Close" />\r
+ <image>\r
+ <Patch value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </image>\r
+ <Boolean isHighlighted="true" />\r
+ <Integer softButtonID="44" />\r
+ <String systemAction="DEFAULT_ACTION" />\r
+ </SoftButton>\r
+ </Vector>\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ </test>\r
+\r
+ <!-- ShowConstantTBT: Different image types -->\r
+ <!-- DYNAMIC -->\r
+ <test testName="ShowConstantTBT_DiffImageTypes" pause="6000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "27"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String navigationText1="navigation Text 1" />\r
+ <String navigationText2="navigation Text 2" />\r
+ <String eta="12:34" />\r
+ <turnIcon>\r
+ <String value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </turnIcon>\r
+ <Float distanceToManeuver="50.5" />\r
+ <Float distanceToManeuverScale="100" />\r
+ <Boolean maneuverComplete="false" />\r
+ <Vector name="softButtons">\r
+ <SoftButton>\r
+ <String type="BOTH" />\r
+ <String text="Close" />\r
+ <image>\r
+ <String value="icon.png" />\r
+ <String imageType="STATIC" />\r
+ </image>\r
+ <Boolean isHighlighted="true" />\r
+ <Integer softButtonID="44" />\r
+ <String systemAction="DEFAULT_ACTION" />\r
+ </SoftButton>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "UNSUPPORTED_RESOURCE" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "80" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "Navigation.ShowConstantTBT" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Float distanceToManeuver="50.5" />\r
+ <Float distanceToManeuverScale="100" />\r
+ <Boolean maneuverComplete="false" />\r
+ <Vector name="navigationTexts">\r
+ <navigation>\r
+ <String fieldName="navigationText1" />\r
+ <String fieldText="navigation Text 1" />\r
+ </navigation>\r
+ <navigation>\r
+ <String fieldName="navigationText2" />\r
+ <String fieldText="navigation Text 2" />\r
+ </navigation>\r
+ <navigation>\r
+ <String fieldName="ETA" />\r
+ <String fieldText="12:34" />\r
+ </navigation>\r
+ </Vector>\r
+ <Vector name="softButtons">\r
+ <SoftButton>\r
+ <String type="BOTH" />\r
+ <String text="Close" />\r
+ <Boolean isHighlighted="true" />\r
+ <Integer softButtonID="44" />\r
+ <String systemAction="DEFAULT_ACTION" />\r
+ </SoftButton>\r
+ </Vector>\r
+ <turnIcon>\r
+ <Patch value="icon.png" />\r
+ <String imageType="DYNAMIC" />\r
+ </turnIcon>\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ </test>\r
+ <!-- STATIC -->\r
+ <test testName="ShowConstantTBT_DiffImageTypes" pause="6000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "27"/>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <String navigationText1="navigation Text 1" />\r
+ <String navigationText2="navigation Text 2" />\r
+ <String eta="12:34" />\r
+ <turnIcon>\r
+ <String value="icon.png" />\r
+ <String imageType="STATIC" />\r
+ </turnIcon>\r
+ <Float distanceToManeuver="50.5" />\r
+ <Float distanceToManeuverScale="100" />\r
+ <Boolean maneuverComplete="false" />\r
+ <Vector name="softButtons">\r
+ <SoftButton>\r
+ <String type="BOTH" />\r
+ <String text="Close" />\r
+ <image>\r
+ <String value="icon.png" />\r
+ <String imageType="STATIC" />\r
+ </image>\r
+ <Boolean isHighlighted="true" />\r
+ <Integer softButtonID="44" />\r
+ <String systemAction="DEFAULT_ACTION" />\r
+ </SoftButton>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "UNSUPPORTED_RESOURCE" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "80" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "Navigation.ShowConstantTBT" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Float distanceToManeuver="50.5" />\r
+ <Float distanceToManeuverScale="100" />\r
+ <Boolean maneuverComplete="false" />\r
+ <Vector name="navigationTexts">\r
+ <navigation>\r
+ <String fieldName="navigationText1" />\r
+ <String fieldText="navigation Text 1" />\r
+ </navigation>\r
+ <navigation>\r
+ <String fieldName="navigationText2" />\r
+ <String fieldText="navigation Text 2" />\r
+ </navigation>\r
+ <navigation>\r
+ <String fieldName="ETA" />\r
+ <String fieldText="12:34" />\r
+ </navigation>\r
+ </Vector>\r
+ <Vector name="softButtons">\r
+ <SoftButton>\r
+ <String type="BOTH" />\r
+ <String text="Close" />\r
+ <Boolean isHighlighted="true" />\r
+ <Integer softButtonID="44" />\r
+ <String systemAction="DEFAULT_ACTION" />\r
+ </SoftButton>\r
+ </Vector>\r
+ <turnIcon>\r
+ <String value="icon.png" />\r
+ <String imageType="STATIC" />\r
+ </turnIcon>\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ </test>\r
+\r
+</file>\r
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<file>\r
+ <type type = "unit"/>\r
+ <!--//////////-->\r
+ <!-- Speak -->\r
+ <!--//////////-->\r
+\r
+ <!-- Speak: All parameters -->\r
+ <test testName="Speak_AllParams" pause="3000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "14"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <Vector name="ttsChunks">\r
+ <TTSChunk>\r
+ <String text="Speak First"/>\r
+ <String type="TEXT"/>\r
+ </TTSChunk>\r
+ <TTSChunk>\r
+ <String text="Speak Second"/>\r
+ <String type="TEXT"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "40" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "TTS.Speak" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name="ttsChunks">\r
+ <TTSChunk>\r
+ <String text="Speak First"/>\r
+ <String type="TEXT"/>\r
+ </TTSChunk>\r
+ <TTSChunk>\r
+ <String text="Speak Second"/>\r
+ <String type="TEXT"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ </params>\r
+\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ </test>\r
+\r
+ <!-- Speak: Missing mandatory -->\r
+ <test testName="Speak_MissingMandatory" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "14"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_DATA" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+\r
+ <!-- Speak: Different speechCapabilities -->\r
+ <!-- TEXT -->\r
+ <test testName="Speak_DiffSpeechCapabilities" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "14"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <Vector name="ttsChunks">\r
+ <TTSChunk>\r
+ <String text="Speak First"/>\r
+ <String type="TEXT"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "40" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "TTS.Speak" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name="ttsChunks">\r
+ <TTSChunk>\r
+ <String text="Speak First"/>\r
+ <String type="TEXT"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ </params>\r
+\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ </test>\r
+ <!-- PRE_RECORDED -->\r
+ <test testName="Speak_DiffSpeechCapabilities" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "14"/>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <Vector name="ttsChunks">\r
+ <TTSChunk>\r
+ <String text="Speak First"/>\r
+ <String type="PRE_RECORDED"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "40" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "TTS.Speak" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name="ttsChunks">\r
+ <TTSChunk>\r
+ <String text="Speak First"/>\r
+ <String type="PRE_RECORDED"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ </params>\r
+\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ </test>\r
+ <!-- SAPI_PHONEMES -->\r
+ <test testName="Speak_DiffSpeechCapabilities" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "14"/>\r
+ <Integer correlation_id = "3" />\r
+ </params>\r
+ <message_params>\r
+ <Vector name="ttsChunks">\r
+ <TTSChunk>\r
+ <String text="Speak First"/>\r
+ <String type="SAPI_PHONEMES"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "3" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "40" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "TTS.Speak" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name="ttsChunks">\r
+ <TTSChunk>\r
+ <String text="Speak First"/>\r
+ <String type="SAPI_PHONEMES"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ </params>\r
+\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ </test>\r
+ <!-- LHPLUS_PHONEMES -->\r
+ <test testName="Speak_DiffSpeechCapabilities" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "14"/>\r
+ <Integer correlation_id = "4" />\r
+ </params>\r
+ <message_params>\r
+ <Vector name="ttsChunks">\r
+ <TTSChunk>\r
+ <String text="Speak First"/>\r
+ <String type="LHPLUS_PHONEMES"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "4" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "40" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "TTS.Speak" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name="ttsChunks">\r
+ <TTSChunk>\r
+ <String text="Speak First"/>\r
+ <String type="LHPLUS_PHONEMES"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ </params>\r
+\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ </test>\r
+ <!-- SILENCE -->\r
+ <test testName="Speak_DiffSpeechCapabilities" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "14"/>\r
+ <Integer correlation_id = "5" />\r
+ </params>\r
+ <message_params>\r
+ <Vector name="ttsChunks">\r
+ <TTSChunk>\r
+ <String text="Speak First"/>\r
+ <String type="SILENCE"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "5" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "40" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "TTS.Speak" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Vector name="ttsChunks">\r
+ <TTSChunk>\r
+ <String text="Speak First"/>\r
+ <String type="SILENCE"/>\r
+ </TTSChunk>\r
+ </Vector>\r
+ </params>\r
+\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ </test>\r
+\r
+</file>\r
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<file>\r
+ <type type = "unit"/>\r
+\r
+ <!--//////////-->\r
+ <!-- SubscribeButton -->\r
+ <!--//////////-->\r
+\r
+ <!-- SubscribeButton: All parameters -->\r
+ <test testName="SubscribeButton_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "18"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String buttonName="PRESET_1"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <test testName="SubscribeButton_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "18"/>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <String buttonName="PRESET_2"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <test testName="SubscribeButton_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "18"/>\r
+ <Integer correlation_id = "3" />\r
+ </params>\r
+ <message_params>\r
+ <String buttonName="PRESET_3"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "3" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <test testName="SubscribeButton_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "18"/>\r
+ <Integer correlation_id = "4" />\r
+ </params>\r
+ <message_params>\r
+ <String buttonName="PRESET_4"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "4" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <test testName="SubscribeButton_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "18"/>\r
+ <Integer correlation_id = "5" />\r
+ </params>\r
+ <message_params>\r
+ <String buttonName="PRESET_5"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "5" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <test testName="SubscribeButton_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "18"/>\r
+ <Integer correlation_id = "6" />\r
+ </params>\r
+ <message_params>\r
+ <String buttonName="PRESET_6"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "6" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <test testName="SubscribeButton_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "18"/>\r
+ <Integer correlation_id = "7" />\r
+ </params>\r
+ <message_params>\r
+ <String buttonName="PRESET_7"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "7" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <test testName="SubscribeButton_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "18"/>\r
+ <Integer correlation_id = "8" />\r
+ </params>\r
+ <message_params>\r
+ <String buttonName="PRESET_8"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "8" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <test testName="SubscribeButton_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "18"/>\r
+ <Integer correlation_id = "9" />\r
+ </params>\r
+ <message_params>\r
+ <String buttonName="PRESET_9"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "9" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <test testName="SubscribeButton_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "18"/>\r
+ <Integer correlation_id = "10" />\r
+ </params>\r
+ <message_params>\r
+ <String buttonName="PRESET_0"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "10" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <test testName="SubscribeButton_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "18"/>\r
+ <Integer correlation_id = "11" />\r
+ </params>\r
+ <message_params>\r
+ <String buttonName="SEEKLEFT"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "11" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <test testName="SubscribeButton_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "18"/>\r
+ <Integer correlation_id = "12" />\r
+ </params>\r
+ <message_params>\r
+ <String buttonName="SEEKRIGHT"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "12" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <test testName="SubscribeButton_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "18"/>\r
+ <Integer correlation_id = "13" />\r
+ </params>\r
+ <message_params>\r
+ <String buttonName="TUNEUP"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "13" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <test testName="SubscribeButton_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "18"/>\r
+ <Integer correlation_id = "14" />\r
+ </params>\r
+ <message_params>\r
+ <String buttonName="TUNEDOWN"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "14" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <test testName="SubscribeButton_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "18"/>\r
+ <Integer correlation_id = "15" />\r
+ </params>\r
+ <message_params>\r
+ <String buttonName="OK"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "15" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <test testName="SubscribeButton_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "18"/>\r
+ <Integer correlation_id = "16" />\r
+ </params>\r
+ <message_params>\r
+ <String buttonName="CUSTOM_BUTTON"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "16" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+\r
+ <!-- SubscribeButton: Missing mandatory -->\r
+ <test testName="SubscribeButton_MissingMandatory" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "18"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_DATA" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+\r
+ <!-- SubscribeButton: Subscribe already subscribed -->\r
+ <test testName="SubscribeButton_AlreadySubscribed">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "18"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String buttonName="PRESET_1"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "IGNORED" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+\r
+\r
+ <!--//////////-->\r
+ <!-- UnsubscribeButton -->\r
+ <!--//////////-->\r
+\r
+ <!-- UnsubscribeButton: All parameters -->\r
+ <test testName="UnsubscribeButton_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "19"/>\r
+ <Integer correlation_id = "21" />\r
+ </params>\r
+ <message_params>\r
+ <String buttonName="PRESET_1"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "21" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <test testName="UnsubscribeButton_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "19"/>\r
+ <Integer correlation_id = "22" />\r
+ </params>\r
+ <message_params>\r
+ <String buttonName="PRESET_2"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "22" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <test testName="UnsubscribeButton_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "19"/>\r
+ <Integer correlation_id = "23" />\r
+ </params>\r
+ <message_params>\r
+ <String buttonName="PRESET_3"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "23" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <test testName="UnsubscribeButton_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "19"/>\r
+ <Integer correlation_id = "24" />\r
+ </params>\r
+ <message_params>\r
+ <String buttonName="PRESET_4"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "24" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <test testName="UnsubscribeButton_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "19"/>\r
+ <Integer correlation_id = "25" />\r
+ </params>\r
+ <message_params>\r
+ <String buttonName="PRESET_5"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "25" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <test testName="UnsubscribeButton_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "19"/>\r
+ <Integer correlation_id = "26" />\r
+ </params>\r
+ <message_params>\r
+ <String buttonName="PRESET_6"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "26" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <test testName="UnsubscribeButton_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "19"/>\r
+ <Integer correlation_id = "27" />\r
+ </params>\r
+ <message_params>\r
+ <String buttonName="PRESET_7"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "27" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <test testName="UnsubscribeButton_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "19"/>\r
+ <Integer correlation_id = "28" />\r
+ </params>\r
+ <message_params>\r
+ <String buttonName="PRESET_8"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "28" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <test testName="UnsubscribeButton_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "19"/>\r
+ <Integer correlation_id = "29" />\r
+ </params>\r
+ <message_params>\r
+ <String buttonName="PRESET_9"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "29" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <test testName="UnsubscribeButton_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "19"/>\r
+ <Integer correlation_id = "30" />\r
+ </params>\r
+ <message_params>\r
+ <String buttonName="PRESET_0"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "30" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <test testName="UnsubscribeButton_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "19"/>\r
+ <Integer correlation_id = "31" />\r
+ </params>\r
+ <message_params>\r
+ <String buttonName="SEEKLEFT"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "31" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <test testName="UnsubscribeButton_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "19"/>\r
+ <Integer correlation_id = "32" />\r
+ </params>\r
+ <message_params>\r
+ <String buttonName="SEEKRIGHT"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "32" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <test testName="UnsubscribeButton_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "19"/>\r
+ <Integer correlation_id = "33" />\r
+ </params>\r
+ <message_params>\r
+ <String buttonName="TUNEUP"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "33" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <test testName="UnsubscribeButton_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "19"/>\r
+ <Integer correlation_id = "34" />\r
+ </params>\r
+ <message_params>\r
+ <String buttonName="TUNEDOWN"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "34" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <test testName="UnsubscribeButton_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "19"/>\r
+ <Integer correlation_id = "35" />\r
+ </params>\r
+ <message_params>\r
+ <String buttonName="OK"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "35" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <test testName="UnsubscribeButton_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "19"/>\r
+ <Integer correlation_id = "36" />\r
+ </params>\r
+ <message_params>\r
+ <String buttonName="CUSTOM_BUTTON"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "36" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+\r
+ <!-- UnsubscribeButton: Missing mandatory -->\r
+ <test testName="UnsubscribeButton_MissingMandatory" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "19"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_DATA" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <!-- UnsubscribeButton: Unsubscribe non-subscribed yet -->\r
+ <test testName="UnsubscribeButton_NonSubscribed" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "19"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String buttonName="CUSTOM_BUTTON"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "IGNORED" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+</file>\r
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<file>\r
+ <type type = "unit"/>\r
+\r
+ <!--//////////-->\r
+ <!-- SubscribeVehicleData and UnsubscribeVehicleData -->\r
+ <!--//////////-->\r
+\r
+ <!-- SubscribeVehicleData: All parameters -->\r
+ <test testName="SubscribeVehicleData_AllParams" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "20"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <Boolean gps="true"/>\r
+ <Boolean speed="true"/>\r
+ <Boolean rpm="true"/>\r
+ <Boolean fuelLevel="true"/>\r
+ <Boolean fuelLevel_State="true"/>\r
+ <Boolean instantFuelConsumption="true"/>\r
+ <Boolean externalTemperature="true"/>\r
+ <Boolean prndl="true"/>\r
+ <Boolean tirePressure="true"/>\r
+ <Boolean odometer="true"/>\r
+ <Boolean beltStatus="true"/>\r
+ <Boolean bodyInformation="true"/>\r
+ <Boolean deviceStatus="true"/>\r
+ <Boolean driverBraking="true"/>\r
+ <Boolean wiperStatus="true"/>\r
+ <Boolean headLampStatus="true"/>\r
+ <Boolean engineTorque="true"/>\r
+ <Boolean accPedalPosition="true"/>\r
+ <Boolean steeringWheelAngle="true"/>\r
+ <Boolean eCallInfo="true"/>\r
+ <Boolean airbagStatus="true"/>\r
+ <Boolean emergencyEvent="true"/>\r
+ <Boolean clusterModeStatus="true"/>\r
+ <Boolean myKey="true"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "93" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "VehicleInfo.SubscribeVehicleData" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Boolean gps="true"/>\r
+ <Boolean speed="true"/>\r
+ <Boolean rpm="true"/>\r
+ <Boolean fuelLevel="true"/>\r
+ <Boolean fuelLevel_State="true"/>\r
+ <Boolean instantFuelConsumption="true"/>\r
+ <Boolean externalTemperature="true"/>\r
+ <Boolean prndl="true"/>\r
+ <Boolean tirePressure="true"/>\r
+ <Boolean odometer="true"/>\r
+ <Boolean beltStatus="true"/>\r
+ <Boolean bodyInformation="true"/>\r
+ <Boolean deviceStatus="true"/>\r
+ <Boolean driverBraking="true"/>\r
+ <Boolean wiperStatus="true"/>\r
+ <Boolean headLampStatus="true"/>\r
+ <Boolean engineTorque="true"/>\r
+ <Boolean accPedalPosition="true"/>\r
+ <Boolean steeringWheelAngle="true"/>\r
+ <Boolean eCallInfo="true"/>\r
+ <Boolean airbagStatus="true"/>\r
+ <Boolean emergencyEvent="true"/>\r
+ <Boolean clusterModeStatus="true"/>\r
+ <Boolean myKey="true"/>\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ </test>\r
+\r
+ <!-- SubscribeVehicleData: Already subscribed -->\r
+ <test testName="SubscribeVehicleData_AlreadySubscribed" pause="2000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "20"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <Boolean gps="true"/>\r
+ <Boolean speed="true"/>\r
+ <Boolean rpm="true"/>\r
+ <Boolean fuelLevel="true"/>\r
+ <Boolean fuelLevel_State="true"/>\r
+ <Boolean instantFuelConsumption="true"/>\r
+ <Boolean externalTemperature="true"/>\r
+ <Boolean prndl="true"/>\r
+ <Boolean tirePressure="true"/>\r
+ <Boolean odometer="true"/>\r
+ <Boolean beltStatus="true"/>\r
+ <Boolean bodyInformation="true"/>\r
+ <Boolean deviceStatus="true"/>\r
+ <Boolean driverBraking="true"/>\r
+ <Boolean wiperStatus="true"/>\r
+ <Boolean headLampStatus="true"/>\r
+ <Boolean engineTorque="true"/>\r
+ <Boolean accPedalPosition="true"/>\r
+ <Boolean steeringWheelAngle="true"/>\r
+ <Boolean eCallInfo="true"/>\r
+ <Boolean airbagStatus="true"/>\r
+ <Boolean emergencyEvent="true"/>\r
+ <Boolean clusterModeStatus="true"/>\r
+ <Boolean myKey="true"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "IGNORED" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+\r
+ <!-- UnsubscribeVehicleData: All parameters -->\r
+ <test testName="UnsubscribeVehicleData_AllParams" pause="1000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "21"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <Boolean gps="true"/>\r
+ <Boolean speed="true"/>\r
+ <Boolean rpm="true"/>\r
+ <Boolean fuelLevel="true"/>\r
+ <Boolean fuelLevel_State="true"/>\r
+ <Boolean instantFuelConsumption="true"/>\r
+ <Boolean externalTemperature="true"/>\r
+ <Boolean prndl="true"/>\r
+ <Boolean tirePressure="true"/>\r
+ <Boolean odometer="true"/>\r
+ <Boolean beltStatus="true"/>\r
+ <Boolean bodyInformation="true"/>\r
+ <Boolean deviceStatus="true"/>\r
+ <Boolean driverBraking="true"/>\r
+ <Boolean wiperStatus="true"/>\r
+ <Boolean headLampStatus="true"/>\r
+ <Boolean engineTorque="true"/>\r
+ <Boolean accPedalPosition="true"/>\r
+ <Boolean steeringWheelAngle="true"/>\r
+ <Boolean eCallInfo="true"/>\r
+ <Boolean airbagStatus="true"/>\r
+ <Boolean emergencyEvent="true"/>\r
+ <Boolean clusterModeStatus="true"/>\r
+ <Boolean myKey="true"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "94" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "VehicleInfo.UnsubscribeVehicleData" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Boolean gps="true"/>\r
+ <Boolean speed="true"/>\r
+ <Boolean rpm="true"/>\r
+ <Boolean fuelLevel="true"/>\r
+ <Boolean fuelLevel_State="true"/>\r
+ <Boolean instantFuelConsumption="true"/>\r
+ <Boolean externalTemperature="true"/>\r
+ <Boolean prndl="true"/>\r
+ <Boolean tirePressure="true"/>\r
+ <Boolean odometer="true"/>\r
+ <Boolean beltStatus="true"/>\r
+ <Boolean bodyInformation="true"/>\r
+ <Boolean deviceStatus="true"/>\r
+ <Boolean driverBraking="true"/>\r
+ <Boolean wiperStatus="true"/>\r
+ <Boolean headLampStatus="true"/>\r
+ <Boolean engineTorque="true"/>\r
+ <Boolean accPedalPosition="true"/>\r
+ <Boolean steeringWheelAngle="true"/>\r
+ <Boolean eCallInfo="true"/>\r
+ <Boolean airbagStatus="true"/>\r
+ <Boolean emergencyEvent="true"/>\r
+ <Boolean clusterModeStatus="true"/>\r
+ <Boolean myKey="true"/>\r
+ </params>\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ </test>\r
+\r
+ <!-- UnsubscribeVehicleData: Unsubscribe not yet subscribed -->\r
+ <test testName="UnsubscribeVehicleData_NotSubscribed" pause="1000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "21"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <Boolean gps="true"/>\r
+ <Boolean speed="true"/>\r
+ <Boolean rpm="true"/>\r
+ <Boolean fuelLevel="true"/>\r
+ <Boolean fuelLevel_State="true"/>\r
+ <Boolean instantFuelConsumption="true"/>\r
+ <Boolean externalTemperature="true"/>\r
+ <Boolean prndl="true"/>\r
+ <Boolean tirePressure="true"/>\r
+ <Boolean odometer="true"/>\r
+ <Boolean beltStatus="true"/>\r
+ <Boolean bodyInformation="true"/>\r
+ <Boolean deviceStatus="true"/>\r
+ <Boolean driverBraking="true"/>\r
+ <Boolean wiperStatus="true"/>\r
+ <Boolean headLampStatus="true"/>\r
+ <Boolean engineTorque="true"/>\r
+ <Boolean accPedalPosition="true"/>\r
+ <Boolean steeringWheelAngle="true"/>\r
+ <Boolean eCallInfo="true"/>\r
+ <Boolean airbagStatus="true"/>\r
+ <Boolean emergencyEvent="true"/>\r
+ <Boolean clusterModeStatus="true"/>\r
+ <Boolean myKey="true"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "IGNORED" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+\r
+ <!-- SubscribeVehicleData: One parameter is false -->\r
+ <test testName="SubscribeVehicleData_OneFalse" pause="1000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "20"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <Boolean gps="false"/>\r
+ <Boolean speed="true"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "93" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "VehicleInfo.SubscribeVehicleData" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Boolean speed="true"/>\r
+ </params>\r
+\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ </test>\r
+\r
+ <!-- UnsubscribeVehicleData: One parameter is false -->\r
+ <test testName="UnsubscribeVehicleData_OneFalse" pause="1000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "21"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <Boolean gps="false"/>\r
+ <Boolean speed="true"/>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "SUCCESS" />\r
+ </message_params>\r
+ </response>\r
+ <HMIRequestFirst>\r
+ <params>\r
+ <Integer function_id = "94" />\r
+ </params>\r
+ <message_params>\r
+ <String method = "VehicleInfo.UnsubscribeVehicleData" />\r
+ <params>\r
+ <Integer appID = "65537" />\r
+ <Boolean speed="true"/>\r
+ </params>\r
+\r
+ </message_params>\r
+ </HMIRequestFirst>\r
+ </test>\r
+\r
+ <!-- Subscribe and UnsubscribeVehicleData: Missing mandatory -->\r
+ <!-- SubscribeVehicleData -->\r
+ <test testName="UnSubscribeVehicleData_MissingMandatory" pause="1000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "21"/>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "1" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_DATA" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+ <!-- UnsubscribeVehicleData -->\r
+ <test testName="UnSubscribeVehicleData_MissingMandatory" pause="1000">\r
+ <request>\r
+ <params>\r
+ <Integer function_id = "21"/>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ </message_params>\r
+ </request>\r
+ <response>\r
+ <params>\r
+ <Integer correlation_id = "2" />\r
+ </params>\r
+ <message_params>\r
+ <String resultCode = "INVALID_DATA" />\r
+ </message_params>\r
+ </response>\r
+ </test>\r
+</file>\r
+++ /dev/null
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_ADMIN_APP_TEST_H_
-#define TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_ADMIN_APP_TEST_H_
-
-//Class replace TEST and Call's Gtest/Gmock of Google
-#include "rpc/GTestFord.h"
-
-//Container singltone, have all class what called in GTestFord
-#include "rpc/GMockClassContainer.h"
-
-//Interface class what called in GTestFord
-#include "rpc/addTest.h"
-#include "rpc/testHMI.h"
-//#include "rpc/xmlParser.h"
-#include "rpc/ICheckClass.h"
-#include "rpc/initStartData.h"
-#include "rpc/HMIMessageHandlerTester.h"
-
-#include "transport_manager/error.h"
-#include "transport_manager/transport_adapter/transport_adapter_event.h"
-#include "transport_manager/transport_adapter/transport_adapter_listener_impl.h"
-
-#include "utils/threads/thread_delegate.h"
-
-
-using namespace application_manager;
-using namespace std;
-using namespace NsSmartDeviceLink::NsJSONHandler::strings;
-using namespace NsSmartDeviceLink::NsSmartObjects;
-//using namespace test::app_manager_test::xml_parser;
-//namespace formatters = NsSmartDeviceLink::NsJSONHandler::Formatters;
-
-namespace test {
- namespace app_manager_test{
-
- /**
- * @brief Main class for test
- */
- class AdminAppTest : public threads::ThreadDelegate
- {
- public:
-
- //metods
-
- /**
- * @brief Constructor
- */
- AdminAppTest();
-
- /**
- * @brief Destructor
- */
- ~AdminAppTest();
-
- /**
- * @brief Run method what creat XMLParser, read XML file
- * creat necessary to us ICheckClass, add him to
- * GMockClassContainer
- *
- * @param
- *
- * @return void
- */
- void run();
-
- /**
- * @brief Set path to XML file
- *
- * @param string patch to XML file
- *
- * @return void
- */
- inline void SetXmlPathToDir(const std::string& path);
-
- /**
- * @brief Thread procedure.
- */
- virtual void threadMain();
-
- protected:
-
- private:
-
- //metods
-
- /**
- * @brief Copy constructor
- */
- AdminAppTest(const AdminAppTest &);
-
-
- /**
- * @brief Operator assignment
- */
- AdminAppTest *operator=(const AdminAppTest &);
-
- //members
-
- /**
- * @brief path to XML file
- */
- //std::string xmlPathToDir;
-
- };
-
-
- inline void AdminAppTest::SetXmlPathToDir(const std::string& path)
- {
- //xmlPathToDir.clear();
- //xmlPathToDir.append(path);
- }
- }
-}
-
-
-#endif //TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_ADMIN_APP_TEST_H_
-
-
-
+++ /dev/null
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_CHECK_HMI_MESSAGE_HANDLER_H_
-#define TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_CHECK_HMI_MESSAGE_HANDLER_H_
-
-#include "rpc/ICheckClass.h"
-
-#include "hmi_message_handler/hmi_message_handler.h"
-#include "protocol_handler/raw_message.h"
-
-#include "utils/shared_ptr.h"
-#include "application_manager/application_manager_impl.h"
-
-namespace test{
- namespace HMI_Message_Handler_Tester{
-
- typedef utils::SharedPtr<application_manager::Message> SP_AM_M;
- /**
- * @brief Test class for test request/response Mobile
- */
- class CheckHMIMessageHandler: public ICheckClass
- {
- public:
- /**
- * @brief In argument name name_test_case,next name_test and got_response_
- *
- * @param first - name test case, second - name test, third - SharedPrt message
- *
- * @return
- */
- CheckHMIMessageHandler(const std::string& inUnitTestName, const std::string& inTestName, SP_AM_M &);
-
- /**
- * @brief Destructor
- */
- ~CheckHMIMessageHandler();
-
- public:
- /**
- * @brief Calls Gtest func and check got response and expected response
- *
- * @param
- *
- * @return bool
- */
- virtual bool check();
-
- /**
- * @brief set got_response_
- *
- * @param first ref MobileMessage
- *
- * @return void
- */
- void addMessage(const MobileMessage &);
-
- protected:
-
- private:
- /**
- * @brief Copy constructor
- *
- * @param first ref CheckMobileMessageHandler
- */
- CheckHMIMessageHandler(const CheckMobileMessageHandler &);
-
- private:
- /**
- * @brief Operator assignment
- *
- * @param first ref CheckMobileMessageHandler
- *
- * @return point to CheckHMIMessageHandler
- */
- CheckHMIMessageHandler *operator=(const CheckMobileMessageHandler &);
-
- private:
- /**
- * @brief Got responce from app. manager
- */
- utils::SharedPtr<application_manager::Message> got_response_;
- /**
- * @brief Expected response from XML
- */
- utils::SharedPtr<application_manager::Message> expected_response_;
- };
-
- }//namespace HMI_Message_Handler_Tester
-}//namespace test
-
-
-
-#endif //TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_CHECK_HMI_MESSAGE_HANDLER_H_
-
-
+++ /dev/null
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_G_MOCK_CLASS_CONTAINER_H_
-#define TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_G_MOCK_CLASS_CONTAINER_H_
-
-//Class replace TEST and Call's Gtest/Gmock of Google
-#include "rpc/ICheckClass.h"
-//Gtest
-#include "rpc/GTestFord.h"
-
-#include <vector>
-
-/**
-* @briefContainer singltone, have all class what called in GTestFord
-*/
-class GMockClassContainer
-{
-public:
-
- /**
- * @brief Return pointer to GMockClassContainer
- *
- * @param
- *
- * @return point to GMockClassContainer
- */
- static GMockClassContainer *instance();
-
- /**
- * @brief Add new ICheckClass for TEST
- *
- * @param first param - class which called Gtest
- *
- * @return void
- */
- void addTest(ICheckClass *);
-
-protected:
-
-private:
- /**
- * @brief Do GTestFord friend
- */
- friend class GTestFord;
- // metods
-
- /**
- * @brief Constructor
- *
- * @param
- *
- * @return
- */
- GMockClassContainer();
-
- /**
- * @brief Destructor
- *
- * @param
- *
- * @return
- */
- ~GMockClassContainer();
-
- /**
- * @brief Copy constructor
- *
- * @param first - GMockClassContainer
- *
- * @return
- */
- GMockClassContainer(const GMockClassContainer &);
-
- /**
- * @brief Operator assignment
- *
- * @param first - GMockClassContainer
- *
- * @return
- */
- GMockClassContainer *operator=(const GMockClassContainer &);
-
- /**
- * @brief Get Test class. Need only for GTestFord
- *
- * @param number tets
- *
- * @return point to ICheckClass
- */
- ICheckClass *getTest(int i);
-
- // members
- /**
- * @brief array Tests which launches Gtest/Gmock
- */
- std::vector<ICheckClass *> mas_;
-};
-
-
-#endif //TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_G_MOCK_CLASS_CONTAINER_H_
-
-
+++ /dev/null
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_HMI_MESSAGE_HANDLER_TEST_H_
-#define TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_HMI_MESSAGE_HANDLER_TEST_H_
-
-#include "utils/macro.h"
-#include "hmi_message_handler/hmi_message_handler.h"
-
-
-using namespace hmi_message_handler;
-
-namespace test{
- namespace HMI_Message_Handler_Tester{
-
- /**
- * @brief Redefinition HMIMessageHandler for test
- */
- class HMIMessageHandlerTester: public HMIMessageHandler
- {
- public:
-
- /**
- * @brief Constructor
- */
- HMIMessageHandlerTester();
-
- /**
- * @brief Destructor
- */
- ~HMIMessageHandlerTester();
-
- public:
- virtual void SendMessageToHMI(utils::SharedPtr<application_manager::Message> message);
- virtual void OnMessageReceived(utils::SharedPtr<application_manager::Message> message);
- virtual void OnErrorSending(utils::SharedPtr<application_manager::Message> message);
- virtual void AddHMIMessageAdapter(HMIMessageAdapter* adapter);
- virtual void RemoveHMIMessageAdapter(HMIMessageAdapter* adapter);
-
- protected:
-
- private:
-
- /**
- * @brief Copy constructor
- *
- * @param first - ref HMIMessageHandlerTester
- */
- HMIMessageHandlerTester(const HMIMessageHandlerTester &);
-
- private:
-
- /**
- * @brief Operator assignment
- *
- * @param first - ref HMIMessageHandlerTester
- *
- * @return point to HMIMessageHandlerTester
- */
- HMIMessageHandlerTester *operator=(const HMIMessageHandlerTester &);
-
- };
-
- }// namespace HMI_Message_Handler_Tester
-}//namespace test
-
-
-#endif //TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_HMI_MESSAGE_HANDLER_TEST_H_
-
-
-
+++ /dev/null
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_I_CHECK_CLASS_H_
-#define TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_I_CHECK_CLASS_H_
-
-#include <string>
-
-
-/**
-* @brief Interface class what called in GTestFord
-*/
-class ICheckClass
-{
-public:
-
- /**
- * @brief Constructor
- *
- * @param first - test case name
- * @param second - test name
- */
- ICheckClass(const std::string& inUnitTestName,const std::string& inTestName);
-
- /**
- * @brief Calls Gtest func
- *
- * @param
- *
- * @return bool
- */
- virtual bool check() = 0;
-
- /**
- * @brief Virtual destructor
- */
- virtual ~ICheckClass();
-
-public:
-
- /**
- * @brief Set unitTestName
- *
- * @param first - test case name
- *
- * @return void
- */
- inline void SetUnitTestName(const std::string& unittestname);
-
- /**
- * @brief Get test case name
- *
- * @param
- *
- * @return const std::string &
- */
- inline const std::string& GetUnitTestName() const;
-
- /**
- * @brief Set test name
- *
- * @param first - test name
- *
- * @return void
- */
- inline void SetTestName(const std::string& testname);
-
- /**
- * @brief Get test name
- *
- * @param
- *
- * @return const std::string &
- */
- inline const std::string& GetTestName() const;
-
-protected:
-
- /**
- * @brief Test case name
- */
- std::string unitTestName_;
-
- /**
- * @brief Test name
- */
- std::string testName_;
-
-private:
-
-};
-
-
-void ICheckClass::SetUnitTestName(const std::string& unittestname)
-{
- unitTestName_.clear();
- unitTestName_.append(unittestname);
-}
-
-
-const std::string& ICheckClass::GetUnitTestName() const
-{
- return unitTestName_;
-}
-
-
-void ICheckClass::SetTestName(const std::string& testname)
-{
- testName_.clear();
- testName_.append(testname);
-}
-
-
-const std::string& ICheckClass::GetTestName() const
-{
- return testName_;
-}
-
-
-
-#endif //TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_I_CHECK_CLASS_H_
-
-
+++ /dev/null
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_ADDTEST_H_
-#define TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_ADDTEST_H_
-
-#include "rpc/ICheckClass.h"
-#include "rpc/GMockClassContainer.h"
-#include "rpc/noParamsFord.h"
-#include "rpc/unaryFord.h"
-#include "rpc/binaryFord.h"
-
-
-/**
-* @brief Add test to Gtest
-*
-* @param first - test case name, second - test name, third - functor, fourth - expected return value functor
-*
-* @return void
-*/
-template<typename NoParamsFunc, typename ReturnValues>
-void addTest(const std::string &testCaseName, const std::string &testName, NoParamsFunc func, ReturnValues ret)
-{
- ICheckClass *test = new noParamsFuncFord<NoParamsFunc, ReturnValues>(testCaseName, testName, func, ret);
- GMockClassContainer *container = GMockClassContainer::instance();
-
- container->addTest(test);
-}
-
-/**
-* @brief Add test to Gtest
-*
-* @param first - test case name, second - test name, third - Unfunctor, fourth - first argument Unfanc,
-* fifth - expected return value Unfunctor
-*
-* @return void
-*/
-template <typename UnFunc, typename FirstArgument, typename ReturnValues>
-void addTest(const std::string &testCaseName, const std::string testName,
- UnFunc func, FirstArgument first, ReturnValues ret)
-{
- ICheckClass *test = new unaryFuncFord<UnFunc,FirstArgument,ReturnValues>(testCaseName, testName, func, first, ret);
- GMockClassContainer *container = GMockClassContainer::instance();
-
- container->addTest(test);
-}
-
-
-/**
-* @brief Add test to Gtest
-*
-* @param first - test case name, second - test name, third - Binfunctor, fourth - first argument Binfanc,
-* fifth - second argument Binfanc, the 6th - expected return value Binfanc
-*
-* @return void
-*/
-template <typename BinFunc, typename FirstArgument, typename SecondArgument, typename ReturnValues>
-void addTest(const std::string &testCaseName, const std::string testName,
- BinFunc func, FirstArgument first, SecondArgument second, ReturnValues ret)
-{
- ICheckClass *test = new binaryFuncFord<BinFunc,FirstArgument,SecondArgument,ReturnValues>(testCaseName, testName, func, first, second, ret);
- GMockClassContainer *container = GMockClassContainer::instance();
-
- container->addTest(test);
-}
-
-
-
-#endif //TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_ADDTEST_H_
-
-
-
-
-
--- /dev/null
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_ADD_TEST_H_
+#define TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_ADD_TEST_H_
+
+#include <string>
+
+#include "rpc/itest_argument.h"
+#include "rpc/gmock_class_container.h"
+#include "rpc/without_argument_test.h"
+#include "rpc/unary_argument_test.h"
+#include "rpc/binary_argument_test.h"
+
+
+/**
+ * @brief Add your functor to test case to Gtest and after this, Gtest call this
+ * functor and return value functor compare with return values - ret. If equal
+ * test PASSED else FAILED. Functor has no input params.
+ *
+ * @param first - test case name
+ * @param second - test name
+ * @param third - functor
+ * @param fourth - expected return value functor
+ *
+ * @return void
+ */
+template<typename NoParamsFunc, typename ReturnValues>
+void addTest(
+ const std::string& test_case_name,
+ const std::string& test_name,
+ NoParamsFunc func,
+ ReturnValues ret) {
+ ITestArgument* test =
+ new WithoutArgumentTest<
+ NoParamsFunc,
+ ReturnValues>(test_case_name, test_name, func, ret);
+ GMockClassContainer* container = GMockClassContainer::instance();
+
+ container->AddTest(test);
+}
+
+/**
+ * @brief Add your functor to test case to Gtest and after this, Gtest call this
+ * functor and return value functor compare with return values - ret. If equal
+ * test PASSED else FAILED. Functor has one input params.
+ *
+ * @param first - test case name
+ * @param second - test name
+ * @param third - Unfunctor
+ * @param fourth - first argument Unfunctor,
+ * @param fifth - expected return value Unfunctor
+ *
+ * @return void
+ */
+template <typename UnFunc, typename FirstArgument, typename ReturnValues>
+void addTest(
+ const std::string& test_case_name,
+ const std::string& test_name,
+ UnFunc func,
+ FirstArgument first,
+ ReturnValues ret) {
+ ITestArgument* test =
+ new UnaryArgumentTest<
+ UnFunc,
+ FirstArgument,
+ ReturnValues>(test_case_name, test_name, func, first, ret);
+ GMockClassContainer* container = GMockClassContainer::instance();
+
+ container->AddTest(test);
+}
+
+/**
+ * @brief Add your functor to test case to Gtest and after this, Gtest call this
+ * functor and return value functor compare with return values - ret. If equal
+ * test PASSED else FAILED. Functor has two input params.
+ *
+ * @param first - test case name
+ * @param second - test name
+ * @param third - Binfunctor
+ * @param fourth - first argument Binfanc
+ * @param fifth - second argument Binfanc,
+ * @param the 6th - expected return value Binfanc
+ *
+ * @return void
+ */
+template <typename BinFunc, typename FirstArgument, typename SecondArgument,
+ typename ReturnValues>
+void addTest(
+ const std::string& test_case_name,
+ const std::string& test_name,
+ BinFunc func,
+ FirstArgument first,
+ SecondArgument second,
+ ReturnValues ret) {
+ ITestArgument* test =
+ new BinaryArgumentTest<
+ BinFunc,
+ FirstArgument,
+ SecondArgument,
+ ReturnValues>(
+ test_case_name, test_name, func, first, second, ret);
+ GMockClassContainer* container = GMockClassContainer::instance();
+
+ container->AddTest(test);
+}
+
+#endif // TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_ADD_TEST_H_
--- /dev/null
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_ADMIN_APP_TEST_H_
+#define TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_ADMIN_APP_TEST_H_
+
+// Class replace TEST and Call's Gtest/Gmock of Google
+#include "rpc/gtest_ford.h"
+
+// Container singltone, have all class what called in GTestFord
+#include "rpc/gmock_class_container.h"
+
+// Interface class what called in GTestFord
+#include "rpc/add_test.h"
+#include "rpc/test_hmi.h"
+#include "rpc/xml_parser.h"
+#include "rpc/itest_argument.h"
+#include "rpc/init_start_data.h"
+#include "rpc/hmi_message_handler_tester.h"
+#include "rpc/smoke_test_exp_media.h"
+
+#include "transport_manager/error.h"
+#include "transport_manager/transport_adapter/transport_adapter_event.h"
+#include "transport_manager/transport_adapter/transport_adapter_listener_impl.h"
+
+#include "utils/threads/thread_delegate.h"
+
+namespace test {
+ /**
+ * @brief Main class for test
+ */
+ class AdminAppTest : public threads::ThreadDelegate {
+ public:
+ /**
+ * @brief Constructor
+ */
+ AdminAppTest();
+
+ /**
+ * @brief Destructor
+ */
+ ~AdminAppTest();
+
+ /**
+ * @brief Run method what creat XMLParser, read XML file
+ * creat necessary to us ICheckClass, add him to
+ * GMockClassContainer
+ *
+ * @param
+ *
+ * @return void
+ */
+ void Run();
+
+ /**
+ * @brief Thread procedure.
+ */
+ virtual void threadMain();
+
+ private:
+ /**
+ * @brief Copy constructor
+ */
+ AdminAppTest(const AdminAppTest&);
+
+ /**
+ * @brief Operator assignment
+ */
+ AdminAppTest* operator=(const AdminAppTest&);
+ };
+} // namespace test
+
+#endif // TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_ADMIN_APP_TEST_H_
+++ /dev/null
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-
-#ifndef TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_BINARY_PREDICAT_FORD_H_
-#define TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_BINARY_PREDICAT_FORD_H_
-
-#include "rpc/ICheckClass.h"
-/**
- * @brief Need onli AddTest
- */
-template <typename BinFunc, typename FirstArgument, typename SecondArgument, typename ReturnValues>
-class binaryFuncFord: public ICheckClass
-{
-public:
- //methods
- /**
- * @brief Constructor
- *
- * @param first - test case name, second - test name, third - Binfunctor, fourth - first argument Binfanc,
- * fifth - second argument Binfanc, the 6th - expected return value Binfanc
- *
- */
- binaryFuncFord(const std::string &testCaseName, const std::string &testName,
- BinFunc func, FirstArgument first, SecondArgument second, ReturnValues ret);
-
- /**
- * @brief Destructor
- */
- ~binaryFuncFord();
-
- /**
- * @brief Calls Gtest func
- *
- * @param
- *
- * @return bool
- */
- virtual bool check();
-
-protected:
-
-private:
- //methods
- /**
- * @brief copy constructor
- *
- * @param first - const ref binaryFuncFord
- */
- binaryFuncFord(const binaryFuncFord &);
-
- /**
- * @brief Operator assignment
- *
- * @param first - const ref binaryFuncFord
- *
- * @return point to binaryFuncFord
- */
- binaryFuncFord &operator=(const binaryFuncFord &);
-
- //members
- /**
- * @brief BinFunc
- */
- BinFunc func_;
-
- /**
- * @brief FirstArgument
- */
- FirstArgument first_;
-
- /**
- * @brief SecondArgument
- */
- SecondArgument second_;
-
- /**
- * @brief ReturnValues
- */
- ReturnValues ret_;
-};
-
-
-template <typename BinFunc, typename FirstArgument, typename SecondArgument, typename ReturnValues>
-binaryFuncFord<BinFunc,FirstArgument,SecondArgument,ReturnValues>::binaryFuncFord(const std::string &testCaseName, const std::string &testName, BinFunc func, FirstArgument first, SecondArgument second, ReturnValues ret)
- :ICheckClass(testCaseName, testName)
- ,func_(func)
- ,first_(first)
- ,second_(second)
- ,ret_(ret)
-
-{
-}
-
-
-template <typename BinFunc, typename FirstArgument, typename SecondArgument, typename ReturnValues>
-binaryFuncFord<BinFunc,FirstArgument,SecondArgument,ReturnValues>::~binaryFuncFord()
-{
-}
-
-
-template <typename BinFunc, typename FirstArgument, typename SecondArgument, typename ReturnValues>
-bool binaryFuncFord<BinFunc,FirstArgument,SecondArgument,ReturnValues>::check()
-{
- return (ret_ == func_(first_,second_));
-}
-
-
-template <typename BinFunc, typename FirstArgument, typename SecondArgument, typename ReturnValues>
-binaryFuncFord<BinFunc,FirstArgument,SecondArgument,ReturnValues>::binaryFuncFord(const binaryFuncFord &in)
- :ICheckClass(in.unitTestName, in.testName)
-{
-}
-
-
-template <typename BinFunc, typename FirstArgument, typename SecondArgument, typename ReturnValues>
-binaryFuncFord<BinFunc,FirstArgument,SecondArgument,ReturnValues> &
- binaryFuncFord<BinFunc,FirstArgument,SecondArgument,ReturnValues>::operator=(const binaryFuncFord &)
-{
- return *this;
-}
-
-
-
-
-#endif //TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_BINARY_PREDICAT_FORD_H_
-
-
-
-
-
--- /dev/null
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_BINARY_ARGUMENT_TEST_H_
+#define TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_BINARY_ARGUMENT_TEST_H_
+
+#include <string>
+
+#include "rpc/itest_argument.h"
+
+/**
+ * @brief Need only AddTest.
+ * Pattern class inherited from interface
+ * InterfaceOfAccessOfGTestToDifferentArgumentsTest, added to
+ * GMockClassContainer and method Check called GTest of Google. In method
+ * Check call binary functor and passed two parameters, then return values
+ * compared with ReturnValues. If equal return true else false.
+ */
+template <typename BinFunc, typename FirstArgument, typename SecondArgument,
+ typename ReturnValues>
+class BinaryArgumentTest : public ITestArgument {
+ public:
+ /**
+ * @brief Constructor
+ *
+ * @param first - test case name
+ * @param second - test name
+ * @param third - Binfunctor
+ * @param fourth - first argument Binfanc
+ * @param fifth - second argument Binfanc,
+ * @param the 6th - expected return value Binfanc
+ *
+ */
+ BinaryArgumentTest(
+ const std::string& test_case_name,
+ const std::string& test_name,
+ BinFunc func,
+ FirstArgument first,
+ SecondArgument second,
+ ReturnValues ret);
+
+ /**
+ * @brief Destructor
+ */
+ ~BinaryArgumentTest();
+
+ /**
+ * @brief Calls Gtest func
+ *
+ * @param
+ *
+ * @return bool
+ */
+ virtual bool Check();
+
+ private:
+ /**
+ * @brief copy constructor
+ *
+ * @param first - const ref BinaryFuncFord
+ */
+ BinaryArgumentTest(const BinaryArgumentTest&);
+
+ /**
+ * @brief Operator assignment
+ *
+ * @param first - const ref BinaryFuncFord
+ *
+ * @return point to BinaryFuncFord
+ */
+ BinaryArgumentTest& operator=(const BinaryArgumentTest&);
+
+ /**
+ * @brief BinFunc
+ */
+ BinFunc func_;
+
+ /**
+ * @brief FirstArgument
+ */
+ FirstArgument first_;
+
+ /**
+ * @brief SecondArgument
+ */
+ SecondArgument second_;
+
+ /**
+ * @brief ReturnValues
+ */
+ ReturnValues ret_;
+};
+
+template <typename BinFunc, typename FirstArgument, typename SecondArgument,
+typename ReturnValues>
+BinaryArgumentTest<BinFunc, FirstArgument, SecondArgument, ReturnValues>::
+ BinaryArgumentTest(
+ const std::string& test_case_name,
+ const std::string& test_name,
+ BinFunc func,
+ FirstArgument first,
+ SecondArgument second,
+ ReturnValues ret)
+ : ITestArgument(test_case_name, test_name),
+ func_(func),
+ first_(first),
+ second_(second),
+ ret_(ret) {
+}
+
+template <typename BinFunc, typename FirstArgument, typename SecondArgument,
+ typename ReturnValues>
+BinaryArgumentTest<BinFunc, FirstArgument, SecondArgument, ReturnValues>::
+ ~BinaryArgumentTest() {
+}
+
+template <typename BinFunc, typename FirstArgument, typename SecondArgument,
+ typename ReturnValues>
+bool BinaryArgumentTest<BinFunc, FirstArgument, SecondArgument,
+ ReturnValues>::Check() {
+ return (ret_ == (*func_)(first_, second_));
+}
+
+template <typename BinFunc, typename FirstArgument, typename SecondArgument,
+ typename ReturnValues>
+BinaryArgumentTest<BinFunc, FirstArgument, SecondArgument, ReturnValues>::
+ BinaryArgumentTest(const BinaryArgumentTest& in)
+ : ITestArgument(in.unit_test_name, in.test_name) {
+}
+
+template <typename BinFunc, typename FirstArgument, typename SecondArgument,
+ typename ReturnValues>
+BinaryArgumentTest<BinFunc, FirstArgument, SecondArgument, ReturnValues>&
+BinaryArgumentTest<BinFunc, FirstArgument, SecondArgument,
+ ReturnValues>
+ ::operator=(const BinaryArgumentTest&) {
+ return *this;
+}
+
+#endif // TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_BINARY_ARGUMENT_TEST_H_
--- /dev/null
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_GMOCK_CLASS_CONTAINER_H_
+#define TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_GMOCK_CLASS_CONTAINER_H_
+
+#include <vector>
+
+// Class replace TEST and Call's Gtest/Gmock of Google
+#include "rpc/itest_argument.h"
+
+// Gtest
+#include "rpc/gtest_ford.h"
+
+/**
+ * @brief Container singltone, have all class what called in GTestFord
+ */
+class GMockClassContainer {
+ public:
+ /**
+ * @brief Return pointer to GMockClassContainer
+ *
+ * @param
+ *
+ * @return point to GMockClassContainer
+ */
+ static GMockClassContainer* instance();
+
+ /**
+ * @brief Add new ICheckClass for TEST
+ *
+ * @param first param - class which called Gtest
+ *
+ * @return void
+ */
+ void AddTest(ITestArgument*);
+
+ private:
+ /**
+ * @brief Do GTestFord friend
+ */
+ friend class GTestFord;
+
+ /**
+ * @brief Constructor
+ *
+ * @param
+ *
+ * @return
+ */
+ GMockClassContainer();
+
+ /**
+ * @brief Destructor
+ *
+ * @param
+ *
+ * @return
+ */
+ ~GMockClassContainer();
+
+ /**
+ * @brief Copy constructor
+ *
+ * @param first - GMockClassContainer
+ *
+ * @return
+ */
+ GMockClassContainer(const GMockClassContainer&);
+
+ /**
+ * @brief Operator assignment
+ *
+ * @param first - GMockClassContainer
+ *
+ * @return
+ */
+ GMockClassContainer* operator=(const GMockClassContainer&);
+
+ /**
+ * @brief Get Test class. Need only for GTestFord
+ *
+ * @param number tets
+ *
+ * @return point to ICheckClass
+ */
+ ITestArgument* GetTest(int i);
+
+ /**
+ * @brief array Tests which launches Gtest/Gmock
+ */
+ std::vector<ITestArgument*> mas_;
+};
+
+
+#endif // TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_GMOCK_CLASS_CONTAINER_H_
* POSSIBILITY OF SUCH DAMAGE.
*/
-
#ifndef TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_G_TEST_FORD_H_
#define TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_G_TEST_FORD_H_
-
#include <gmock/gmock.h>
#include <gtest/gtest.h>
-#include "rpc/GMockClassContainer.h"
+#include "rpc/gmock_class_container.h"
+#include "utils/macro.h"
/**
-* @briefClass replace TEST and Call's Gtest/Gmock of Google
+* @brief Class replace TEST and Call's Gtest/Gmock of Google
*/
-class GTestFord : public testing::Test
-{
-public:
-
- //metods
-
- /**
- * @brief Constructor
- */
- GTestFord();
-
- /**
- * @brief Virtual Distructor
- */
- virtual ~GTestFord();
-
-protected:
+class GTestFord : public testing::Test {
+ public:
+ /**
+ * @brief Constructor
+ */
+ GTestFord();
-private:
+ /**
+ * @brief Virtual Distructor
+ */
+ virtual ~GTestFord();
- //metods
+ private:
+ /**
+ * @brief main function where the testing is executed
+ *
+ * @param
+ *
+ * @return void
+ */
+ virtual void TestBody();
- /**
- * @brief main function where the testing is executed
- *
- * @param
- *
- * @return void
- */
- virtual void TestBody();
+ /**
+ * @brief Change pointer element to GMockClassContainer mas_
+ */
+ static int index_;
- //members
-
- /**
- * @brief Change pointer element to GMockClassContainer mas_
- */
- static int index;
-
+ DISALLOW_COPY_AND_ASSIGN(GTestFord);
};
-
-#endif //TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_G_TEST_FORD_H_
-
+#endif // TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_G_TEST_FORD_H_
--- /dev/null
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_HMI_MESSAGE_HANDLER_TESTER_H_
+#define TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_HMI_MESSAGE_HANDLER_TESTER_H_
+
+#include <list>
+
+#include "utils/macro.h"
+#include "utils/logger.h"
+#include "utils/signals.h"
+#include "config_profile/profile.h"
+
+#include "hmi_message_handler/hmi_message_handler.h"
+#include "hmi_message_handler/hmi_message_handler_impl.h"
+#include "protocol_handler/protocol_handler_impl.h"
+#include "transport_manager/transport_manager.h"
+#include "transport_manager/transport_manager_default.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/mobile_message_handler.h"
+#include "application_manager/message_helper.h"
+#include "formatters/CFormatterJsonSDLRPCv2.hpp"
+
+namespace am = application_manager;
+namespace jsn = NsSmartDeviceLink::NsJSONHandler::strings;
+namespace smart = NsSmartDeviceLink::NsSmartObjects;
+
+namespace test {
+ /**
+ * @brief Redefinition HMIMessageHandler for test
+ */
+ class HMIMessageHandlerTester :
+ public hmi_message_handler::HMIMessageHandler {
+ public:
+ static HMIMessageHandlerTester* instance();
+
+ /**
+ * @brief Destructor
+ */
+ ~HMIMessageHandlerTester();
+
+ virtual void SendMessageToHMI(
+ hmi_message_handler::MessageSharedPointer message);
+ virtual void OnMessageReceived(
+ utils::SharedPtr<application_manager::Message> message);
+ virtual void OnErrorSending(
+ utils::SharedPtr<application_manager::Message> message);
+ virtual void AddHMIMessageAdapter(
+ hmi_message_handler::HMIMessageAdapter* adapter);
+ virtual void RemoveHMIMessageAdapter(
+ hmi_message_handler::HMIMessageAdapter* adapter);
+
+ void SignalNewRequestFromMobile();
+
+ bool operator()(
+ utils::SharedPtr<smart::SmartObject> in_request);
+
+ bool CheckUntestableRequest();
+
+ private:
+ /**
+ * @brief Constructor
+ */
+ HMIMessageHandlerTester();
+
+ /**
+ * @brief Copy constructor
+ *
+ * @param first - ref HMIMessageHandlerTester
+ *
+ */
+ HMIMessageHandlerTester(const HMIMessageHandlerTester&);
+
+ /**
+ * @brief Operator assignment
+ *
+ * @param first - ref HMIMessageHandlerTester
+ *
+ * @return point to HMIMessageHandlerTester
+ */
+ HMIMessageHandlerTester* operator=(const HMIMessageHandlerTester&);
+
+ utils::SharedPtr<smart::SmartObject> request_;
+ utils::SharedPtr<smart::SmartObject> response_;
+
+ hmi_message_handler::MessageSharedPointer* response_from_app_;
+ sync_primitives::ConditionalVariable cond_var_;
+ sync_primitives::AutoLock aLock_;
+ sync_primitives::Lock lock_;
+
+ hmi_message_handler::HMIMessageHandlerImpl* hmi_impl_;
+
+ std::list<hmi_message_handler::MessageSharedPointer> mas_request_to_hmi_;
+ std::list<hmi_message_handler::MessageSharedPointer>
+ mas_untestable_request_to_hmi;
+ };
+} // namespace test
+
+#endif // TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_HMI_MESSAGE_HANDLER_TESTER_H_
#ifndef TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_INIT_HMI_H_
#define TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_INIT_HMI_H_
-
#include <string.h>
#include <dirent.h>
#include <stdio.h>
-
#include <sys/stat.h>
#include <signal.h>
#include <fcntl.h>
#include <cstdlib>
#include <vector>
#include <string>
-#include <iostream>
-#include <fstream>
-
-
+#include <iostream>
+#include <fstream>
#include "utils/macro.h"
#include "utils/logger.h"
#include "config_profile/profile.h"
#include "networking.h"
#include "application_manager/message_helper.h"
+#include "utils/threads/thread_delegate.h"
+#include "utils/threads/thread_options.h"
+#include "utils/threads/thread.h"
+
+namespace InitializeHMI {
+ /**
+ * @brief Patch to browser
+ */
+ const char kBrowser[] = "/usr/bin/chromium-browser";
+ /**
+ * @brief Browser name
+ */
+ const char kBrowserName[] = "chromium-browser";
+ /**
+ * @brief Browser params
+ */
+ const char kBrowserParams[] = "--auth-schemes=basic,digest,ntlm";
+ /**
+ * @brief Local host address
+ */
+ const char kLocalHostAddress[] = "127.0.0.1";
+ /**
+ * @brief Initialize HTML based HMI.
+ *
+ * @return true if success otherwise false.
+ */
+ // bool InitHmi();
+
+ class InitHMI : public threads::ThreadDelegate {
+ public:
+ InitHMI();
+
+ ~InitHMI();
+
+ virtual void threadMain();
+ private:
+ DISALLOW_COPY_AND_ASSIGN(InitHMI);
+ };
-using namespace NsSmartDeviceLink::NsSmartObjects;
+ bool InitFuncHmi();
-namespace InitializeHMI{
- /**
- * @brief Patch to browser
- */
- const char kBrowser[] = "/usr/bin/chromium-browser";
- /**
- * @brief Browser name
- */
- const char kBrowserName[] = "chromium-browser";
- /**
- * @brief Browser params
- */
- const char kBrowserParams[] = "--auth-schemes=basic,digest,ntlm";
- /**
- * @brief Local host address
- */
- const char kLocalHostAddress[] = "127.0.0.1";
+ bool InitHmi();
- /**
- * @brief Initialize HTML based HMI.
- *
- * @return true if success otherwise false.
- */
- bool InitHmi();
-
- }
-
-
-#endif //TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_INIT_HMI_H_
+} // namespace InitializeHMI
+#endif // TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_INIT_HMI_H_
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
-
+
#ifndef TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_INIT_START_DATA_H_
#define TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_INIT_START_DATA_H_
-#include "rpc/InitHMI.h"
+#include "rpc/init_hmi.h"
+#include "rpc/protocol_handler_mockup.h"
#include "transport_manager/error.h"
-#include "transport_manager/transport_adapter/transport_adapter_event.h"
+#include "transport_manager/transport_adapter/transport_adapter_event.h"
#include "transport_manager/transport_adapter/transport_adapter_listener_impl.h"
#include "transport_manager/transport_adapter/transport_adapter_controller.h"
#include "transport_manager/transport_adapter/transport_adapter_impl.h"
-
#include "transport_manager/transport_adapter/server_connection_factory.h"
#include "transport_manager/transport_adapter/client_connection_listener.h"
-
-
#include "transport_manager/tcp/tcp_connection_factory.h"
#include "transport_manager/tcp/tcp_client_listener.h"
#include "transport_manager/tcp/dnssd_service_browser.h"
#include "transport_manager/tcp/tcp_transport_adapter.h"
-
+#include "application_manager/application_manager_impl.h"
#include "utils/logger.h"
-/**
-* @brief Initialize TransportManager, ProtocolHandlerImpl, ConnectionHandlerImpl
-* ApplicationManagerImpl, MessageBrokerAdapter
-*/
-void initStartData();
-
-
-
-#endif //TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_INIT_START_DATA_H_
-
-
+namespace am = application_manager;
+namespace smart = NsSmartDeviceLink::NsSmartObjects;
+namespace jsn = NsSmartDeviceLink::NsJSONHandler::strings;
+/**
+ * @brief Initialize TransportManager, ProtocolHandlerImpl, ConnectionHandlerImpl
+ * ApplicationManagerImpl, MessageBrokerAdapter
+ */
+void InitStartData();
+/**
+ * @brief Registration application
+ */
+void RegApp();
+#endif // TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_INIT_START_DATA_H_
--- /dev/null
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_ITEST_ARGUMENT_H_
+#define TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_ITEST_ARGUMENT_H_
+
+#include <string>
+
+/**
+ * @brief Interface provides access Gtest to different tests.
+ * In GMockClassContainer contains vector pointer of
+ * InterfaceOfAccessOfGTestToDifferentArgumentsTest and when Gtest run, he call
+ * Check() in all class contains in GMockClassContainer.
+ */
+
+class ITestArgument {
+ public:
+ /**
+ * @brief Constructor
+ *
+ * @param first - test case name
+ *
+ * @param second - test name
+ */
+ ITestArgument(
+ const std::string& in_unit_test_name,
+ const std::string& in_test_name);
+
+ /**
+ * @brief Calls Gtest func
+ *
+ * @param
+ *
+ * @return bool
+ */
+ virtual bool Check() = 0;
+
+ /**
+ * @brief Virtual destructor
+ */
+ virtual ~ITestArgument();
+
+ /**
+ * @brief Set unitTestName
+ *
+ * @param first - test case name
+ *
+ * @return void
+ */
+ inline void SetUnitTestName(const std::string& unittestname);
+
+ /**
+ * @brief Get test case name
+ *
+ * @param
+ *
+ * @return const std::string &
+ */
+ inline const std::string& GetUnitTestName() const;
+
+ /**
+ * @brief Set test name
+ *
+ * @param first - test name
+ *
+ * @return void
+ */
+ inline void SetTestName(const std::string& testname);
+
+ /**
+ * @brief Get test name
+ *
+ * @param
+ *
+ * @return const std::string &
+ */
+ inline const std::string& GetTestName() const;
+
+ protected:
+ /**
+ * @brief Test case name
+ */
+ std::string unit_test_name_;
+
+ /**
+ * @brief Test name
+ */
+ std::string test_name_;
+};
+
+void ITestArgument::SetUnitTestName(
+ const std::string& unit_test_name) {
+ unit_test_name_.clear();
+ unit_test_name_.append(unit_test_name);
+}
+
+const std::string& ITestArgument::
+ GetUnitTestName() const {
+ return unit_test_name_;
+}
+
+void ITestArgument::SetTestName(
+ const std::string& test_name) {
+ test_name_.clear();
+ test_name_.append(test_name);
+}
+
+const std::string& ITestArgument::
+ GetTestName() const {
+ return test_name_;
+}
+
+#endif // TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_ITEST_ARGUMENT_H_
+++ /dev/null
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-
-#ifndef TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_NO_PARAMS_PREDICAT_FORD_H_
-#define TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_NO_PARAMS_PREDICAT_FORD_H_
-
-#include "rpc/ICheckClass.h"
-
-
-/**
- * @brief Need onli AddTest
- */
-template <typename Func, typename ReturnValues>
-class noParamsFuncFord: public ICheckClass
-{
-public:
- //methods
-
- /**
- * @brief Constructor
- *
- * @param first - test case name, second - test name, third - functor, fourth - expected return value functor
- *
- */
- noParamsFuncFord(const std::string &testCaseName, const std::string &testName, Func inFunc, ReturnValues ret);
-
-
- /**
- * @brief Destructor
- */
- ~noParamsFuncFord();
-
- /**
- * @brief Calls Gtest func
- *
- * @param
- *
- * @return bool
- */
- virtual bool check();
-
-protected:
-
-private:
- //methods
- /**
- * @brief copy constructor
- *
- * @param first - const ref noParamsFuncFord
- */
- noParamsFuncFord(const noParamsFuncFord &);
-
- /**
- * @brief Operator assignment
- *
- * @param first - const ref noParamsFuncFord
- *
- * @return point to noParamsFuncFord
- */
- noParamsFuncFord &operator=(const noParamsFuncFord &);
-
- //members
- /**
- * @brief functor
- */
- Func func_;
-
- /**
- * @brief ReturnValues
- */
- ReturnValues ret_;
-};
-
-
-template <typename Func, typename ReturnValues>
-noParamsFuncFord<Func,ReturnValues>::noParamsFuncFord(const std::string &testCaseName, const std::string &testName, Func inFunc, ReturnValues ret)
- :ICheckClass(testCaseName, testName)
- ,func_(inFunc)
- ,ret_(ret)
-{
-}
-
-
-template <typename Func, typename ReturnValues>
-noParamsFuncFord<Func,ReturnValues>::~noParamsFuncFord()
-{
-}
-
-
-template <typename Func, typename ReturnValues>
-bool noParamsFuncFord<Func,ReturnValues>::check()
-{
- return (ret_ == func_());
-}
-
-
-template <typename Func, typename ReturnValues>
-noParamsFuncFord<Func,ReturnValues>::noParamsFuncFord(const noParamsFuncFord &in)
- :ICheckClass(in.unitTestName, in.testName)
-{
-}
-
-
-template <typename Func, typename ReturnValues>
-noParamsFuncFord<Func,ReturnValues> &noParamsFuncFord<Func,ReturnValues>::operator=(const noParamsFuncFord &)
-{
- return *this;
-}
-
-
-
-
-
-#endif //TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_NO_PARAMS_PREDICAT_FORD_H_
-
-
-
-
-
--- /dev/null
+/**
+ * \file protocol_handler.h
+ * \brief ProtocolHandlerImpl class header file.
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_PROTOCOL_HANDLER_MOCKUP_H_
+#define TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_PROTOCOL_HANDLER_MOCKUP_H_
+
+#include "utils/macro.h"
+#include "utils/logger.h"
+#include "utils/signals.h"
+#include "config_profile/profile.h"
+#include "protocol_handler/protocol_handler_impl.h"
+#include "transport_manager/transport_manager.h"
+#include "transport_manager/transport_manager_default.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/mobile_message_handler.h"
+#include "application_manager/message_helper.h"
+#include "hmi_message_handler/hmi_message_handler_impl.h"
+#include "hmi_message_handler/messagebroker_adapter.h"
+#include "formatters/CFormatterJsonSDLRPCv2.hpp"
+#include "protocol_handler/message_priority.h"
+#include "protocol_handler/service_type.h"
+#include "json/reader.h"
+
+#include "rpc/init_start_data.h"
+#include "rpc/hmi_message_handler_tester.h"
+
+namespace am = application_manager;
+namespace jsn = NsSmartDeviceLink::NsJSONHandler::strings;
+namespace smart = NsSmartDeviceLink::NsSmartObjects;
+
+namespace test {
+ class ProtocolHandlerMockup : public protocol_handler::ProtocolHandlerImpl {
+ public:
+ static ProtocolHandlerMockup* instance();
+
+ ~ProtocolHandlerMockup();
+
+ bool operator()(
+ utils::SharedPtr<smart::SmartObject> in_request,
+ utils::SharedPtr<smart::SmartObject> in_responce);
+
+ void SendMessageToMobileApp(const protocol_handler::RawMessagePtr& message,
+ bool final_message) OVERRIDE;
+
+ private:
+ ProtocolHandlerMockup(
+ transport_manager::TransportManager* transport_manager_param);
+
+ ProtocolHandlerMockup* operator=(const ProtocolHandlerMockup&);
+
+ ProtocolHandlerMockup(const ProtocolHandlerMockup&);
+
+ utils::SharedPtr<smart::SmartObject> request_;
+ utils::SharedPtr<smart::SmartObject> response_;
+
+ utils::SharedPtr<am::Message> response_from_hmi_;
+ sync_primitives::ConditionalVariable cond_var_;
+ sync_primitives::AutoLock a_lock_;
+ sync_primitives::Lock lock_;
+ };
+} // namespace test
+
+#endif // TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_PROTOCOL_HANDLER_MOCKUP_H_
--- /dev/null
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_SMOKE_TEST_EXP_MEDIA_H_
+#define TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_SMOKE_TEST_EXP_MEDIA_H_
+
+#include <stdio.h>
+#include <libxml/xmlreader.h>
+#include <string>
+
+#include "rpc/xml_parser.h"
+#include "rpc/add_test.h"
+#include "rpc/init_start_data.h"
+#include "rpc/protocol_handler_mockup.h"
+#include "rpc/hmi_message_handler_tester.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/application_impl.h"
+
+namespace am = application_manager;
+namespace jsn = NsSmartDeviceLink::NsJSONHandler::strings;
+namespace smart = NsSmartDeviceLink::NsSmartObjects;
+
+namespace test {
+ /**
+ * @brief Function read test from xml files and create Gtest to verify Mobile
+ * response and HMI request
+ *
+ * @param Patch to folder has xml files
+ *
+ */
+ void SmokeTestExpMedia(const char* patch);
+
+ /**
+ * @brief Function checks whether remains untested HMI request
+ *
+ * @return true if not request or false otherwise
+ *
+ */
+ bool CheckNotTestedHMIRequest();
+} // namespace test
+
+#endif // TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_SMOKE_TEST_EXP_MEDIA_H_
+
#include "application_manager/application_manager_impl.h"
#include "connection_handler/connection_handler_impl.h"
#include "smart_objects/smart_object.h"
+#include "hmi_message_handler/hmi_message_handler_impl.h"
+#include "rpc/hmi_message_handler_tester.h"
+#include "rpc/init_start_data.h"
-#include "rpc/HMIMessageHandlerTester.h"
-//#include "rpc/MobileMessageHandlerTester.h"
+namespace am = application_manager;
+namespace jsn = NsSmartDeviceLink::NsJSONHandler::strings;
+namespace smart = NsSmartDeviceLink::NsSmartObjects;
+namespace test {
+ namespace app_manager_test {
+ /**
+ * @brief testHMI. Init Device. Updated Device List to connaction_handler,
+ * establish connaction. Registr Application. Send HMIRequest to
+ * ManageMobileCommand with params AddCommand
+ */
+ void TestHMI();
-using namespace NsSmartDeviceLink::NsSmartObjects;
-using namespace NsSmartDeviceLink::NsJSONHandler::strings;
-using namespace application_manager;
+ } // namespace app_manager_test
+} // namespace test
-namespace test{
- namespace app_manager_test{
- /**
- * @brief testHMI. Init Device. Updated Device List to connaction_handler,
- * establish connaction. Registr Application. Send HMIRequest to
- * ManageMobileCommand with params AddCommand
- */
- void testHMI();
-
- }//namespace app_manager_test
-}//namespace test
-
-
-#endif //TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_TEST_HMI_H_
+#endif // TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_TEST_HMI_H_
+++ /dev/null
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-
-#ifndef TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_UNARY_PREDICAT_FORD_H_
-#define TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_UNARY_PREDICAT_FORD_H_
-
-#include "rpc/ICheckClass.h"
-
-
-/**
- * @brief Need onli AddTest
- */
-template <typename UnFunc, typename FirstArgument, typename ReturnValues>
-class unaryFuncFord: public ICheckClass
-{
-public:
- //methods
- /**
- * @brief Constructor
- *
- * @param first - test case name, second - test name, third - Unfunctor, fourth - first argument Unfunctor,
- * fifth - expected return value Unfunctor
- *
- */
- unaryFuncFord(const std::string &testCaseName, const std::string &testName,
- UnFunc inFunc, FirstArgument first, ReturnValues ret);
-
- /**
- * @brief Destructor
- */
- ~unaryFuncFord();
-
- /**
- * @brief Calls Gtest func
- *
- * @param
- *
- * @return bool
- */
- virtual bool check();
-
-protected:
-
-private:
- //methods
-
- /**
- * @brief copy constructor
- *
- * @param first - const ref unaryFuncFord
- */
- unaryFuncFord(const unaryFuncFord &);
-
- /**
- * @brief Operator assignment
- *
- * @param first - const ref unaryFuncFord
- *
- * @return point to unaryFuncFord
- */
- unaryFuncFord &operator=(const unaryFuncFord &);
-
- //members
-
- /**
- * @brief UnFunctor
- */
- UnFunc func_;
-
- /**
- * @brief FirstArgument
- */
- FirstArgument first_;
-
- /**
- * @brief ReturnValues
- */
- ReturnValues ret_;
-};
-
-
-
-template <typename UnFunc, typename FirstArgument, typename ReturnValues>
-unaryFuncFord<UnFunc,FirstArgument,ReturnValues>::unaryFuncFord(const std::string &testCaseName, const std::string &testName,
- UnFunc inFunc, FirstArgument first, ReturnValues ret)
- :ICheckClass(testCaseName, testName)
- ,func_(inFunc)
- ,first_(first)
- ,ret_(ret)
-{
-}
-
-
-template <typename UnFunc, typename FirstArgument, typename ReturnValues>
-unaryFuncFord<UnFunc,FirstArgument,ReturnValues>::~unaryFuncFord()
-{
-}
-
-
-template <typename UnFunc, typename FirstArgument, typename ReturnValues>
-bool unaryFuncFord<UnFunc,FirstArgument,ReturnValues>::check()
-{
- return (ret_ == func_(first_));
-}
-
-
-template <typename UnFunc, typename FirstArgument, typename ReturnValues>
-unaryFuncFord<UnFunc,FirstArgument,ReturnValues>::unaryFuncFord(const unaryFuncFord &in)
- :ICheckClass(in.unitTestName, in.testName)
-{
-}
-
-
-template <typename UnFunc, typename FirstArgument, typename ReturnValues>
-unaryFuncFord<UnFunc,FirstArgument,ReturnValues> &unaryFuncFord<UnFunc,FirstArgument,ReturnValues>::operator=(const unaryFuncFord &)
-{
- return *this;
-}
-
-
-
-#endif //TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_UNARY_PREDICAT_FORD_H_
-
-
-
-
-
--- /dev/null
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_UNARY_ARGUMENT_TEST_H_
+#define TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_UNARY_ARGUMENT_TEST_H_
+
+#include <string>
+
+#include "rpc/itest_argument.h"
+
+/**
+ * @brief Need only AddTest.
+ * Pattern class inherited from interface
+ * InterfaceOfAccessOfGTestToDifferentArgumentsTest, added to
+ * GMockClassContainer and method Check called GTest of Google. In method
+ * Check call unary functor and passed one parameter, then return values
+ * compared with ReturnValues. If equal return true else false.
+ */
+template <typename UnFunc, typename FirstArgument, typename ReturnValues>
+class UnaryArgumentTest : public ITestArgument {
+ public:
+ /**
+ * @brief Constructor
+ *
+ * @param first - test case name
+ * @param second - test name
+ * @param third - Unfunctor
+ * @param fourth - first argument Unfunctor,
+ * @param fifth - expected return value Unfunctor
+ *
+ */
+ UnaryArgumentTest(
+ const std::string& test_case_name,
+ const std::string& test_name,
+ UnFunc in_func,
+ FirstArgument first,
+ ReturnValues ret);
+
+ /**
+ * @brief Destructor
+ */
+ ~UnaryArgumentTest();
+
+ /**
+ * @brief Calls Gtest func
+ *
+ * @param
+ *
+ * @return bool
+ */
+ virtual bool Check();
+
+ private:
+ /**
+ * @brief copy constructor
+ *
+ * @param first - const ref unaryFuncFord
+ */
+ UnaryArgumentTest(const UnaryArgumentTest&);
+
+ /**
+ * @brief Operator assignment
+ *
+ * @param first - const ref unaryFuncFord
+ *
+ * @return point to unaryFuncFord
+ */
+ UnaryArgumentTest& operator=(const UnaryArgumentTest&);
+
+ /**
+ * @brief UnFunctor
+ */
+ UnFunc func_;
+
+ /**
+ * @brief FirstArgument
+ */
+ FirstArgument first_;
+
+ /**
+ * @brief ReturnValues
+ */
+ ReturnValues ret_;
+};
+
+template <typename UnFunc, typename FirstArgument, typename ReturnValues>
+UnaryArgumentTest<UnFunc, FirstArgument, ReturnValues>
+ ::UnaryArgumentTest(
+ const std::string& test_case_name,
+ const std::string& test_name,
+ UnFunc in_func,
+ FirstArgument first,
+ ReturnValues ret)
+ : ITestArgument(test_case_name, test_name),
+ func_(in_func),
+ first_(first),
+ ret_(ret) {
+}
+
+template <typename UnFunc, typename FirstArgument, typename ReturnValues>
+UnaryArgumentTest<UnFunc, FirstArgument, ReturnValues>
+ ::~UnaryArgumentTest() {
+}
+
+template <typename UnFunc, typename FirstArgument, typename ReturnValues>
+bool UnaryArgumentTest<UnFunc, FirstArgument, ReturnValues>::Check() {
+ return (ret_ == (*func_)(first_));
+}
+
+template <typename UnFunc, typename FirstArgument, typename ReturnValues>
+UnaryArgumentTest<UnFunc, FirstArgument, ReturnValues>
+ ::UnaryArgumentTest(const UnaryArgumentTest& in)
+ : ITestArgument(in.unit_test_name, in.test_name) {
+}
+
+template <typename UnFunc, typename FirstArgument, typename ReturnValues>
+UnaryArgumentTest<UnFunc, FirstArgument, ReturnValues>&
+ UnaryArgumentTest<UnFunc, FirstArgument, ReturnValues>
+ ::operator=(const UnaryArgumentTest&) {
+ return *this;
+}
+
+#endif // TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_UNARY_ARGUMENT_TEST_H_
--- /dev/null
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_WITHOUT_ARGUMENT_TEST_H_
+#define TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_WITHOUT_ARGUMENT_TEST_H_
+
+#include <string>
+
+#include "rpc/itest_argument.h"
+
+/**
+ * @brief Need only AddTest.
+ * Pattern class inherited from interface
+ * InterfaceOfAccessOfGTestToDifferentArgumentsTest, added to
+ * GMockClassContainer and method Check called GTest of Google. In method
+ * Check call functor, then return values compared with ReturnValues.
+ * If equal return true else false.
+ */
+template <typename Func, typename ReturnValues>
+class WithoutArgumentTest : public ITestArgument {
+ public:
+ /**
+ * @brief Constructor
+ *
+ * @param first - test case name
+ * @param second - test name
+ * @param third - functor
+ * @param fourth - expected return value functor
+ *
+ */
+ WithoutArgumentTest(
+ const std::string& test_case_name,
+ const std::string& test_name,
+ Func inFunc,
+ ReturnValues ret);
+
+ /**
+ * @brief Destructor
+ */
+ ~WithoutArgumentTest();
+
+ /**
+ * @brief Calls Gtest func
+ *
+ * @param
+ *
+ * @return bool
+ */
+ virtual bool Check();
+
+ private:
+ /**
+ * @brief copy constructor
+ *
+ * @param first - const ref noParamsFuncFord
+ */
+ WithoutArgumentTest(const WithoutArgumentTest&);
+
+ /**
+ * @brief Operator assignment
+ *
+ * @param first - const ref noParamsFuncFord
+ *
+ * @return point to noParamsFuncFord
+ */
+ WithoutArgumentTest& operator=(const WithoutArgumentTest&);
+
+ /**
+ * @brief functor
+ */
+ Func func_;
+
+ /**
+ * @brief ReturnValues
+ */
+ ReturnValues ret_;
+};
+
+template <typename Func, typename ReturnValues>
+WithoutArgumentTest<Func, ReturnValues>
+ ::WithoutArgumentTest(
+ const std::string& test_case_name,
+ const std::string& test_name,
+ Func in_func,
+ ReturnValues ret)
+ : ITestArgument(test_case_name, test_name),
+ func_(in_func),
+ ret_(ret) {
+}
+
+template <typename Func, typename ReturnValues>
+WithoutArgumentTest<Func, ReturnValues>::~WithoutArgumentTest() {
+}
+
+template <typename Func, typename ReturnValues>
+bool WithoutArgumentTest<Func, ReturnValues>::Check() {
+ return (ret_ == (*func_)());
+}
+
+template <typename Func, typename ReturnValues>
+WithoutArgumentTest<Func, ReturnValues>
+ ::WithoutArgumentTest(const WithoutArgumentTest& in)
+ : ITestArgument(
+ in.unitTestName, in.testName) {
+}
+
+template <typename Func, typename ReturnValues>
+WithoutArgumentTest<Func, ReturnValues>& WithoutArgumentTest<Func, ReturnValues>
+ ::operator=(const WithoutArgumentTest&) {
+ return *this;
+}
+
+#endif // TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_WITHOUT_ARGUMENT_TEST_H_
+++ /dev/null
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_XML_PARSER_H_
-#define TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_XML_PARSER_H_
-
-#include <string>
-#include <dirent.h>
-#include <map>
-#include <algorithm>
-#include <cstring>
-
-#include "smart_objects/smart_object.h"
-#include "libxml/xmlreader.h"
-#include "formatters/CFormatterJsonSDLRPCv2.hpp"
-#include "formatters/formatter_json_rpc.h"
-
-using namespace NsSmartDeviceLink::NsJSONHandler::strings;
-using namespace NsSmartDeviceLink::NsSmartObjects;
-namespace jhs = NsSmartDeviceLink::NsJSONHandler::strings;
-using namespace std;
-
-namespace test {
-namespace app_manager_test {
-namespace xml_parser {
-
- /**
- *@brief Typedef for string params
- */
- typedef std::map<std::string,std::string> SSMap;
-
- /**
- *@brief Singleton class for parsing XML-file with requests
- */
- class XmlParser
- {
- public:
- static XmlParser* instance();
-
- /**
- *@brief Sets current dir path with XML-files
- *@param std::string pith path
- */
- void SetXmlDir(const std::string& path);
-
- /**
- *@brief Gets current dir path with XML-files
- *@return returns std::string with current path
- */
- std::string GetXmlDir() const;
-
- /**
- *@brief Gets current xml-file name
- *@return returns std::string with current xml-file name
- */
- std::string GetXmlFileName() const;
-
- /**
- *@brief Opens a dir with xml-files
- *@return true if succesfull, otherwise false
- */
- bool OpenDir();
-
- /**
- *@brief Finds first xml-file in dir and then next xml-files
- *@return true if succesfull, otherwise false
- */
- bool NextXml();
-
- /**
- *@brief Reads current xml-file
- *@return true if succesfull, otherwise false
- */
- bool ReadXml();
-
- /**
- *@brief Closes current xml-file
- */
- void CloseXml();
-
- /**
- *@brief Closes current dir with xml-files
- */
- void CloseDir();
-
- /**
- *@brief Finds first and then next test nodes
- *@return true if succesfull
- */
- bool MoveToNextTestNode();
-
- /**
- *@brief Fill smartobject with test params
- *@param SmartObject to fill
- *@return true if succesfull
- */
- bool GetRequestFromTest(SmartObject& so);
-
- private:
- XmlParser();
- ~XmlParser();
-
- private:
-
- /**
- *@brief Finds first test node in xml-file
- *@return true if succesfull
- */
- bool FindFirstTestNode();
-
- /**
- *@brief Recursive function that finds test nodes
- *@param xmlNode* to find in
- *@param xmlNode*& found test node
- *@return true if succesfull
- */
- bool SearchInNodes(xmlNode* node,xmlNode*& testNode);
-
- /**
- *@brief Moves to next test node
- *@return true if succesfull
- */
- bool NextTestNode();
-
- /**
- *@brief Reads test attributes and puts them into SmartObject
- *@param SmartObject& to fill
- */
- void SetTestAttributes(SmartObject& so);
-
- /**
- *@brief Recursively fills smartobject with params in test node
- *@param xmlNode* to start with
- *@param SmartObject& to fill
- */
- void PutParamsToSO(xmlNode* node,SmartObject& so);
-
- /**
- *@brief Recursively puts vector param to smartobject
- *@param xmlNode* vector node
- *@param SmartObject& to fill
- */
- void PutVectorToSO(xmlNode* node,SmartObject& so);
-
- /**
- *@brief Puts an integer param in smartobject
- *@param xmlAttr* pointer to parameter
- *@param SmartObject& to put in
- */
- void SetIntegerMsgParam(const xmlAttr* xmlParam,SmartObject& so);
-
- /**
- *@brief Puts a boolean parameter in smartobject
- *@param xmlAttr* pointer to parameter
- *@param SmartObject& to put in
- */
- void SetBooleanMsgParam(const xmlAttr* xmlParam,SmartObject& so);
-
- /**
- *@brief Puts a string parameter in smartobject
- *@param xmlAttr* pointer to parameter
- *@param SmartObject& to put in
- */
- void SetStringMsgParam(const xmlAttr* xmlParam,SmartObject& so);
-
- /**
- *@brief just moves to next valid tag (not text tag or comment tag)
- *@param xmlNode*& node to start from
- */
- void MoveToTag(xmlNode*& node);
-
- /**
- *@brief converts a xmlChar string to std::string
- *@param xmlChar* string
- *@return std::string with converted xmlChar string
- */
- std::string ToString(const xmlChar* str);
-
- /**
- *@brief veifies if a string has no invalid chars
- *@param std::string& to check
- *@return true if a string has no invalid chars, otherwise false
- */
- bool VerifyString(const std::string& param);
-
- /**
- *@brief checks if a string has only number chars and converts it to integer
- *@param std::string& to check and convert
- *@return converted value if a string has been converted, otherwise -1
- */
- int StrToInt(const std::string& param);
-
- /**
- *@brief checks if a string consists only of "true" or "false"
- *@param std::string& to check and convert
- *@return if string consists of "true", returns true, other occations - false
- */
- bool StrToBool(const std::string& param);
-
-
-
- std::string sXmlDir;
- DIR* xmlDir;
- dirent* xmlFile;
- std::string sXmlFileName;
- xmlDocPtr xmlDoc;
- xmlNode* xmlTestNode;
-
- bool dirOpened;
- bool xmlOpened;
- bool xmlFileExists;
- bool firstTestNodeFound;
-
- SSMap params;
- };
-}//xml_parser
-}//app_manager_test
-}//test
-
-
-
-#endif //TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_XML_PARSER_H_
-
-
--- /dev/null
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_XML_PARSER_H_
+#define TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_XML_PARSER_H_
+
+#include <string>
+#include <dirent.h>
+#include <map>
+#include <algorithm>
+#include <cstring>
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/message_helper.h"
+#include "libxml/xmlreader.h"
+#include "formatters/CFormatterJsonSDLRPCv2.hpp"
+#include "formatters/formatter_json_rpc.h"
+#include "utils/file_system.h"
+
+namespace am = application_manager;
+namespace smart = NsSmartDeviceLink::NsSmartObjects;
+namespace jhs = NsSmartDeviceLink::NsJSONHandler::strings;
+
+namespace test {
+ /**
+ * @brief Typedef for string params
+ */
+ typedef std::map<std::string, std::string> SSMap;
+
+ /**
+ * @brief Singleton class for parsing XML-file with requests
+ */
+ class XmlParser {
+ public:
+ static XmlParser* instance();
+
+ /**
+ * @brief Sets current dir path with XML-files
+ *
+ * @param std::string pith path
+ */
+ void SetXmlDir(const std::string& path);
+
+ /**
+ * @brief Gets current dir path with XML-files
+ *
+ * @return returns std::string with current path
+ */
+ std::string GetXmlDir() const;
+
+ /**
+ * @brief Gets current xml-file name
+ *
+ * @return returns std::string with current xml-file name
+ */
+ std::string GetXmlFileName() const;
+
+ /**
+ * @brief Opens a dir with xml-files
+ *
+ * @return true if succesfull, otherwise false
+ */
+ bool OpenDir();
+
+ /**
+ * @brief Finds first xml-file in dir and then next xml-files
+ *
+ * @return true if succesfull, otherwise false
+ */
+ bool NextXml();
+
+ /**
+ * @brief Reads current xml-file
+ *
+ * @return true if succesfull, otherwise false
+ */
+ bool ReadXml();
+
+ /**
+ *@brief Closes current xml-file
+ */
+ void CloseXml();
+
+ /**
+ * @brief Closes current dir with xml-files
+ */
+ void CloseDir();
+
+ /**
+ * @brief Finds first and then next test nodes
+ *
+ * @return true if succesfull
+ */
+ bool MoveToNextTestNode();
+
+ /**
+ * @brief Fill smartobject with test params
+ *
+ * @param SmartObject to fill
+ *
+ * @return true if succesfull
+ */
+ bool GetRequestFromTest(smart::SmartObject* so);
+
+ private:
+ /**
+ * @brief Constructor
+ */
+ XmlParser();
+
+ /**
+ * @brief Distructor
+ */
+ ~XmlParser();
+
+ /**
+ * @brief Finds first test node in xml-file
+ *
+ * @return true if succesfull
+ */
+ bool FindFirstTestNode();
+
+ /**
+ * @brief Recursive function that finds test nodes
+ *
+ * @param xmlNode* to find in
+ * @param xmlNode*& found test node
+ *
+ * @return true if succesfull
+ */
+ bool SearchInNodes(xmlNode* node, xmlNode** testNode);
+
+ /**
+ * @brief Moves to next test node
+ *
+ * @return true if succesfull
+ */
+ bool NextTestNode();
+
+ /**
+ * @brief Reads test attributes and puts them into SmartObject
+ *
+ * @param SmartObject& to fill
+ */
+ void SetTestAttributes(smart::SmartObject* so);
+
+ /**
+ * @brief Recursively fills smartobject with params in test node
+ *
+ * @param xmlNode* to start with
+ * @param SmartObject& to fill
+ */
+ void PutParamsToSO(xmlNode* node, smart::SmartObject* so);
+
+ /**
+ * @brief Recursively puts vector param to smartobject
+ *
+ * @param xmlNode* vector node
+ * @param SmartObject& to fill
+ */
+ void PutVectorToSO(xmlNode* node, smart::SmartObject* so);
+
+ /**
+ * @brief Puts an integer param in smartobject
+ *
+ * @param xmlAttr* pointer to parameter
+ * @param SmartObject& to put in
+ */
+ void SetIntegerMsgParam(const xmlAttr* xml_param, smart::SmartObject* so);
+
+ /**
+ * @brief Puts a boolean parameter in smartobject
+ *
+ * @param xmlAttr* pointer to parameter
+ * @param SmartObject& to put in
+ */
+ void SetBooleanMsgParam(const xmlAttr* xml_param, smart::SmartObject* so);
+
+ /**
+ * @brief Puts a string parameter in smartobject
+ *
+ * @param xmlAttr* pointer to parameter
+ * @param SmartObject& to put in
+ */
+ void SetStringMsgParam(const xmlAttr* xml_param, smart::SmartObject* so);
+
+ /**
+ * @brief Puts a "return" parameter in smartobject
+ *
+ * @param xmlAttr* pointer to parameter
+ * @param SmartObject& to put in
+ */
+ void SetToResult(const xmlAttr* xml_param, smart::SmartObject* so);
+
+ /**
+ * @brief Puts a binary parameter in smartobject
+ *
+ * @param xmlAttr* pointer to parameter
+ * @param SmartObject& to put in
+ */
+ void SetBinaryMsgParam(const xmlAttr* xml_param, smart::SmartObject* so);
+
+ /**
+ * @brief Puts a patch parameter in smartobject
+ *
+ * @param xmlAttr* pointer to parameter
+ * @param SmartObject& to put in
+ */
+ void SetPatchMsgParam(const xmlAttr* xml_param, smart::SmartObject* so);
+
+ /**
+ * @brief just moves to next valid tag (not text tag or comment tag)
+ *
+ * @param xmlNode*& node to start from
+ */
+ void MoveToTag(xmlNode** node);
+
+ /**
+ * @brief converts a xmlChar string to std::string
+ *
+ * @param xmlChar* string
+ *
+ * @return std::string with converted xmlChar string
+ */
+ std::string ToString(const xmlChar* str);
+
+ /**
+ * @brief veifies if a string has no invalid chars
+ *
+ * @param std::string& to check
+ *
+ * @return true if a string has no invalid chars, otherwise false
+ */
+ bool VerifyString(const std::string& param);
+
+ /**
+ * @brief checks if a string has only number chars and converts it to
+ * integer
+ *
+ * @param std::string& to check and convert
+ *
+ * @return converted value if a string has been converted, otherwise -1
+ */
+ int StrToInt(const std::string& param);
+
+ /**
+ * @brief Puts a float parameter in smartobject
+ *
+ * @param xmlAttr* pointer to parameter
+ * @param SmartObject& to put in
+ */
+ void PutFloatToSO(const xmlAttr* xmlParam, smart::SmartObject* so);
+
+ /**
+ * @brief checks if a string consists only of "true" or "false"
+ *
+ * @param std::string& to check and convert
+ *
+ * @return if string consists of "true", returns true, other occations
+ * - false
+ */
+ bool StrToBool(const std::string& param);
+
+ std::string s_xml_dir_;
+ DIR* xml_dir_;
+ dirent* xml_file_;
+ std::string s_xml_file_name_;
+ xmlDocPtr xml_doc_;
+ xmlNode* xml_test_node_;
+
+ bool dir_opened_;
+ bool xml_opened_;
+ bool xml_file_exists_;
+ bool first_test_node_found_;
+
+ SSMap params_;
+ };
+} // namespace test
+
+#endif // TEST_COMPONENTS_APPLICATION_MANAGER_RPC_INCLUDE_RPC_XML_PARSER_H_
+++ /dev/null
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-
-#include "rpc/AdminAppTest.h"
-#include "../../../../../src/appMain/life_cycle.h"
-
-
-namespace test {
- namespace app_manager_test {
-
- AdminAppTest::AdminAppTest()
- //xmlPathToDir()
- {
- }
-
-
- AdminAppTest::~AdminAppTest()
- {
- }
-
-
- void AdminAppTest::threadMain()
- {
- this->run();
- }
-
-
- void AdminAppTest::run()
- {
- application_manager::ApplicationManagerImpl* app_manager_ =
- application_manager::ApplicationManagerImpl::instance();
-
- //Start init dependence appManagerImpl,HMIImpl,transport...
- initStartData();
-
- sleep(5);
- printf("\n\n\n after init in Admin \n\n\n");
- //////////////////////////////////////////////
- //Test AddCommand
-
- testHMI();
-
- app_manager_->UnregisterAllApplications();
-
- //////////////////////////////////////////////
- //Test Mobile
-
- //testMobile();
-
- //////////////////////////////////////////////
- //check add Test
-
- //addTest("www", "aaa", foo, 65);
-
-
- //////////////////////////////////////////////
-
- /*
- too_many_request_test_case *requestTestCase =
- new too_many_request_test_case("too_many_request_test_case", "first");
-
- GMockClassContainer *container = GMockClassContainer::instance();
-
- container->addTest(requestTestCase);
- */
-
- //////////////////////////////////////////////
- /*
- too_many_pending_requests_test_case *requestPendingTestCase = new too_many_pending_requests_test_case("too_many_pending_requests_test_case", "first");
-
- GMockClassContainer *container = GMockClassContainer::instance();
-
- container->addTest(requestPendingTestCase);
- */
- //////////////////////////////////////////////
-
-
- }
- }//namespace app_manager_test
-}//namespace test
-
-
-
+++ /dev/null
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-
-#include "rpc/CheckMobileMessageHandler.h"
-
-namespace test{
- namespace Mobile_Message_Handler_Tester{
-
- CheckMobileMessageHandler::CheckMobileMessageHandler(const std::string &inUnitTestName,
- const std::string &inTestName,
- utils::SharedPtr<application_manager::Message> &inResponse)
- :ICheckClass(inUnitTestName, inTestName)
- //,flagRun_(false)
- ,got_response_(new application_manager::Message())
- ,expected_response_(new application_manager::Message())
- {
- *expected_response_ = *inResponse;
- }
-
-
- CheckMobileMessageHandler::~CheckMobileMessageHandler()
- {
- }
-
-
- CheckMobileMessageHandler::CheckMobileMessageHandler(const CheckMobileMessageHandler &inCheck)
- :ICheckClass(inCheck.unitTestName, inCheck.testName)
- {
- }
-
-
- CheckMobileMessageHandler *CheckMobileMessageHandler::operator=(const CheckMobileMessageHandler &)
- {
- return this;
- }
-
-
- bool CheckMobileMessageHandler::check()
- {
- bool returnValues = true;
-
- printf("\n\n\n----------------------------------------\n\n");
- printf("EXPECTED_RESPONSE:\n\n");
- printf("correlation_id : %d\n",(*expected_response_).correlation_id());
- printf("function_id : %d\n",(*expected_response_).function_id());
- printf("connection_key : %d\n",(*expected_response_).connection_key());
- printf("type : %d\n",(*expected_response_).type());
- printf("protocol_version : %d\n",(*expected_response_).protocol_version());
- printf("json_message : %s\n\n",(*expected_response_).json_message().data());
-
- printf("GOT_RESPONSE:\n\n");
- printf("correlation_id : %d\n",(*got_response_).correlation_id());
- printf("function_id : %d\n",(*got_response_).function_id());
- printf("connection_key : %d\n",(*got_response_).connection_key());
- printf("type : %d\n",(*got_response_).type());
- printf("protocol_version : %d\n",(*got_response_).protocol_version());
- printf("json_message : %s\n\n",(*got_response_).json_message().data());
-
- printf("----------------------------------------\n\n");
-
-
- returnValues = returnValues && ((*expected_response_).correlation_id()==(*got_response_).correlation_id());
- //printf("%d\n",returnValues);
- returnValues = returnValues && ((*expected_response_).function_id()==(*got_response_).function_id());
- //printf("%d\n",returnValues);
- returnValues = returnValues && ((*expected_response_).connection_key()==(*got_response_).connection_key());
- //printf("%d\n",returnValues);
- returnValues = returnValues && ((*expected_response_).protocol_version()==(*got_response_).protocol_version());
- //printf("%d\n",returnValues);
- returnValues = returnValues && ((*expected_response_).json_message()==(*got_response_).json_message());
- //printf("%d\n",returnValues);
-
- return returnValues;
- }
-
-
- void CheckMobileMessageHandler::addMessage(const MobileMessage &inMessage)
- {
- *got_response_ = *inMessage;
-
- //flagRun_ = true;
- }
-
- }//namespace Mobile_Message_Handler_Tester
-}//namespace test
-
-
+++ /dev/null
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-
-#include "rpc/HMIMessageHandlerTester.h"
-
-
-namespace test{
- namespace HMI_Message_Handler_Tester{
-
-
- HMIMessageHandlerTester::HMIMessageHandlerTester()
- {
- }
-
-
- HMIMessageHandlerTester::~HMIMessageHandlerTester()
- {
- }
-
-
- HMIMessageHandlerTester::HMIMessageHandlerTester(const HMIMessageHandlerTester &)
- {
- }
-
-
- HMIMessageHandlerTester *HMIMessageHandlerTester::operator=(const HMIMessageHandlerTester &)
- {
- return this;
- }
-
-
-
- void HMIMessageHandlerTester::SendMessageToHMI(utils::SharedPtr<application_manager::Message> message)
- {
- printf("\n\n\n\n HMIMessageHandlerTester::SendMessageToHMI \n\n\n\n");
-
-
-
- printf("correlation_id : %d\n",(*message).correlation_id());
- printf("function_id : %d\n",(*message).function_id());
- printf("connection_key : %d\n",(*message).connection_key());
- printf("type : %d\n",(*message).type());
- printf("protocol_version : %d\n",(*message).protocol_version());
- printf("json_message : %s\n\n",(*message).json_message().data());
-
- }
-
-
- void HMIMessageHandlerTester::OnMessageReceived(utils::SharedPtr<application_manager::Message> message)
- {
- printf("\n\n\n\n HMIMessageHandlerTester::OnMessageReceived \n\n\n\n");
- }
-
-
- void HMIMessageHandlerTester::OnErrorSending(utils::SharedPtr<application_manager::Message> message)
- {
- printf("\n\n\n\n HMIMessageHandlerTester::OnErrorSending \n\n\n\n");
- }
-
-
- void HMIMessageHandlerTester::AddHMIMessageAdapter(HMIMessageAdapter* adapter)
- {
- printf("\n\n\n\n HMIMessageHandlerTester::AddHMIMessageAdapter \n\n\n\n");
- }
-
-
- void HMIMessageHandlerTester::RemoveHMIMessageAdapter(HMIMessageAdapter* adapter)
- {
- printf("\n\n\n\n HMIMessageHandlerTester::RemoveHMIMessageAdapter \n\n\n\n");
- }
-
-
-
-
- }// namespace HMI_Message_Handler_Tester
-}//namespace test
-
-
+++ /dev/null
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "rpc/InitHMI.h"
-
-namespace InitializeHMI{
- log4cxx::LoggerPtr loggerInitHmi = log4cxx::LoggerPtr(
- log4cxx::Logger::getLogger("test_InitHMI"));
-
- bool InitHmi(){
-
- pid_t pid_hmi = 0;
- struct stat sb;
- if (stat("../src/appMain/hmi_link", &sb) == -1) {
- LOG4CXX_INFO(loggerInitHmi, "File with HMI link doesn't exist!");
- return false;
- }
-
- std::ifstream file_str;
- file_str.open("../src/appMain/hmi_link");
-
- if (!file_str.is_open()) {
- LOG4CXX_INFO(loggerInitHmi, "File with HMI link was not opened!");
- return false;
- }
-
- file_str.seekg(0, std::ios::end);
- int length = file_str.tellg();
- file_str.seekg(0, std::ios::beg);
-
- char* raw_data = new char[length + 1];
- if (!raw_data) {
- LOG4CXX_INFO(loggerInitHmi, "Memory allocation failed.");
- return false;
- }
-
- memset(raw_data, 0, length + 1);
- file_str.getline(raw_data, length + 1);
- std::string hmi_link = std::string(raw_data, strlen(raw_data));
- delete[] raw_data;
-
-
- LOG4CXX_INFO(loggerInitHmi, "Input string:" << hmi_link << " length = " << hmi_link.size());
- file_str.close();
-
- if (stat(hmi_link.c_str(), &sb) == -1) {
- LOG4CXX_INFO(loggerInitHmi, "HMI index.html doesn't exist!");
- return false;
- }
-
- // Create a child process.
- pid_hmi = fork();
-
- switch (pid_hmi) {
- case -1: { // Error
- LOG4CXX_INFO(loggerInitHmi, "fork() failed!");
- return false;
- }
- case 0: { // Child process
- int fd_dev0 = open("/dev/null", O_RDWR, S_IWRITE);
- if (0 > fd_dev0) {
- LOG4CXX_WARN(loggerInitHmi, "Open dev0 failed!");
- return false;
- }
- // close input/output file descriptors.
- close(STDIN_FILENO);
- close(STDOUT_FILENO);
- close(STDERR_FILENO);
-
- // move input/output to /dev/null.
- dup2(fd_dev0, STDIN_FILENO);
- dup2(fd_dev0, STDOUT_FILENO);
- dup2(fd_dev0, STDERR_FILENO);
-
- // Execute the program.
- execlp(kBrowser, kBrowserName, kBrowserParams, hmi_link.c_str(),
- reinterpret_cast<char*>(0));
- LOG4CXX_WARN(loggerInitHmi, "execl() failed! Install chromium-browser!");
-
- return true;
- }
- default: { /* Parent process */
- LOG4CXX_INFO(loggerInitHmi, "Process created with pid " << pid_hmi);
- return true;
- }
- }
-
-
- //return true;
- }
-
-}//namespace InitializeHMI
-
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "rpc/addTest.h"
+#include "rpc/admin_app_test.h"
+#include "life_cycle.h"
+namespace test {
+
+ AdminAppTest::AdminAppTest()
+ : ThreadDelegate() {
+ }
+
+ AdminAppTest::~AdminAppTest() {
+ }
+
+ void AdminAppTest::threadMain() {
+ Run();
+ }
+
+ void AdminAppTest::Run() {
+ printf("\n\n\n before init in Admin \n\n\n");
+ // Start init dependence appManagerImpl,HMIImpl,transport...
+ InitStartData();
+
+ printf("\n\n\n after init in Admin \n\n\n");
+
+ //////////////////////////////////////////////
+ // Smoke test
+ SmokeTestExpMedia("./components/application_manager/rpc/XmlTests");
+ sleep(5);
+ }
+} // namespace test
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "rpc/GMockClassContainer.h"
+#include "rpc/gmock_class_container.h"
-
-GMockClassContainer::GMockClassContainer()
-{
+GMockClassContainer::GMockClassContainer() {
}
-
-GMockClassContainer::~GMockClassContainer()
-{
+GMockClassContainer::~GMockClassContainer() {
}
-
-GMockClassContainer *GMockClassContainer::instance()
-{
- static GMockClassContainer container;
- return &container;
+GMockClassContainer* GMockClassContainer::instance() {
+ static GMockClassContainer container;
+ return &container;
}
+void GMockClassContainer::AddTest(ITestArgument* in_check) {
+ mas_.push_back(in_check);
-void GMockClassContainer::addTest(ICheckClass *inCheck)
-{
- mas_.push_back(inCheck);
-
- testing::internal::MakeAndRegisterTestInfo(inCheck->GetUnitTestName().data(),
- inCheck->GetTestName().data(),
- 0,
- 0,
- testing::internal::GetTestTypeId(),
- testing::Test::SetUpTestCase,
- testing::Test::TearDownTestCase,
- new testing::internal::TestFactoryImpl<GTestFord>);
+ testing::internal::MakeAndRegisterTestInfo(
+ in_check->GetUnitTestName().data(), in_check->GetTestName().data(), 0, 0,
+ testing::internal::GetTestTypeId(), testing::Test::SetUpTestCase,
+ testing::Test::TearDownTestCase,
+ new testing::internal::TestFactoryImpl<GTestFord>);
}
+ITestArgument* GMockClassContainer::GetTest(int i) {
+ ITestArgument* returnValues = NULL;
-ICheckClass *GMockClassContainer::getTest(int i)
-{
- ICheckClass *returnValues = NULL;
-
- if (i <= mas_.size())
- {
- returnValues = mas_[i];
- }
-
- return returnValues;
+ if (i <= mas_.size()) {
+ returnValues = mas_[i];
+ }
+ return returnValues;
}
-
-
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "rpc/GTestFord.h"
+#include "rpc/gtest_ford.h"
-GTestFord::GTestFord()
-{
+GTestFord::GTestFord() {
}
-
-GTestFord::~GTestFord()
-{
+GTestFord::~GTestFord() {
}
+int GTestFord::index_ = 0;
-int GTestFord::index = 0;
-
+void GTestFord::TestBody() {
+ GMockClassContainer* container = GMockClassContainer::instance();
-void GTestFord::TestBody()
-{
- GMockClassContainer *container = GMockClassContainer::instance();
+ EXPECT_EQ((container->GetTest(index_))->Check(), true);
- EXPECT_EQ( (container->getTest(index))->check(),true);
- index++;
+ index_++;
}
-
--- /dev/null
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "rpc/hmi_message_handler_tester.h"
+
+namespace test {
+ HMIMessageHandlerTester::HMIMessageHandlerTester()
+ : cond_var_(),
+ aLock_(lock_) {
+ hmi_impl_ = hmi_message_handler::HMIMessageHandlerImpl::instance();
+ DCHECK(hmi_impl_ != NULL)
+ }
+
+ HMIMessageHandlerTester::~HMIMessageHandlerTester() {
+ }
+
+ HMIMessageHandlerTester::HMIMessageHandlerTester(
+ const HMIMessageHandlerTester&)
+ : cond_var_(),
+ aLock_(lock_) {
+ }
+
+ HMIMessageHandlerTester* HMIMessageHandlerTester::operator=(
+ const HMIMessageHandlerTester&) {
+ return this;
+ }
+
+ HMIMessageHandlerTester* HMIMessageHandlerTester::instance() {
+ static HMIMessageHandlerTester instance;
+ return &instance;
+ }
+
+ void HMIMessageHandlerTester::SignalNewRequestFromMobile() {
+ while (!mas_request_to_hmi_.empty()) {
+ mas_untestable_request_to_hmi.push_back(mas_request_to_hmi_.front());
+ mas_request_to_hmi_.pop_front();
+ }
+ }
+
+ void HMIMessageHandlerTester::SendMessageToHMI(
+ hmi_message_handler::MessageSharedPointer message) {
+ printf("\n\n\n\n HMIMessageHandlerTester::SendMessageToHMI \n\n\n\n");
+
+ mas_request_to_hmi_.push_back(message);
+
+ printf("correlation_id : %d\n", (*message).correlation_id());
+ printf("function_id : %d\n", (*message).function_id());
+ printf("connection_key : %d\n", (*message).connection_key());
+ printf("type : %d\n", (*message).type());
+ printf("protocol_version : %d\n", (*message).protocol_version());
+ printf("json_message : %s\n\n", (*message).json_message().data());
+
+ hmi_impl_->SendMessageToHMI(message);
+ }
+
+ void HMIMessageHandlerTester::OnMessageReceived(
+ utils::SharedPtr<application_manager::Message> message) {
+ hmi_impl_->OnMessageReceived(message);
+ printf("\n\n\n\n HMIMessageHandlerTester::OnMessageReceived \n\n\n\n");
+ }
+
+ void HMIMessageHandlerTester::OnErrorSending(
+ utils::SharedPtr<application_manager::Message> message) {
+ hmi_impl_->OnErrorSending(message);
+ printf("\n\n\n\n HMIMessageHandlerTester::OnErrorSending \n\n\n\n");
+ }
+
+ void HMIMessageHandlerTester::AddHMIMessageAdapter(
+ hmi_message_handler::HMIMessageAdapter* adapter) {
+ hmi_impl_->AddHMIMessageAdapter(adapter);
+ printf("\n\n\n\n HMIMessageHandlerTester::AddHMIMessageAdapter \n\n\n\n");
+ }
+
+ void HMIMessageHandlerTester::RemoveHMIMessageAdapter(
+ hmi_message_handler::HMIMessageAdapter* adapter) {
+ hmi_impl_->RemoveHMIMessageAdapter(adapter);
+ printf("\n\n\n\n "
+ "HMIMessageHandlerTester::RemoveHMIMessageAdapter \n\n\n\n");
+ }
+
+ bool HMIMessageHandlerTester::operator()(
+ utils::SharedPtr<smart::SmartObject> message) {
+ bool returnValues = true;
+
+ if (mas_request_to_hmi_.empty()) {
+ return false;
+ }
+
+ hmi_message_handler::MessageSharedPointer* mes =
+ &mas_request_to_hmi_.front();
+
+ smart::SmartObject object;
+ NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonSDLRPCv2
+ ::fromString(
+ (*mes)->json_message().data(),
+ object,
+ (*mes)->function_id(),
+ mobile_apis::messageType::request);
+ printf("\nRequest to HMI");
+ application_manager::MessageHelper::PrintSmartObject(object);
+
+ printf("\nRequest from XML");
+ application_manager::MessageHelper::PrintSmartObject(*message);
+ /*
+ if ((*message)["msg_params"]["params"].keyExists("cmdIcon")) {
+ object["msg_params"]["params"]["cmdIcon"]["value"] =
+ (*message)["msg_params"]["params"]["cmdIcon"]["value"].asString();
+ // printf("\n\n blabla %s\n\n\n",object["msg_params"]["params"]
+ ["cmdIcon"]["value"].asString().c_str());
+ }
+ */
+ returnValues = returnValues &&
+ (object["params"]["function_id"] ==
+ (*message)["params"]["function_id"]);
+ returnValues = returnValues &&
+ (object["msg_params"]["method"] ==
+ (*message)["msg_params"]["method"]);
+ returnValues = returnValues &&
+ (object["msg_params"]["params"] ==
+ (*message)["msg_params"]["params"]);
+
+ mas_request_to_hmi_.pop_front();
+ mes = NULL;
+
+ return returnValues;
+ }
+
+ bool HMIMessageHandlerTester::CheckUntestableRequest() {
+ if (mas_untestable_request_to_hmi.empty()) {
+ return true;
+ }
+
+ std::list<hmi_message_handler::MessageSharedPointer>::iterator iter =
+ mas_untestable_request_to_hmi.begin();
+ for (; iter != mas_untestable_request_to_hmi.end(); iter++) {
+ smart::SmartObject object;
+ NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonSDLRPCv2
+ ::fromString(
+ (iter->get())->json_message().data(),
+ object,
+ (iter->get())->function_id(),
+ mobile_apis::messageType::request);
+ application_manager::MessageHelper::PrintSmartObject(object);
+ }
+
+ return false;
+ }
+} // namespace test
+
+
+++ /dev/null
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "rpc/initStartData.h"
-#include "../../../../../src/appMain/life_cycle.h"
-
-void initStartData()
-{
- transport_manager::TransportManager* transport_manager_;
- protocol_handler::ProtocolHandlerImpl* protocol_handler_;
- connection_handler::ConnectionHandlerImpl* connection_handler_;
- application_manager::ApplicationManagerImpl* app_manager_;
-#ifdef WEB_HMI
- hmi_message_handler::MessageBrokerAdapter* mb_adapter_;
-#endif
-#ifdef QT_HMI
- hmi_message_handler::DBusMessageAdapter* dbus_adapter_;
-#endif
-
- //policies::PolicyManagerImpl* policy_manager_;
-
- media_manager::MediaManagerImpl* media_manager_;
-
-
- //mobile_message_handler::MobileMessageHandlerImpl* mmh_;
- hmi_message_handler::HMIMessageHandlerImpl* hmi_handler_;
-
-
- log4cxx::PropertyConfigurator::configure("./../src/appMain/log4cxx.properties");
-
-
-
-
- // --------------------------------------------------------------------------
- // Third-Party components initialization.
- //if (!main_namespace::LifeCycle::instance()->InitMessageBroker()) {
-
- // exit(EXIT_FAILURE);
- //}
-
-
- // --------------------------------------------------------------------------
- // Components initialization
-// transport_manager::TransportManagerAttr tma;
-// tma.disconnectTimeout = 1000;
- transport_manager_ =
- // new transport_manager::TransportManagerImpl(tma);
- transport_manager::TransportManagerDefault::instance();
- DCHECK(transport_manager_);
-
- protocol_handler_ =
- new protocol_handler::ProtocolHandlerImpl(transport_manager_);
- DCHECK(protocol_handler_);
-
- //mmh_ =
- // mobile_message_handler::MobileMessageHandlerImpl::instance();
- //DCHECK(mmh_);
-
- connection_handler_ =
- connection_handler::ConnectionHandlerImpl::instance();
- DCHECK(connection_handler_);
-
- app_manager_ =
- application_manager::ApplicationManagerImpl::instance();
- DCHECK(app_manager_);
-
- hmi_handler_ =
- hmi_message_handler::HMIMessageHandlerImpl::instance();
- DCHECK(hmi_handler_);
-
- //policy_manager_ = policies::PolicyManagerImpl::instance();
- //DCHECK(policy_manager_);
-
- media_manager_ = media_manager::MediaManagerImpl::instance();
-
- ////////////////////////////////////////
- /*
- //Add 25 december
- printf("\n\n\n add device \n\n\n");
- transport_manager::DeviceHandle device_handler_test = 1;
- std::string mac_address_test = "255.255.255.0";
- std::string name_test = "test_DeviceInfo";
-
- transport_manager::ConnectionUID connection_id_test = 1;
-
- transport_manager::DeviceInfo device_info_test(device_handler_test, mac_address_test, name_test);
-
- std::vector<transport_manager::DeviceInfo> device_list_test;
- device_list_test.push_back(device_info_test);
- connection_handler_->OnDeviceListUpdated(device_list_test);
-
-
- connection_handler_->OnConnectionEstablished(device_info_test, connection_id_test);
- */
- ////////////////////////////////////
-
-
-
- //transport_manager_->SetProtocolHandler(protocol_handler_);
- transport_manager_->AddEventListener(protocol_handler_);
- transport_manager_->AddEventListener(connection_handler_);
- //printf("\n\n\n after init transport_manager \n\n\n");
-
-
- hmi_handler_->set_message_observer(app_manager_);
- //printf("\n\n\n after init hmi \n\n\n");
-
- media_manager_->SetProtocolHandler(protocol_handler_);
- //printf("\n\n\n after init media_manager \n\n\n");
- protocol_handler_->set_session_observer(connection_handler_);
- //protocol_handler_->AddProtocolObserver(mmh_);
- protocol_handler_->AddProtocolObserver(media_manager_);
- protocol_handler_->AddProtocolObserver(app_manager_);
- //printf("\n\n\n after init protocol_handler \n\n\n");
- connection_handler_->set_transport_manager(transport_manager_);
- connection_handler_->set_connection_handler_observer(app_manager_);
- //printf("\n\n\n after init connection_handler \n\n\n");
- //mmh_->set_protocol_handler(protocol_handler_);
- //mmh_->AddMobileMessageListener(app_manager_);
- //printf("\n\n\n after init mmh \n\n\n");
- // It's important to initialise TM after setting up listener chain
- // [TM -> CH -> AM], otherwise some events from TM could arrive at nowhere
- transport_manager_->Init();
-
- //app_manager_->set_mobile_message_handler(mmh_);
- app_manager_->set_connection_handler(connection_handler_);
- app_manager_->set_hmi_message_handler(hmi_handler_);
- app_manager_->set_protocol_handler(protocol_handler_);
-
- //app_manager_->set_policy_manager(policy_manager_);
-
- //printf("\n\n\n after init app \n\n\n");
-
- if (profile::Profile::instance()->server_address() ==
- std::string(InitializeHMI::kLocalHostAddress)) {
-
- if (!InitializeHMI::InitHmi()) {
- exit(EXIT_FAILURE);
- }
-
- }
-
- printf("\n\n\n after first init \n\n\n");
-
-
- //transport_manager::transport_adapter::TransportAdapterController* TAC =
- // new transport_manager::transport_adapter::TransportAdapterController;
-
- //transport_manager::transport_adapter::TcpTransportAdapter* ta =
- // new transport_manager::transport_adapter::TcpTransportAdapter();
-
- /*
- transport_manager::transport_adapter::DnssdServiceBrowser* DSB =
- new transport_manager::transport_adapter::DnssdServiceBrowser(ta);
-
- transport_manager::transport_adapter::ServerConnectionFactory* SCF =
- new transport_manager::transport_adapter::TcpConnectionFactory(ta);
-
- transport_manager::transport_adapter::ClientConnectionListener* CCL =
- new transport_manager::transport_adapter::TcpClientListener(ta,80);
- */
-
- //ta = new transport_manager::transport_adapter::TransportAdapter(DSB,SCF,CCL);
-
- //utils::SharedPtr<TransportAdapter> taSprt(ta);
-
- //transport_manager_->AddTransportAdapter(taSprt);
- /*
-
- //transport_manager::transport_adapter::
-
- utils::SharedPtr<protocol_handler::RawMessage> rawMessageSptr;//typedef utils::SharedPtr<protocol_handler::RawMessage> RawMessageSptr;
- int type = 0;//TransportAdapterListenerImpl::EventTypeEnum::ON_SEARCH_DONE;
-
- transport_manager::DeviceUID DUID;//typedef std::string DeviceUID;
- int app_handle = 0;//typedef int ApplicationHandle;
-
- transport_manager::BaseError *br = new transport_manager::BaseError;
- transport_manager::TransportAdapterEvent *tae =
- new transport_manager::TransportAdapterEvent(type, taSprt, DUID, app_handle, rawMessageSptr, br);
-
- transport_manager_->ReceiveEventFromDevice(*tae);
- */
-
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
--- /dev/null
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "rpc/init_hmi.h"
+
+namespace InitializeHMI {
+ #ifdef __QNX__
+ bool Execute(std::string command, const char * const *) {
+ log4cxx::LoggerPtr logger = log4cxx::LoggerPtr(
+ log4cxx::Logger::getLogger("appMain"));
+ if (system(command.c_str()) == -1) {
+ LOG4CXX_INFO(logger, "Can't start HMI!");
+ return false;
+ }
+ return true;
+ }
+ #else
+ bool Execute(std::string file, const char * const * argv) {
+ log4cxx::LoggerPtr logger = log4cxx::LoggerPtr(
+ log4cxx::Logger::getLogger("appMain"));
+ // Create a child process.
+ pid_t pid_hmi = fork();
+
+ switch (pid_hmi) {
+ case -1: { // Error
+ LOG4CXX_INFO(logger, "fork() failed!");
+ return false;
+ }
+ case 0: { // Child process
+ int32_t fd_dev0 = open("/dev/null", O_RDWR, S_IWRITE);
+ if (0 > fd_dev0) {
+ LOG4CXX_WARN(logger, "Open dev0 failed!");
+ return false;
+ }
+ // close input/output file descriptors.
+ close(STDIN_FILENO);
+ close(STDOUT_FILENO);
+ close(STDERR_FILENO);
+
+ // move input/output to /dev/null.
+ dup2(fd_dev0, STDIN_FILENO);
+ dup2(fd_dev0, STDOUT_FILENO);
+ dup2(fd_dev0, STDERR_FILENO);
+
+ // Execute the program.
+ if (execvp(file.c_str(), const_cast<char* const *>(argv)) == -1) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger, "execvp() failed! Can't start HMI!");
+ _exit(EXIT_FAILURE);
+ }
+
+ return true;
+ }
+ default: { /* Parent process */
+ LOG4CXX_INFO(logger, "Process created with pid " << pid_hmi);
+ return true;
+ }
+ }
+ }
+ #endif
+ #ifdef WEB_HMI
+ /**
+ * Initialize HTML based HMI.
+ * @return true if success otherwise false.
+ */
+ bool InitHmi() {
+ log4cxx::LoggerPtr logger = log4cxx::LoggerPtr(
+ log4cxx::Logger::getLogger("appMain"));
+ struct stat sb;
+ if (stat("../src/appMain/hmi_link", &sb) == -1) {
+ LOG4CXX_INFO(logger, "File with HMI link doesn't exist!");
+ return false;
+ }
+
+ std::ifstream file_str;
+ file_str.open("../src/appMain/hmi_link");
+
+ if (!file_str.is_open()) {
+ LOG4CXX_INFO(logger, "File with HMI link was not opened!");
+ return false;
+ }
+
+ file_str.seekg(0, std::ios::end);
+ int32_t length = file_str.tellg();
+ file_str.seekg(0, std::ios::beg);
+
+ std::string hmi_link;
+ std::getline(file_str, hmi_link);
+
+ LOG4CXX_INFO(logger,
+ "Input string:" << hmi_link << " length = "
+ << hmi_link.size());
+ file_str.close();
+
+ if (stat(hmi_link.c_str(), &sb) == -1) {
+ LOG4CXX_INFO(logger, "HMI index.html doesn't exist!");
+ return false;
+ }
+
+ std::string kBin = kBrowser;
+ const char* const kParams[4] = {kBrowserName, kBrowserParams,
+ hmi_link.c_str(), NULL};
+
+ return Execute(kBin, kParams);
+ }
+ #endif // WEB_HMI
+ #ifdef QT_HMI
+ /**
+ * Initialize HTML based HMI.
+ * @return true if success otherwise false.
+ */
+ bool InitHmi() {
+ log4cxx::LoggerPtr logger = log4cxx::LoggerPtr(
+ log4cxx::Logger::getLogger("appMain"));
+ std::string kStartHmi = "./start_hmi.sh";
+ struct stat sb;
+ if (stat(kStartHmi.c_str(), &sb) == -1) {
+ LOG4CXX_INFO(logger, "HMI start script doesn't exist!");
+ return false;
+ }
+
+ return Execute(kStartHmi, NULL);
+ }
+ #endif // QT_HMI
+
+ log4cxx::LoggerPtr loggerInitHmi = log4cxx::LoggerPtr(
+ log4cxx::Logger::getLogger("test_InitHMI"));
+
+ InitHMI::InitHMI()
+ : ThreadDelegate() {
+ }
+
+ InitHMI::~InitHMI() {
+ }
+
+ void InitHMI::operator=(const InitHMI&) {
+ }
+
+ InitHMI::InitHMI(const InitHMI&)
+ : ThreadDelegate() {
+ }
+
+ void InitHMI::threadMain() {
+ if (!InitHmi()) {
+ // main_namespace::LifeCycle::instance()->StopComponents();
+ // without this line log4cxx threads continue using some instances
+ // destroyed by exit()
+ // log4cxx::Logger::getRootLogger()->closeNestedAppenders();
+ exit(EXIT_FAILURE);
+ }
+ }
+} // namespace InitializeHMI
+
--- /dev/null
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "rpc/init_start_data.h"
+#include "life_cycle.h"
+
+void InitStartData() {
+ printf("\n\n\n in initStartData\n\n\n");
+
+ log4cxx::LoggerPtr logger_ = log4cxx::LoggerPtr(
+ log4cxx::Logger::getLogger("initStartData"));
+
+ LOG4CXX_INFO(logger_, " Application started!");
+
+ // --------------------------------------------------------------------------
+ // Components initialization
+
+ if (!main_namespace::LifeCycle::instance()->StartComponents()) {
+ LOG4CXX_INFO(logger_, "Start Components fail");
+ exit(EXIT_FAILURE);
+ }
+
+ // Third-Party components initialization.
+
+ if (!main_namespace::LifeCycle::instance()->InitMessageSystem()) {
+ main_namespace::LifeCycle::instance()->StopComponents();
+ // without this line log4cxx threads continue using some
+ // instances destroyed by exit()
+ log4cxx::Logger::getRootLogger()->closeNestedAppenders();
+ exit(EXIT_FAILURE);
+ }
+ LOG4CXX_INFO(logger_, "InitMessageBroker successful");
+
+ if (profile::Profile::instance()->launch_hmi()) {
+ if (profile::Profile::instance()->server_address() ==
+ std::string(InitializeHMI::kLocalHostAddress)) {
+ LOG4CXX_INFO(logger_, "Start HMI on localhost");
+
+ sleep(1);
+ /*
+ threads::ThreadOptions threadOption(16384);
+ InitializeHMI::InitHMI* initHMI = new InitializeHMI::InitHMI;
+ threads::Thread threadInitializeHMI("InitializeHMI", initHMI);
+ //initHMI->threadMain();
+ //threadInitializeHMI.startWithOptions(threadOption);
+ threadInitializeHMI.start();
+ threadInitializeHMI.join();
+ */
+
+ if (!InitializeHMI::InitHmi()) {
+ main_namespace::LifeCycle::instance()->StopComponents();
+ // without this line log4cxx threads continue using some
+ // instances destroyed by exit()
+ log4cxx::Logger::getRootLogger()->closeNestedAppenders();
+ exit(EXIT_FAILURE);
+ }
+ LOG4CXX_INFO(logger_, "InitHmi successful");
+ }
+ }
+ utils::SubscribeToTerminateSignal(
+ &main_namespace::LifeCycle::StopComponentsOnSignal);
+}
+
+
+void RegApp() {
+ connection_handler::ConnectionHandlerImpl* connection_handler_ =
+ connection_handler::ConnectionHandlerImpl::instance();
+
+ application_manager::ApplicationManagerImpl* app_manager_ =
+ application_manager::ApplicationManagerImpl::instance();
+
+ utils::SharedPtr<am::Application> appl(app_manager_->application(65537));
+
+ if (appl.valid()) {
+ return;
+ }
+
+ printf("\n\n\n Registration Application \n\n\n");
+
+ transport_manager::DeviceHandle device_handler_test = 1;
+ std::string mac_address_test = "255.255.255.0";
+ std::string name_test = "test_DeviceInfo";
+
+ transport_manager::ConnectionUID connection_id_test = 1;
+
+ transport_manager::DeviceInfo device_info_test(
+ device_handler_test,
+ mac_address_test,
+ name_test);
+
+ // std::vector<transport_manager::DeviceInfo> device_list_test;
+ // device_list_test.push_back(device_info_test);
+ // connection_handler_->OnDeviceListUpdated(device_list_test);
+ connection_handler_->OnDeviceAdded(device_info_test);
+
+ connection_handler_->OnConnectionEstablished(
+ device_info_test,
+ connection_id_test);
+ sleep(5);
+
+ utils::SharedPtr<smart::SmartObject> AppRegRequest(new smart::SmartObject);
+
+ // -------------------------------------------------------------------------
+ (*AppRegRequest)[jsn::S_PARAMS][am::strings::function_id] =
+ mobile_apis::FunctionID::RegisterAppInterfaceID;
+ (*AppRegRequest)[jsn::S_PARAMS][am::strings::message_type] =
+ mobile_apis::messageType::request;
+
+ (*AppRegRequest)[jsn::S_PARAMS][am::strings::connection_key] = 65537;
+
+ (*AppRegRequest)[jsn::S_MSG_PARAMS][am::strings::app_name] =
+ "SyncProxyTester";
+ (*AppRegRequest)[jsn::S_MSG_PARAMS][am::strings::available] = true;
+ (*AppRegRequest)[jsn::S_MSG_PARAMS][am::strings::language_desired] =
+ hmi_apis::Common_Language::EN_US;
+ (*AppRegRequest)[jsn::S_MSG_PARAMS][am::strings::hmi_display_language_desired]
+ = hmi_apis::Common_Language::EN_US;
+
+ (*AppRegRequest)[jsn::S_MSG_PARAMS][am::strings::app_id] = "65537";
+ (*AppRegRequest)[jsn::S_MSG_PARAMS]
+ [am::strings::sync_msg_version]["majorVersion"] = 2;
+ (*AppRegRequest)[jsn::S_MSG_PARAMS]
+ [am::strings::sync_msg_version]["minorVersion"] = 2;
+ (*AppRegRequest)[jsn::S_MSG_PARAMS]
+ [am::strings::is_media_application] = true;
+ (*AppRegRequest)[jsn::S_MSG_PARAMS]
+ [am::strings::app_hmi_type][0] = "NAVIGATION";
+ (*AppRegRequest)[jsn::S_MSG_PARAMS]
+ [am::strings::ngn_media_screen_app_name] = "SyncP";
+ (*AppRegRequest)[jsn::S_MSG_PARAMS]
+ [am::strings::vr_synonyms][0] = "VR SyncProxyTester";
+
+ app_manager_->ManageMobileCommand(AppRegRequest);
+
+ // -------------------------------------------------------------------------
+ // Activate App
+ sleep(2);
+ utils::SharedPtr<smart::SmartObject> ActivateApp(new smart::SmartObject);
+ (*ActivateApp)[jsn::S_PARAMS][am::strings::function_id] =
+ hmi_apis::FunctionID::BasicCommunication_OnAppActivated;
+ (*ActivateApp)[jsn::S_PARAMS][am::strings::connection_key] = 65537;
+ (*ActivateApp)[jsn::S_PARAMS][am::strings::message_type] =
+ mobile_apis::messageType::request;
+ (*ActivateApp)[jsn::S_MSG_PARAMS][am::strings::app_id] = "65537";
+
+ app_manager_->ManageHMICommand(ActivateApp);
+}
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include <rpc/itest_argument.h>
-#include <rpc/ICheckClass.h>
-
-
-ICheckClass::ICheckClass(const std::string& inUnitTestName,const std::string& inTestName):
- unitTestName_(inUnitTestName)
- ,testName_(inTestName)
-{
+ITestArgument::ITestArgument(
+ const std::string& in_unit_test_name,
+ const std::string& in_test_name)
+ : unit_test_name_(in_unit_test_name),
+ test_name_(in_test_name) {
}
-
-
-ICheckClass::~ICheckClass()
-{
+ITestArgument::~ITestArgument() {
}
-
-
--- /dev/null
+/**
+ * \file protocol_handler.h
+ * \brief ProtocolHandlerImpl class header file.
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "rpc/protocol_handler_mockup.h"
+
+namespace test {
+ ProtocolHandlerMockup::ProtocolHandlerMockup(
+ transport_manager::TransportManager* transport_manager_param)
+ : ProtocolHandlerImpl(transport_manager_param),
+ cond_var_(),
+ a_lock_(lock_),
+ response_from_hmi_() {
+ }
+
+ ProtocolHandlerMockup::~ProtocolHandlerMockup() {
+ }
+
+ ProtocolHandlerMockup* ProtocolHandlerMockup::instance() {
+ transport_manager::TransportManager* transport_manager_;
+ transport_manager_ = transport_manager::TransportManagerDefault::instance();
+
+ if (!transport_manager_) {
+ return NULL;
+ }
+
+ static ProtocolHandlerMockup instance(transport_manager_);
+ return &instance;
+ }
+
+ ProtocolHandlerMockup* ProtocolHandlerMockup::operator=(
+ const ProtocolHandlerMockup &) {
+ return this;
+ }
+
+ ProtocolHandlerMockup::ProtocolHandlerMockup(const ProtocolHandlerMockup &)
+ : ProtocolHandlerImpl(NULL),
+ cond_var_(),
+ a_lock_(lock_) {
+ }
+
+ void ProtocolHandlerMockup::SendMessageToMobileApp(
+ const protocol_handler::RawMessagePtr& message, bool final_message) {
+ printf("\n\n\n SendMessageToMobileApp \n\n\n");
+
+ utils::SharedPtr<application_manager::Message> shared_prt_mes;
+ shared_prt_mes =
+ application_manager::MobileMessageHandler::
+ HandleIncomingMessageProtocolV2(message);
+
+ printf("correlation_id : %d\n", (*shared_prt_mes).correlation_id());
+ printf("function_id : %d\n", (*shared_prt_mes).function_id());
+ printf("connection_key : %d\n", (*shared_prt_mes).connection_key());
+ printf("type : %d\n", (*shared_prt_mes).type());
+ printf("protocol_version : %d\n", (*shared_prt_mes).protocol_version());
+ printf("json_message : %s\n\n", (*shared_prt_mes).json_message().data());
+
+ if ((*shared_prt_mes).json_message().find("resultCode") !=
+ std::string::npos) {
+ response_from_hmi_ = shared_prt_mes;
+ cond_var_.NotifyOne();
+ }
+ }
+
+ bool ProtocolHandlerMockup::operator()(
+ utils::SharedPtr<smart::SmartObject> in_request,
+ utils::SharedPtr<smart::SmartObject> in_response) {
+ bool return_values = true;
+ sleep(3);
+
+ HMIMessageHandlerTester* hmi_handler_test =
+ HMIMessageHandlerTester::instance();
+
+ hmi_handler_test->SignalNewRequestFromMobile();
+
+ request_ = in_request;
+ response_ = in_response;
+ printf("SO from mobile");
+ application_manager::MessageHelper::PrintSmartObject(*in_request);
+
+ application_manager::ApplicationManagerImpl* app_manager_ =
+ application_manager::ApplicationManagerImpl::instance();
+
+ // app_manager_->set_protocol_handler(this);
+ // app_manager_->ManageMobileCommand(request_);//dont work in all test
+
+ application_manager::Message* mes = new application_manager::Message(
+ protocol_handler::MessagePriority::kDefault);
+
+ utils::SharedPtr<application_manager::Message> message_to_app(mes);
+ std::string str;
+
+ (*message_to_app).set_correlation_id(
+ (*request_)[jsn::S_PARAMS][am::strings::correlation_id].asInt());
+ (*message_to_app).set_function_id(
+ (*request_)[jsn::S_PARAMS][am::strings::function_id].asInt());
+ (*message_to_app).set_connection_key(
+ (*request_)[jsn::S_PARAMS][am::strings::connection_key].asInt());
+ (*message_to_app).set_message_type(application_manager::kRequest);
+
+ NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonSDLRPCv2::
+ toString((*request_), str);
+
+ (*message_to_app).set_json_message(str);
+
+ utils::SharedPtr<protocol_handler::RawMessage> raw_mes(
+ am::MobileMessageHandler::HandleOutgoingMessageProtocolV2(
+ message_to_app));
+
+ // app_manager_->OnMessageReceived(raw_mes);
+ // app_manager_->ManageMobileCommand(request_);
+
+ if ((*request_)[jsn::S_PARAMS].keyExists("binary_data")) {
+ app_manager_->ManageMobileCommand(request_);
+ } else {
+ app_manager_->OnMessageReceived(raw_mes);
+ }
+
+ cond_var_.WaitFor(a_lock_, 10000);
+
+ std::string str_result_code;
+ Json::Value value;
+ Json::Reader reader;
+
+ reader.parse((*response_from_hmi_).json_message(), value);
+ Json::Value result_code = value.get("resultCode", "");
+ str_result_code = result_code.asString();
+
+ printf("\n\n\nXMLResponce correlation_id :%d",
+ (*response_)[jsn::S_PARAMS][am::strings::correlation_id].asInt());
+ printf(" XMLResponce result_code :%s\n",
+ ((*response_)[jsn::S_MSG_PARAMS][am::strings::result_code].
+ asString()).c_str());
+
+ printf("HMIResponce correlation_id : %d HMIResponce result_code : %s\n\n\n",
+ (*response_from_hmi_).correlation_id(), str_result_code.c_str());
+
+ if ((*response_from_hmi_).correlation_id() !=
+ (*response_)[jsn::S_PARAMS][am::strings::correlation_id].asInt()) {
+ return_values = false;
+ }
+ if (str_result_code !=
+ (*response_)[jsn::S_MSG_PARAMS][am::strings::result_code].asString()) {
+ return_values = false;
+ }
+ sleep(1);
+
+ return return_values;
+ }
+} // namespace test
+
+
--- /dev/null
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "rpc/smoke_test_exp_media.h"
+
+namespace test {
+ void SmokeTestExpMedia(const char* patch) {
+ am::ApplicationManagerImpl* app_manager_ =
+ am::ApplicationManagerImpl::instance();
+
+ ProtocolHandlerMockup* protocol_handler_test_ =
+ ProtocolHandlerMockup::instance();
+
+ HMIMessageHandlerTester* hmi_handler_test =
+ HMIMessageHandlerTester::instance();
+
+ utils::SharedPtr<am::Application> appl(app_manager_->application(65537));
+
+ if (!(appl.valid())) {
+ RegApp();
+ sleep(3);
+ appl = app_manager_->application(65537);
+
+ if (!appl.valid()) {
+ return;
+ }
+ }
+
+ app_manager_->set_hmi_message_handler(hmi_handler_test);
+ app_manager_->set_protocol_handler(protocol_handler_test_);
+
+ XmlParser* xmlp = XmlParser::instance();
+
+ xmlp->SetXmlDir(patch);
+
+ if (!xmlp->OpenDir()) {
+ printf("\n\n Opening XML dir failed\n\n");
+ return;
+ }
+ printf("\n\n Openeding XML dir\n\n");
+
+ while (xmlp->NextXml()) {
+ if (xmlp->ReadXml()) {
+ printf("\n\n Opening XML \n\n");
+ while (xmlp->MoveToNextTestNode()) {
+ utils::SharedPtr<smart::SmartObject> soForParser(
+ new smart::SmartObject);
+ utils::SharedPtr<smart::SmartObject> soRequest(
+ new smart::SmartObject);
+ utils::SharedPtr<smart::SmartObject> soResponse(
+ new smart::SmartObject);
+
+ if (xmlp->GetRequestFromTest(&(*soForParser))) {
+ *soRequest = (*soForParser)["request"];
+ *soResponse = (*soForParser)["response"];
+
+
+
+ (*soRequest)[jsn::S_PARAMS][am::strings::connection_key] = 65537;
+ (*soRequest)[jsn::S_PARAMS][am::strings::message_type] =
+ mobile_apis::messageType::request;
+
+ addTest<ProtocolHandlerMockup*,
+ utils::SharedPtr<smart::SmartObject>,
+ utils::SharedPtr<smart::SmartObject>,
+ bool>
+ ("smoke_test_exp_media",
+ (*soForParser)["testName"].asString(),
+ protocol_handler_test_,
+ soRequest,
+ soResponse,
+ true);
+
+ if ((*soForParser).keyExists("HMIRequestFirst")) {
+ utils::SharedPtr<smart::SmartObject> soHMIRequestFirst(
+ new smart::SmartObject);
+
+ *soHMIRequestFirst = (*soForParser)["HMIRequestFirst"];
+
+ addTest<HMIMessageHandlerTester*,
+ utils::SharedPtr<smart::SmartObject>,
+ bool>
+ ("smoke_test_exp_media",
+ (*soForParser)["testName"].asString() + "HMIFirst",
+ hmi_handler_test,
+ soHMIRequestFirst,
+ true);
+ }
+
+ if ((*soForParser).keyExists("HMIRequestSecond")) {
+ utils::SharedPtr<smart::SmartObject> soHMIRequestSecond(
+ new smart::SmartObject);
+
+ *soHMIRequestSecond = (*soForParser)["HMIRequestSecond"];
+
+ addTest<HMIMessageHandlerTester*,
+ utils::SharedPtr<smart::SmartObject>,
+ bool>
+ ("smoke_test_exp_media",
+ (*soForParser)["testName"].asString() + "HMISecond",
+ hmi_handler_test, soHMIRequestSecond, true);
+ }
+
+ if ((*soForParser).keyExists("HMIRequestThird")) {
+ utils::SharedPtr<smart::SmartObject> soHMIRequestSecond(
+ new smart::SmartObject);
+
+ *soHMIRequestSecond = (*soForParser)["HMIRequestThird"];
+
+ addTest<HMIMessageHandlerTester*,
+ utils::SharedPtr<smart::SmartObject>,
+ bool>
+ ("smoke_test_exp_media",
+ (*soForParser)["testName"].asString() + "HMIThird",
+ hmi_handler_test, soHMIRequestSecond, true);
+ }
+
+ if ((*soForParser).keyExists("HMIRequestFourth")) {
+ utils::SharedPtr<smart::SmartObject> soHMIRequestSecond(
+ new smart::SmartObject);
+
+ *soHMIRequestSecond = (*soForParser)["HMIRequestFourth"];
+
+ addTest<HMIMessageHandlerTester*,
+ utils::SharedPtr<smart::SmartObject>,
+ bool>
+ ("smoke_test_exp_media",
+ (*soForParser)["testName"].asString() + "HMIFourth",
+ hmi_handler_test,
+ soHMIRequestSecond,
+ true);
+ }
+ sleep(1);
+ }
+ }
+ } else {
+ printf("\n\n Opening XML failed\n\n");
+ }
+ }
+
+ xmlp->CloseXml();
+ xmlp->CloseDir();
+
+ addTest("smoke_test_exp_media",
+ "check_not_tested_hmi_request",
+ &CheckNotTestedHMIRequest,
+ true);
+ } // smoke_test_exp_media
+
+ bool CheckNotTestedHMIRequest() {
+ HMIMessageHandlerTester* hmi_handler_test =
+ HMIMessageHandlerTester::instance();
+
+ return hmi_handler_test->CheckUntestableRequest();
+ }
+} // namespace test
+
+++ /dev/null
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <unistd.h>
-#include "rpc/testHMI.h"
-#include "application_manager/application_impl.h"
-
-namespace test{
- namespace app_manager_test{
- void testHMI()
- {
-
- printf("\n\n\n init param to HMI AddCommand \n\n\n");
-
-
- connection_handler::ConnectionHandlerImpl* connection_handler_ =
- connection_handler::ConnectionHandlerImpl::instance();
-
-
- application_manager::ApplicationManagerImpl* app_manager_ =
- application_manager::ApplicationManagerImpl::instance();
-
- transport_manager::DeviceHandle device_handler_test = 1;
- std::string mac_address_test = "255.255.255.0";
- std::string name_test = "test_DeviceInfo";
-
- transport_manager::ConnectionUID connection_id_test = 1;
-
- transport_manager::DeviceInfo device_info_test(device_handler_test, mac_address_test, name_test);
-
- std::vector<transport_manager::DeviceInfo> device_list_test;
- device_list_test.push_back(device_info_test);
- connection_handler_->OnDeviceListUpdated(device_list_test);
-
-
- connection_handler_->OnConnectionEstablished(device_info_test, connection_id_test);
-
-
- //////////////////////////////////////////
- //HMICapabilities 14.1
- //HMICapabilities& hmi_capabilities =
- // ApplicationManagerImpl::instance()->hmi_capabilities();
-
- //hmi_capabilities.
- //app_manager_->OnHMIStartedCooperation();
- HMICapabilities &hmi_capabilities = app_manager_->hmi_capabilities();
- hmi_capabilities.set_is_vr_cooperating(true);
- hmi_capabilities.set_is_tts_cooperating(true);
- hmi_capabilities.set_is_ui_cooperating(true);
- hmi_capabilities.set_is_navi_cooperating(true);
- hmi_capabilities.set_is_ivi_cooperating(true);
-
- hmi_capabilities.set_active_ui_language(hmi_apis::Common_Language::EN_US);
- hmi_capabilities.set_active_vr_language(hmi_apis::Common_Language::EN_US);
- hmi_capabilities.set_active_tts_language(hmi_apis::Common_Language::EN_US);
-
- SmartObject hmi_capa;
- hmi_capabilities.set_ui_supported_languages(hmi_capa);
- hmi_capabilities.set_tts_supported_languages(hmi_capa);
- hmi_capabilities.set_vr_supported_languages(hmi_capa);
- hmi_capabilities.set_vehicle_type(hmi_capa);
-
-
- ////////////////////////////////////////
- sleep(2);
- printf("\n\n\n Registration Application \n\n\n");
- ///////////////////////////////////////////////////
- /*
- Reg app
-
- utils::SharedPtr<SmartObject> AppRegRequest(new SmartObject);
-
- (*AppRegRequest)[S_PARAMS][strings::connection_key] = 65537;
- //(*AppRegRequest)[S_MSG_PARAMS][strings::menu_params][strings::menu_name] = "MenuName";
- (*AppRegRequest)[S_MSG_PARAMS][strings::app_name] = "SyncProxyTester";
-
-
-
- (*AppRegRequest)[S_PARAMS][strings::function_id] = mobile_apis::FunctionID::RegisterAppInterfaceID;
- (*AppRegRequest)[S_PARAMS][strings::message_type] = mobile_apis::messageType::request;
- (*AppRegRequest)[S_PARAMS][strings::correlation_id] = 1;
-
- (*AppRegRequest)[S_MSG_PARAMS][strings::available] = true;
- Application* appl = app_manager_->RegisterApplication(AppRegRequest);
- */
- ///////////////////////////////////
- //add to 23 december
-
- utils::SharedPtr<SmartObject> AppRegRequest(new SmartObject);
- //test::Mobile_Message_Handler_Tester::MobileMessageHandlerTester* mobile_handler_test;
- //mobile_handler_test =
- // new test::Mobile_Message_Handler_Tester::MobileMessageHandlerTester;
-
- //app_manager_->set_mobile_message_handler(mobile_handler_test);
- ////////////////////////////////////
- //add 25 december
- //app_manager_->set_active_vr_language(hmi_apis::Common_Language::EN_US);
- //app_manager_->set_active_ui_language(hmi_apis::Common_Language::EN_US);
- /////////////////////////////////////
- (*AppRegRequest)[S_PARAMS][strings::function_id] = mobile_apis::FunctionID::RegisterAppInterfaceID;
- (*AppRegRequest)[S_PARAMS][strings::message_type] = mobile_apis::messageType::request;
- (*AppRegRequest)[S_PARAMS][strings::correlation_id] = 1;
- (*AppRegRequest)[S_PARAMS][strings::connection_key] = 65537;
-
-
- (*AppRegRequest)[S_MSG_PARAMS][strings::app_name] = "SyncProxyTester";
- (*AppRegRequest)[S_MSG_PARAMS][strings::available] = true;
- (*AppRegRequest)[S_MSG_PARAMS][strings::language_desired] = hmi_apis::Common_Language::EN_US;
- (*AppRegRequest)[S_MSG_PARAMS][strings::hmi_display_language_desired] = hmi_apis::Common_Language::EN_US;
-
-
-
- //(*AppRegRequest)[S_MSG_PARAMS][strings::app_id] = "12345";
- //(*AppRegRequest)[S_MSG_PARAMS][strings::is_media_application] = true;
- //(*AppRegRequest)[S_MSG_PARAMS][strings::vr_synonyms][0] = "VR SyncProxyTester";
- //(*AppRegRequest)[S_MSG_PARAMS][strings::ngn_media_screen_app_name] = "SPT";
- //(*AppRegRequest)[S_MSG_PARAMS][strings::tts_name][0]["text"] = "SyncProxyTester";
- //(*AppRegRequest)[S_MSG_PARAMS][strings::tts_name][0]["type"] = "TEXT";
- //(*AppRegRequest)[S_MSG_PARAMS][strings::app_hmi_type] = mobile_apis::AppHMIType::NAVIGATION;
- //(*AppRegRequest)[S_MSG_PARAMS][strings::cmd_id] = 321;
- //(*AppRegRequest)[S_MSG_PARAMS][strings::menu_params][strings::menu_name] = "MenuName";
- //(*AppRegRequest)[S_MSG_PARAMS][strings::language_desired] = hmi_apis::Common_Language::EN_US;
- //(*AppRegRequest)[S_MSG_PARAMS][strings::hmi_display_language_desired] = hmi_apis::Common_Language::EN_US;
-
-
- //MessageChaining* MesChain = app_manager_->AddMessageChain(connectKey, 1, 16, NULL, &(*AppRegRequest) );
- //printf("\n\n\n after MesChain \n\n\n");
- //app_manager_->AddMessageChain(connectKey,1,16,MesChain, &(*AppRegRequest) );
- //printf("\n\n\n after MesChain after\n\n\n");
-
- //app_manager_->set_hmi_level(mobile_apis::HMILevel::HMI_BACKGROUND);
- app_manager_->ManageMobileCommand(AppRegRequest);
- ///////////////////////////////////
-
-
- ApplicationSharedPtr appl = app_manager_->application(65537);
-
- ////////////////////////////////////////
- sleep(5);
-
-
-
- printf("\n\n\n AddCommand Request \n\n\n");
-
- test::HMI_Message_Handler_Tester::HMIMessageHandlerTester* hmi_handler_test;
-
- hmi_handler_test = new test::HMI_Message_Handler_Tester::HMIMessageHandlerTester;
-
- utils::SharedPtr<SmartObject> HMIRequest(new SmartObject);
-
-
-
- //NsSmartDeviceLink::NsJSONHandler::strings::
- //mobile_apis::FunctionID::RegisterAppInterfaceID;
-
-
- (*HMIRequest)[S_PARAMS][strings::function_id] = mobile_apis::FunctionID::AddCommandID;
- (*HMIRequest)[S_PARAMS][strings::correlation_id] = 1;
- (*HMIRequest)[S_PARAMS][strings::message_type] = mobile_apis::messageType::request;
- (*HMIRequest)[S_PARAMS][strings::protocol_type] = 0;
- (*HMIRequest)[S_PARAMS][strings::protocol_version] = 2;
- (*HMIRequest)[S_PARAMS][strings::connection_key] = appl->app_id();
-
- (*HMIRequest)[S_MSG_PARAMS][strings::app_id] = "12345";
- (*HMIRequest)[S_MSG_PARAMS][strings::app_name] = "SyncProxyTester";
-
- (*HMIRequest)[S_MSG_PARAMS][strings::cmd_id] = 321;
- (*HMIRequest)[S_MSG_PARAMS][strings::success] = true;
- (*HMIRequest)[S_MSG_PARAMS][strings::hmi_level] = 5;
-
- (*HMIRequest)[S_MSG_PARAMS][strings::language_desired] = hmi_apis::Common_Language::EN_US;
- (*HMIRequest)[S_MSG_PARAMS][strings::hmi_display_language_desired] = hmi_apis::Common_Language::EN_US;
-
- (*HMIRequest)[S_MSG_PARAMS][strings::is_media_application] = true;
- (*HMIRequest)[S_MSG_PARAMS][strings::device_name] = device_handler_test;
-
- //(*HMIRequest)[S_MSG_PARAMS][strings::menu_params][strings::vr_commands] = mobile_apis::Result::RETRY;
- (*HMIRequest)[S_MSG_PARAMS][strings::menu_params][strings::menu_name] = "MenuName";
-
-
- /*
- (*spRequest)[S_MSG_PARAMS][strings::sync_msg_version]["majorVersion"] = 2;
- (*spRequest)[S_MSG_PARAMS][strings::sync_msg_version]["minorVersion"] = 2;
- (*spRequest)[S_MSG_PARAMS][strings::tts_name][0]["text"] = "SyncProxyTester";
- (*spRequest)[S_MSG_PARAMS][strings::tts_name][0]["type"] = "TEXT";
- (*spRequest)[S_MSG_PARAMS][strings::ngn_media_screen_app_name] = "SPT";
- (*spRequest)[S_MSG_PARAMS][strings::vr_synonyms][0] = "VR SyncProxyTester";
- (*spRequest)[S_MSG_PARAMS][strings::is_media_application] = true;
- (*spRequest)[S_MSG_PARAMS][strings::app_type][0] = "DEFAULT";
-
- */
-
-
- app_manager_->set_hmi_message_handler(hmi_handler_test);
- /*
- //////////////////////////////////////
- //change 25 december
- app_manager_->set_active_vr_language(hmi_apis::Common_Language::EN_US);
- app_manager_->set_active_ui_language(hmi_apis::Common_Language::EN_US);
-
- /////////////////////////////////
- */
- //Application* appRegistr = app_manager_->application(appl->app_id());
- //if (appRegistr)
- // printf("\n\n\n blablabla \n\n\n");
-
- //appl->set_hmi_level(mobile_apis::HMILevel::HMI_BACKGROUND);
-
- app_manager_->ManageMobileCommand(HMIRequest);
-
-
- sleep(5);
- }
- }//namespace app_manager_test
-}//namespace test
-
-
-
-
-
--- /dev/null
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <unistd.h>
+#include "application_manager/application_impl.h"
+
+#include "rpc/test_hmi.h"
+
+namespace test {
+ namespace app_manager_test {
+ void TestHMI() {
+ printf("\n\n\n init param to HMI AddCommand \n\n\n");
+
+ connection_handler::ConnectionHandlerImpl* connection_handler_ =
+ connection_handler::ConnectionHandlerImpl::instance();
+
+ application_manager::ApplicationManagerImpl* app_manager_ =
+ application_manager::ApplicationManagerImpl::instance();
+
+ utils::SharedPtr<am::Application> appl(app_manager_->application(65537));
+
+ if (!appl.valid()) {
+ RegApp();
+ sleep(5);
+ appl = app_manager_->application(65537);
+
+ if (!appl.valid()) {
+ printf("\n\n\n No register app \n\n\n");
+ return;
+ }
+ }
+ ////////////////////////////////////////
+ sleep(5);
+
+ printf("\n\n\n AddCommand Request \n\n\n");
+
+ HMIMessageHandlerTester* hmi_handler_test;
+
+ hmi_handler_test = HMIMessageHandlerTester::instance();
+
+ utils::SharedPtr<smart::SmartObject> HMIRequest(new smart::SmartObject);
+
+ (*HMIRequest)[jsn::S_PARAMS][am::strings::function_id] =
+ mobile_apis::FunctionID::AddCommandID;
+ // (*HMIRequest)[S_PARAMS][strings::correlation_id] = 3;
+ (*HMIRequest)[jsn::S_PARAMS][am::strings::message_type] =
+ mobile_apis::messageType::request;
+ (*HMIRequest)[jsn::S_PARAMS][am::strings::protocol_type] = 0;
+ (*HMIRequest)[jsn::S_PARAMS][am::strings::protocol_version] = 2;
+ (*HMIRequest)[jsn::S_PARAMS][am::strings::connection_key] = 65537;
+
+ // (*HMIRequest)[S_MSG_PARAMS][strings::app_id] = "12345";
+ (*HMIRequest)[jsn::S_MSG_PARAMS][am::strings::app_name] =
+ "SyncProxyTester";
+
+ app_manager_->set_hmi_message_handler(hmi_handler_test);
+
+ // appl->set_hmi_level(mobile_apis::HMILevel::HMI_BACKGROUND);
+
+ app_manager_->ManageMobileCommand(HMIRequest);
+
+ sleep(5);
+
+ hmi_message_handler::HMIMessageHandlerImpl* hmi_handler_;
+
+ hmi_handler_ = hmi_message_handler::HMIMessageHandlerImpl::instance();
+ DCHECK(hmi_handler_ != NULL)
+
+ app_manager_->set_hmi_message_handler(hmi_handler_);
+ }
+ } // namespace app_manager_test
+} // namespace test
+++ /dev/null
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "rpc/xmlParser.h"
-
-namespace test
-{
-namespace app_manager_test
-{
-namespace xml_parser
-{
-
- const char* XML_TEST_NODE_NAME = "test";
- const char* XML_TEST_MESSAGE_REQUEST = "request";
- const char* XML_TEST_MESSAGE_RESPONSE = "response";
-
- const char* XML_TEST_FUNCTION_PARAM_VECTOR = "Vector";
- const char* XML_TEST_FUNCTION_PARAM_BOOLEAN = "Boolean";
- const char* XML_TEST_FUNCTION_PARAM_STRING = "String";
- const char* XML_TEST_FUNCTION_PARAM_INTEGER = "Integer";
-
-
- XmlParser::XmlParser():
- sXmlDir()
- ,xmlDir(0)
- ,xmlFile(0)
- ,xmlDoc(0)
- ,sXmlFileName()
- ,xmlTestNode(0)
- ,dirOpened(false)
- ,xmlOpened(false)
- ,xmlFileExists(false)
- ,firstTestNodeFound(false)
- ,params() {
- params.insert(SSMap::value_type("params",jhs::S_PARAMS));
- params.insert(SSMap::value_type("message_params",jhs::S_MSG_PARAMS));
- params.insert(SSMap::value_type("function_id",jhs::S_FUNCTION_ID));
- params.insert(SSMap::value_type("correlation_id",jhs::S_CORRELATION_ID));
- params.insert(SSMap::value_type("protocol_type",jhs::S_PROTOCOL_TYPE));
- params.insert(SSMap::value_type("protocol_version",jhs::S_PROTOCOL_VERSION));
- params.insert(SSMap::value_type("message_type",jhs::S_MESSAGE_TYPE));
- }
-
- XmlParser::~XmlParser() {
- CloseDir();
- CloseXml();
- }
-
- XmlParser* XmlParser::instance() {
- static XmlParser instance;
- return &instance;
- }
-
- void XmlParser::SetXmlDir(const std::string& path) {
- sXmlDir.clear();
- sXmlDir.append(path);
- }
-
- std::string XmlParser::GetXmlDir() const {
- return sXmlDir;
- }
-
- bool XmlParser::OpenDir() {
- xmlDir = opendir(sXmlDir.data());
- if (xmlDir) {
- return (dirOpened = true);
- }
- return (dirOpened = false);
- }
-
- bool XmlParser::NextXml() {
- if (!dirOpened) return false;
- xmlFile = readdir(xmlDir);
- if (xmlFile) {
- sXmlFileName.clear();
- sXmlFileName.append(xmlFile->d_name);
- return (xmlFileExists = true);
- }
- return (xmlFileExists = false);
- }
-
- bool XmlParser::ReadXml() {
- if (!xmlFileExists) return false;
-
- std::string filePath;
-
- filePath.clear();
- filePath.append(sXmlDir);
- filePath.append("/");
- filePath.append(sXmlFileName);
-
- if (!sXmlFileName.compare(".") || !sXmlFileName.compare("..")) return false;
- xmlDoc = xmlReadFile(filePath.data(),0,0);
- if (xmlDoc) {
- return (xmlOpened = true);
- }
- return (xmlOpened = false);
- }
-
- void XmlParser::CloseXml() {
- if (xmlOpened) xmlFreeDoc(xmlDoc);
- xmlOpened = false;
- firstTestNodeFound = false;
- xmlFileExists = false;
- }
-
- void XmlParser::CloseDir() {
- CloseXml();
- if (dirOpened) closedir(xmlDir);
- dirOpened = false;
- }
-
- bool XmlParser::MoveToNextTestNode() {
- if (!xmlOpened) return false;
- if (!firstTestNodeFound) return (firstTestNodeFound = FindFirstTestNode());
- return NextTestNode();
- }
-
- bool XmlParser::GetRequestFromTest(SmartObject& so) {
- if (!xmlOpened) return false;
- xmlNode* xmlTestParams = xmlTestNode->children;
- so = SmartType::SmartType_Null;
- SetTestAttributes(so);
- MoveToTag(xmlTestParams);
- if (!xmlTestParams) return false;
- PutParamsToSO(xmlTestParams,so);
- return true;
- }
-
- std::string XmlParser::GetXmlFileName() const {
- return sXmlFileName;
- }
-
- bool XmlParser::FindFirstTestNode() {
- xmlNode* rootNode = xmlDoc->children;
- return SearchInNodes(rootNode,xmlTestNode);
- }
-
- bool XmlParser::SearchInNodes(xmlNode* node,xmlNode*& testNode) {
- bool found = false;
- std::string nodeName;
- while (node) {
- MoveToTag(node);
- if (!node) break;
-
- found = found || SearchInNodes(node->children,testNode);
- if (found) return found;
-
- nodeName.clear();
- nodeName.append(ToString(node->name));
-
- if (!nodeName.compare(XML_TEST_NODE_NAME)) {
- testNode = node;
- return true;
- }
- node = node->next;
- }
- return false;
- }
-
- bool XmlParser::NextTestNode() {
- std::string nodeName;
- xmlTestNode = xmlTestNode->next;
- MoveToTag(xmlTestNode);
-
- if (!xmlTestNode) return false;
- do {
- nodeName.clear();
- nodeName.append(ToString(xmlTestNode->name));
- if (nodeName.compare(XML_TEST_NODE_NAME)) {
- xmlTestNode = xmlTestNode->next;
- } else {
- break;
- }
- }
- while (xmlTestNode);
- if (!xmlTestNode) return false;
- return true;
- }
-
-
- void XmlParser::SetTestAttributes(SmartObject& so) {
- xmlAttr* xmlTestNodeAttr = xmlTestNode->properties;
- std::string attrName;
- std::string attrValue;
- while (xmlTestNodeAttr) {
- attrName.clear();
- attrName.append(ToString(xmlTestNodeAttr->name));
- attrValue.clear();
- attrValue.append(ToString(xmlTestNodeAttr->children->content));
- so[attrName] = attrValue;
- xmlTestNodeAttr = xmlTestNodeAttr->next;
- }
- }
-
- void XmlParser::PutParamsToSO(xmlNode* node,SmartObject& so) {
- std::string nodeName;
-
- while (node) {
- MoveToTag(node);
- if (!node) break;
-
- nodeName.clear();
- nodeName.append(ToString(node->name));
-
- bool flag = true;
-
- if (!nodeName.compare(XML_TEST_FUNCTION_PARAM_STRING)) {
- SetStringMsgParam(node->properties,so);
- flag = false;
- }
- if (!nodeName.compare(XML_TEST_FUNCTION_PARAM_INTEGER)) {
- SetIntegerMsgParam(node->properties,so);
- flag = false;
- }
- if (!nodeName.compare(XML_TEST_FUNCTION_PARAM_BOOLEAN)) {
- SetBooleanMsgParam(node->properties,so);
- flag = false;
- }
- if (!nodeName.compare(XML_TEST_FUNCTION_PARAM_VECTOR)) {
- if ((node->properties)&&
- (node->properties->children)&&
- (node->properties->children->content)) {
- std::string vectorName(ToString(node->properties->children->content));
- PutVectorToSO(node->children,so[vectorName]);
- }
- flag = false;
- }
- if (flag) {
- SSMap::iterator elem = params.find(nodeName);
- if(elem!=params.end()) {
- PutParamsToSO(node->children,so[elem->second]);
- } else {
- PutParamsToSO(node->children,so[nodeName]);
- }
- }
- node = node->next;
- }
- }
-
- void XmlParser::PutVectorToSO(xmlNode* node,SmartObject& so) {
- int index = 0;
- while (node) {
- MoveToTag(node);
- if (!node) break;
-
- std::string nodeName(ToString(node->name));
-
- bool flag = true;
- if (!nodeName.compare(XML_TEST_FUNCTION_PARAM_STRING)) {
- SetStringMsgParam(node->properties,so[index]);
- flag = false;
- }
- if(flag) PutParamsToSO(node->children,so[index]);
- index++;
- node = node->next;
- }
- }
-
- void XmlParser::SetIntegerMsgParam(const xmlAttr* xmlParam,SmartObject& so) {
- if (!xmlParam) return;
-
- std::string msgParam(ToString(xmlParam->name));
- if ((!xmlParam->children)||(!xmlParam->children->content)) return;
-
- std::string msgValue(ToString(xmlParam->children->content));
-
- if (!VerifyString(msgParam)) return;
-
- so[msgParam] = StrToInt(msgValue);
- }
-
- void XmlParser::SetBooleanMsgParam(const xmlAttr* xmlParam,SmartObject& so) {
- if (!xmlParam) return;
-
- std::string msgParam(ToString(xmlParam->name));
- if ((!xmlParam->children)||(!xmlParam->children->content)) return;
-
- std::string msgValue(ToString(xmlParam->children->content));
-
- if (!VerifyString(msgParam)) return;
-
- so[msgParam] = StrToBool(msgValue);
- }
-
- void XmlParser::SetStringMsgParam(const xmlAttr* xmlParam,SmartObject& so) {
- if (!xmlParam) return;
-
- std::string msgParam(ToString(xmlParam->name));
- if ((!xmlParam->children)||(!xmlParam->children->content)) return;
-
- std::string msgParamValue(ToString(xmlParam->children->content));
-
- if (!VerifyString(msgParam)) return;
- if (!VerifyString(msgParamValue)) return;
-
- SSMap::iterator elem = params.find(msgParam);
- if (elem!=params.end()) {
- so[elem->second] = msgParamValue;
- return;
- }
- if (!msgParam.compare("add")) {
- so = msgParamValue;
- return;
- }
- so[msgParam] = msgParamValue;
- }
-
- void XmlParser::MoveToTag(xmlNode*& node) {
- while (node) {
- if (XML_TEXT_NODE==node->type || XML_COMMENT_NODE==node->type) {
- node = node->next;
- } else {
- break;
- }
- }
- }
-
- std::string XmlParser::ToString(const xmlChar* str) {
- return std::string((char*)str);
- }
-
- bool XmlParser::VerifyString(const std::string& param) {
- bool good = true;
- const char invalidChars[7] = "\\/&\"<>";
-
- for (int i=0;i<param.length();i++) {
- if (strchr(invalidChars,param[i])) {
- good = false;
- break;
- }
- }
- return good;
- }
-
- int XmlParser::StrToInt(const std::string& param) {
- bool good = true;
- const char validChars[11] = "0123456789";
- int val = -1;
-
- for (int i=0;i<param.length();i++) {
- if (!strchr(validChars,param[i])) {
- good = false;
- break;
- }
- }
- if (good) val = atoi(param.data());
-
- return val;
- }
-
- bool XmlParser::StrToBool(const std::string& param) {
- bool good = false;
- std::string toCheck;
- toCheck.clear();
- toCheck.append(param);
- std::transform(toCheck.begin(),toCheck.end(),toCheck.begin(),::tolower);
-
- if (!toCheck.compare("true")) good = true;
- return good;
- }
-
-}//namespace xml_parser
-}//namespace app_manager_test
-}//namespace test
--- /dev/null
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "rpc/xml_parser.h"
+
+namespace test {
+
+ const char* XML_TEST_NODE_NAME = "test";
+ const char* XML_TEST_MESSAGE_REQUEST = "request";
+ const char* XML_TEST_MESSAGE_RESPONSE = "response";
+
+ const char* XML_TEST_FUNCTION_PARAM_VECTOR = "Vector";
+ const char* XML_TEST_FUNCTION_PARAM_BOOLEAN = "Boolean";
+ const char* XML_TEST_FUNCTION_PARAM_STRING = "String";
+ const char* XML_TEST_FUNCTION_PARAM_INTEGER = "Integer";
+ const char* XML_TEST_FUNCTION_PARAM_BINARY = "Binary";
+ const char* XML_TEST_FUNCTION_PARAM_GARBAGE = "Garbage";
+ const char* XML_TEST_FUNCTION_PARAM_PATCH = "Patch";
+ const char* XML_TEST_FUNCTION_PARAM_ARRAY = "Array";
+ const char* XML_TEST_FUNCTION_PARAM_FLOAT = "Float";
+
+ XmlParser::XmlParser()
+ : s_xml_dir_(),
+ xml_dir_(0),
+ xml_file_(0),
+ xml_doc_(0),
+ s_xml_file_name_(),
+ xml_test_node_(0),
+ dir_opened_(false),
+ xml_opened_(false),
+ xml_file_exists_(false),
+ first_test_node_found_(false),
+ params_() {
+ params_.insert(SSMap::value_type("params", jhs::S_PARAMS));
+ params_.insert(SSMap::value_type("message_params", jhs::S_MSG_PARAMS));
+ params_.insert(SSMap::value_type("function_id", jhs::S_FUNCTION_ID));
+ params_.insert(SSMap::value_type("correlation_id", jhs::S_CORRELATION_ID));
+ params_.insert(SSMap::value_type("protocol_type", jhs::S_PROTOCOL_TYPE));
+ params_.insert(SSMap::value_type("protocol_version",
+ jhs::S_PROTOCOL_VERSION));
+ params_.insert(SSMap::value_type("message_type", jhs::S_MESSAGE_TYPE));
+ }
+
+ XmlParser::~XmlParser() {
+ CloseDir();
+ CloseXml();
+ }
+
+ XmlParser* XmlParser::instance() {
+ static XmlParser instance;
+ return &instance;
+ }
+
+ void XmlParser::SetXmlDir(const std::string& path) {
+ s_xml_dir_.clear();
+ s_xml_dir_.append(path);
+ }
+
+ std::string XmlParser::GetXmlDir() const {
+ return s_xml_dir_;
+ }
+
+ bool XmlParser::OpenDir() {
+ xml_dir_ = opendir(s_xml_dir_.data());
+ if (xml_dir_) {
+ return (dir_opened_ = true);
+ }
+ return (dir_opened_ = false);
+ }
+
+ bool XmlParser::NextXml() {
+ if (!dir_opened_) return false;
+ xml_file_ = readdir(xml_dir_);
+ if (xml_file_) {
+ s_xml_file_name_.clear();
+ s_xml_file_name_.append(xml_file_->d_name);
+ return (xml_file_exists_ = true);
+ }
+ return (xml_file_exists_ = false);
+ }
+
+ bool XmlParser::ReadXml() {
+ if (!xml_file_exists_) return false;
+
+ std::string filePath;
+
+ filePath.append(s_xml_dir_);
+ filePath.append("/");
+ filePath.append(s_xml_file_name_);
+
+ if (!s_xml_file_name_.compare(".") || !s_xml_file_name_.compare("..")) {
+ return false;
+ }
+ if (xml_doc_) {
+ xmlFreeDoc(xml_doc_);
+ first_test_node_found_ = false;
+ xml_opened_ = false;
+ }
+ xml_doc_ = xmlReadFile(filePath.data(), 0, 0);
+ if (xml_doc_) {
+ return (xml_opened_ = true);
+ }
+ return (xml_opened_ = false);
+ }
+
+ void XmlParser::CloseXml() {
+ if (xml_opened_) xmlFreeDoc(xml_doc_);
+ xml_opened_ = false;
+ first_test_node_found_ = false;
+ xml_file_exists_ = false;
+ }
+
+ void XmlParser::CloseDir() {
+ CloseXml();
+ if (dir_opened_) closedir(xml_dir_);
+ dir_opened_ = false;
+ }
+
+ bool XmlParser::MoveToNextTestNode() {
+ if (!xml_opened_) return false;
+ if (!first_test_node_found_) {
+ return (first_test_node_found_ = FindFirstTestNode());
+ }
+ return NextTestNode();
+ }
+
+ bool XmlParser::GetRequestFromTest(smart::SmartObject* so) {
+ if (!xml_opened_) return false;
+ xmlNode* xml_test_params = xml_test_node_->children;
+ *so = smart::SmartType::SmartType_Null;
+ SetTestAttributes(so);
+ MoveToTag(&xml_test_params);
+ if (!xml_test_params) return false;
+ PutParamsToSO(xml_test_params, so);
+ return true;
+ }
+
+ std::string XmlParser::GetXmlFileName() const {
+ return s_xml_file_name_;
+ }
+
+ bool XmlParser::FindFirstTestNode() {
+ xmlNode* rootNode = xml_doc_->children;
+ return SearchInNodes(rootNode, &xml_test_node_);
+ }
+
+ bool XmlParser::SearchInNodes(xmlNode* node, xmlNode** testNode) {
+ bool found = false;
+ std::string nodeName;
+ while (node) {
+ MoveToTag(&node);
+ if (!node) break;
+
+ found = found || SearchInNodes(node->children, testNode);
+ if (found) return found;
+
+ nodeName.clear();
+ nodeName.append(ToString(node->name));
+
+ if (!nodeName.compare(XML_TEST_NODE_NAME)) {
+ *testNode = node;
+ return true;
+ }
+ node = node->next;
+ }
+ return false;
+ }
+
+ bool XmlParser::NextTestNode() {
+ std::string nodeName;
+ xml_test_node_ = xml_test_node_->next;
+ MoveToTag(&xml_test_node_);
+
+ if (!xml_test_node_) return false;
+ do {
+ nodeName.append(ToString(xml_test_node_->name));
+ if (nodeName.compare(XML_TEST_NODE_NAME)) {
+ xml_test_node_ = xml_test_node_->next;
+ } else {
+ break;
+ }
+ } while (xml_test_node_);
+ if (!xml_test_node_) return false;
+ return true;
+ }
+
+
+ void XmlParser::SetTestAttributes(smart::SmartObject* so) {
+ xmlAttr* xml_test_node_attr = xml_test_node_->properties;
+
+ while (xml_test_node_attr) {
+ std::string attrName;
+ std::string attrValue;
+
+ attrName.append(ToString(xml_test_node_attr->name));
+ attrValue.append(ToString(xml_test_node_attr->children->content));
+ (*so)[attrName] = attrValue;
+ xml_test_node_attr = xml_test_node_attr->next;
+ }
+ }
+
+ void XmlParser::PutParamsToSO(xmlNode* node, smart::SmartObject* so) {
+ std::string node_name;
+
+ while (node) {
+ MoveToTag(&node);
+ if (!node) break;
+
+ node_name.clear();
+ node_name.append(ToString(node->name));
+ bool flag = true;
+
+ if (!node_name.compare(XML_TEST_FUNCTION_PARAM_STRING)) {
+ SetStringMsgParam(node->properties, so);
+ flag = false;
+ }
+ if (!node_name.compare(XML_TEST_FUNCTION_PARAM_INTEGER)) {
+ SetIntegerMsgParam(node->properties, so);
+ flag = false;
+ }
+ if (!node_name.compare(XML_TEST_FUNCTION_PARAM_BOOLEAN)) {
+ SetBooleanMsgParam(node->properties, so);
+ flag = false;
+ }
+ if (!node_name.compare(XML_TEST_FUNCTION_PARAM_VECTOR)) {
+ if ((node->properties)&&
+ (node->properties->children)&&
+ (node->properties->children->content)) {
+ std::string vector_name(
+ ToString(node->properties->children->content));
+ PutVectorToSO(node->children, &(*so)[vector_name]);
+ }
+ flag = false;
+ }
+ if (!node_name.compare(XML_TEST_FUNCTION_PARAM_BINARY)) {
+ SetBinaryMsgParam(node->properties, so);
+ flag = false;
+ }
+ if (!node_name.compare("result")) {
+ SetToResult(node->properties, so);
+ flag = false;
+ }
+ if (!node_name.compare(XML_TEST_FUNCTION_PARAM_GARBAGE)) {
+ (*so)[ToString(node->properties->name)];
+ flag = false;
+ }
+ if (!node_name.compare(XML_TEST_FUNCTION_PARAM_PATCH)) {
+ SetPatchMsgParam(node->properties, so);
+ flag = false;
+ }
+ if (!node_name.compare(XML_TEST_FUNCTION_PARAM_ARRAY)) {
+ std::string array_name(ToString(node->properties->children->content));
+ (*so)[array_name] = smart::SmartObject(smart::SmartType_Array);
+ PutParamsToSO(node->children, &((*so)[array_name]));
+ flag = false;
+ }
+ if (!node_name.compare(XML_TEST_FUNCTION_PARAM_FLOAT)) {
+ PutFloatToSO(node->properties, so);
+ flag = false;
+ }
+ if (flag) {
+ SSMap::iterator elem = params_.find(node_name);
+ if (elem != params_.end()) {
+ PutParamsToSO(node->children, &(*so)[elem->second]);
+ } else {
+ PutParamsToSO(node->children, &(*so)[node_name]);
+ }
+ }
+ node = node->next;
+ }
+ }
+
+ void XmlParser::PutVectorToSO(xmlNode* node, smart::SmartObject* so) {
+ int index = 0;
+ while (node) {
+ MoveToTag(&node);
+ if (!node) break;
+
+ std::string nodeName(ToString(node->name));
+
+ bool flag = true;
+ if (!nodeName.compare(XML_TEST_FUNCTION_PARAM_STRING)) {
+ SetStringMsgParam(node->properties, &(*so)[index]);
+ flag = false;
+ }
+ if (flag)
+ PutParamsToSO(node->children, &(*so)[index]);
+ index++;
+ node = node->next;
+ }
+ }
+
+ void XmlParser::SetIntegerMsgParam(const xmlAttr* xmlParam,
+ smart::SmartObject* so) {
+ if (!xmlParam) return;
+
+ std::string msgParam(ToString(xmlParam->name));
+ if ((!xmlParam->children)||(!xmlParam->children->content)) return;
+
+ std::string msgValue(ToString(xmlParam->children->content));
+ if (!VerifyString(msgParam)) return;
+
+ (*so)[msgParam] = StrToInt(msgValue);
+ }
+
+ void XmlParser::SetBooleanMsgParam(const xmlAttr* xmlParam,
+ smart::SmartObject* so) {
+ if (!xmlParam) return;
+
+ std::string msgParam(ToString(xmlParam->name));
+ if ((!xmlParam->children)||(!xmlParam->children->content)) return;
+
+ std::string msgValue(ToString(xmlParam->children->content));
+ if (!VerifyString(msgParam)) return;
+
+ (*so)[msgParam] = StrToBool(msgValue);
+ }
+
+ void XmlParser::SetStringMsgParam(const xmlAttr* xmlParam,
+ smart::SmartObject* so) {
+ if (!xmlParam) return;
+
+ std::string msgParam(ToString(xmlParam->name));
+ if ((!xmlParam->children)||(!xmlParam->children->content)) return;
+
+ std::string msgParamValue(ToString(xmlParam->children->content));
+ if (!VerifyString(msgParam)) return;
+ if (!VerifyString(msgParamValue)) return;
+
+ SSMap::iterator elem = params_.find(msgParam);
+ if (elem != params_.end()) {
+ (*so)[elem->second] = msgParamValue;
+ return;
+ }
+ if (!msgParam.compare("add")) {
+ *so = msgParamValue;
+ return;
+ }
+ (*so)[msgParam] = msgParamValue;
+ }
+
+
+ void XmlParser::SetToResult(const xmlAttr* xmlParam, smart::SmartObject* so) {
+ if (!xmlParam) return;
+
+ std::string attrName;
+ std::string attrValue;
+ while (xmlParam) {
+ attrName.append(ToString(xmlParam->name));
+ attrValue.append(ToString(xmlParam->children->content));
+ if (attrName.compare("return")) {
+ (*so)["message_params"][am::strings::result_code] = attrValue;
+ } else {
+ (*so)[am::strings::params][am::strings::correlation_id] = attrValue;
+ }
+ xmlParam = xmlParam->next;
+ }
+ }
+
+ void XmlParser::SetBinaryMsgParam(const xmlAttr* xmlParam,
+ smart::SmartObject* so) {
+ if (!xmlParam) return;
+
+ std::string msgParam(ToString(xmlParam->name));
+ if ((!xmlParam->children) || (!xmlParam->children->content)) return;
+
+ std::string msgValue(ToString(xmlParam->children->content));
+ if (!VerifyString(msgParam)) return;
+
+ std::vector<uint8_t> binStr;
+
+ std::string fullPatch = "SyncProxyTester/" + msgValue;
+ std::string full_file_path = file_system::FullPath(fullPatch);
+
+ if (file_system::ReadBinaryFile(full_file_path, binStr)) {
+ (*so)[am::strings::binary_data] = binStr;
+ }
+ }
+
+ void XmlParser::SetPatchMsgParam(const xmlAttr* xmlParam,
+ smart::SmartObject* so) {
+ std::string msgParam(ToString(xmlParam->name));
+ if ((!xmlParam->children)||(!xmlParam->children->content)) return;
+
+ std::string msgValue(ToString(xmlParam->children->content));
+ if (!VerifyString(msgParam)) return;
+
+ std::string fullPatch = "SyncProxyTester/" + msgValue;
+ std::string full_file_path = file_system::FullPath(fullPatch);
+
+ (*so)[msgParam] = full_file_path;
+ }
+
+ void XmlParser::MoveToTag(xmlNode** node) {
+ while (*node) {
+ if ((XML_TEXT_NODE == (*node)->type) ||
+ (XML_COMMENT_NODE == (*node)->type)) {
+ *node = (*node)->next;
+ } else {
+ break;
+ }
+ }
+ }
+
+ std::string XmlParser::ToString(const xmlChar* str) {
+ return std::string(reinterpret_cast<const char*>(str));
+ }
+
+ bool XmlParser::VerifyString(const std::string& param) {
+ bool good = true;
+ const char invalidChars[7] = "\\/&\"<>";
+
+ for (int i = 0; i < param.length(); i++) {
+ if (strchr(invalidChars, param[i])) {
+ good = false;
+ break;
+ }
+ }
+ return good;
+ }
+
+ int XmlParser::StrToInt(const std::string& param) {
+ bool good = true;
+ const char validChars[11] = "0123456789";
+ int val = -1;
+
+ for (int i = 0; i < param.length(); i++) {
+ if (!strchr(validChars, param[i])) {
+ good = false;
+ break;
+ }
+ }
+ if (good) {
+ val = atoi(param.data());
+ }
+
+ return val;
+ }
+
+ void XmlParser::PutFloatToSO(const xmlAttr* xmlParam,
+ smart::SmartObject* so) {
+ if (!xmlParam) return;
+
+ std::string msgParam(ToString(xmlParam->name));
+ if ((!xmlParam->children) || (!xmlParam->children->content)) return;
+
+ std::string msgValue(ToString(xmlParam->children->content));
+ if (!VerifyString(msgParam)) return;
+
+ (*so)[msgParam] = atof(msgValue.c_str());
+ }
+
+ bool XmlParser::StrToBool(const std::string& param) {
+ bool good = false;
+ std::string toCheck;
+
+ toCheck.append(param);
+ std::transform(toCheck.begin(), toCheck.end(), toCheck.begin(), ::tolower);
+
+ if (!toCheck.compare("true")) {
+ good = true;
+ }
+ return good;
+ }
+} // namespace test
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
#include "gtest/gtest.h"
#include "gmock/gmock.h"
-//#include "config_profile/profile.h"
+
+#include "config_profile/profile.h"
#include "utils/file_system_tests.h"
#include "utils/prioritized_queue_tests.h"
#include "protocol_handler/protocol_handler_tm_test.h"
-//#include "request_watchdog/request_watchdog_test.h"
#include "application_manager/formatters_commands.h"
-//#include "media_manager/media_manager_impl_test.h"
-//#include "SmartObjectDraftTest.h"
-//#include "SmartObjectInvalidTest.h"
-//#include "SmartObjectStressTest.h"
-//#include "SmartObjectUnitTest.h"
-//#include "TSharedPtrTest.h"
-//#include "SmartObjectConvertionTimeTest.h"
-//#include "jsoncpp/json_reader_test.h"
-//#include "json_handler/smart_schema_draft_test.h"
-//#include "json_handler/formatters/formatter_test_helper.h"
-//#include "json_handler/formatters/formatter_json_alrpcv1_test.h"
-//#include "json_handler/formatters/formatter_json_alrpcv2_test.h"
-//#include "json_handler/formatters/formatter_json_rpcv2_test.h"
-
-
-#include "rpc/AdminAppTest.h"
-//#include "smart_objects/smart_object.h"
-//#include "application_manager/smart_object_keys.h"
-//#include "formatters/CSmartFactory.hpp"
-
-//using namespace test::components::request_watchdog_test;
-//using namespace test::components::utils;
-//using namespace test::components::protocol_handler_test;
-//using namespace utils;
-
-//using namespace test::third_party_libs::json_reader_test;
-//using namespace test::components::json_handler::smart_schema_draft_test;
-//using namespace test::components::json_handler::formatters;
-
-//using namespace NsSmartDeviceLink::NsSmartObjects;
-//using namespace NsSmartDeviceLink::NsJSONHandler::strings;
-/*
-#ifdef __cplusplus
-extern "C" void __gcov_flush();
-#endif
-*/
-int main(int argc, char **argv) {printf("\n\n\n after init in Admin \n\n\n");
- ::testing::InitGoogleMock(&argc, argv);
+#include "media_manager/media_manager_impl_test.h"
+#include "SmartObjectDraftTest.h"
+#include "SmartObjectInvalidTest.h"
+#include "SmartObjectStressTest.h"
+#include "SmartObjectUnitTest.h"
+#include "TSharedPtrTest.h"
+// #include "jsoncpp/json_reader_test.h"
- profile::Profile::instance()->config_file_name("smartDeviceLink.ini");
+// #include "json_handler/smart_schema_draft_test.h"
+// #include "SmartObjectConvertionTimeTest.h"
+// #include "request_watchdog/request_watchdog_test.h"
+// #include "json_handler/formatters/formatter_test_helper.h"
+// #include "json_handler/formatters/formatter_json_alrpcv1_test.h"
+// #include "json_handler/formatters/formatter_json_alrpcv2_test.h"
+// #include "json_handler/formatters/formatter_json_rpcv2_test.h"
+
+#include "rpc/admin_app_test.h"
- application_manager::ApplicationManagerImpl* app_manager_ =
- application_manager::ApplicationManagerImpl::instance();
-
- printf("\n\n\n after init in Admin \n\n\n");
- //test::app_manager_test::AdminAppTest app;
-
- //threads::Thread threadAdminAppTest("AdminAppTest", &app);
+#include "utils/threads/thread_options.h"
+#include "utils/threads/thread.h"
+#include "life_cycle.cc"
- //threadAdminAppTest.start();
+#include "hmi_message_handler/hmi_message_handler.h"
- //app.run();
-
- //threadAdminAppTest.join();
- //sleep(60);
+// #define QT_HMI
- //app.run();
+#ifdef __cplusplus
+extern "C" void __gcov_flush();
+#endif
+
+int main(int argc, char **argv) {
+ ::testing::InitGoogleMock(&argc, argv);
- //sleep(20);
+ profile::Profile::instance()->config_file_name("smartDeviceLink.ini");
+ log4cxx::PropertyConfigurator::configure("log4cxx.properties");
+ test::AdminAppTest app;
- //app.run();
-
- //threadAdminAppTest.join();
- //sleep(60);
-
+ app.Run();
+ sleep(5);
int result = RUN_ALL_TESTS();
-/*
+
#ifdef __cplusplus
__gcov_flush();
#endif
-*/
+
return result;
}