diff --git a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/MainAbility/test/getAbilityInfoJsunit.test.ets b/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/MainAbility/test/getAbilityInfoJsunit.test.ets index e972942f271d0ff2b1b15eb9d2f3efc5076e88fd..447fc3ba91a560f2422bc4eba3d83b82063c4cf8 100644 --- a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/MainAbility/test/getAbilityInfoJsunit.test.ets +++ b/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/MainAbility/test/getAbilityInfoJsunit.test.ets @@ -291,13 +291,39 @@ export default function getHapModuleInfoJsunit() { expect(info.icon).assertEqual("$media:icon"); expect(info.process).assertEqual(""); expect(info.supportedModes).assertEqual(0); - expect(info.moduleSourceDirs[0]).assertEqual("/data/app/el1/bundle/public/" + - "com.ohos.acecollaboration/com.ohos.acecollaboration"); - expect(info.moduleInfos[0].moduleName).assertEqual("entry"); - expect(info.moduleInfos[0].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" + - "com.ohos.acecollaboration/com.ohos.acecollaboration"); expect(info.entryDir).assertEqual("/data/app/el1/bundle/public/" + "com.ohos.acecollaboration/com.ohos.acecollaboration"); + if (info.moduleSourceDirs.length == 1){ + expect(info.moduleInfos[0].moduleName).assertEqual("entry"); + expect(info.moduleInfos[0].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" + + "com.ohos.acecollaboration/com.ohos.acecollaboration"); + }else if(info.moduleSourceDirs.length == 2) { + if (info.moduleInfos[0].moduleName == "myapplication1") { + expect(info.moduleInfos[0].moduleName).assertEqual("myapplication1"); + expect(info.moduleInfos[0].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" + + "com.ohos.acecollaboration/com.example.myapplication1"); + expect(info.moduleInfos[1].moduleName).assertEqual("entry"); + expect(info.moduleInfos[1].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" + + "com.ohos.acecollaboration/com.ohos.acecollaboration"); + }else{ + expect(info.moduleInfos[0].moduleName).assertEqual("myapplication2"); + expect(info.moduleInfos[0].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" + + "com.ohos.acecollaboration/com.example.myapplication2"); + expect(info.moduleInfos[1].moduleName).assertEqual("entry"); + expect(info.moduleInfos[1].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" + + "com.ohos.acecollaboration/com.ohos.acecollaboration"); + } + }else { + expect(info.moduleInfos[0].moduleName).assertEqual("myapplication1"); + expect(info.moduleInfos[0].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" + + "com.ohos.acecollaboration/com.example.myapplication1"); + expect(info.moduleInfos[1].moduleName).assertEqual("myapplication2"); + expect(info.moduleInfos[1].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" + + "com.ohos.acecollaboration/com.example.myapplication2"); + expect(info.moduleInfos[2].moduleName).assertEqual("entry"); + expect(info.moduleInfos[2].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" + + "com.ohos.acecollaboration/com.ohos.acecollaboration"); + } console.log(msg + "---checkApplicationInfo End--- "); diff --git a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/MainAbility/test/getHapModuleInfoJsunit.test.ets b/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/MainAbility/test/getHapModuleInfoJsunit.test.ets index 70ad8f51dbab5adef986953af5dab6ff6d7e81fd..7d99f6be366de1d94e506061ae4af379bccd8c37 100644 --- a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/MainAbility/test/getHapModuleInfoJsunit.test.ets +++ b/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/MainAbility/test/getHapModuleInfoJsunit.test.ets @@ -233,8 +233,8 @@ export default function getHapModuleInfoJsunit() { expect(data.label).assertEqual("$string:entry_MainAbility"); expect(data.description).assertEqual("$string:mainability_description"); expect(data.icon).assertEqual("$media:icon"); - expect(data.descriptionId).assertEqual(16777220); - expect(data.iconId).assertEqual(16777221); + expect(data.descriptionId > 0).assertTrue(); + expect(data.iconId > 0).assertTrue(); expect(data.moduleName).assertEqual("entry"); expect(data.process).assertEqual(""); expect(data.targetAbility).assertEqual(""); @@ -254,7 +254,7 @@ export default function getHapModuleInfoJsunit() { expect(data.minFormWidth).assertEqual(0); expect(data.defaultFormWidth).assertEqual(0); expect(data.uri).assertEqual(""); - expect(data.labelId).assertEqual(16777218); + expect(data.labelId > 0).assertTrue(); expect(data.subType).assertEqual(0); console.log(msg+ "---checkAbilityInfo End--- "); } @@ -337,13 +337,11 @@ export default function getHapModuleInfoJsunit() { } expect(info.name).assertEqual("com.ohos.acecollaboration"); expect(info.description).assertEqual("$string:mainability_description"); - expect(info.descriptionId).assertEqual(16777220); + expect(info.descriptionId > 0).assertTrue(); expect(info.systemApp).assertEqual(true); expect(info.enabled).assertEqual(true); expect(info.label).assertEqual("$string:entry_MainAbility"); - expect(info.labelId).assertEqual("16777218"); expect(info.icon).assertEqual("$media:icon"); - expect(info.iconId).assertEqual("16777221"); expect(info.process).assertEqual(""); expect(info.supportedModes).assertEqual(0); expect(info.entryDir).assertEqual("/data/app/el1/bundle/public/" + diff --git a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/MainAbility2/test/getAbilityInfoJsunit2.test.ets b/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/MainAbility2/test/getAbilityInfoJsunit2.test.ets index 96062c51c50f0d299a62774d7cdf901a07774328..827da661a688dc43e67505489d4e27b7da6d4ecd 100644 --- a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/MainAbility2/test/getAbilityInfoJsunit2.test.ets +++ b/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/MainAbility2/test/getAbilityInfoJsunit2.test.ets @@ -206,13 +206,39 @@ export default function getAbilityInfoJsunit() { expect(info.icon).assertEqual("$media:icon"); expect(info.process).assertEqual(""); expect(info.supportedModes).assertEqual(0); - expect(info.moduleSourceDirs[0]).assertEqual("/data/app/el1/bundle/public/" + - "com.ohos.acecollaboration/com.ohos.acecollaboration"); - expect(info.moduleInfos[0].moduleName).assertEqual("entry"); - expect(info.moduleInfos[0].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" + - "com.ohos.acecollaboration/com.ohos.acecollaboration"); expect(info.entryDir).assertEqual("/data/app/el1/bundle/public/" + "com.ohos.acecollaboration/com.ohos.acecollaboration"); + if (info.moduleSourceDirs.length == 1){ + expect(info.moduleInfos[0].moduleName).assertEqual("entry"); + expect(info.moduleInfos[0].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" + + "com.ohos.acecollaboration/com.ohos.acecollaboration"); + }else if(info.moduleSourceDirs.length == 2) { + if (info.moduleInfos[0].moduleName == "myapplication1") { + expect(info.moduleInfos[0].moduleName).assertEqual("myapplication1"); + expect(info.moduleInfos[0].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" + + "com.ohos.acecollaboration/com.example.myapplication1"); + expect(info.moduleInfos[1].moduleName).assertEqual("entry"); + expect(info.moduleInfos[1].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" + + "com.ohos.acecollaboration/com.ohos.acecollaboration"); + }else{ + expect(info.moduleInfos[0].moduleName).assertEqual("myapplication2"); + expect(info.moduleInfos[0].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" + + "com.ohos.acecollaboration/com.example.myapplication2"); + expect(info.moduleInfos[1].moduleName).assertEqual("entry"); + expect(info.moduleInfos[1].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" + + "com.ohos.acecollaboration/com.ohos.acecollaboration"); + } + }else { + expect(info.moduleInfos[0].moduleName).assertEqual("myapplication1"); + expect(info.moduleInfos[0].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" + + "com.ohos.acecollaboration/com.example.myapplication1"); + expect(info.moduleInfos[1].moduleName).assertEqual("myapplication2"); + expect(info.moduleInfos[1].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" + + "com.ohos.acecollaboration/com.example.myapplication2"); + expect(info.moduleInfos[2].moduleName).assertEqual("entry"); + expect(info.moduleInfos[2].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" + + "com.ohos.acecollaboration/com.ohos.acecollaboration"); + } console.log(msg+ "---checkApplicationInfo End--- "); } }) diff --git a/aafwk/aafwk_standard/actsabilitymanageretstest/myapplication1/src/main/ets/MainAbility/test/getHapModuleInfoJsunit_app1.test.ets b/aafwk/aafwk_standard/actsabilitymanageretstest/myapplication1/src/main/ets/MainAbility/test/getHapModuleInfoJsunit_app1.test.ets index 801d2d6b2596299e74a8618bad015e23cbc9f680..685a71d103d5574b438ddfd73b934ec212570fc2 100644 --- a/aafwk/aafwk_standard/actsabilitymanageretstest/myapplication1/src/main/ets/MainAbility/test/getHapModuleInfoJsunit_app1.test.ets +++ b/aafwk/aafwk_standard/actsabilitymanageretstest/myapplication1/src/main/ets/MainAbility/test/getHapModuleInfoJsunit_app1.test.ets @@ -183,8 +183,8 @@ export default function getHapModuleInfoJsunit() { expect(data.label).assertEqual("$string:myapplication1_MainAbility"); expect(data.description).assertEqual("$string:description_mainability"); expect(data.icon).assertEqual("$media:icon"); - expect(data.descriptionId).assertEqual(16777220); - expect(data.iconId).assertEqual(16777221); + expect(data.descriptionId > 0).assertTrue(); + expect(data.iconId > 0).assertTrue(); expect(data.moduleName).assertEqual("myapplication1"); expect(data.process).assertEqual(""); expect(data.targetAbility).assertEqual(""); @@ -204,7 +204,7 @@ export default function getHapModuleInfoJsunit() { expect(data.minFormWidth).assertEqual(0); expect(data.defaultFormWidth).assertEqual(0); expect(data.uri).assertEqual(""); - expect(data.labelId).assertEqual(16777218); + expect(data.labelId > 0).assertTrue(); expect(data.subType).assertEqual(0); console.log(msg+ "---checkAbilityInfo End--- "); } @@ -254,13 +254,11 @@ export default function getHapModuleInfoJsunit() { expect(typeof (info.entryDir)).assertEqual("string"); expect(info.name).assertEqual("com.ohos.acecollaboration"); expect(info.description).assertEqual("$string:mainability_description"); - expect(info.descriptionId).assertEqual(16777220); + expect(info.descriptionId > 0).assertTrue(); expect(info.systemApp).assertEqual(true); expect(info.enabled).assertEqual(true); expect(info.label).assertEqual("$string:entry_MainAbility"); - expect(info.labelId).assertEqual("16777218"); expect(info.icon).assertEqual("$media:icon"); - expect(info.iconId).assertEqual("16777221"); expect(info.process).assertEqual(""); expect(info.supportedModes).assertEqual(0); if (info.moduleSourceDirs.length == 1){