[ITC][notification-ex][ACR-1479][Added TC and enums for APIs] 38/229938/5
authorABHISHEK JAIN <j.abhishek@samsung.com>
Mon, 6 Apr 2020 13:25:00 +0000 (18:55 +0530)
committershobhit verma <shobhit.v@samsung.com>
Wed, 15 Apr 2020 10:16:08 +0000 (10:16 +0000)
Change-Id: I90e7ab42944c579966b33d2bc6b1003d65d3b381
Signed-off-by: ABHISHEK JAIN <j.abhishek@samsung.com>
src/itc/notification/ITs-notification-ex.c
src/itc/notification/tct-notification-native_mobile.h
src/itc/notification/tct-notification-native_tizeniot.h
src/itc/notification/tct-notification-native_wearable.h

index ef8f3bd3f5ac2b80da529bc41e54bcf5060138bd..02510978319e5fbf56b0dac553d449949b25111d 100755 (executable)
@@ -2641,7 +2641,8 @@ int ITc_noti_ex_item_set_get_policy_p(void)
        {
                NOTI_EX_ITEM_POLICY_NONE,
                NOTI_EX_ITEM_POLICY_ON_BOOT_CLEAR,
-               NOTI_EX_ITEM_POLICY_SIM_MODE
+               NOTI_EX_ITEM_POLICY_SIM_MODE,
+               NOTI_EX_ITEM_POLICY_DISABLE_AUTO_DELETE
        };
 
        nRet = CreateButton();
@@ -6848,5 +6849,66 @@ int ITc_noti_ex_item_checkbox_set_get_check_state_p(void)
        return 0;
 }
 
+//& type : auto
+//& purpose: Sets and gets extenasion data for notification_ex item.
+/**
+* @testcase                    ITc_noti_ex_item_set_get_extension_data_p
+* @since_tizen                 5.5
+* @author                      SRID(j.abhishek)
+* @reviewer                    SRID(shobhit.v)
+* @type                        auto
+* @description                 Sets and gets extenasion data for notification_ex item.
+* @scenario                    Creates the notification_ex text item and create bundle value.\n
+*                              Set items extension, Get it again with the same key and check for Pass/Fail.
+* @apicovered                  noti_ex_item_set_extension_data, noti_ex_item_get_extension_data
+* @passcase                    noti_ex_item_set_extension_data, noti_ex_item_get_extension_data are successful and return correct value
+* @failcase                    noti_ex_item_set_extension_data, noti_ex_item_get_extension_data failed.
+* @precondition                NA
+* @postcondition               free bundle and Destroy handle.
+*/
+int ITc_noti_ex_item_set_get_extension_data_p(void)
+{
+       START_TEST;
+
+       int nRet = NOTI_EX_ERROR_NONE;
+       noti_ex_item_h hItemText = NULL;
+
+       const char *pszTextID = "text_id";
+       const char *pszTextTitle = "textTitle";
+       const char *pszTextHyperLink = "testHyperLink";
+       const char *pszKey = "TEST_KEY";
+       const char *pszVal = "TEST_VALUE";
+       const char *pszExtKey = "key";
+
+       nRet = noti_ex_item_text_create(&hItemText, pszTextID, pszTextTitle, pszTextHyperLink);
+       PRINT_RESULT(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_text_create", NotificationExGetError(nRet));
+       CHECK_HANDLE(hItemText, "noti_ex_item_text_create");
+
+       bundle *retBundleVal = NULL;
+       bundle *BundleVal = NULL;
+
+       BundleVal = bundle_create();
+       CHECK_HANDLE_CLEANUP(BundleVal, "bundle_create", noti_ex_item_destroy(hItemText));
+
+       nRet = bundle_add_str(BundleVal, pszKey, pszVal);
+       PRINT_RESULT_CLEANUP(BUNDLE_ERROR_NONE, nRet, "bundle_add_str", NotificationExGetError(nRet), bundle_free(BundleVal);noti_ex_item_destroy(hItemText));
+
+       //Target API
+       nRet = noti_ex_item_set_extension_data(hItemText, pszExtKey, BundleVal);
+       PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_set_extension_data", NotificationExGetError(nRet), bundle_free(BundleVal);noti_ex_item_destroy(hItemText));
+       bundle_free(BundleVal);
+
+       //Target API
+       nRet = noti_ex_item_get_extension_data(hItemText, pszExtKey, &retBundleVal);
+       PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_get_extension_data", NotificationExGetError(nRet), bundle_free(retBundleVal);noti_ex_item_destroy(hItemText));
+       CHECK_HANDLE_CLEANUP(retBundleVal, "noti_ex_item_get_extension_data", noti_ex_item_destroy(hItemText); bundle_free(retBundleVal));
+       bundle_free(retBundleVal);
+
+       nRet = noti_ex_item_destroy(hItemText);
+       PRINT_RESULT_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_destroy", NotificationExGetError(nRet));
+
+       return 0;
+}
+
 /** @} */ //end of itc-notification-ex
 /** @} */ //end of itc-notification-testcases
index 1669f44a269f574fb4628d33e1b89cdf0a6480f7..798afe6a06aa50f6e750ed0034a76366e3d24dcd 100755 (executable)
@@ -177,6 +177,7 @@ extern int ITc_noti_ex_item_text_set_multi_language_p(void);
 extern int ITc_noti_ex_item_checkbox_set_get_check_state_p(void);
 extern int ITc_noti_ex_item_entry_set_multi_language_p(void);
 extern int ITc_noti_ex_item_input_selector_set_multi_language_contents_p(void);
+extern int ITc_noti_ex_item_set_get_extension_data_p(void);
 
 testcase tc_array[] = {
        {"ITc_notification_clone_p",ITc_notification_clone_p,ITs_notification_startup,ITs_notification_cleanup},
@@ -331,6 +332,7 @@ testcase tc_array[] = {
        {"ITc_noti_ex_item_checkbox_set_get_check_state_p", ITc_noti_ex_item_checkbox_set_get_check_state_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup},
        {"ITc_noti_ex_item_entry_set_multi_language_p", ITc_noti_ex_item_entry_set_multi_language_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup},
        {"ITc_noti_ex_item_input_selector_set_multi_language_contents_p", ITc_noti_ex_item_input_selector_set_multi_language_contents_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup},
+       {"ITc_noti_ex_item_set_get_extension_data_p", ITc_noti_ex_item_set_get_extension_data_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup},
        {NULL, NULL}
 };
 
index 1669f44a269f574fb4628d33e1b89cdf0a6480f7..798afe6a06aa50f6e750ed0034a76366e3d24dcd 100755 (executable)
@@ -177,6 +177,7 @@ extern int ITc_noti_ex_item_text_set_multi_language_p(void);
 extern int ITc_noti_ex_item_checkbox_set_get_check_state_p(void);
 extern int ITc_noti_ex_item_entry_set_multi_language_p(void);
 extern int ITc_noti_ex_item_input_selector_set_multi_language_contents_p(void);
+extern int ITc_noti_ex_item_set_get_extension_data_p(void);
 
 testcase tc_array[] = {
        {"ITc_notification_clone_p",ITc_notification_clone_p,ITs_notification_startup,ITs_notification_cleanup},
@@ -331,6 +332,7 @@ testcase tc_array[] = {
        {"ITc_noti_ex_item_checkbox_set_get_check_state_p", ITc_noti_ex_item_checkbox_set_get_check_state_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup},
        {"ITc_noti_ex_item_entry_set_multi_language_p", ITc_noti_ex_item_entry_set_multi_language_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup},
        {"ITc_noti_ex_item_input_selector_set_multi_language_contents_p", ITc_noti_ex_item_input_selector_set_multi_language_contents_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup},
+       {"ITc_noti_ex_item_set_get_extension_data_p", ITc_noti_ex_item_set_get_extension_data_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup},
        {NULL, NULL}
 };
 
index ba39b4cc4c710b50c2a8d0c66b0600665605483a..0e895c9ae1baae750e8f4ced4d54d7cc731ee052 100755 (executable)
@@ -177,6 +177,7 @@ extern int ITc_noti_ex_item_text_set_multi_language_p(void);
 extern int ITc_noti_ex_item_entry_set_multi_language_p(void);
 extern int ITc_noti_ex_item_input_selector_set_multi_language_contents_p(void);
 extern int ITc_noti_ex_item_checkbox_set_get_check_state_p(void);
+extern int ITc_noti_ex_item_set_get_extension_data_p(void);
 
 testcase tc_array[] = {
        {"ITc_notification_clone_p",ITc_notification_clone_p,ITs_notification_startup,ITs_notification_cleanup},
@@ -331,6 +332,7 @@ testcase tc_array[] = {
        {"ITc_noti_ex_item_entry_set_multi_language_p", ITc_noti_ex_item_entry_set_multi_language_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup},
        {"ITc_noti_ex_item_input_selector_set_multi_language_contents_p", ITc_noti_ex_item_input_selector_set_multi_language_contents_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup},
        {"ITc_noti_ex_item_checkbox_set_get_check_state_p", ITc_noti_ex_item_checkbox_set_get_check_state_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup},
+       {"ITc_noti_ex_item_set_get_extension_data_p", ITc_noti_ex_item_set_get_extension_data_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup},
        {NULL, NULL}
 };