[ITC][app-manager][ACR-1418][Updated TC for new enum for Component-based application] 47/210947/3
authorABHISHEK JAIN <j.abhishek@samsung.com>
Fri, 26 Jul 2019 07:12:03 +0000 (12:42 +0530)
committershobhit verma <shobhit.v@samsung.com>
Fri, 26 Jul 2019 08:36:23 +0000 (08:36 +0000)
Change-Id: I55819e46f5b0a6febacb44d82abbbe55fd983cc3
Signed-off-by: ABHISHEK JAIN <j.abhishek@samsung.com>
src/itc/app-manager/ITs-app-manager-common.h
src/itc/app-manager/ITs-app-manager-info.c
src/itc/app-manager/res/mobile/org.example.componentbased-1.0.0-arm.tpk [new file with mode: 0644]
src/itc/app-manager/res/mobile/org.example.componentbased-1.0.0-i386.tpk [new file with mode: 0644]
src/itc/app-manager/res/tizeniot/org.example.componentbased-1.0.0-arm.tpk [new file with mode: 0644]
src/itc/app-manager/res/tizeniot/org.example.componentbased-1.0.0-i386.tpk [new file with mode: 0644]
src/itc/app-manager/res/tv/org.example.componentbased-1.0.0-arm.tpk [new file with mode: 0644]
src/itc/app-manager/res/tv/org.example.componentbased-1.0.0-i386.tpk [new file with mode: 0644]
src/itc/app-manager/res/wearable/org.example.componentbased-1.0.0-arm.tpk [new file with mode: 0644]
src/itc/app-manager/res/wearable/org.example.componentbased-1.0.0-i386.tpk [new file with mode: 0644]

index 1d07821b45f23d06e4177d1e33e29355990cf807..0e8cc71fd648c4146a78b9578ed8c39ec9ff623b 100755 (executable)
@@ -41,6 +41,7 @@
 #define GMAINTIMEOUT                           10000           //10 seconds
 #define TEST_TESTAPPLICATION_APPID     "org.tizen.testapplication"
 #define TEST_APPMANAGERTESTFILE_APPID  "org.tizen.appmanagertestfile"
+#define TEST_COMPONENTBASED_APPID      "org.example.componentbased"
 #define MKEY                                           "test"
 #define MVALUE                                         "metavalue"
 #define API_NAMESPACE                          "APP_MANAGER_ITC"
index f3aa30772be089f70f8a96f284db626be53a4851..32ec513bf5ac6f378f675a39e5d74ec289b787fb 100755 (executable)
@@ -41,7 +41,8 @@ void ITs_app_manager_info_startup(void)
        FPRINTF("[Line : %d][%s] TEST SUIT start-up: ITs_App_Manager_p\\n", __LINE__, API_NAMESPACE);
 #endif
 
-       TCT_CheckInstalledApp(2, TEST_TESTAPPLICATION_APPID, TEST_APPMANAGERTESTFILE_APPID);
+       //TCT_CheckInstalledApp(2, TEST_TESTAPPLICATION_APPID, TEST_APPMANAGERTESTFILE_APPID);
+       TCT_CheckInstalledApp(3, TEST_TESTAPPLICATION_APPID, TEST_APPMANAGERTESTFILE_APPID, TEST_COMPONENTBASED_APPID);
        sleep(2);
        int nRet = APP_MANAGER_ERROR_NONE;
 
@@ -1072,10 +1073,10 @@ int ITc_app_manager_app_info_get_localed_label_p(void)
 * @type                                auto
 * @since_tizen                         4.0
 * @description                 Gets the application component type.
-* @scenario                            Gets the application component type.
+* @scenario                            Gets the application component type and compare with expected value.
 * @apicovered                  app_info_get_app_component_type
-* @passcase                            If app_info_get_app_component_type returns success
-* @failcase                            If app_info_get_app_component_type or any precondition api returns fail
+* @passcase                            If app_info_get_app_component_type returns success or type matches
+* @failcase                            If app_info_get_app_component_type or any precondition api returns fail or type mismatch
 * @precondition                        app manager instance should be created
 * @postcondition               app manager instance should be destroyed
 */
@@ -1083,21 +1084,40 @@ int ITc_app_manager_app_info_get_app_component_type_p(void)
 {
        START_TEST;
 
-       app_info_h pstAppInfoHandle = NULL;
+       const char *AppIDs[] =
+       {
+               TEST_TESTAPPLICATION_APPID,
+               TEST_COMPONENTBASED_APPID
+       };
+
+       app_info_app_component_type_e eAPP_COMP_TYPE[] =
+       {
+               APP_INFO_APP_COMPONENT_TYPE_UI_APP,
+               APP_INFO_APP_COMPONENT_TYPE_COMPONENT_BASED_APP
+       };
+
+       app_info_h hAppInfo = NULL;
        app_info_app_component_type_e eGetComponent;
+       int nRet = APP_MANAGER_ERROR_NONE;
+       int nLoopCnt, nLoopSize;
 
-       int nRet = app_manager_get_app_info((const char *)TEST_TESTAPPLICATION_APPID, &pstAppInfoHandle);
-       PRINT_RESULT(APP_MANAGER_ERROR_NONE, nRet, "app_manager_get_app_info", AppManagerGetError(nRet));
-       CHECK_HANDLE(pstAppInfoHandle, "app_manager_get_app_info");
+       nLoopSize = sizeof(AppIDs)/sizeof(AppIDs[0]);
 
-       nRet = app_info_get_app_component_type(pstAppInfoHandle, &eGetComponent);
-       PRINT_RESULT_CLEANUP(APP_MANAGER_ERROR_NONE, nRet, "app_info_get_component_type", AppManagerGetError(nRet),app_info_destroy(pstAppInfoHandle));
-       FPRINTF("eGetComponent value is = [%s]  \\n" ,AppManagerGetAppComponent(eGetComponent));
+       for (nLoopCnt = 0; nLoopCnt < nLoopSize; nLoopCnt++)
+       {
+               nRet = app_manager_get_app_info((const char *)AppIDs[nLoopCnt], &hAppInfo);
+               PRINT_RESULT(APP_MANAGER_ERROR_NONE, nRet, "app_manager_get_app_info", AppManagerGetError(nRet));
+               CHECK_HANDLE(hAppInfo, "app_manager_get_app_info");
 
-       nRet = app_info_destroy(pstAppInfoHandle);
-       PRINT_RESULT_NORETURN(APP_MANAGER_ERROR_NONE, nRet, "app_info_destroy", AppManagerGetError(nRet));
+               nRet = app_info_get_app_component_type(hAppInfo, &eGetComponent);
+               PRINT_RESULT_CLEANUP(APP_MANAGER_ERROR_NONE, nRet, "app_info_get_component_type", AppManagerGetError(nRet),app_info_destroy(hAppInfo));
+               PRINT_RESULT_CLEANUP(eAPP_COMP_TYPE[nLoopCnt], eGetComponent, "app_info_get_component_type", AppManagerGetError(nRet),app_info_destroy(hAppInfo));
 
+               nRet = app_info_destroy(hAppInfo);
+               PRINT_RESULT_NORETURN(APP_MANAGER_ERROR_NONE, nRet, "app_info_destroy", AppManagerGetError(nRet));
+       }
        return 0;
 }
+
 /** @} */
 /** @} */
diff --git a/src/itc/app-manager/res/mobile/org.example.componentbased-1.0.0-arm.tpk b/src/itc/app-manager/res/mobile/org.example.componentbased-1.0.0-arm.tpk
new file mode 100644 (file)
index 0000000..bf7119a
Binary files /dev/null and b/src/itc/app-manager/res/mobile/org.example.componentbased-1.0.0-arm.tpk differ
diff --git a/src/itc/app-manager/res/mobile/org.example.componentbased-1.0.0-i386.tpk b/src/itc/app-manager/res/mobile/org.example.componentbased-1.0.0-i386.tpk
new file mode 100644 (file)
index 0000000..190f7cc
Binary files /dev/null and b/src/itc/app-manager/res/mobile/org.example.componentbased-1.0.0-i386.tpk differ
diff --git a/src/itc/app-manager/res/tizeniot/org.example.componentbased-1.0.0-arm.tpk b/src/itc/app-manager/res/tizeniot/org.example.componentbased-1.0.0-arm.tpk
new file mode 100644 (file)
index 0000000..bf7119a
Binary files /dev/null and b/src/itc/app-manager/res/tizeniot/org.example.componentbased-1.0.0-arm.tpk differ
diff --git a/src/itc/app-manager/res/tizeniot/org.example.componentbased-1.0.0-i386.tpk b/src/itc/app-manager/res/tizeniot/org.example.componentbased-1.0.0-i386.tpk
new file mode 100644 (file)
index 0000000..190f7cc
Binary files /dev/null and b/src/itc/app-manager/res/tizeniot/org.example.componentbased-1.0.0-i386.tpk differ
diff --git a/src/itc/app-manager/res/tv/org.example.componentbased-1.0.0-arm.tpk b/src/itc/app-manager/res/tv/org.example.componentbased-1.0.0-arm.tpk
new file mode 100644 (file)
index 0000000..bf7119a
Binary files /dev/null and b/src/itc/app-manager/res/tv/org.example.componentbased-1.0.0-arm.tpk differ
diff --git a/src/itc/app-manager/res/tv/org.example.componentbased-1.0.0-i386.tpk b/src/itc/app-manager/res/tv/org.example.componentbased-1.0.0-i386.tpk
new file mode 100644 (file)
index 0000000..190f7cc
Binary files /dev/null and b/src/itc/app-manager/res/tv/org.example.componentbased-1.0.0-i386.tpk differ
diff --git a/src/itc/app-manager/res/wearable/org.example.componentbased-1.0.0-arm.tpk b/src/itc/app-manager/res/wearable/org.example.componentbased-1.0.0-arm.tpk
new file mode 100644 (file)
index 0000000..bf7119a
Binary files /dev/null and b/src/itc/app-manager/res/wearable/org.example.componentbased-1.0.0-arm.tpk differ
diff --git a/src/itc/app-manager/res/wearable/org.example.componentbased-1.0.0-i386.tpk b/src/itc/app-manager/res/wearable/org.example.componentbased-1.0.0-i386.tpk
new file mode 100644 (file)
index 0000000..190f7cc
Binary files /dev/null and b/src/itc/app-manager/res/wearable/org.example.componentbased-1.0.0-i386.tpk differ