[ITC][d2d-conv-manager][ACR-571][Added new module]
authorShilpa Jindal <shilpa.j@samsung.com>
Mon, 27 Jun 2016 04:24:04 +0000 (09:54 +0530)
committerAmritanshu Pandia <a.pandia1@samsung.com>
Tue, 28 Jun 2016 13:14:13 +0000 (06:14 -0700)
Change-Id: I6d731ff52f2ea5771ff62bcb665dda5f442fd061
Signed-off-by: Shilpa Jindal <shilpa.j@samsung.com>
14 files changed:
packaging/itc/native-d2d-conv-manager-itc.spec [new file with mode: 0644]
packaging/itc/native-d2d-conv-manager-itc.xml [new file with mode: 0644]
src/itc/d2d-conv-manager/CMakeLists.txt [new file with mode: 0644]
src/itc/d2d-conv-manager/ITs-d2d-conv-channel.c [new file with mode: 0755]
src/itc/d2d-conv-manager/ITs-d2d-conv-manager-common.c [new file with mode: 0644]
src/itc/d2d-conv-manager/ITs-d2d-conv-manager-common.h [new file with mode: 0755]
src/itc/d2d-conv-manager/ITs-d2d-conv-manager.c [new file with mode: 0755]
src/itc/d2d-conv-manager/ITs-d2d-conv-payload.c [new file with mode: 0755]
src/itc/d2d-conv-manager/ITs-d2d-conv-service.c [new file with mode: 0755]
src/itc/d2d-conv-manager/tct-d2d-conv-manager-native.c [new file with mode: 0644]
src/itc/d2d-conv-manager/tct-d2d-conv-manager-native_common_iot.h [new file with mode: 0644]
src/itc/d2d-conv-manager/tct-d2d-conv-manager-native_mobile.h [new file with mode: 0644]
src/itc/d2d-conv-manager/tct-d2d-conv-manager-native_tv.h [new file with mode: 0644]
src/itc/d2d-conv-manager/tct-d2d-conv-manager-native_wearable.h [new file with mode: 0644]

diff --git a/packaging/itc/native-d2d-conv-manager-itc.spec b/packaging/itc/native-d2d-conv-manager-itc.spec
new file mode 100644 (file)
index 0000000..715ebf3
--- /dev/null
@@ -0,0 +1,66 @@
+%define MODULE_NAME d2d-conv-manager
+%define MODULE_LIBNAME d2d-conv-manager
+Name:       native-%{MODULE_NAME}-itc
+Summary:    Native API Integration TC (%{name})
+Version:    0.1
+Release:    0
+Group:      Development/Tools
+License:    Apache-2.0
+Source0:    %{name}-%{version}.tar.gz
+BuildRequires:  pkgconfig(%{MODULE_LIBNAME})
+BuildRequires: pkgconfig(capi-appfw-application)
+BuildRequires:  pkgconfig(glib-2.0)
+BuildRequires:  cmake
+BuildRequires: pkgconfig(bundle)
+BuildRequires: pkgconfig(elementary)
+BuildRequires: pkgconfig(dlog)
+BuildRequires:  pkgconfig(capi-system-info)
+
+%description
+Native API Integration TC (%{name})
+
+%prep
+%setup -q
+
+%build
+
+%define PREFIX "%{_libdir}/%{name}"
+
+export LDFLAGS+="-Wl,--rpath=%{PREFIX} -Wl,--as-needed"
+
+%if %{?DEVICE_BUILD_TYPE_MOBILE:1}0
+cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="mobile" -DCMAKE_INSTALL_PREFIX=%{_prefix}
+%endif
+
+%if %{?DEVICE_BUILD_TYPE_WEARABLE:1}0
+cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="wearable" -DCMAKE_INSTALL_PREFIX=%{_prefix}
+%endif
+
+%if %{?DEVICE_BUILD_TYPE_TV:1}0
+cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="tv" -DCMAKE_INSTALL_PREFIX=%{_prefix}
+%endif
+
+%if %{?DEVICE_BUILD_TYPE_COMMON_IOT:1}0
+cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="common_iot" -DCMAKE_INSTALL_PREFIX=%{_prefix}
+%endif
+
+make %{?jobs:-j%jobs}
+
+%install
+rm -rf %{buildroot}
+%make_install
+mkdir -p %{buildroot}/usr/share/license
+cp LICENSE %{buildroot}/usr/share/license/%{name}
+
+mkdir -p %{buildroot}/usr/share/packages/
+cp packaging/itc/native-%{MODULE_NAME}-itc.xml %{buildroot}/usr/share/packages/
+mkdir -p %{buildroot}%{APP_PATH}%{name}/bin
+%post
+
+%postun
+
+
+%files
+%{APP_PATH}%{name}/*
+/usr/share/packages/native-%{MODULE_NAME}-itc.xml
+/usr/share/license/%{name}
diff --git a/packaging/itc/native-d2d-conv-manager-itc.xml b/packaging/itc/native-d2d-conv-manager-itc.xml
new file mode 100644 (file)
index 0000000..aa48937
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" package="native-d2d-conv-manager-itc" version="0.1.0" api-version="3.0">
+    <label>NativeD2dConvManagerTest</label>
+    <author email="mymail@tizentest.com" href="www.tizentest.com">test</author>
+    <description>Native API test Application</description>
+    <ui-application appid="native.d2d-conv-manager-itc" exec="/usr/apps/native-d2d-conv-manager-itc/bin/tct-d2d-conv-manager-native" nodisplay="false" multiple="false" type="capp" taskmanage="true">
+       <privileges>
+               <privilege>http://tizen.org/privilege/internet</privilege>
+                <privilege>http://tizen.org/privilege/bluetooth</privilege>
+        <privilege>http://tizen.org/privilege/d2d.datasharing</privilege>
+                <privilege>http://tizen.org/privilege/network.get</privilege>
+
+    </privileges>
+
+    </ui-application>
+</manifest>
diff --git a/src/itc/d2d-conv-manager/CMakeLists.txt b/src/itc/d2d-conv-manager/CMakeLists.txt
new file mode 100644 (file)
index 0000000..f29c9f6
--- /dev/null
@@ -0,0 +1,40 @@
+SET(PKG_NAME "d2d-conv-manager")
+
+SET(EXEC_NAME "tct-${PKG_NAME}-native")
+SET(RPM_NAME "native-${PKG_NAME}-itc")
+
+SET(CAPI_LIB "d2d-conv-manager")
+SET(TC_SOURCES
+    ITs-d2d-conv-manager-common.c
+       ITs-d2d-conv-manager.c
+       ITs-d2d-conv-channel.c
+       ITs-d2d-conv-payload.c
+       ITs-d2d-conv-service.c
+)
+
+PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED
+    ${CAPI_LIB}
+       capi-appfw-application
+       glib-2.0
+    bundle
+       capi-system-info
+       dlog 
+       elementary
+)
+
+INCLUDE_DIRECTORIES(
+    ${${CAPI_LIB}_INCLUDE_DIRS}
+)
+
+ADD_EXECUTABLE(${EXEC_NAME} ${EXEC_NAME}.c ${TC_SOURCES} ${COMMON_FILE})
+TARGET_LINK_LIBRARIES(${EXEC_NAME}
+    ${${CAPI_LIB}_LIBRARIES}
+    bundle
+)
+
+INSTALL(PROGRAMS ${EXEC_NAME}
+    DESTINATION ${BIN_DIR}/${RPM_NAME}/bin
+)
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -g -fPIE -Wall")
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib -pie")
diff --git a/src/itc/d2d-conv-manager/ITs-d2d-conv-channel.c b/src/itc/d2d-conv-manager/ITs-d2d-conv-channel.c
new file mode 100755 (executable)
index 0000000..d33c8be
--- /dev/null
@@ -0,0 +1,197 @@
+//
+// Copyright (c) 2014 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+#include "ITs-d2d-conv-manager-common.h"
+
+
+conv_channel_h g_hchannel;
+//& set: D2dConv-manager
+
+/** @addtogroup itc-d2d-conv-manager
+*  @ingroup itc
+*  @{
+*/
+
+/**
+ * @function           ITs_d2d_conv_manager_channel_startup
+ * @description                Called before each test
+ * @parameter          NA
+ * @return                     NA
+ */
+void ITs_d2d_conv_channel_startup(void)
+{
+       struct stat stBuff;
+       if ( stat(ERR_LOG, &stBuff) == 0 )
+       {
+               remove(ERR_LOG);
+       }
+       
+       g_bD2dFail = false;
+       g_bIsD2dConvFeatureSupported = true;
+       g_bIsD2dConvFeatureSupported = TCTCheckSystemInfoFeatureSupported(D2D_CONV_FEATURE, API_NAMESPACE);             
+       
+       int nRet = conv_channel_create(&g_hchannel);
+    if ( !g_bIsD2dConvFeatureSupported )
+       {
+               if ( nRet != TIZEN_ERROR_NOT_SUPPORTED )
+               {
+                       FPRINTF("[Line : %d][%s] conv_channel_create returned %s error for unsupported feature\\n", __LINE__, API_NAMESPACE,  D2dConvGetError(nRet));
+                       g_bFeatureMismatch = true;
+               }
+               else
+               {
+                       FPRINTF("[Line : %d][%s] conv_channel_create correctly returned %s error for unsupported feature\\n", __LINE__, API_NAMESPACE,  D2dConvGetError(nRet));
+                       g_bFeatureNotSupported = true;
+               }
+               return;
+       }
+       if ( nRet != CONV_ERROR_NONE )
+       {
+               FPRINTF("[Line : %d][%s] conv_channel_create failed, error returned = %d(%s)\\n", __LINE__, API_NAMESPACE,  nRet, D2dConvGetError(nRet));
+               g_bD2dFail = true;
+       }
+       else
+       {
+               FPRINTF("[Line : %d][%s] conv_channel_create in startup passed\\n", __LINE__, API_NAMESPACE);           
+       }       
+       
+
+       return;
+}
+
+
+/**
+ * @function           ITs_d2d_conv_manager_channel_channel_cleanup
+ * @description                Called after each test
+ * @parameter          NA
+ * @return                     NA
+ */
+void ITs_d2d_conv_channel_cleanup(void)
+{
+       
+       if(g_hchannel != NULL)
+       {
+               int nRet = conv_channel_destroy(g_hchannel);
+               if ( nRet == CONV_ERROR_NONE )
+               {
+                       FPRINTF("[Line : %d][%s] conv_channel_destroy passed cleanUp\\n", __LINE__, API_NAMESPACE);
+               }
+               else
+               {
+                       FPRINTF("[Line : %d][%s] conv_channel_destroy failed, error returned = %d(%s)\\n", __LINE__, API_NAMESPACE,  nRet,D2dConvGetError(nRet));
+               }
+       }
+       return;
+}
+
+//& type: auto
+//& purpose: Creates and destroys D2D convergence manager channel handle
+/**
+* @testcase                    ITc_d2d_conv_channel_create_destroy_p
+* @author                              SRID(shilpa.j)
+* @reviewer                            SRID(a.pandia1)
+* @type                                auto
+* @since_tizen                         3.0
+* @description                 Creates D2D convergence manager channel handle
+* @scenario                            Creates D2D convergence manager channel handle
+* @apicovered                  conv_channel_create,conv_channel_destroy
+* @passcase                            If conv_channel_create  and conv_channel_destroy returns success
+* @failcase                            If conv_channel_create or conv_channel_destroy fails
+* @precondition                        NA
+* @postcondition               D2D convergence manager channel handle should be destroyed
+*/
+int ITc_d2d_conv_channel_create_destroy_p(void)
+{
+
+       START_TEST;
+       
+       conv_channel_h hchannel;
+       
+       int nRet = conv_channel_create(&hchannel);      
+       PRINT_RESULT(CONV_ERROR_NONE, nRet, "conv_channel_create", D2dConvGetError(nRet));
+       CHECK_HANDLE(hchannel, "conv_channel_create");
+       
+       nRet = conv_channel_destroy(hchannel);
+       PRINT_RESULT(CONV_ERROR_NONE, nRet, "conv_channel_destroy", D2dConvGetError(nRet));
+       
+               return 0;
+       
+       
+}
+
+
+//& type: auto
+//& purpose:  Sets and gets a string from channel.
+/**
+* @testcase                    ITc_d2d_conv_channel_set_get_string_p
+* @author                              SRID(shilpa.j)
+* @reviewer                            SRID(a.pandia1)
+* @type                                auto
+* @since_tizen                         3.0
+* @description                 Sets and gets a string from channel by using  manager channel handle
+* @scenario                            Creates D2D convergence manager channel handle
+                                               Sets a string from channel
+                                               Gets a string from channel
+                                               Destroys the manager channel handle
+* @apicovered                  conv_channel_create,conv_channel_destroy,conv_channel_get_string,conv_channel_set_string
+* @passcase                            If conv_channel_get_string  and conv_channel_set_string returns success
+* @failcase                            If conv_channel_get_string or conv_channel_set_string fails
+* @precondition                        NA
+* @postcondition               D2D convergence manager channel handle should be destroyed
+*/
+int ITc_d2d_conv_channel_set_get_string_p(void)
+{
+
+       START_TEST;
+       
+       conv_channel_h hchannel;
+       char *pszValue = NULL;
+       char*pszString = "test_id";
+       char*pszChannelId = "channel_id";
+
+
+       int nRet = conv_channel_create(&hchannel);      
+       PRINT_RESULT(CONV_ERROR_NONE, nRet, "conv_channel_create", D2dConvGetError(nRet));
+       CHECK_HANDLE(hchannel, "conv_channel_create");
+       
+       nRet = conv_channel_set_string(hchannel, pszChannelId, pszString);
+       PRINT_RESULT_CLEANUP(CONV_ERROR_NONE, nRet, "conv_channel_set_string", D2dConvGetError(nRet),conv_channel_destroy(hchannel));
+       
+       nRet = conv_channel_get_string(hchannel, pszChannelId, &pszValue);
+       PRINT_RESULT_CLEANUP(CONV_ERROR_NONE, nRet, "conv_channel_get_string", D2dConvGetError(nRet),conv_channel_destroy(hchannel));
+       if ( pszValue == NULL )
+       {
+               FPRINTF("[Line : %d][%s] conv_channel_get_string error returned String is NULL\\n", __LINE__, API_NAMESPACE);
+               conv_channel_destroy(hchannel);
+               return 1;
+       }
+       else if ( strcmp(pszValue, pszString) != 0 )
+       {
+               FPRINTF("[Line : %d][%s] conv_channel_get_string error  = String returned [ %s ] is not correct\\n", __LINE__, API_NAMESPACE, pszValue);
+               conv_channel_destroy(hchannel);
+               FREE_MEMORY(pszValue);
+               return 1;
+       }
+       FREE_MEMORY(pszValue);  
+       nRet = conv_channel_destroy(hchannel);
+       PRINT_RESULT_NORETURN(CONV_ERROR_NONE, nRet, "conv_channel_destroy", D2dConvGetError(nRet));
+       
+               return 0;
+       
+       
+}
+
+/** @} */
+/** @} */
\ No newline at end of file
diff --git a/src/itc/d2d-conv-manager/ITs-d2d-conv-manager-common.c b/src/itc/d2d-conv-manager/ITs-d2d-conv-manager-common.c
new file mode 100644 (file)
index 0000000..f579a50
--- /dev/null
@@ -0,0 +1,66 @@
+//
+// Copyright (c) 2014 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+#include "ITs-d2d-conv-manager-common.h"
+
+/** @addtogroup itc-d2d-conv-manager
+*  @ingroup itc
+*  @{
+*/
+
+//Add helper function definitions here
+
+
+/**
+* @function            D2dConvGetError
+* @description         Maps error enums to string values
+* @parameter           nRet : error code returned
+* @return                      error string
+*/
+char* D2dConvGetError(int nRet)
+{
+       char *szErrorVal = NULL;
+       switch(nRet)
+       {
+               case CONV_ERROR_NONE:                                           szErrorVal = "CONV_ERROR_NONE";                                         break;
+               case CONV_ERROR_INVALID_PARAMETER:                      szErrorVal = "CONV_ERROR_INVALID_PARAMETER";            break;
+               case CONV_ERROR_NOT_SUPPORTED:                          szErrorVal = "CONV_ERROR_NOT_SUPPORTED";                        break;
+               case CONV_ERROR_INVALID_OPERATION:                      szErrorVal = "CONV_ERROR_INVALID_OPERATION";            break;
+               case CONV_ERROR_OUT_OF_MEMORY:                          szErrorVal = "CONV_ERROR_OUT_OF_MEMORY";                        break;
+               case CONV_ERROR_PERMISSION_DENIED:                      szErrorVal = "CONV_ERROR_PERMISSION_DENIED";            break;
+               case CONV_ERROR_NO_DATA:                                        szErrorVal = "CONV_ERROR_NO_DATA";                                      break;
+               default:                                                                        szErrorVal = "Unknown Error";                                           break;
+       }
+       return szErrorVal;
+}
+
+/**
+* @function            D2dConvTimeout
+* @description         callback function to terminate g_main loop
+* @parameter           data : user data sent to callback
+* @return                      NA
+*/
+gboolean D2dConvTimeout(gpointer data)
+{
+       GMainLoop* pMainLoop = (GMainLoop *)data;
+       if ( pMainLoop != NULL )
+       {
+               g_main_loop_quit(pMainLoop);
+               g_main_loop_unref(pMainLoop);
+               pMainLoop = NULL;
+       }
+       return false;
+}
+/** @} */
diff --git a/src/itc/d2d-conv-manager/ITs-d2d-conv-manager-common.h b/src/itc/d2d-conv-manager/ITs-d2d-conv-manager-common.h
new file mode 100755 (executable)
index 0000000..be328f2
--- /dev/null
@@ -0,0 +1,88 @@
+//
+// Copyright (c) 2014 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+#ifndef _ITS_D2D_CONV_MANAGER_COMMON_H_
+#define _ITS_D2D_CONV_MANAGER_COMMON_H_
+
+//Add test package related includes here
+
+#include "tct_common.h"
+
+#include <glib.h>
+#include <glib-object.h>
+
+#include <d2d_conv_manager.h>
+/** @addtogroup itc-%{MODULE_NAME}
+*  @ingroup itc
+*  @{
+*/
+
+//Add helper function declarations here
+
+#define API_NAMESPACE                          "D2D_CONV_ITC"
+#define D2D_CONV_FEATURE                       "http://tizen.org/feature/convergence.d2d"
+#define TIMEOUT_CB                                     15000
+
+
+bool g_bFeatureMismatch;
+bool g_bFeatureNotSupported;
+bool g_bD2dFail;
+bool g_bIsD2dConvFeatureSupported;
+bool g_bD2dConvCB;
+GMainLoop *g_loop;
+char* D2dConvGetError(int nRet);
+gboolean D2dConvTimeout(gpointer data);
+
+#define START_TEST {\
+       FPRINTF("[Line : %d][%s] Starting test : %s\\n", __LINE__, API_NAMESPACE, __FUNCTION__);\
+       if ( g_bFeatureMismatch )\
+{\
+       return 1;\
+}\
+       if ( g_bFeatureNotSupported )\
+{\
+       return 0;\
+}\
+if ( g_bD2dFail )\
+       {\
+               FPRINTF("[Line : %d][%s] Startup failed, Leaving test\\n", __LINE__, API_NAMESPACE);\
+               return 1;\
+       }\
+}
+
+#define CHECK_HANDLE_CLEANUP(Handle, API, FreeResource) {\
+       if ( Handle == NULL )\
+{\
+       FPRINTF("[Line : %d][%s] %s failed, error returned = Handle returned is NULL\\n", __LINE__, API_NAMESPACE, API);\
+       FreeResource;\
+       return 1;\
+}\
+}
+
+#define RUN_POLLING_LOOP {\
+       if ( g_bD2dConvCB == false )\
+{\
+       g_loop = g_main_loop_new(NULL, false);\
+       nTimeoutId = g_timeout_add(TIMEOUT_CB, D2dConvTimeout, g_loop);\
+       g_main_loop_run(g_loop);\
+       g_source_remove(nTimeoutId);\
+       g_loop = NULL;\
+}\
+}
+
+
+
+/** @} */
+#endif  //_ITS_D2D_CONV_MANAGER_COMMON_H_
diff --git a/src/itc/d2d-conv-manager/ITs-d2d-conv-manager.c b/src/itc/d2d-conv-manager/ITs-d2d-conv-manager.c
new file mode 100755 (executable)
index 0000000..6d389c7
--- /dev/null
@@ -0,0 +1,205 @@
+//
+// Copyright (c) 2014 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+#include "ITs-d2d-conv-manager-common.h"
+conv_h g_hConvHandle = NULL;
+
+
+
+
+/**
+* @function            DiscoveryCB
+* @description         Callback function to receive discovered device information
+* @parameter           conv_device_h device handle, conv_discovery_result_e result, void *user_data : The user data passed from the for each function
+* @return                      NA
+*/
+void DiscoveryCB(conv_device_h device_handle, conv_discovery_result_e result, void *user_data)
+{
+       g_bD2dConvCB = true;
+       
+       if ( g_loop != NULL )
+       {
+               g_main_loop_quit(g_loop);
+               g_loop = NULL;
+       }
+       return ;
+}
+
+//& set: D2dConv-manager
+
+/** @addtogroup itc-d2d-conv-manager
+*  @ingroup itc
+*  @{
+*/
+
+/**
+ * @function           ITs_d2d_conv_manager_startup
+ * @description                Called before each test
+ * @parameter          NA
+ * @return                     NA
+ */
+void ITs_d2d_conv_manager_startup(void)
+{
+       struct stat stBuff;
+       if ( stat(ERR_LOG, &stBuff) == 0 )
+       {
+               remove(ERR_LOG);
+       }
+#if DEBUG
+       FPRINTF("[Line : %d][%s] TEST SUIT start-up: ITs_D2d_Conv_p\\n", __LINE__, API_NAMESPACE);
+#endif
+       
+       g_bD2dFail = false;
+       g_bIsD2dConvFeatureSupported = true;
+       g_bIsD2dConvFeatureSupported = TCTCheckSystemInfoFeatureSupported(D2D_CONV_FEATURE, API_NAMESPACE);             
+       
+       int nRet = conv_create(&g_hConvHandle);
+    if ( !g_bIsD2dConvFeatureSupported )
+       {
+               if ( nRet != TIZEN_ERROR_NOT_SUPPORTED )
+               {
+                       FPRINTF("[Line : %d][%s] conv_create returned %s error for unsupported feature\\n", __LINE__, API_NAMESPACE,  D2dConvGetError(nRet));
+                       g_bFeatureMismatch = true;
+               }
+               else
+               {
+                       FPRINTF("[Line : %d][%s] conv_create correctly returned %s error for unsupported feature\\n", __LINE__, API_NAMESPACE,  D2dConvGetError(nRet));
+                       g_bFeatureNotSupported = true;
+               }
+               return;
+       }
+       if ( nRet != CONV_ERROR_NONE )
+       {
+               FPRINTF("[Line : %d][%s] conv_create failed, error returned = %d(%s)\\n", __LINE__, API_NAMESPACE,  nRet, D2dConvGetError(nRet));               
+               g_bD2dFail = true;
+       }
+       else
+       {
+               FPRINTF("[Line : %d][%s] conv_create in startup passed\\n", __LINE__, API_NAMESPACE);           
+       }       
+       
+       return;
+}
+
+
+/**
+ * @function           ITs_d2d_conv_manager_cleanup
+ * @description                Called after each test
+ * @parameter          NA
+ * @return                     NA
+ */
+void ITs_d2d_conv_manager_cleanup(void)
+{
+#if DEBUG
+       FPRINTF("[Line : %d][%s] TEST SUIT clean-up: ITs_D2d_Conv_p\\n", __LINE__, API_NAMESPACE);
+#endif
+       if(g_hConvHandle != NULL)
+       {
+               int nRet = conv_destroy(g_hConvHandle);
+               if ( nRet == CONV_ERROR_NONE )
+               {
+                       FPRINTF("[Line : %d][%s] conv_destroy passed cleanUp\\n", __LINE__, API_NAMESPACE);
+               }
+               else
+               {
+                       FPRINTF("[Line : %d][%s] conv_destroy failed, error returned = %d(%s)\\n", __LINE__, API_NAMESPACE,  nRet,D2dConvGetError(nRet));
+               }
+       }
+       return;
+}
+
+/** @addtogroup itc-d2d-conv-manager-testcases
+*  @brief              Integration testcases for module d2d-conv-manager
+*  @ingroup    itc-d2d-conv-manager
+*  @{
+*/
+
+//& purpose: Creates a D2D convergence manager handle
+//& type: auto
+/**
+* @testcase                    ITc_d2d_conv_create_destroy_p    
+* @since_tizen                 3.0
+* @author              SRID(gaurav.m2)
+* @reviewer            SRID(a.pandia1)
+* @type                                auto
+* @description                 Creates a D2D convergence manager handle
+* @scenario                            conv_create, conv_destroy
+* @apicovered                  conv_create, conv_destroy
+* @passcase                            When conv_create, conv_destroy is successful.
+* @failcase                            If target API conv_create, conv_destroy fails or any precondition API fails.
+* @precondition                        None
+* @postcondition               None
+*/
+int ITc_d2d_conv_create_destroy_p(void)
+{
+       START_TEST;
+               
+       conv_h hConvHandle = NULL;
+       //Target API
+       int nRet = conv_create(&hConvHandle);
+       PRINT_RESULT(CONV_ERROR_NONE, nRet,"conv_create", D2dConvGetError(nRet));
+       CHECK_HANDLE(hConvHandle, "conv_create");       
+                       
+       //Target API
+       nRet = conv_destroy(hConvHandle);
+       PRINT_RESULT(CONV_ERROR_NONE, nRet,"conv_destroy", D2dConvGetError(nRet));
+       
+       return 0;
+}
+
+//& purpose: Called when a nearby device which provides D2D services has been discovered. 
+//& type: auto
+/**
+* @testcase                    ITc_d2d_conv_discovery_start_stop_p
+* @since_tizen                 3.0
+* @author              SRID(gaurav.m2)
+* @reviewer            SRID(a.pandia1)
+* @type                                auto
+* @description                 Called when a nearby device which provides D2D services has been discovered.
+* @scenario                            conv_discovery_start, conv_discovery_stop
+* @apicovered                  conv_discovery_start, conv_discovery_stop
+* @passcase                            When conv_discovery_start, conv_discovery_stop is successful.
+* @failcase                            If target API conv_discovery_start, conv_discovery_stop fails or any precondition API fails.
+* @precondition                        None
+* @postcondition               None
+*/
+int ITc_d2d_conv_discovery_start_stop_p(void)
+{
+       START_TEST;
+       int nTimeoutId  = 0;
+       int nTimeoutSec = 10;
+       g_bD2dConvCB = false;
+               
+       //Target API
+       int nRet = conv_discovery_start(g_hConvHandle, nTimeoutSec, DiscoveryCB, NULL); 
+       RUN_POLLING_LOOP;
+       PRINT_RESULT(CONV_ERROR_NONE, nRet,"conv_discovery_start", D2dConvGetError(nRet));
+       if ( g_bD2dConvCB == false )
+       {
+               FPRINTF("[Line : %d][%s] DiscoveryCB failed\\n", __LINE__, API_NAMESPACE);
+               conv_discovery_stop(g_hConvHandle);
+               return 1;
+       }
+       
+       //Target API
+       nRet = conv_discovery_stop(g_hConvHandle);
+       PRINT_RESULT(CONV_ERROR_NONE, nRet,"conv_discovery_stop", D2dConvGetError(nRet));
+       
+       return 0;
+}
+
+
+/** @} */
+/** @} */
\ No newline at end of file
diff --git a/src/itc/d2d-conv-manager/ITs-d2d-conv-payload.c b/src/itc/d2d-conv-manager/ITs-d2d-conv-payload.c
new file mode 100755 (executable)
index 0000000..0130471
--- /dev/null
@@ -0,0 +1,317 @@
+//
+// Copyright (c) 2014 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+#include "ITs-d2d-conv-manager-common.h"
+
+
+
+conv_payload_h g_hPayload;
+//& set: D2dConv-manager
+
+/** @addtogroup itc-d2d-conv-manager
+*  @ingroup itc
+*  @{
+*/
+
+/**
+ * @function           ITs_d2d_conv_manager_channel_startup
+ * @description                Called before each test
+ * @parameter          NA
+ * @return                     NA
+ */
+void ITs_d2d_conv_payload_startup(void)
+{
+       struct stat stBuff;
+       if ( stat(ERR_LOG, &stBuff) == 0 )
+       {
+               remove(ERR_LOG);
+       }
+       
+       g_bD2dFail = false;
+       g_bIsD2dConvFeatureSupported = true;
+       g_bIsD2dConvFeatureSupported = TCTCheckSystemInfoFeatureSupported(D2D_CONV_FEATURE, API_NAMESPACE);             
+       
+       int nRet = conv_payload_create(&g_hPayload);
+    if ( !g_bIsD2dConvFeatureSupported )
+       {
+               if ( nRet != TIZEN_ERROR_NOT_SUPPORTED )
+               {
+                       FPRINTF("[Line : %d][%s] conv_payload_create returned %s error for unsupported feature\\n", __LINE__, API_NAMESPACE,  D2dConvGetError(nRet));
+                       g_bFeatureMismatch = true;
+               }
+               else
+               {
+                       FPRINTF("[Line : %d][%s] conv_payload_create correctly returned %s error for unsupported feature\\n", __LINE__, API_NAMESPACE,  D2dConvGetError(nRet));
+                       g_bFeatureNotSupported = true;
+               }
+               return;
+       }
+       if ( nRet != CONV_ERROR_NONE )
+       {
+               FPRINTF("[Line : %d][%s] conv_payload_create failed, error returned = %d(%s)\\n", __LINE__, API_NAMESPACE,  nRet, D2dConvGetError(nRet));
+               g_bD2dFail = true;
+       }
+       else
+       {
+               FPRINTF("[Line : %d][%s] conv_payload_create in startup passed\\n", __LINE__, API_NAMESPACE);
+               
+       }       
+       
+
+       return;
+}
+
+
+/**
+ * @function           ITs_d2d_conv_manager_channel_channel_cleanup
+ * @description                Called after each test
+ * @parameter          NA
+ * @return                     NA
+ */
+void ITs_d2d_conv_payload_cleanup(void)
+{
+       int nRet = 0;
+       if(g_hPayload != NULL)
+       {
+                nRet = conv_payload_destroy(g_hPayload);
+               if ( nRet == CONV_ERROR_NONE )
+               {
+                       FPRINTF("[Line : %d][%s] conv_payload_destroy passed cleanUp\\n", __LINE__, API_NAMESPACE);
+               }
+               else
+               {
+                       FPRINTF("[Line : %d][%s] conv_payload_destroy failed, error returned = %d(%s)\\n", __LINE__, API_NAMESPACE,  nRet,D2dConvGetError(nRet));
+               }
+       }
+       return;
+}
+
+//& type: auto
+//& purpose: Creates and destroys D2D convergence manager payload handle.
+/**
+* @testcase                    ITc_d2d_conv_payload_create_destroy_p
+* @author                              SRID(shilpa.j)
+* @reviewer                            SRID(a.pandia1)
+* @type                                auto
+* @since_tizen                         3.0
+* @description                 Creates and destroys D2D convergence manager payload handle.
+* @scenario                            Creates D2D convergence manager payload handle.
+                                               Destroys D2D convergence manager payload handle
+* @apicovered                  conv_payload_create,conv_payload_destroy
+* @passcase                            If conv_payload_create  and conv_payload_destroy returns success
+* @failcase                            If conv_payload_create or conv_payload_destroy fails
+* @precondition                        NA
+* @postcondition               D2D convergence manager payload handle should be destroyed
+*/
+int ITc_d2d_conv_payload_create_destroy_p(void)
+{
+
+       START_TEST;
+               
+       conv_payload_h hpayload;
+       
+       int nRet = conv_payload_create(&hpayload);      
+       PRINT_RESULT(CONV_ERROR_NONE, nRet, "conv_payload_create", D2dConvGetError(nRet));
+       CHECK_HANDLE(hpayload, "conv_payload_create");
+       
+       nRet = conv_payload_destroy(hpayload);
+       PRINT_RESULT(CONV_ERROR_NONE, nRet, "conv_payload_destroy", D2dConvGetError(nRet));     
+       
+       return 0;       
+       
+}
+
+//& type: auto
+//& purpose:  Gets and sets a string from payload.
+/**
+* @testcase                    ITc_d2d_conv_payload_set_get_string_p
+* @author                              SRID(shilpa.j)
+* @reviewer                            SRID(a.pandia1)
+* @type                                auto
+* @since_tizen                         3.0
+* @description                 Sets and gets a string from payload by using  manager payload handle
+* @scenario                            Creates D2D convergence manager payload handle
+                                               Sets a string from payload                                              
+                                               Gets a string from payload
+                                               Destroys the manager payload handle
+* @apicovered                  conv_payload_create,conv_payload_destroy,conv_payload_set_string,conv_payload_get_string
+* @passcase                            If conv_payload_set_string  and conv_payload_get_string returns success
+* @failcase                            If conv_payload_set_string or conv_payload_get_string fails
+* @precondition                        NA
+* @postcondition               D2D convergence manager payload handle should be destroyed
+*/
+int ITc_d2d_conv_payload_set_get_string_p(void)
+{
+
+       START_TEST;
+       
+       conv_payload_h hpayload;
+       char *pszValue = NULL;
+       char*pszString = "test_value";
+       char*pszTest = "test_key";
+
+
+       int nRet = conv_payload_create(&hpayload);      
+       PRINT_RESULT(CONV_ERROR_NONE, nRet, "conv_channel_create", D2dConvGetError(nRet));
+       CHECK_HANDLE(hpayload, "conv_payload_create");
+       
+       nRet = conv_payload_set_string(hpayload, pszTest, pszString);
+       PRINT_RESULT_CLEANUP(CONV_ERROR_NONE, nRet, "conv_payload_set_string", D2dConvGetError(nRet),conv_payload_destroy(hpayload));
+       
+       nRet = conv_payload_get_string(hpayload, pszTest, &pszValue);
+       PRINT_RESULT_CLEANUP(CONV_ERROR_NONE, nRet, "conv_payload_get_string", D2dConvGetError(nRet),conv_payload_destroy(hpayload));
+       if ( pszValue == NULL )
+       {
+               FPRINTF("[Line : %d][%s] conv_payload_get_string error returned String is NULL\\n", __LINE__, API_NAMESPACE);
+               conv_payload_destroy(hpayload);
+               return 1;
+       }
+       else if ( strcmp(pszValue, pszString) != 0 )
+       {
+               FPRINTF("[Line : %d][%s] conv_channel_get_string error  = String returned [ %s ] is not correct\\n", __LINE__, API_NAMESPACE, pszValue);
+               conv_payload_destroy(hpayload);
+               FREE_MEMORY(pszValue);
+               return 1;
+       }
+       
+       FREE_MEMORY(pszValue);  
+       nRet = conv_payload_destroy(hpayload);
+       PRINT_RESULT_NORETURN(CONV_ERROR_NONE, nRet, "conv_payload_destroy", D2dConvGetError(nRet));    
+       
+       return 0;
+       
+}
+
+//& type: auto
+//& purpose:  Sets and gets an app-control to/from payload.
+/**
+* @testcase                    ITc_d2d_conv_payload_set_get_app_control_p
+* @author                              SRID(shilpa.j)
+* @reviewer                            SRID(a.pandia1)
+* @type                                auto
+* @since_tizen                         3.0
+* @description                  Sets and gets an app-control from payload by using  manager payload handle
+* @scenario                            Creates D2D convergence manager payload handle
+                                               Sets  an app-control from payload
+                                               Gets an app-control from payload
+                                               Destroys the manager payload handle
+* @apicovered                  conv_payload_create,conv_payload_destroy,app_control_create,app_control_set_app_id,conv_payload_set_app_control,conv_payload_get_app_control
+* @passcase                            If conv_payload_set_app_control  and conv_payload_get_app_control returns success
+* @failcase                            If conv_payload_set_app_control or conv_payload_get_app_control fails
+* @precondition                        NA
+* @postcondition               D2D convergence manager payload handle should be destroyed
+*/
+int ITc_d2d_conv_payload_set_get_app_control_p(void)
+{
+
+       START_TEST;
+       
+       conv_payload_h hpayload;
+       app_control_h happ_control = NULL;
+       app_control_h happCtrl = NULL;
+
+
+       int nRet = conv_payload_create(&hpayload);      
+       PRINT_RESULT(CONV_ERROR_NONE, nRet, "conv_channel_create", D2dConvGetError(nRet));
+       CHECK_HANDLE(hpayload, "conv_payload_create");
+       
+       nRet = app_control_create(&happ_control);
+       PRINT_RESULT(CONV_ERROR_NONE, nRet, "app_control_create", D2dConvGetError(nRet));
+       CHECK_HANDLE(hpayload, "app_control_create");
+       
+       nRet = app_control_set_app_id(happ_control, "org.tizen.browser");
+       PRINT_RESULT(CONV_ERROR_NONE, nRet, "app_control_set_app_id", D2dConvGetError(nRet));
+       
+       nRet = app_control_set_operation(happ_control, APP_CONTROL_OPERATION_MAIN);
+       PRINT_RESULT(CONV_ERROR_NONE, nRet, "app_control_set_operation", D2dConvGetError(nRet));
+       //Target API
+       nRet = conv_payload_set_app_control(hpayload, "app_control", happ_control);
+       PRINT_RESULT(CONV_ERROR_NONE, nRet, "conv_payload_set_app_control", D2dConvGetError(nRet));
+       
+       nRet = conv_payload_get_app_control(hpayload, "app_control", &happCtrl);
+       PRINT_RESULT(CONV_ERROR_NONE, nRet, "conv_payload_get_app_control", D2dConvGetError(nRet));
+       CHECK_HANDLE(happCtrl, "conv_payload_get_app_control");
+       
+       nRet = conv_payload_destroy(hpayload);
+       PRINT_RESULT_NORETURN(CONV_ERROR_NONE, nRet, "conv_payload_destroy", D2dConvGetError(nRet));    
+       
+       return 0;
+       
+}
+
+//& type: auto
+//& purpose:  Gets and sets byte array from payload. 
+/**
+* @testcase                    ITc_d2d_conv_payload_set_get_byte_p
+* @author                              SRID(shilpa.j)
+* @reviewer                            SRID(a.pandia1)
+* @type                                auto
+* @since_tizen                         3.0
+* @description                 Gets and sets byte array from payload by using  manager payload handle
+* @scenario                            Creates D2D convergence manager payload handle
+                                               Sets a byte array from payload                                          
+                                               Gets a byte array from payload
+                                               Destroys the manager payload handle
+* @apicovered                  conv_payload_create,conv_payload_destroy,conv_payload_set_byte,conv_payload_get_byte
+* @passcase                            If conv_payload_set_byte  and conv_payload_get_byte returns success
+* @failcase                            If conv_payload_set_byte or conv_payload_get_byte fails
+* @precondition                        NA
+* @postcondition               D2D convergence manager payload handle should be destroyed
+*/
+int  ITc_d2d_conv_payload_set_get_byte_p(void)
+{
+
+       START_TEST;
+       
+       conv_payload_h hpayload;
+       unsigned char *pszValue = (unsigned char *)"test_byte";
+       unsigned char *pszVal;
+       char*pszTest = "test_key";
+       int nlen = -1;
+
+
+       int nRet = conv_payload_create(&hpayload);      
+       PRINT_RESULT(CONV_ERROR_NONE, nRet, "conv_channel_create", D2dConvGetError(nRet));
+       CHECK_HANDLE(hpayload, "conv_payload_create");
+       
+       nRet = conv_payload_set_byte(hpayload, pszTest,sizeof(pszValue), pszValue);
+       PRINT_RESULT_CLEANUP(CONV_ERROR_NONE, nRet, "conv_payload_set_string", D2dConvGetError(nRet),conv_payload_destroy(hpayload));
+       
+       nRet = conv_payload_get_byte(hpayload, pszTest, &nlen, &pszVal);
+       PRINT_RESULT_CLEANUP(CONV_ERROR_NONE, nRet, "conv_payload_get_string", D2dConvGetError(nRet),conv_payload_destroy(hpayload));
+       if ( pszVal == NULL )
+       {
+               FPRINTF("[Line : %d][%s] conv_payload_get_byte error returned Byte array is NULL\\n", __LINE__, API_NAMESPACE);
+               conv_payload_destroy(hpayload);
+               return 1;
+       }
+       if(nlen == -1)
+       {
+               FPRINTF("[Line : %d][%s] conv_payload_get_byte nlen variable not set\\n", __LINE__, API_NAMESPACE);
+               FREE_MEMORY(pszVal);
+               conv_payload_destroy(hpayload);
+               return 1;
+       }
+
+       FREE_MEMORY(pszVal);    
+       nRet = conv_payload_destroy(hpayload);
+       PRINT_RESULT_NORETURN(CONV_ERROR_NONE, nRet, "conv_payload_destroy", D2dConvGetError(nRet));
+       
+       return 0;       
+       
+}
+
+/** @} */
+/** @} */
\ No newline at end of file
diff --git a/src/itc/d2d-conv-manager/ITs-d2d-conv-service.c b/src/itc/d2d-conv-manager/ITs-d2d-conv-service.c
new file mode 100755 (executable)
index 0000000..46493eb
--- /dev/null
@@ -0,0 +1,460 @@
+//
+// Copyright (c) 2014 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+#include "ITs-d2d-conv-manager-common.h"
+conv_service_h g_handleConvService;
+bool g_bD2dConvServiceStartup = false;
+
+
+
+
+/**
+* @function            ConvServiceListenerCB
+* @description         Called when the service is started or stopped, and when data is received or published
+* @parameter           conv_service_h handle, conv_channel_h channel handle, conv_error_e error, conv_payload_h handle, void *user_data : The user data passed from the for each function
+* @return                      NA
+*/
+void ConvServiceListenerCB(conv_service_h service_handle, conv_channel_h channel_handle, conv_error_e error, conv_payload_h result, void* user_data)
+{                                                      
+       g_bD2dConvCB = true;
+       
+       if ( g_loop != NULL )
+       {
+               g_main_loop_quit(g_loop);
+               g_loop = NULL;
+       }
+       return ;
+}
+
+//& set: D2dConv-manager
+
+/** @addtogroup itc-d2d-conv-manager
+*  @ingroup itc
+*  @{
+*/
+
+/**
+ * @function           ITs_d2d_conv_service_startup
+ * @description                Called before each test
+ * @parameter          NA
+ * @return                     NA
+ */
+void ITs_d2d_conv_service_startup(void)
+{
+       struct stat stBuff;
+       if ( stat(ERR_LOG, &stBuff) == 0 )
+       {
+               remove(ERR_LOG);
+       }
+#if DEBUG
+       FPRINTF("[Line : %d][%s] TEST SUIT start-up: ITs_D2d_Conv_p\\n", __LINE__, API_NAMESPACE);
+#endif
+       
+       g_bD2dFail = false;
+       g_bIsD2dConvFeatureSupported = true;
+       g_bIsD2dConvFeatureSupported = TCTCheckSystemInfoFeatureSupported(D2D_CONV_FEATURE, API_NAMESPACE);             
+       
+       int nRet = conv_service_create(&g_handleConvService);
+    if ( !g_bIsD2dConvFeatureSupported )
+       {
+               if ( nRet != TIZEN_ERROR_NOT_SUPPORTED )
+               {
+                       FPRINTF("[Line : %d][%s] conv_service_create returned %s error for unsupported feature\\n", __LINE__, API_NAMESPACE,  D2dConvGetError(nRet));
+                       g_bFeatureMismatch = true;
+               }
+               else
+               {
+                       FPRINTF("[Line : %d][%s] conv_service_create correctly returned %s error for unsupported feature\\n", __LINE__, API_NAMESPACE,  D2dConvGetError(nRet));
+                       g_bFeatureNotSupported = true;
+               }
+               return;
+       }
+       if ( nRet != CONV_ERROR_NONE )
+       {
+               FPRINTF("[Line : %d][%s] conv_service_create failed, error returned = %d(%s)\\n", __LINE__, API_NAMESPACE,  nRet, D2dConvGetError(nRet));               
+               g_bD2dFail = true;
+       }
+       else
+       {
+               FPRINTF("[Line : %d][%s] conv_service_create in startup passed\\n", __LINE__, API_NAMESPACE);           
+       }       
+       
+       return;
+}
+
+
+/**
+ * @function           ITs_d2d_conv_service_cleanup
+ * @description                Called after each test
+ * @parameter          NA
+ * @return                     NA
+ */
+void ITs_d2d_conv_service_cleanup(void)
+{
+#if DEBUG
+       FPRINTF("[Line : %d][%s] TEST SUIT clean-up: ITs_D2d_Conv_p\\n", __LINE__, API_NAMESPACE);
+#endif
+       if(g_handleConvService != NULL)
+       {
+               int nRet = conv_service_destroy(g_handleConvService);
+               if ( nRet == CONV_ERROR_NONE )
+               {
+                       FPRINTF("[Line : %d][%s] conv_service_destroy passed cleanUp\\n", __LINE__, API_NAMESPACE);
+               }
+               else
+               {
+                       FPRINTF("[Line : %d][%s] conv_service_destroy failed, error returned = %d(%s)\\n", __LINE__, API_NAMESPACE,  nRet,D2dConvGetError(nRet));
+               }
+       }
+       return;
+}
+
+/** @addtogroup itc-d2d-conv-manager-testcases
+*  @brief              Integration testcases for module d2d-conv-manager
+*  @ingroup    itc-d2d-conv-manager
+*  @{
+*/
+
+//& purpose: Creates D2D convergence manager service handle
+//& type: auto
+/**
+* @testcase                    ITc_d2d_conv_service_create_destroy_p
+* @since_tizen                 3.0
+* @author              SRID(gaurav.m2)
+* @reviewer            SRID(a.pandia1)
+* @type                                auto
+* @description                 Creates D2D convergence manager service handle
+* @scenario                            conv_service_create, conv_service_destroy
+* @apicovered                  conv_service_create, conv_service_create
+* @passcase                            When conv_service_create, conv_service_create is successful.
+* @failcase                            If target API conv_service_create, conv_service_destroy fails or any precondition API fails.
+* @precondition                        None
+* @postcondition               None
+*/
+int ITc_d2d_conv_service_create_destroy_p(void)
+{
+       START_TEST;
+               
+       conv_service_h hConServicevHandle = NULL;
+       
+       //Target API
+       int nRet = conv_service_create(&hConServicevHandle);
+       PRINT_RESULT(CONV_ERROR_NONE, nRet,"conv_service_create", D2dConvGetError(nRet));
+       CHECK_HANDLE(hConServicevHandle, "conv_service_create");        
+       
+       //Target API
+       nRet = conv_service_destroy(hConServicevHandle);
+       PRINT_RESULT(CONV_ERROR_NONE, nRet,"conv_service_destroy", D2dConvGetError(nRet));
+       
+       return 0;
+}
+
+//& purpose: Creates clone D2D convergence manager service handle
+//& type: auto
+/**
+* @testcase                    ITc_d2d_conv_service_clone_p
+* @since_tizen                 3.0
+* @author              SRID(gaurav.m2)
+* @reviewer            SRID(a.pandia1)
+* @type                                auto
+* @description                 Creates clone D2D convergence manager service handle
+* @scenario                            conv_service_create, conv_service_clone, conv_service_destroy
+* @apicovered                  conv_service_create, conv_service_clone, conv_service_create
+* @passcase                            When conv_service_create, conv_service_clone, conv_service_create is successful.
+* @failcase                            If target API conv_service_create, conv_service_clone, conv_service_destroy fails or any precondition API fails.
+* @precondition                        None
+* @postcondition               None
+*/
+int ITc_d2d_conv_service_clone_p(void)
+{
+       START_TEST;
+               
+       conv_service_h hConvServicevHandle = NULL;
+       conv_service_h hConvServicevHandleTarget = NULL;
+       
+       int nRet = conv_service_create(&hConvServicevHandle);
+       PRINT_RESULT(CONV_ERROR_NONE, nRet,"conv_service_create", D2dConvGetError(nRet));
+       CHECK_HANDLE(hConvServicevHandle, "conv_service_create");       
+       
+       //Target API
+       nRet = conv_service_clone(hConvServicevHandle, &hConvServicevHandleTarget);
+       PRINT_RESULT_CLEANUP(CONV_ERROR_NONE, nRet, "conv_service_clone", D2dConvGetError(nRet), conv_service_destroy(hConvServicevHandle));
+       
+       CHECK_HANDLE(hConvServicevHandleTarget, "conv_service_clone");  
+       
+       nRet = conv_service_destroy(hConvServicevHandle);
+       PRINT_RESULT_NORETURN(CONV_ERROR_NONE, nRet,"conv_service_destroy", D2dConvGetError(nRet));
+       
+       return 0;
+}
+
+//& purpose: Set/Gets a string from service property
+//& type: auto
+/**
+* @testcase                    ITc_d2d_conv_service_set_get_property_string_p
+* @since_tizen                 3.0
+* @author              SRID(gaurav.m2)
+* @reviewer            SRID(a.pandia1)
+* @type                                auto
+* @description                 Set/Gets a string from service property
+* @scenario                            conv_service_create, conv_service_set_property_string, conv_service_get_property_string, conv_service_destroy
+* @apicovered                  conv_service_create,  conv_service_set_property_string, conv_service_get_property_string,, conv_service_create
+* @passcase                            When conv_service_create,  conv_service_set_property_string, conv_service_get_property_string,, conv_service_create is successful.
+* @failcase                            If target API conv_service_create,  conv_service_set_property_string, conv_service_get_property_string,, conv_service_destroy fails or any precondition API fails.
+* @precondition                        None
+* @postcondition               None
+*/
+int ITc_d2d_conv_service_set_get_property_string_p(void)
+{
+       START_TEST;
+               
+       conv_service_h hConServicevHandle = NULL;
+       char *p_Setkey = "test_key";
+       char *p_SetValue = "test_value";
+       char *p_GetValue = NULL;
+       
+       int nRet = conv_service_create(&hConServicevHandle);
+       PRINT_RESULT(CONV_ERROR_NONE, nRet,"conv_service_create", D2dConvGetError(nRet));
+       CHECK_HANDLE(hConServicevHandle, "conv_service_create");        
+       
+       //Target API
+       nRet = conv_service_set_property_string(hConServicevHandle, p_Setkey, p_SetValue);
+       PRINT_RESULT_CLEANUP(CONV_ERROR_NONE, nRet, "conv_service_set_property_string", D2dConvGetError(nRet), conv_service_destroy(hConServicevHandle));
+
+       //Target API
+       nRet = conv_service_get_property_string(hConServicevHandle, p_Setkey, &p_GetValue);
+       PRINT_RESULT_CLEANUP(CONV_ERROR_NONE, nRet, "conv_service_get_property_string", D2dConvGetError(nRet), conv_service_destroy(hConServicevHandle));
+       
+       if ( p_GetValue == NULL )
+    {
+        FPRINTF("[Line : %d][%s] conv_service_get_property_string error returned String is NULL\\n", __LINE__, API_NAMESPACE);
+        conv_service_destroy(hConServicevHandle);
+        return 1;
+    }
+       else if ( strcmp(p_SetValue, p_GetValue) != 0 )
+    {
+        FPRINTF("[Line : %d][%s] conv_service_get_property_string error  = String returned [ %s ] is not correct\\n", __LINE__, API_NAMESPACE, p_GetValue);
+        conv_service_destroy(hConServicevHandle);
+        FREE_MEMORY(p_GetValue);
+        return 1;
+    }
+
+       FREE_MEMORY(p_GetValue);
+       nRet = conv_service_destroy(hConServicevHandle);
+       PRINT_RESULT_NORETURN(CONV_ERROR_NONE, nRet,"conv_service_destroy", D2dConvGetError(nRet));
+       
+       return 0;
+}
+
+//& purpose: Gets connection state from service 
+//& type: auto
+/**
+* @testcase                    ITc_d2d_conv_service_get_connection_state_p
+* @since_tizen                 3.0
+* @author              SRID(gaurav.m2)
+* @reviewer            SRID(a.pandia1)
+* @type                                auto
+* @description                 Gets connection state from service 
+* @scenario                            conv_service_create, conv_service_get_connection_state, conv_service_destroy
+* @apicovered                  conv_service_create,  conv_service_get_connection_state, conv_service_create
+* @passcase                            When conv_service_create, conv_service_get_connection_state, conv_service_create is successful.
+* @failcase                            If target API conv_service_create, conv_service_get_connection_state, conv_service_destroy fails or any precondition API fails.
+* @precondition                        None
+* @postcondition               None
+*/
+int ITc_d2d_conv_service_get_connection_state_p(void)
+{
+       START_TEST;
+               
+       conv_service_h hConvServicevHandle = NULL;
+       conv_service_connection_state_e eState;
+       
+       int nRet = conv_service_create(&hConvServicevHandle);
+       PRINT_RESULT(CONV_ERROR_NONE, nRet,"conv_service_create", D2dConvGetError(nRet));
+       CHECK_HANDLE(hConvServicevHandle, "conv_service_create");       
+       
+       //Target API
+       nRet = conv_service_get_connection_state(hConvServicevHandle, &eState);
+       PRINT_RESULT_CLEANUP(CONV_ERROR_NONE, nRet, "conv_service_get_connection_state", D2dConvGetError(nRet), conv_service_destroy(hConvServicevHandle));
+       
+       if( eState <  CONV_SERVICE_CONNECTION_STATE_NONE || eState > CONV_SERVICE_CONNECTION_STATE_CONNECTING )
+       {
+               FPRINTF("[Line : %d][%s] conv_service_get_connection_state error  = enum lalue returned is not correct\\n", __LINE__, API_NAMESPACE);
+               conv_service_destroy(hConvServicevHandle);
+           return 1;
+       }
+       nRet = conv_service_destroy(hConvServicevHandle);
+       PRINT_RESULT_NORETURN(CONV_ERROR_NONE, nRet,"conv_service_destroy", D2dConvGetError(nRet));
+       
+       return 0;
+}
+
+//& purpose: Set/Gets service type from service handle
+//& type: auto
+/**
+* @testcase                    ITc_d2d_conv_service_set_get_type_p
+* @since_tizen                 3.0
+* @author              SRID(gaurav.m2)
+* @reviewer            SRID(a.pandia1)
+* @type                                auto
+* @description                 Set/Gets service type from service handle
+* @scenario                            conv_service_create, conv_service_set_type, conv_service_get_type, conv_service_destroy
+* @apicovered                  conv_service_create,  conv_service_set_type, conv_service_get_type,, conv_service_create
+* @passcase                            When conv_service_create,  conv_service_set_type, conv_service_get_type, conv_service_create is successful.
+* @failcase                            If target API conv_service_create,  conv_service_set_type, conv_service_get_type, conv_service_destroy fails or any precondition API fails.
+* @precondition                        None
+* @postcondition               None
+*/
+int ITc_d2d_conv_service_set_get_type_p(void)
+{
+       START_TEST;
+               
+       conv_service_h hConvServicevHandle = NULL;
+       conv_service_e eServiceValue = CONV_SERVICE_APP_TO_APP_COMMUNICATION;
+       conv_service_e eGetServiceValue;
+       
+       int nRet = conv_service_create(&hConvServicevHandle);
+       PRINT_RESULT(CONV_ERROR_NONE, nRet,"conv_service_create", D2dConvGetError(nRet));
+       CHECK_HANDLE(hConvServicevHandle, "conv_service_create");       
+       
+       //Target API
+       nRet = conv_service_set_type(hConvServicevHandle, eServiceValue);
+       PRINT_RESULT_CLEANUP(CONV_ERROR_NONE, nRet, "conv_service_set_type", D2dConvGetError(nRet), conv_service_destroy(hConvServicevHandle));
+
+       //Target API
+       nRet = conv_service_get_type(hConvServicevHandle, &eGetServiceValue);
+       PRINT_RESULT_CLEANUP(CONV_ERROR_NONE, nRet, "conv_service_get_type", D2dConvGetError(nRet), conv_service_destroy(hConvServicevHandle));
+       
+       if ( eServiceValue != eGetServiceValue )
+    {
+        FPRINTF("[Line : %d][%s] conv_service_get_type returned enum is same as set\\n", __LINE__, API_NAMESPACE);
+        conv_service_destroy(hConvServicevHandle);
+        return 1;
+    }
+       
+       nRet = conv_service_destroy(hConvServicevHandle);
+       PRINT_RESULT_NORETURN(CONV_ERROR_NONE, nRet,"conv_service_destroy", D2dConvGetError(nRet));
+       
+       return 0;
+}
+
+//& purpose: Reads from remote service asynchronously
+//& type: auto
+/**
+* @testcase                    ITc_d2d_conv_service_read_p
+* @since_tizen                 3.0
+* @author              SRID(gaurav.m2)
+* @reviewer            SRID(a.pandia1)
+* @type                                auto
+* @description                 Retrieves data from remote service or regarding to remote service.
+* @scenario                            conv_service_create, conv_service_read, conv_service_destroy
+* @apicovered                  conv_service_create,  conv_service_read, conv_service_create
+* @passcase                            When conv_service_create, conv_service_read, conv_service_create is successful.
+* @failcase                            If target API conv_service_create, conv_service_read, conv_service_destroy fails or any precondition API fails.
+* @precondition                        None
+* @postcondition               None
+*/
+int ITc_d2d_conv_service_read_p(void)
+{
+       START_TEST;
+               
+       conv_service_h hConvServicevHandle = NULL;
+       conv_payload_h hpayload;
+       conv_channel_h hchannel;
+
+       int nRet = conv_service_create(&hConvServicevHandle);
+       PRINT_RESULT(CONV_ERROR_NONE, nRet,"conv_service_create", D2dConvGetError(nRet));
+       CHECK_HANDLE(hConvServicevHandle, "conv_service_create");                         
+
+    nRet = conv_payload_create(&hpayload);    
+    PRINT_RESULT_CLEANUP(CONV_ERROR_NONE, nRet, "conv_payload_create", D2dConvGetError(nRet), conv_service_destroy(hConvServicevHandle));
+    CHECK_HANDLE_CLEANUP(hpayload, "conv_payload_create",conv_service_destroy(hConvServicevHandle));
+
+       nRet = conv_channel_create(&hchannel);    
+    PRINT_RESULT_CLEANUP(CONV_ERROR_NONE, nRet, "conv_channel_create", D2dConvGetError(nRet), conv_service_destroy(hConvServicevHandle);conv_payload_destroy(hpayload));
+    CHECK_HANDLE_CLEANUP(hchannel, "conv_channel_create",conv_service_destroy(hConvServicevHandle);conv_payload_destroy(hpayload));
+
+       //Target API
+       nRet = conv_service_read(hConvServicevHandle, hchannel,  hpayload);
+       PRINT_RESULT_CLEANUP(CONV_ERROR_NONE, nRet, "conv_service_read", D2dConvGetError(nRet),conv_channel_destroy(hchannel);conv_payload_destroy(hpayload);conv_service_destroy(hConvServicevHandle));
+
+       nRet = conv_channel_destroy(hchannel);
+    PRINT_RESULT_NORETURN(CONV_ERROR_NONE, nRet, "conv_channel_destroy", D2dConvGetError(nRet));
+
+       nRet = conv_payload_destroy(hpayload);
+    PRINT_RESULT_NORETURN(CONV_ERROR_NONE,nRet, "conv_payload_destroy", D2dConvGetError(nRet));
+
+       nRet = conv_service_destroy(hConvServicevHandle);
+       PRINT_RESULT_NORETURN(CONV_ERROR_NONE, nRet,"conv_service_destroy", D2dConvGetError(nRet));
+       
+       return 0;
+}
+
+//& purpose: Registers/unregister listener to receive message from remote service
+//& type: auto
+/**
+* @testcase                    ITc_d2d_conv_service_set_unset_listener_cb_p
+* @since_tizen                 3.0
+* @author              SRID(gaurav.m2)
+* @reviewer            SRID(a.pandia1)
+* @type                                auto
+* @description                 Listens/unset any messages from remote service
+* @scenario                            conv_service_create, conv_service_set_listener_cb, conv_service_destroy
+* @apicovered                  conv_service_create,  conv_service_set_listener_cb, conv_service_create
+* @passcase                            When conv_service_create, conv_service_set_listener_cb, conv_service_create is successful.
+* @failcase                            If target API conv_service_create, conv_service_set_listener_cb, conv_service_destroy fails or any precondition API fails.
+* @precondition                        None
+* @postcondition               None
+*/
+int ITc_d2d_conv_service_set_unset_listener_cb_p(void)
+{
+       START_TEST;
+       int nTimeoutId = 0;
+               
+       conv_service_h hConvServicevHandle = NULL;
+       conv_service_e eValue = CONV_SERVICE_APP_TO_APP_COMMUNICATION;
+       void *user_data = NULL;
+               
+       int nRet = conv_service_create(&hConvServicevHandle);
+       PRINT_RESULT(CONV_ERROR_NONE, nRet,"conv_service_create", D2dConvGetError(nRet));
+       CHECK_HANDLE(hConvServicevHandle, "conv_service_create");
+
+       nRet = conv_service_set_type(hConvServicevHandle, eValue);
+       PRINT_RESULT(CONV_ERROR_NONE, nRet,"conv_service_set_type", D2dConvGetError(nRet));
+       
+       g_bD2dConvCB = false;
+       //Target API
+       nRet = conv_service_set_listener_cb(hConvServicevHandle, ConvServiceListenerCB, user_data);
+       PRINT_RESULT_CLEANUP(CONV_ERROR_NONE, nRet, "conv_service_set_listener_cb", D2dConvGetError(nRet), conv_service_destroy(hConvServicevHandle));
+       RUN_POLLING_LOOP;
+       if ( g_bD2dConvCB == false )
+       {
+               FPRINTF("[Line : %d][%s] ConvServiceListenerCB failed\\n", __LINE__, API_NAMESPACE);
+               conv_service_unset_listener_cb(hConvServicevHandle);
+               conv_service_destroy(hConvServicevHandle);
+               return 1;
+       }
+       
+       nRet = conv_service_unset_listener_cb(hConvServicevHandle);
+       PRINT_RESULT_CLEANUP(CONV_ERROR_NONE, nRet, "conv_service_unset_listener_cb", D2dConvGetError(nRet), conv_service_destroy(hConvServicevHandle));
+       
+       nRet = conv_service_destroy(hConvServicevHandle);
+       PRINT_RESULT_NORETURN(CONV_ERROR_NONE, nRet,"conv_service_destroy", D2dConvGetError(nRet));
+       
+       return 0;
+}
+
+/** @} */
+/** @} */
\ No newline at end of file
diff --git a/src/itc/d2d-conv-manager/tct-d2d-conv-manager-native.c b/src/itc/d2d-conv-manager/tct-d2d-conv-manager-native.c
new file mode 100644 (file)
index 0000000..ed04b5c
--- /dev/null
@@ -0,0 +1,143 @@
+//
+// Copyright (c) 2014 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+#include "tct_common.h"
+
+#ifdef MOBILE  //Starts MOBILE
+#include "tct-d2d-conv-manager-native_mobile.h"
+#endif  //MOBILE       //End MOBILE
+
+#ifdef WEARABLE        //Starts WEARABLE
+#include "tct-d2d-conv-manager-native_wearable.h"
+#endif  //WEARABLE     //End WEARABLE
+
+#ifdef TV      //Starts TV
+#include "tct-d2d-conv-manager-native_tv.h"
+#endif  //TV   //End TV
+
+#ifdef COMMON_IOT      //Starts COMMON_IOT
+#include "tct-d2d-conv-manager-native_common_iot.h"
+#endif  //COMMON_IOT   //End COMMON_IOT
+
+#include <stdio.h>
+#include <string.h>
+#include <malloc.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/wait.h>
+#include <glib.h>
+#include <stdbool.h>
+#include <app.h>
+#include <dlog.h>
+
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <errno.h>
+
+#include <Elementary.h>
+
+typedef struct appdata {
+       Evas_Object *win;
+       Evas_Object *conform;
+       Evas_Object *label;
+} appdata_s;
+
+static bool app_create(void *data)
+{
+       return true;
+}
+
+static void app_control(app_control_h app_control, void *data)
+{
+       char* pszGetTCName = NULL;
+       int i=0, result=0, nRet=0;
+       nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName);
+       if(nRet != APP_CONTROL_ERROR_NONE)
+       {
+               dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet);
+               PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__);
+               PRINT_TC_RESULT("%d",1);
+               FREE_MEMORY_TC(pszGetTCName);
+               return;
+       }
+
+       dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName);
+       for ( i = 0; tc_array[i].name; i++ )
+       {
+               if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) )
+               {
+                       if ( tc_array[i].startup )
+                       {
+                               dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName);
+                               tc_array[i].startup();
+                       }
+
+                       dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName);
+                       result = tc_array[i].function();
+                       dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result);
+
+                       if ( tc_array[i].cleanup )
+                       {
+                               dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName);
+                               tc_array[i].cleanup();
+                       }
+
+                       PRINT_TC_RESULT("%d",result);
+                       FREE_MEMORY_TC(pszGetTCName);
+                       return;
+               }
+       }
+
+       dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName);
+       PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName);
+       PRINT_TC_RESULT("%d",1);
+       FREE_MEMORY_TC(pszGetTCName);
+       return;
+}
+
+static void app_terminate(void *data)
+{
+       dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__);
+}
+
+int main(int argc, char *argv[])
+{
+       int ret = 0;
+       appdata_s ad = {0,};
+
+       ui_app_lifecycle_callback_s event_callback = {0,};
+       event_callback.create = app_create;
+       event_callback.terminate = app_terminate;
+       event_callback.app_control = app_control;
+
+       //setting gcda file location for coverage
+       setenv("GCOV_PREFIX","/tmp",1);
+       dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Coverage *.gcda File location set to /tmp/home/abuild/rpmbuild/BUILD/ ", __FUNCTION__, __LINE__);
+
+       dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__);
+       ret = ui_app_main(argc, argv, &event_callback, &ad);
+       if (ret != APP_ERROR_NONE)
+       {
+               dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret);
+               PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret);
+               PRINT_TC_RESULT("%d",1);
+               return ret;
+       }
+
+       dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__);
+       return ret;
+}
diff --git a/src/itc/d2d-conv-manager/tct-d2d-conv-manager-native_common_iot.h b/src/itc/d2d-conv-manager/tct-d2d-conv-manager-native_common_iot.h
new file mode 100644 (file)
index 0000000..bcad7cf
--- /dev/null
@@ -0,0 +1,69 @@
+//
+// Copyright (c) 2014 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+#ifndef __TCT_D2D_CONV_MANAGER_NATIVE_H__
+#define __TCT_D2D_CONV_MANAGER_NATIVE_H__
+
+#include "testcase.h"
+#include "tct_common.h"
+
+extern void ITs_d2d_conv_manager_startup(void);
+extern void ITs_d2d_conv_manager_cleanup(void);
+extern void ITs_d2d_conv_service_startup(void);
+extern void ITs_d2d_conv_service_cleanup(void);
+extern void ITs_d2d_conv_payload_startup(void);
+extern void ITs_d2d_conv_payload_cleanup(void);
+extern void ITs_d2d_conv_channel_startup(void);
+extern void ITs_d2d_conv_channel_cleanup(void);
+
+extern int ITc_d2d_conv_create_destroy_p(void);
+extern int ITc_d2d_conv_discovery_start_stop_p(void);
+extern int ITc_d2d_conv_service_create_destroy_p(void);
+extern int ITc_d2d_conv_service_clone_p(void);
+extern int ITc_d2d_conv_service_set_get_property_string_p(void);
+extern int ITc_d2d_conv_service_get_connection_state_p(void);
+extern int ITc_d2d_conv_service_set_get_type_p(void);
+extern int ITc_d2d_conv_service_read_p(void);
+extern int ITc_d2d_conv_service_set_unset_listener_cb_p(void);
+extern int ITc_d2d_conv_payload_create_destroy_p(void);
+extern int ITc_d2d_conv_payload_set_get_string_p(void);
+extern int ITc_d2d_conv_payload_set_get_app_control_p(void);
+extern int ITc_d2d_conv_payload_set_get_byte_p(void);
+extern int ITc_d2d_conv_channel_create_destroy_p(void);
+extern int ITc_d2d_conv_channel_set_get_string_p(void);
+
+
+
+testcase tc_array[] = {
+    {"ITc_d2d_conv_create_destroy_p", ITc_d2d_conv_create_destroy_p, ITs_d2d_conv_manager_startup, ITs_d2d_conv_manager_cleanup},
+    {"ITc_d2d_conv_discovery_start_stop_p", ITc_d2d_conv_discovery_start_stop_p, ITs_d2d_conv_manager_startup, ITs_d2d_conv_manager_cleanup},
+       {"ITc_d2d_conv_service_create_destroy_p", ITc_d2d_conv_service_create_destroy_p, ITs_d2d_conv_manager_startup, ITs_d2d_conv_manager_cleanup},
+       {"ITc_d2d_conv_service_clone_p", ITc_d2d_conv_service_clone_p, ITs_d2d_conv_manager_startup, ITs_d2d_conv_manager_cleanup},
+       {"ITc_d2d_conv_service_set_get_property_string_p", ITc_d2d_conv_service_set_get_property_string_p, ITs_d2d_conv_manager_startup, ITs_d2d_conv_manager_cleanup},
+       {"ITc_d2d_conv_service_get_connection_state_p", ITc_d2d_conv_service_get_connection_state_p, ITs_d2d_conv_manager_startup, ITs_d2d_conv_manager_cleanup},
+       {"ITc_d2d_conv_service_set_get_type_p", ITc_d2d_conv_service_set_get_type_p, ITs_d2d_conv_manager_startup, ITs_d2d_conv_manager_cleanup},
+       {"ITc_d2d_conv_service_read_p", ITc_d2d_conv_service_read_p, ITs_d2d_conv_manager_startup, ITs_d2d_conv_manager_cleanup},
+       {"ITc_d2d_conv_service_set_unset_listener_cb_p", ITc_d2d_conv_service_set_unset_listener_cb_p, ITs_d2d_conv_manager_startup, ITs_d2d_conv_manager_cleanup},     
+       {"ITc_d2d_conv_payload_create_destroy_p", ITc_d2d_conv_payload_create_destroy_p, ITs_d2d_conv_payload_startup, ITs_d2d_conv_payload_cleanup},
+       {"ITc_d2d_conv_payload_set_get_string_p", ITc_d2d_conv_payload_set_get_string_p, ITs_d2d_conv_payload_startup, ITs_d2d_conv_payload_cleanup},
+       {"ITc_d2d_conv_payload_set_get_app_control_p", ITc_d2d_conv_payload_set_get_app_control_p, ITs_d2d_conv_payload_startup, ITs_d2d_conv_payload_cleanup},
+       {"ITc_d2d_conv_payload_set_get_byte_p", ITc_d2d_conv_payload_set_get_byte_p, ITs_d2d_conv_payload_startup, ITs_d2d_conv_payload_cleanup},       
+       {"ITc_d2d_conv_channel_create_destroy_p", ITc_d2d_conv_channel_create_destroy_p, ITs_d2d_conv_channel_startup, ITs_d2d_conv_channel_cleanup},
+       {"ITc_d2d_conv_channel_set_get_string_p", ITc_d2d_conv_channel_set_get_string_p, ITs_d2d_conv_channel_startup, ITs_d2d_conv_channel_cleanup},
+       
+    {NULL, NULL}
+};
+
+#endif // __TCT_D2D_CONV_MANAGER_NATIVE_H__
diff --git a/src/itc/d2d-conv-manager/tct-d2d-conv-manager-native_mobile.h b/src/itc/d2d-conv-manager/tct-d2d-conv-manager-native_mobile.h
new file mode 100644 (file)
index 0000000..72d91ae
--- /dev/null
@@ -0,0 +1,67 @@
+//
+// Copyright (c) 2014 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+#ifndef __TCT_D2D_CONV_MANAGER_NATIVE_H__
+#define __TCT_D2D_CONV_MANAGER_NATIVE_H__
+
+#include "testcase.h"
+#include "tct_common.h"
+
+extern void ITs_d2d_conv_manager_startup(void);
+extern void ITs_d2d_conv_manager_cleanup(void);
+extern void ITs_d2d_conv_service_startup(void);
+extern void ITs_d2d_conv_service_cleanup(void);
+extern void ITs_d2d_conv_payload_startup(void);
+extern void ITs_d2d_conv_payload_cleanup(void);
+extern void ITs_d2d_conv_channel_startup(void);
+extern void ITs_d2d_conv_channel_cleanup(void);
+
+extern int ITc_d2d_conv_create_destroy_p(void);
+extern int ITc_d2d_conv_discovery_start_stop_p(void);
+extern int ITc_d2d_conv_service_create_destroy_p(void);
+extern int ITc_d2d_conv_service_clone_p(void);
+extern int ITc_d2d_conv_service_set_get_property_string_p(void);
+extern int ITc_d2d_conv_service_get_connection_state_p(void);
+extern int ITc_d2d_conv_service_set_get_type_p(void);
+extern int ITc_d2d_conv_service_read_p(void);
+extern int ITc_d2d_conv_service_set_unset_listener_cb_p(void);
+extern int ITc_d2d_conv_payload_create_destroy_p(void);
+extern int ITc_d2d_conv_payload_set_get_string_p(void);
+extern int ITc_d2d_conv_payload_set_get_app_control_p(void);
+extern int ITc_d2d_conv_payload_set_get_byte_p(void);
+extern int ITc_d2d_conv_channel_create_destroy_p(void);
+extern int ITc_d2d_conv_channel_set_get_string_p(void);
+
+
+testcase tc_array[] = {
+    {"ITc_d2d_conv_create_destroy_p", ITc_d2d_conv_create_destroy_p, ITs_d2d_conv_manager_startup, ITs_d2d_conv_manager_cleanup},
+    {"ITc_d2d_conv_discovery_start_stop_p", ITc_d2d_conv_discovery_start_stop_p, ITs_d2d_conv_manager_startup, ITs_d2d_conv_manager_cleanup},
+       {"ITc_d2d_conv_service_create_destroy_p", ITc_d2d_conv_service_create_destroy_p, ITs_d2d_conv_manager_startup, ITs_d2d_conv_manager_cleanup},
+       {"ITc_d2d_conv_service_clone_p", ITc_d2d_conv_service_clone_p, ITs_d2d_conv_manager_startup, ITs_d2d_conv_manager_cleanup},
+       {"ITc_d2d_conv_service_set_get_property_string_p", ITc_d2d_conv_service_set_get_property_string_p, ITs_d2d_conv_manager_startup, ITs_d2d_conv_manager_cleanup},
+       {"ITc_d2d_conv_service_get_connection_state_p", ITc_d2d_conv_service_get_connection_state_p, ITs_d2d_conv_manager_startup, ITs_d2d_conv_manager_cleanup},
+       {"ITc_d2d_conv_service_set_get_type_p", ITc_d2d_conv_service_set_get_type_p, ITs_d2d_conv_manager_startup, ITs_d2d_conv_manager_cleanup},
+       {"ITc_d2d_conv_service_read_p", ITc_d2d_conv_service_read_p, ITs_d2d_conv_manager_startup, ITs_d2d_conv_manager_cleanup},
+       {"ITc_d2d_conv_service_set_unset_listener_cb_p", ITc_d2d_conv_service_set_unset_listener_cb_p, ITs_d2d_conv_manager_startup, ITs_d2d_conv_manager_cleanup},     
+       {"ITc_d2d_conv_payload_create_destroy_p", ITc_d2d_conv_payload_create_destroy_p, ITs_d2d_conv_payload_startup, ITs_d2d_conv_payload_cleanup},
+       {"ITc_d2d_conv_payload_set_get_string_p", ITc_d2d_conv_payload_set_get_string_p, ITs_d2d_conv_payload_startup, ITs_d2d_conv_payload_cleanup},
+       {"ITc_d2d_conv_payload_set_get_app_control_p", ITc_d2d_conv_payload_set_get_app_control_p, ITs_d2d_conv_payload_startup, ITs_d2d_conv_payload_cleanup},
+       {"ITc_d2d_conv_payload_set_get_byte_p", ITc_d2d_conv_payload_set_get_byte_p, ITs_d2d_conv_payload_startup, ITs_d2d_conv_payload_cleanup},       
+       {"ITc_d2d_conv_channel_create_destroy_p", ITc_d2d_conv_channel_create_destroy_p, ITs_d2d_conv_channel_startup, ITs_d2d_conv_channel_cleanup},
+       {"ITc_d2d_conv_channel_set_get_string_p", ITc_d2d_conv_channel_set_get_string_p, ITs_d2d_conv_channel_startup, ITs_d2d_conv_channel_cleanup},
+    {NULL, NULL}
+};
+
+#endif // __TCT_D2D_CONV_MANAGER_NATIVE_H__
diff --git a/src/itc/d2d-conv-manager/tct-d2d-conv-manager-native_tv.h b/src/itc/d2d-conv-manager/tct-d2d-conv-manager-native_tv.h
new file mode 100644 (file)
index 0000000..4301c90
--- /dev/null
@@ -0,0 +1,66 @@
+//
+// Copyright (c) 2014 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+#ifndef __TCT_D2D_CONV_MANAGER_NATIVE_H__
+#define __TCT_D2D_CONV_MANAGER_NATIVE_H__
+
+#include "testcase.h"
+#include "tct_common.h"
+
+extern void ITs_d2d_conv_manager_startup(void);
+extern void ITs_d2d_conv_manager_cleanup(void);
+extern void ITs_d2d_conv_service_startup(void);
+extern void ITs_d2d_conv_service_cleanup(void);
+extern void ITs_d2d_conv_payload_startup(void);
+extern void ITs_d2d_conv_payload_cleanup(void);
+extern void ITs_d2d_conv_channel_startup(void);
+extern void ITs_d2d_conv_channel_cleanup(void);
+
+extern int ITc_d2d_conv_create_destroy_p(void);
+extern int ITc_d2d_conv_discovery_start_stop_p(void);
+extern int ITc_d2d_conv_service_create_destroy_p(void);
+extern int ITc_d2d_conv_service_clone_p(void);
+extern int ITc_d2d_conv_service_set_get_property_string_p(void);
+extern int ITc_d2d_conv_service_get_connection_state_p(void);
+extern int ITc_d2d_conv_service_set_get_type_p(void);
+extern int ITc_d2d_conv_service_read_p(void);
+extern int ITc_d2d_conv_service_set_unset_listener_cb_p(void);
+extern int ITc_d2d_conv_payload_create_destroy_p(void);
+extern int ITc_d2d_conv_payload_set_get_string_p(void);
+extern int ITc_d2d_conv_payload_set_get_app_control_p(void);
+extern int ITc_d2d_conv_payload_set_get_byte_p(void);
+extern int ITc_d2d_conv_channel_create_destroy_p(void);
+extern int ITc_d2d_conv_channel_set_get_string_p(void);
+
+testcase tc_array[] = {
+    {"ITc_d2d_conv_create_destroy_p", ITc_d2d_conv_create_destroy_p, ITs_d2d_conv_manager_startup, ITs_d2d_conv_manager_cleanup},
+    {"ITc_d2d_conv_discovery_start_stop_p", ITc_d2d_conv_discovery_start_stop_p, ITs_d2d_conv_manager_startup, ITs_d2d_conv_manager_cleanup},
+       {"ITc_d2d_conv_service_create_destroy_p", ITc_d2d_conv_service_create_destroy_p, ITs_d2d_conv_manager_startup, ITs_d2d_conv_manager_cleanup},
+       {"ITc_d2d_conv_service_clone_p", ITc_d2d_conv_service_clone_p, ITs_d2d_conv_manager_startup, ITs_d2d_conv_manager_cleanup},
+       {"ITc_d2d_conv_service_set_get_property_string_p", ITc_d2d_conv_service_set_get_property_string_p, ITs_d2d_conv_manager_startup, ITs_d2d_conv_manager_cleanup},
+       {"ITc_d2d_conv_service_get_connection_state_p", ITc_d2d_conv_service_get_connection_state_p, ITs_d2d_conv_manager_startup, ITs_d2d_conv_manager_cleanup},
+       {"ITc_d2d_conv_service_set_get_type_p", ITc_d2d_conv_service_set_get_type_p, ITs_d2d_conv_manager_startup, ITs_d2d_conv_manager_cleanup},
+       {"ITc_d2d_conv_service_read_p", ITc_d2d_conv_service_read_p, ITs_d2d_conv_manager_startup, ITs_d2d_conv_manager_cleanup},
+       {"ITc_d2d_conv_service_set_unset_listener_cb_p", ITc_d2d_conv_service_set_unset_listener_cb_p, ITs_d2d_conv_manager_startup, ITs_d2d_conv_manager_cleanup},     
+       {"ITc_d2d_conv_payload_create_destroy_p", ITc_d2d_conv_payload_create_destroy_p, ITs_d2d_conv_payload_startup, ITs_d2d_conv_payload_cleanup},
+       {"ITc_d2d_conv_payload_set_get_string_p", ITc_d2d_conv_payload_set_get_string_p, ITs_d2d_conv_payload_startup, ITs_d2d_conv_payload_cleanup},
+       {"ITc_d2d_conv_payload_set_get_app_control_p", ITc_d2d_conv_payload_set_get_app_control_p, ITs_d2d_conv_payload_startup, ITs_d2d_conv_payload_cleanup},
+       {"ITc_d2d_conv_payload_set_get_byte_p", ITc_d2d_conv_payload_set_get_byte_p, ITs_d2d_conv_payload_startup, ITs_d2d_conv_payload_cleanup},       
+       {"ITc_d2d_conv_channel_create_destroy_p", ITc_d2d_conv_channel_create_destroy_p, ITs_d2d_conv_channel_startup, ITs_d2d_conv_channel_cleanup},
+       {"ITc_d2d_conv_channel_set_get_string_p", ITc_d2d_conv_channel_set_get_string_p, ITs_d2d_conv_channel_startup, ITs_d2d_conv_channel_cleanup},
+    {NULL, NULL}
+};
+
+#endif // __TCT_D2D_CONV_MANAGER_NATIVE_H__
diff --git a/src/itc/d2d-conv-manager/tct-d2d-conv-manager-native_wearable.h b/src/itc/d2d-conv-manager/tct-d2d-conv-manager-native_wearable.h
new file mode 100644 (file)
index 0000000..4301c90
--- /dev/null
@@ -0,0 +1,66 @@
+//
+// Copyright (c) 2014 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+#ifndef __TCT_D2D_CONV_MANAGER_NATIVE_H__
+#define __TCT_D2D_CONV_MANAGER_NATIVE_H__
+
+#include "testcase.h"
+#include "tct_common.h"
+
+extern void ITs_d2d_conv_manager_startup(void);
+extern void ITs_d2d_conv_manager_cleanup(void);
+extern void ITs_d2d_conv_service_startup(void);
+extern void ITs_d2d_conv_service_cleanup(void);
+extern void ITs_d2d_conv_payload_startup(void);
+extern void ITs_d2d_conv_payload_cleanup(void);
+extern void ITs_d2d_conv_channel_startup(void);
+extern void ITs_d2d_conv_channel_cleanup(void);
+
+extern int ITc_d2d_conv_create_destroy_p(void);
+extern int ITc_d2d_conv_discovery_start_stop_p(void);
+extern int ITc_d2d_conv_service_create_destroy_p(void);
+extern int ITc_d2d_conv_service_clone_p(void);
+extern int ITc_d2d_conv_service_set_get_property_string_p(void);
+extern int ITc_d2d_conv_service_get_connection_state_p(void);
+extern int ITc_d2d_conv_service_set_get_type_p(void);
+extern int ITc_d2d_conv_service_read_p(void);
+extern int ITc_d2d_conv_service_set_unset_listener_cb_p(void);
+extern int ITc_d2d_conv_payload_create_destroy_p(void);
+extern int ITc_d2d_conv_payload_set_get_string_p(void);
+extern int ITc_d2d_conv_payload_set_get_app_control_p(void);
+extern int ITc_d2d_conv_payload_set_get_byte_p(void);
+extern int ITc_d2d_conv_channel_create_destroy_p(void);
+extern int ITc_d2d_conv_channel_set_get_string_p(void);
+
+testcase tc_array[] = {
+    {"ITc_d2d_conv_create_destroy_p", ITc_d2d_conv_create_destroy_p, ITs_d2d_conv_manager_startup, ITs_d2d_conv_manager_cleanup},
+    {"ITc_d2d_conv_discovery_start_stop_p", ITc_d2d_conv_discovery_start_stop_p, ITs_d2d_conv_manager_startup, ITs_d2d_conv_manager_cleanup},
+       {"ITc_d2d_conv_service_create_destroy_p", ITc_d2d_conv_service_create_destroy_p, ITs_d2d_conv_manager_startup, ITs_d2d_conv_manager_cleanup},
+       {"ITc_d2d_conv_service_clone_p", ITc_d2d_conv_service_clone_p, ITs_d2d_conv_manager_startup, ITs_d2d_conv_manager_cleanup},
+       {"ITc_d2d_conv_service_set_get_property_string_p", ITc_d2d_conv_service_set_get_property_string_p, ITs_d2d_conv_manager_startup, ITs_d2d_conv_manager_cleanup},
+       {"ITc_d2d_conv_service_get_connection_state_p", ITc_d2d_conv_service_get_connection_state_p, ITs_d2d_conv_manager_startup, ITs_d2d_conv_manager_cleanup},
+       {"ITc_d2d_conv_service_set_get_type_p", ITc_d2d_conv_service_set_get_type_p, ITs_d2d_conv_manager_startup, ITs_d2d_conv_manager_cleanup},
+       {"ITc_d2d_conv_service_read_p", ITc_d2d_conv_service_read_p, ITs_d2d_conv_manager_startup, ITs_d2d_conv_manager_cleanup},
+       {"ITc_d2d_conv_service_set_unset_listener_cb_p", ITc_d2d_conv_service_set_unset_listener_cb_p, ITs_d2d_conv_manager_startup, ITs_d2d_conv_manager_cleanup},     
+       {"ITc_d2d_conv_payload_create_destroy_p", ITc_d2d_conv_payload_create_destroy_p, ITs_d2d_conv_payload_startup, ITs_d2d_conv_payload_cleanup},
+       {"ITc_d2d_conv_payload_set_get_string_p", ITc_d2d_conv_payload_set_get_string_p, ITs_d2d_conv_payload_startup, ITs_d2d_conv_payload_cleanup},
+       {"ITc_d2d_conv_payload_set_get_app_control_p", ITc_d2d_conv_payload_set_get_app_control_p, ITs_d2d_conv_payload_startup, ITs_d2d_conv_payload_cleanup},
+       {"ITc_d2d_conv_payload_set_get_byte_p", ITc_d2d_conv_payload_set_get_byte_p, ITs_d2d_conv_payload_startup, ITs_d2d_conv_payload_cleanup},       
+       {"ITc_d2d_conv_channel_create_destroy_p", ITc_d2d_conv_channel_create_destroy_p, ITs_d2d_conv_channel_startup, ITs_d2d_conv_channel_cleanup},
+       {"ITc_d2d_conv_channel_set_get_string_p", ITc_d2d_conv_channel_set_get_string_p, ITs_d2d_conv_channel_startup, ITs_d2d_conv_channel_cleanup},
+    {NULL, NULL}
+};
+
+#endif // __TCT_D2D_CONV_MANAGER_NATIVE_H__