From: Shobhit Verma Date: Tue, 3 Oct 2023 09:03:20 +0000 (+0530) Subject: [ITC][email][ACR-1794] Removed deprecated module X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4fb9b436e59d2990122e9466f08fba8d4fa50db9;p=test%2Ftct%2Fnative%2Fapi.git [ITC][email][ACR-1794] Removed deprecated module Change-Id: I39c8bb7c3357f5cdc5d88d59b9f0eb620693e0bc Signed-off-by: Shobhit Verma --- diff --git a/packaging/itc/native-email-itc.spec b/packaging/itc/native-email-itc.spec deleted file mode 100755 index 25d6575ec..000000000 --- a/packaging/itc/native-email-itc.spec +++ /dev/null @@ -1,100 +0,0 @@ -%define MODULE_NAME email -%define MODULE_LIBNAME capi-messaging-email -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(elementary) -BuildRequires: pkgconfig(dlog) -BuildRequires: pkgconfig(glib-2.0) -BuildRequires: cmake -BuildRequires: pkgconfig(bundle) -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 %{?ASAN_BUILD:1}0 - %if %{?DEVICE_BUILD_TYPE_MOBILE:1}0 - cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="mobile" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix} - %endif - %if %{?DEVICE_BUILD_TYPE_WEARABLE:1}0 - cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="wearable" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix} - %endif - %if %{?DEVICE_BUILD_TYPE_TV:1}0 - cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="tv" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix} - %endif - %if %{?DEVICE_BUILD_TYPE_TIZENIOT:1}0 - cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="tizeniot" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix} - %endif -%else - %if %{?DEVICE_BUILD_TYPE_MOBILE:1}0 - cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="mobile" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix} - %endif - %if %{?DEVICE_BUILD_TYPE_WEARABLE:1}0 - cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="wearable" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix} - %endif - %if %{?DEVICE_BUILD_TYPE_TV:1}0 - cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="tv" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix} - %endif - %if %{?DEVICE_BUILD_TYPE_TIZENIOT:1}0 - cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="tizeniot" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix} - %endif -%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 -#cp templates/external_wrapper.sh %{buildroot}%{APP_PATH}%{name}/bin - -mkdir -p %{buildroot}%{APP_PATH}%{name}/data/ - -%if %{?DEVICE_BUILD_TYPE_MOBILE:1}0 -cp src/itc/email/res/mobile/Image_01.jpg %{buildroot}%{APP_PATH}%{name}/data/Image_01.jpg -%endif - -%if %{?DEVICE_BUILD_TYPE_WEARABLE:1}0 -cp src/itc/email/res/wearable/Image_01.jpg %{buildroot}%{APP_PATH}%{name}/data/Image_01.jpg -%endif - -%if %{?DEVICE_BUILD_TYPE_TV:1}0 -cp src/itc/email/res/tv/Image_01.jpg %{buildroot}%{APP_PATH}%{name}/data/Image_01.jpg -%endif - -%if %{?DEVICE_BUILD_TYPE_TIZENIOT:1}0 -cp src/itc/email/res/tizeniot/Image_01.jpg %{buildroot}%{APP_PATH}%{name}/data/Image_01.jpg -%endif - -%post -chown -R 5000:5000 %{APP_PATH}%{name}/data -chsmack -a %{name} %{APP_PATH}%{name}/data -chmod 777 %{APP_PATH}%{name}/data/Image_01.jpg -chsmack -a _ %{APP_PATH}%{name}/data/Image_01.jpg - -%postun - -%files -%{APP_PATH}%{name}/* -/usr/share/packages/native-%{MODULE_NAME}-itc.xml -/usr/share/license/%{name} diff --git a/packaging/itc/native-email-itc.xml b/packaging/itc/native-email-itc.xml deleted file mode 100755 index 06773371d..000000000 --- a/packaging/itc/native-email-itc.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - test - Native API test Application - - - - - - - - - - http://tizen.org/privilege/email - http://tizen.org/privilege/mediastorage - - diff --git a/scripts_tpk/spec.sh b/scripts_tpk/spec.sh index 31c9551d6..cdcd28d76 100755 --- a/scripts_tpk/spec.sh +++ b/scripts_tpk/spec.sh @@ -230,17 +230,6 @@ case "$1" in chsmack -a "User::App::Shared" $APP_DATA_DIR/* chsmack -e "User::App::Shared" $APP_DATA_DIR/* ;; - "org.tizen.email-native-itc") - echo "Installing pre-requisites for the package $1" - mkdir -p $APP_DATA_DIR - chsmack -a "User::App::Shared" $APP_DATA_DIR - chsmack -e "User::App::Shared" $APP_DATA_DIR - cp Image_01.jpg $APP_DATA_DIR/Image_01.jpg - chown -R 5000:5000 $APP_DATA_DIR - chmod -R 777 $APP_DATA_DIR - chsmack -a "User::App::Shared" $APP_DATA_DIR/* - chsmack -e "User::App::Shared" $APP_DATA_DIR/* - ;; "org.tizen.image-util-native-itc") echo "Installing pre-requisites for the package $1" mkdir -p $APP_DATA_DIR diff --git a/scripts_tpk/tizeniot_service_modules.txt b/scripts_tpk/tizeniot_service_modules.txt index bdf7b087a..07e526c73 100755 --- a/scripts_tpk/tizeniot_service_modules.txt +++ b/scripts_tpk/tizeniot_service_modules.txt @@ -16,7 +16,6 @@ context data-control device dlog -email http image-util iotcon diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index feb50af53..61b59cd06 100755 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -239,8 +239,6 @@ ELSE( DEFINED MODULE ) ADD_SUBDIRECTORY(itc/dlog) MESSAGE(STATUS "Building: ${CMAKE_CURRENT_SOURCE_DIR}/itc/efl-util") ADD_SUBDIRECTORY(itc/efl-util) - MESSAGE(STATUS "Building: ${CMAKE_CURRENT_SOURCE_DIR}/itc/email") - ADD_SUBDIRECTORY(itc/email) MESSAGE(STATUS "Building: ${CMAKE_CURRENT_SOURCE_DIR}/itc/image-util") ADD_SUBDIRECTORY(itc/image-util) MESSAGE(STATUS "Building: ${CMAKE_CURRENT_SOURCE_DIR}/itc/key-manager") diff --git a/src/itc/email/CMakeLists.txt b/src/itc/email/CMakeLists.txt deleted file mode 100755 index 5d3b13455..000000000 --- a/src/itc/email/CMakeLists.txt +++ /dev/null @@ -1,41 +0,0 @@ -SET(PKG_NAME "email") - -SET(EXEC_NAME "tct-${PKG_NAME}-native") -SET(RPM_NAME "native-${PKG_NAME}-itc") - -SET(CAPI_LIB "capi-messaging-email") -SET(TC_SOURCES - ITs-email-common.c - ITs-email.c -) - -PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED - ${CAPI_LIB} - capi-appfw-application - bundle - capi-system-info - glib-2.0 - dlog -) - -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 -) - -IF( DEFINED ASAN ) -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -Wall -pie -g -fsanitize=address -fsanitize-recover=address -U_FORTIFY_SOURCE -fno-omit-frame-pointer") -SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib -Wl,-fsanitize=address") -ELSE() -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -g -fPIE -Wall") -SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib -pie") -ENDIF() diff --git a/src/itc/email/ITs-email-common.c b/src/itc/email/ITs-email-common.c deleted file mode 100755 index ab6a76435..000000000 --- a/src/itc/email/ITs-email-common.c +++ /dev/null @@ -1,176 +0,0 @@ -// -// 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-email-common.h" - -/** @addtogroup itc-email -* @ingroup itc -* @{ -*/ - -extern char g_pstrRecipient[CONFIG_VALUE_LEN_MAX]; - -//Add helper function definitions here - -/** -* @function EmailGetError -* @description Maps error enums to string values -* @parameter nRet : error code returned -* @return error string -*/ -char* EmailGetError(int nRet) -{ - char *szErrorVal = NULL; - - switch ( nRet ) - { - case EMAILS_ERROR_NONE: szErrorVal = "EMAILS_ERROR_NONE"; break; - case EMAILS_ERROR_OUT_OF_MEMORY: szErrorVal = "EMAILS_ERROR_OUT_OF_MEMORY"; break; - case EMAILS_ERROR_INVALID_PARAMETER: szErrorVal = "EMAILS_ERROR_INVALID_PARAMETER"; break; - case EMAILS_ERROR_SERVER_NOT_READY: szErrorVal = "EMAILS_ERROR_SERVER_NOT_READY"; break; - case EMAILS_ERROR_COMMUNICATION_WITH_SERVER_FAILED: szErrorVal = "EMAILS_ERROR_COMMUNICATION_WITH_SERVER_FAILED"; break; - case EMAILS_ERROR_OPERATION_FAILED: szErrorVal = "EMAILS_ERROR_OPERATION_FAILED"; break; - case EMAILS_ERROR_ACCOUNT_NOT_FOUND: szErrorVal = "EMAILS_ERROR_ACCOUNT_NOT_FOUND"; break; - case EMAILS_ERROR_DB_FAILED: szErrorVal = "EMAILS_ERROR_DB_FAILED"; break; - case EMAILS_ERROR_PERMISSION_DENIED: szErrorVal = "EMAILS_ERROR_PERMISSION_DENIED"; break; - case EMAILS_ERROR_NOT_SUPPORTED: szErrorVal = "EMAILS_ERROR_NOT_SUPPORTED"; break;//ACR 992 - - - default: szErrorVal = "Undefined Error"; break; - } - - return szErrorVal; -} - -/** -* @function EmailGetRecipientType -* @description Maps recipient type enums to string values -* @parameter nRecipient : Recipient type -* @return Recipient type string -*/ -char* EmailGetRecipientType(int nRecipient) -{ - char* szRecipientType = NULL; - - switch ( nRecipient ) - { - case EMAIL_RECIPIENT_TYPE_TO: szRecipientType = "EMAIL_RECIPIENT_TYPE_TO"; break; - case EMAIL_RECIPIENT_TYPE_CC: szRecipientType = "EMAIL_RECIPIENT_TYPE_CC"; break; - case EMAIL_RECIPIENT_TYPE_BCC: szRecipientType = "EMAIL_RECIPIENT_TYPE_BCC"; break; - default: szRecipientType = "Unknown Recipient Type"; break; - } - - return szRecipientType; -} - -bool CreateEmailMessageWithoutAttachment(email_h email) -{ - /* Set Email Message Subject */ - int nRet = email_set_subject(email, EMAILSUBJECT); - if ( nRet != EMAILS_ERROR_NONE ) - { - FPRINTF("[Line : %d][%s] email_set_subject failed, error returned = %s\\n", __LINE__, API_NAMESPACE, EmailGetError(nRet)); - return false; - } - - /* Set Email Message Body */ - nRet = email_set_body(email, EMAILBODY); - if ( nRet != EMAILS_ERROR_NONE ) - { - FPRINTF("[Line : %d][%s] email_set_body failed, error returned = %s\\n", __LINE__, API_NAMESPACE, EmailGetError(nRet)); - return false; - } - - /* Add Email Message Recipient */ - nRet = email_add_recipient(email, EMAIL_RECIPIENT_TYPE_TO, g_pstrRecipient); - if ( nRet != EMAILS_ERROR_NONE) - { - FPRINTF("[Line : %d][%s] email_add_recipient failed, error returned = %s\\n", __LINE__, API_NAMESPACE, EmailGetError(nRet)); - return false; - } - - return true; -} - -bool CreateEmailMessageWithAttachment(email_h email) { - bool bRet = CreateEmailMessageWithoutAttachment(email); - if ( bRet == false ) - { - FPRINTF("[Line : %d][%s] failed to create email message without attachment\\n", __LINE__, API_NAMESPACE); - return false; - } - - /* Add Attachment to the Email Message */ - char *pszImagePath = EmailGetDataPath(IMAGE_NAME); - if(pszImagePath == NULL) - { - FPRINTF("[Line : %d][%s] EmailGetDataPath failed,\\n", __LINE__, API_NAMESPACE); - return false; - } - int nRet = email_add_attach(email, pszImagePath); - if ( nRet != EMAILS_ERROR_NONE ) - { - FPRINTF("[Line : %d][%s] email_add_attach failed, error returned = %s\\n", __LINE__, API_NAMESPACE, EmailGetError(nRet)); - FREE_MEMORY(pszImagePath); - return false; - } - FREE_MEMORY(pszImagePath); - return true; -} - -bool SendEmailMessageWithoutAttachment(email_h email) -{ - bool bRet = CreateEmailMessageWithoutAttachment(email); - if ( bRet == false ) - { - FPRINTF("[Line : %d][%s] failed to create email message without attachment\\n", __LINE__, API_NAMESPACE); - return false; - } - - /* Send Email Message */ - int nRet = email_send_message(email, true); - if ( nRet != EMAILS_ERROR_NONE ) - { - FPRINTF("[Line : %d][%s] email_send_message failed, error returned = %s\\n", __LINE__, API_NAMESPACE, EmailGetError(nRet)); - return false; - } - - return true; -} - -/** -* @function EmailGetDataPath -* @description Get the path to application data directory -* @parameter [IN] char* pszFileName [file name] -* @return NA -*/ -char* EmailGetDataPath(char *pszFileName) -{ - char *pszAppData = app_get_data_path(),*pszImgPath = NULL; - if ( pszAppData == NULL || strlen(pszAppData) == 0 ) - { - FPRINTF("[Line : %d][%s] app_get_data_path() returned invalid path\\n", __LINE__, API_NAMESPACE); - return pszImgPath; - } - - pszImgPath = (char*) calloc(1, strlen(pszAppData) + strlen(pszFileName) + 1); - if(pszImgPath == NULL) - return pszImgPath; - snprintf(pszImgPath, strlen(pszAppData) + strlen(pszFileName) + 1, "%s%s",pszAppData, pszFileName ); - FPRINTF("[Line : %d][%s] app_get_data_path() is %s\\n", __LINE__, API_NAMESPACE, pszImgPath); - return pszImgPath; -} - -/** @} */ diff --git a/src/itc/email/ITs-email-common.h b/src/itc/email/ITs-email-common.h deleted file mode 100755 index a5c3c0246..000000000 --- a/src/itc/email/ITs-email-common.h +++ /dev/null @@ -1,106 +0,0 @@ -// -// 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_EMAIL_COMMON_H_ -#define _ITS_EMAIL_COMMON_H_ - -//Add test package related includes here - -#include "tct_common.h" - -#include -#include - -#include -#include - -/** @addtogroup itc-email -* @ingroup itc -* @{ -*/ - -#define API_NAMESPACE "EMAIL_ITC" -#define TIMEOUT_CB 30000 -#define PATH_LEN 1024 - -#define ACCOUNT_USERNAME sbrcsrbdtest@gmail.com -#define ACCOUNT_PASSWORD root080233 -#define EMAILSUBJECT "Sample E-Mail Subject" -#define EMAILBODY "Sample E-Mail Body Text" -#define EMAILADDRESS "sbrcsrbdtest@gmail.com" //password : root080233 -#define IMAGE_NAME "Image_01.jpg" - -#define TELEPHONY_FEATURE "http://tizen.org/feature/network.telephony" -#define WIFI_FEATURE "http://tizen.org/feature/network.wifi" -#define EMAIL_FEATURE "http://tizen.org/feature/email" //Mail feature ACR 992 - - -#define START_TEST {\ - FPRINTF("[Line : %d][%s] Starting test : %s\\n", __LINE__, API_NAMESPACE, __FUNCTION__);\ - if(g_eEmailNotSupported)\ - {\ - FPRINTF("[Line : %d][%s] Feature =%s not supported :success ", __LINE__, API_NAMESPACE,EMAIL_FEATURE);\ - return 0;\ - }\ - else if (g_eEmailMismatch)\ - {\ - FPRINTF("[Line : %d][%s] Precondition of email feature=%s:Mismatch,failure ", __LINE__, API_NAMESPACE,EMAIL_FEATURE);\ - return 1;\ - }\ - if ( !g_bEmailCreation )\ - {\ - FPRINTF("[Line : %d][%s] Precondition of email message handle creation failed. So leaving test ", __LINE__, API_NAMESPACE);\ - return 1;\ - }\ -} - -#define RUN_POLLING_LOOP {\ - g_pEmailMainLoop = g_main_loop_new(NULL, false);\ - nEmailTimeoutId = g_timeout_add(TIMEOUT_CB, EmailTimeout, g_pEmailMainLoop);\ - g_main_loop_run(g_pEmailMainLoop);\ - g_source_remove(nEmailTimeoutId);\ - g_pEmailMainLoop = NULL;\ -} - -GMainLoop *g_pEmailMainLoop; -email_h g_hEmail; - -bool g_bIsEmailSendFeatureSupported; -bool g_bEmailCreation; -bool g_bCallbackOccurred; -bool g_bEmailSentSuccess; - -bool g_eEmailNotSupported; -bool g_eEmailMismatch; - - -// Maps error enums to string values -char* EmailGetError(int nRet); - -// Maps recipient type enums to string values -char* EmailGetRecipientType(int nRecipient); - -// Create email message without attachment -bool CreateEmailMessageWithoutAttachment(email_h email); - -// Create email message with attachment -bool CreateEmailMessageWithAttachment(email_h email); - -// Get the path to application data directory -char* EmailGetDataPath(char *pszFileName); - -/** @} */ - -#endif //_ITS_EMAIL_COMMON_H_ diff --git a/src/itc/email/ITs-email.c b/src/itc/email/ITs-email.c deleted file mode 100755 index e8d260fff..000000000 --- a/src/itc/email/ITs-email.c +++ /dev/null @@ -1,678 +0,0 @@ -// -// 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-email-common.h" - -/** @addtogroup itc-email -* @ingroup itc -* @{ -*/ - -//& set: Email - -char g_pstrRecipient[CONFIG_VALUE_LEN_MAX] = {0,}; - -/** -* @function ITs_email_startup -* @description Called before each test, creates email handle -* @parameter NA -* @return NA -*/ -void ITs_email_startup(void) -{ - struct stat stBuff; - g_eEmailNotSupported=false; - g_eEmailMismatch =false; - if ( stat(ERR_LOG, &stBuff) == 0 ) - { - remove(ERR_LOG); - } - -#if DEBUG - FPRINTF("[Line : %d][%s] TEST SUIT start-up: ITs_Messaging_Email_p\\n", __LINE__, API_NAMESPACE); -#endif - //Create Email Message Handle - - g_bIsEmailSendFeatureSupported = TCTCheckSystemInfoFeatureSupported(EMAIL_FEATURE, API_NAMESPACE); - - int nRet = email_create_message(&g_hEmail); - - if(! g_bIsEmailSendFeatureSupported ) - { - if(nRet == EMAILS_ERROR_NOT_SUPPORTED) - { - FPRINTF("[Line : %d][%s] email_create_message() returned %s error for unsupported feature :success \\n", __LINE__, API_NAMESPACE, EmailGetError(nRet)); - g_eEmailNotSupported=true; - } - else - { - FPRINTF("[Line : %d][%s] email_create_message() returned %s error for unsupported feature,error mismatch :Failure \\n", __LINE__, API_NAMESPACE, EmailGetError(nRet)); - g_eEmailMismatch=true; - } - return ; - } - - if ( nRet == EMAILS_ERROR_NONE ) - { - FPRINTF("[Line : %d][%s] Email message handle created successfully in precondition\\n", __LINE__, API_NAMESPACE); - g_bEmailCreation = true; - - //Initialize recipient email address value from configuration file - if ( true == GetValueFromConfigFile("EMAIL_RECIPIENT", g_pstrRecipient, API_NAMESPACE) ) - { -#if DEBUG - FPRINTF("[Line : %d][%s] Values Received = %s\\n", __LINE__, API_NAMESPACE, g_pstrRecipient); -#endif - } - else - { - FPRINTF("[Line : %d][%s] GetValueFromConfigFile returned error in start-up\\n", __LINE__, API_NAMESPACE); - - strncpy(g_pstrRecipient, EMAILADDRESS, CONFIG_VALUE_LEN_MAX-1); - FPRINTF("[Line : %d][%s] Using recipient address : %s\\n", __LINE__, API_NAMESPACE, EMAILADDRESS); - } - } - else - { - FPRINTF("[Line : %d][%s] Unable to create email message handle, error returned = %s\\n", __LINE__, API_NAMESPACE, EmailGetError(nRet)); - g_bEmailCreation = false; - } - - g_bIsEmailSendFeatureSupported = TCTCheckSystemInfoFeatureSupported(TELEPHONY_FEATURE, API_NAMESPACE) || - TCTCheckSystemInfoFeatureSupported(WIFI_FEATURE, API_NAMESPACE); -} - -/** -* @function ITs_email_cleanup -* @description Called after each test, destroys email handle -* @parameter NA -* @return NA -*/ -void ITs_email_cleanup(void) -{ -#if DEBUG - FPRINTF("[Line : %d][%s] TEST SUIT clean-up: ITs_Messaging_Email_p\\n", __LINE__, API_NAMESPACE); -#endif - - //Destroy Email Message Handle - if ( g_hEmail != NULL ) - { - int nRet = email_destroy_message(g_hEmail); - if ( nRet == 0 ) - { - FPRINTF("[Line : %d][%s] Email message handle destroyed successfully\\n", __LINE__, API_NAMESPACE); - } - else - { - FPRINTF("[Line : %d][%s] Unable to destroy email message handle, error returned = %s\\n", __LINE__, API_NAMESPACE, EmailGetError(nRet)); - } - } -} - -/** -* @function EmailTimeout -* @description Called if some callback is not invoked for a particular EmailTimeout -* @parameter gpointer data -* @return gboolean -*/ -gboolean EmailTimeout(gpointer data) -{ - GMainLoop *pMainLoop = (GMainLoop *) data; - if ( pMainLoop != NULL ) - { - g_main_loop_quit(g_pEmailMainLoop); - g_main_loop_unref(g_pEmailMainLoop); - g_pEmailMainLoop = NULL; - } - - FPRINTF("[Line : %d][%s] Callback Time-out\\n", __LINE__, API_NAMESPACE); - return false; -} - -void email_message_sent_callback(email_h email, email_sending_e result, void *user_data) -{ - FPRINTF("[Line : %d][%s] Callback invoked: email_message_sent_callback \\n", __LINE__, API_NAMESPACE); - g_bCallbackOccurred = true; - - if ( email == NULL ) - { - FPRINTF("[Line : %d][%s] email is NULL in callback email_message_sent_callback\\n", __LINE__, API_NAMESPACE); - if ( g_pEmailMainLoop ) - { - g_main_loop_quit(g_pEmailMainLoop); - g_main_loop_unref(g_pEmailMainLoop); - g_pEmailMainLoop = NULL; - } - return; - } - - if ( result == EMAIL_SENDING_SUCCEEDED ) - { - FPRINTF("[Line : %d][%s] email_send_message succeeded\\n", __LINE__, API_NAMESPACE); - g_bEmailSentSuccess = true; - } - else if ( result == EMAIL_SENDING_FAILED ) - { - FPRINTF("[Line : %d][%s] email_send_message failed\\n", __LINE__, API_NAMESPACE); - g_bEmailSentSuccess = false; - } - - if ( g_pEmailMainLoop ) - { - g_main_loop_quit(g_pEmailMainLoop); - g_main_loop_unref(g_pEmailMainLoop); - g_pEmailMainLoop = NULL; - } -} - - -/** @addtogroup itc-email-testcases -* @brief Integration testcases for module email -* @ingroup itc-email -* @{ -*/ - -//& purpose Adds and removes attachment to an email message -//& type: auto -/** -* @testcase ITc_email_add_remove_attach_p -* @since_tizen 2.3 -* @author SRID(gupta.sanjay) -* @reviewer SRID(ravi.kumar2) -* @type auto -* @description Adds and removes attachment to an email message -* @scenario Creates an email message\n -* Adds a file as an attachment\n -* Removes the attachment\n -* Destroys the email message -* @apicovered email_add_attach, email_remove_all_attachments -* @passcase If adds and removes the attachment to the email message successfully -* @failcase If fails to add and remove attachment to the email message -* @precondition NA -* @postcondition NA -*/ -int ITc_email_add_remove_attach_p(void) -{ - START_TEST; - - //Target API - /**** Add Attachment to the Email Message ****/ - char *pszImagePath = EmailGetDataPath(IMAGE_NAME); - if(pszImagePath == NULL) - { - FPRINTF("[Line : %d][%s] EmailGetDataPath failed,\\n", __LINE__, API_NAMESPACE); - return 1; - } - int nRet = email_add_attach(g_hEmail, pszImagePath); - PRINT_RESULT_CLEANUP(EMAILS_ERROR_NONE, nRet, "email_add_attach", EmailGetError(nRet),FREE_MEMORY(pszImagePath)); - - //Target API - /**** Clears All Attachments of the Email Message ****/ - nRet = email_remove_all_attachments(g_hEmail); - PRINT_RESULT_CLEANUP(EMAILS_ERROR_NONE, nRet, "email_remove_all_attachments", EmailGetError(nRet),FREE_MEMORY(pszImagePath)); - - FREE_MEMORY(pszImagePath); - - return 0; -} - -//& purpose Adds and removes recipient to an email message -//& type: auto -/** -* @testcase ITc_email_add_remove_recipient_p -* @since_tizen 2.3 -* @author SRID(gupta.sanjay) -* @reviewer SRID(ravi.kumar2) -* @type auto -* @description Adds and removes recipient to an email message -* @scenario Creates an email message\n -* Adds a recipient\n -* Removes the recipient\n -* Destroys the email message -* @apicovered email_add_recipient, email_remove_all_recipients -* @passcase If adds and removes the recipient to the email message successfully -* @failcase If fails to add and remove recipient to the email message -* @precondition NA -* @postcondition NA -*/ -int ITc_email_add_remove_recipient_p(void) -{ - START_TEST; - - email_recipient_type_e recipient_type[] = { EMAIL_RECIPIENT_TYPE_TO, EMAIL_RECIPIENT_TYPE_CC, EMAIL_RECIPIENT_TYPE_BCC }; - int enum_size = sizeof(recipient_type) / sizeof(recipient_type[0]); - int enum_counter = 0; - - for ( enum_counter=0; enum_counter -#include -#include "tct_common.h" - -#ifdef MOBILE //Starts MOBILE -#include "tct-email-native_mobile.h" -#endif //MOBILE //End MOBILE - -#ifdef WEARABLE //Starts WEARABLE -#include "tct-email-native_wearable.h" -#endif //WEARABLE //End WEARABLE - -#ifdef TV //Starts TV -#include "tct-email-native_tv.h" -#endif //TV //End TV - -#ifdef TIZENIOT //Starts TIZENIOT -#include "tct-email-native_tizeniot.h" -#endif //TIZENIOT //End TIZENIOT - - -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -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)) ) - { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Startup begin", pszGetTCName); - if ( tc_array[i].startup ) - { - tc_array[i].startup(); - } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Startup end", pszGetTCName); - - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body begin", pszGetTCName); - result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body end", pszGetTCName); - - dlog_print(DLOG_INFO, "NativeTCT", "%s : Cleanup begin", pszGetTCName); - if ( tc_array[i].cleanup ) - { - tc_array[i].cleanup(); - } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Cleanup end", pszGetTCName); - 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; - - 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, NULL); - 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/email/tct-email-native_mobile.h b/src/itc/email/tct-email-native_mobile.h deleted file mode 100755 index 7da9e85ef..000000000 --- a/src/itc/email/tct-email-native_mobile.h +++ /dev/null @@ -1,48 +0,0 @@ -// -// 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_EMAIL-NATIVE_H__ -#define __TCT_EMAIL-NATIVE_H__ - -#include "testcase.h" -#include "tct_common.h" - -extern void ITs_email_startup(void); -extern void ITs_email_cleanup(void); - -extern int ITc_email_add_remove_attach_p(void); -extern int ITc_email_add_remove_recipient_p(void); -extern int ITc_email_create_destroy_message_p(void); -extern int ITc_email_save_message_p(void); -extern int ITc_email_send_message_with_attachment_p(void); -extern int ITc_email_send_message_without_attachment_p(void); -extern int ITc_email_set_body_p(void); -extern int ITc_email_set_unset_message_sent_cb_p(void); -extern int ITc_email_set_subject_p(void); - -testcase tc_array[] = { - {"ITc_email_add_remove_attach_p",ITc_email_add_remove_attach_p,ITs_email_startup,ITs_email_cleanup}, - {"ITc_email_add_remove_recipient_p",ITc_email_add_remove_recipient_p,ITs_email_startup,ITs_email_cleanup}, - {"ITc_email_create_destroy_message_p",ITc_email_create_destroy_message_p,ITs_email_startup,ITs_email_cleanup}, - {"ITc_email_save_message_p",ITc_email_save_message_p,ITs_email_startup,ITs_email_cleanup}, - {"ITc_email_send_message_with_attachment_p",ITc_email_send_message_with_attachment_p,ITs_email_startup,ITs_email_cleanup}, - {"ITc_email_send_message_without_attachment_p",ITc_email_send_message_without_attachment_p,ITs_email_startup,ITs_email_cleanup}, - {"ITc_email_set_body_p",ITc_email_set_body_p,ITs_email_startup,ITs_email_cleanup}, - {"ITc_email_set_unset_message_sent_cb_p",ITc_email_set_unset_message_sent_cb_p,ITs_email_startup,ITs_email_cleanup}, - {"ITc_email_set_subject_p",ITc_email_set_subject_p,ITs_email_startup,ITs_email_cleanup}, - {NULL, NULL} -}; - -#endif // __TCT_EMAIL-NATIVE_H__ diff --git a/src/itc/email/tct-email-native_tizeniot.h b/src/itc/email/tct-email-native_tizeniot.h deleted file mode 100755 index 7da9e85ef..000000000 --- a/src/itc/email/tct-email-native_tizeniot.h +++ /dev/null @@ -1,48 +0,0 @@ -// -// 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_EMAIL-NATIVE_H__ -#define __TCT_EMAIL-NATIVE_H__ - -#include "testcase.h" -#include "tct_common.h" - -extern void ITs_email_startup(void); -extern void ITs_email_cleanup(void); - -extern int ITc_email_add_remove_attach_p(void); -extern int ITc_email_add_remove_recipient_p(void); -extern int ITc_email_create_destroy_message_p(void); -extern int ITc_email_save_message_p(void); -extern int ITc_email_send_message_with_attachment_p(void); -extern int ITc_email_send_message_without_attachment_p(void); -extern int ITc_email_set_body_p(void); -extern int ITc_email_set_unset_message_sent_cb_p(void); -extern int ITc_email_set_subject_p(void); - -testcase tc_array[] = { - {"ITc_email_add_remove_attach_p",ITc_email_add_remove_attach_p,ITs_email_startup,ITs_email_cleanup}, - {"ITc_email_add_remove_recipient_p",ITc_email_add_remove_recipient_p,ITs_email_startup,ITs_email_cleanup}, - {"ITc_email_create_destroy_message_p",ITc_email_create_destroy_message_p,ITs_email_startup,ITs_email_cleanup}, - {"ITc_email_save_message_p",ITc_email_save_message_p,ITs_email_startup,ITs_email_cleanup}, - {"ITc_email_send_message_with_attachment_p",ITc_email_send_message_with_attachment_p,ITs_email_startup,ITs_email_cleanup}, - {"ITc_email_send_message_without_attachment_p",ITc_email_send_message_without_attachment_p,ITs_email_startup,ITs_email_cleanup}, - {"ITc_email_set_body_p",ITc_email_set_body_p,ITs_email_startup,ITs_email_cleanup}, - {"ITc_email_set_unset_message_sent_cb_p",ITc_email_set_unset_message_sent_cb_p,ITs_email_startup,ITs_email_cleanup}, - {"ITc_email_set_subject_p",ITc_email_set_subject_p,ITs_email_startup,ITs_email_cleanup}, - {NULL, NULL} -}; - -#endif // __TCT_EMAIL-NATIVE_H__ diff --git a/src/itc/email/tct-email-native_wearable.h b/src/itc/email/tct-email-native_wearable.h deleted file mode 100755 index 7da9e85ef..000000000 --- a/src/itc/email/tct-email-native_wearable.h +++ /dev/null @@ -1,48 +0,0 @@ -// -// 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_EMAIL-NATIVE_H__ -#define __TCT_EMAIL-NATIVE_H__ - -#include "testcase.h" -#include "tct_common.h" - -extern void ITs_email_startup(void); -extern void ITs_email_cleanup(void); - -extern int ITc_email_add_remove_attach_p(void); -extern int ITc_email_add_remove_recipient_p(void); -extern int ITc_email_create_destroy_message_p(void); -extern int ITc_email_save_message_p(void); -extern int ITc_email_send_message_with_attachment_p(void); -extern int ITc_email_send_message_without_attachment_p(void); -extern int ITc_email_set_body_p(void); -extern int ITc_email_set_unset_message_sent_cb_p(void); -extern int ITc_email_set_subject_p(void); - -testcase tc_array[] = { - {"ITc_email_add_remove_attach_p",ITc_email_add_remove_attach_p,ITs_email_startup,ITs_email_cleanup}, - {"ITc_email_add_remove_recipient_p",ITc_email_add_remove_recipient_p,ITs_email_startup,ITs_email_cleanup}, - {"ITc_email_create_destroy_message_p",ITc_email_create_destroy_message_p,ITs_email_startup,ITs_email_cleanup}, - {"ITc_email_save_message_p",ITc_email_save_message_p,ITs_email_startup,ITs_email_cleanup}, - {"ITc_email_send_message_with_attachment_p",ITc_email_send_message_with_attachment_p,ITs_email_startup,ITs_email_cleanup}, - {"ITc_email_send_message_without_attachment_p",ITc_email_send_message_without_attachment_p,ITs_email_startup,ITs_email_cleanup}, - {"ITc_email_set_body_p",ITc_email_set_body_p,ITs_email_startup,ITs_email_cleanup}, - {"ITc_email_set_unset_message_sent_cb_p",ITc_email_set_unset_message_sent_cb_p,ITs_email_startup,ITs_email_cleanup}, - {"ITc_email_set_subject_p",ITc_email_set_subject_p,ITs_email_startup,ITs_email_cleanup}, - {NULL, NULL} -}; - -#endif // __TCT_EMAIL-NATIVE_H__ diff --git a/tct_unsupported.txt b/tct_unsupported.txt index 665fade0b..e0b91a47f 100755 --- a/tct_unsupported.txt +++ b/tct_unsupported.txt @@ -286,7 +286,6 @@ tv:armv7l:itc:capi-ui-sticker; tv:armv7l:itc:location-manager; tv:armv7l:itc:phonenumber-utils; tv:armv7l:itc:contacts-service2; -tv:armv7l:itc:email; tv:armv7l:itc:messages; tv:armv7l:itc:context; tv:armv7l:itc:sync-manager;