diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsetsmodulenametest/entry/src/main/ets/test/ActsBmsEtsModuleNameTest.test.ets b/bundlemanager/bundle_standard/bundlemanager/actsbmsetsmodulenametest/entry/src/main/ets/test/ActsBmsEtsModuleNameTest.test.ets index 02dbd887d9baaa0a61960f6ec89eca75bec4305a..f610f5d54e2a082849288769cb6802ca7450b90b 100644 --- a/bundlemanager/bundle_standard/bundlemanager/actsbmsetsmodulenametest/entry/src/main/ets/test/ActsBmsEtsModuleNameTest.test.ets +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsetsmodulenametest/entry/src/main/ets/test/ActsBmsEtsModuleNameTest.test.ets @@ -298,7 +298,7 @@ export default function actsBmsJsModuleNameTest() { expect(err).assertFail(); }); bundle.isAbilityEnabled(abilityInfo, (err, data) => { - expect(err).assertEqual(SUCCESS_CODE); + expect(err.code).assertEqual(SUCCESS_CODE); if (err) { console.error('[isAbilityEnabledEmptyModule]Operation failed. Err: ' + JSON.stringify(err)); } @@ -327,7 +327,7 @@ export default function actsBmsJsModuleNameTest() { if (err) { console.error('[isAbilityEnabledInvalidModule]Operation failed. Err: ' + JSON.stringify(err)); } - expect(err).assertEqual(SUCCESS_CODE); + expect(err.code).assertEqual(SUCCESS_CODE); console.info("'[isAbilityEnabledInvalidModule]Return data: " + JSON.stringify(data)); done(); }); @@ -349,7 +349,7 @@ export default function actsBmsJsModuleNameTest() { expect(err).assertFail(); }); bundle.isAbilityEnabled(abilityInfo, (err, data) => { - expect(err).assertEqual(SUCCESS_CODE); + expect(err.code).assertEqual(SUCCESS_CODE); if (err) { console.error('[isAbilityEnabledHasModule]Operation failed. Err: ' + JSON.stringify(err)); } @@ -371,14 +371,14 @@ export default function actsBmsJsModuleNameTest() { expect(data).assertFail(); }).catch((err) => { console.error('[isAbilityEnabledUndefinedModule]Operation failed. Err: ' + JSON.stringify(err)); - expect(err).assertEqual(INVALID_PARAM); + expect(err.code).assertEqual(INVALID_PARAM); }); bundle.isAbilityEnabled(abilityInfo, (err, data) => { expect(data).assertEqual(undefined); if (err) { console.error('[isAbilityEnabledUndefinedModule]Operation failed. Err: ' + JSON.stringify(err)); } - expect(err).assertEqual(INVALID_PARAM); + expect(err.code).assertEqual(INVALID_PARAM); console.info("'[isAbilityEnabledUndefinedModule]Return data: " + JSON.stringify(data)); done(); }); diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsetsunpermissiontest/entry/src/main/ets/test/ActsBmsEtsUnPermissionTest.test.ets b/bundlemanager/bundle_standard/bundlemanager/actsbmsetsunpermissiontest/entry/src/main/ets/test/ActsBmsEtsUnPermissionTest.test.ets index 68d6dcd43b24924e3ac7b46faae13440b309aab3..cea7e5de75413475036dc90c7bc21af3fab0d4ae 100644 --- a/bundlemanager/bundle_standard/bundlemanager/actsbmsetsunpermissiontest/entry/src/main/ets/test/ActsBmsEtsUnPermissionTest.test.ets +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsetsunpermissiontest/entry/src/main/ets/test/ActsBmsEtsUnPermissionTest.test.ets @@ -51,10 +51,10 @@ export default function actsBmsJsUnPermissionTest() { await bundle.getAllApplicationInfo(DEFAULT_FLAG).then(data => { expect().assertFail(); }).catch(err => { - expect(err).assertEqual(INVALID_CODE); + expect(err.code).assertEqual(INVALID_CODE); }); bundle.getAllApplicationInfo(DEFAULT_FLAG, (err, data) => { - expect(err).assertEqual(INVALID_CODE); + expect(err.code).assertEqual(INVALID_CODE); expect(data).assertEqual(undefined); done(); }); @@ -87,10 +87,10 @@ export default function actsBmsJsUnPermissionTest() { await bundle.getApplicationInfo(BUNDLE_NAME_OTHER, DEFAULT_FLAG).then(data => { expect().assertFail(); }).catch(err => { - expect(err).assertEqual(INVALID_CODE); + expect(err.code).assertEqual(INVALID_CODE); }); bundle.getApplicationInfo(BUNDLE_NAME_OTHER, DEFAULT_FLAG, (err, data) => { - expect(err).assertEqual(INVALID_CODE); + expect(err.code).assertEqual(INVALID_CODE); expect(data).assertEqual(undefined); done(); }); diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsjsunpermissiontest/src/main/js/test/ActsBmsJsUnPermissionTest.test.js b/bundlemanager/bundle_standard/bundlemanager/actsbmsjsunpermissiontest/src/main/js/test/ActsBmsJsUnPermissionTest.test.js index f093db21d210344159a8af74f010c9e13fa5c576..ca78ebec87d0f2180ff597f67cf258a4737aa503 100644 --- a/bundlemanager/bundle_standard/bundlemanager/actsbmsjsunpermissiontest/src/main/js/test/ActsBmsJsUnPermissionTest.test.js +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsjsunpermissiontest/src/main/js/test/ActsBmsJsUnPermissionTest.test.js @@ -46,10 +46,10 @@ describe('ActsBmsJsUnPermissionTest', function () { await bundle.getApplicationInfo(LAUNCHER_BUNDLE_NAME, DEFAULT_FLAG, userId).then(data => { expect().assertFail(); }).catch(err => { - expect(err).assertEqual(INVALID_CODE); + expect(err.code).assertEqual(INVALID_CODE); }); bundle.getApplicationInfo(LAUNCHER_BUNDLE_NAME, DEFAULT_FLAG, userId, (err, data) => { - expect(err).assertEqual(INVALID_CODE); + expect(err.code).assertEqual(INVALID_CODE); expect(data).assertEqual(undefined); done(); }); @@ -64,10 +64,10 @@ describe('ActsBmsJsUnPermissionTest', function () { await bundle.getAllApplicationInfo(DEFAULT_FLAG, userId).then(data => { expect().assertFail(); }).catch(err => { - expect(err).assertEqual(INVALID_CODE); + expect(err.code).assertEqual(INVALID_CODE); }); bundle.getAllApplicationInfo(DEFAULT_FLAG, userId, (err, data) => { - expect(err).assertEqual(INVALID_CODE); + expect(err.code).assertEqual(INVALID_CODE); expect(data).assertEqual(undefined); done(); }); @@ -143,10 +143,10 @@ describe('ActsBmsJsUnPermissionTest', function () { await bundle.getLaunchWantForBundle(LAUNCHER_BUNDLE_NAME).then(data => { expect().assertFail(); }).catch(err => { - expect(err).assertEqual(INVALID_CODE); + expect(err.code).assertEqual(INVALID_CODE); }); bundle.getLaunchWantForBundle(LAUNCHER_BUNDLE_NAME, (err, data) => { - expect(err).assertEqual(INVALID_CODE); + expect(err.code).assertEqual(INVALID_CODE); expect(data).assertEqual(undefined); done(); }); diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/GetLaunchWantForBundle.test.ets b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/GetLaunchWantForBundle.test.ets index 729ed24422f7ee51edd266075a2b68d52e1952da..0465203271764dbbe9c173ce27d7e653baf366cc 100644 --- a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/GetLaunchWantForBundle.test.ets +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/GetLaunchWantForBundle.test.ets @@ -44,7 +44,7 @@ export default function getLaunchWantForBundle() { expect(err).assertFail(); }); bundleMgr.getLaunchWantForBundle(NAME1, (err, res) => { - expect(err).assertEqual(0); + expect(err.code).assertEqual(0); expect(res.bundleName).assertEqual(NAME1); expect(res.abilityName).assertEqual(ABILITYNAME1); expect(res.deviceId).assertEqual(''); @@ -74,7 +74,7 @@ export default function getLaunchWantForBundle() { expect(err).assertFail(); }); bundleMgr.getLaunchWantForBundle(NAME2, (err, res) => { - expect(err).assertEqual(0); + expect(err.code).assertEqual(0); expect(res.bundleName).assertEqual(NAME2); expect(res.abilityName).assertEqual(ABILITYNAME2); expect(res.deviceId).assertEqual(''); @@ -96,11 +96,11 @@ export default function getLaunchWantForBundle() { await bundleMgr.getLaunchWantForBundle(NAME3).then(res => { expect().assertFail(); }).catch(err => { - expect(err).assertEqual(1); + expect(err.code).assertEqual(1); }); bundleMgr.getLaunchWantForBundle(NAME3, (err, res) => { if (err) { - expect(err).assertEqual(1); + expect(err.code).assertEqual(1); done(); return; } @@ -122,11 +122,11 @@ export default function getLaunchWantForBundle() { await bundleMgr.getLaunchWantForBundle(null).then(res => { expect().assertFail(); }).catch(err => { - expect(err).assertEqual(1); + expect(err.code).assertEqual(1); }); bundleMgr.getLaunchWantForBundle(null, (err, res) => { if (err) { - expect(err).assertEqual(1); + expect(err.code).assertEqual(1); done(); return; } diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/GetResourceTest.test.ets b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/GetResourceTest.test.ets index 0220ffbeaeb043ea424d489df8fd324710f15f56..586a45baf98fdb11e73af354ad46209fbccf3919 100644 --- a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/GetResourceTest.test.ets +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/GetResourceTest.test.ets @@ -176,7 +176,7 @@ export default function GetResourceTest() { } else { expect().assertFail(); } - expect(err).assertEqual(0) + expect(err.code).assertEqual(0) done(); }) }); @@ -291,7 +291,7 @@ export default function GetResourceTest() { expect(applicationInfo.descriptionResource.bundleName).assertEqual(BUNDLE_NAME) expect(applicationInfo.descriptionResource.moduleName).assertEqual(MODULE_NAME) expect(applicationInfo.descriptionResource.id).assertLarger(0) - expect(err).assertEqual(0) + expect(err.code).assertEqual(0) done(); }) }); diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/IsAbilityEnabledETSUnit.ets b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/IsAbilityEnabledETSUnit.ets index 332b4db8b37cb18f403dc6092833a79f2adaee8c..ea867323c260e51d4bbbdc5f3b03306ee8bbff0a 100644 --- a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/IsAbilityEnabledETSUnit.ets +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/IsAbilityEnabledETSUnit.ets @@ -73,7 +73,7 @@ export default function isAbilityEnabledETSUnit() { }); timeOldStamp = await Utils.getNowTime(); Bundle.isAbilityEnabled(abilityInfo, (error, data) => { - if (error) { + if (error.code != 0) { expect(error).assertFail(); } let timeNewStamp = Utils.getNowTime(); @@ -114,16 +114,16 @@ export default function isAbilityEnabledETSUnit() { expect(error).assertFail(); }); Bundle.isAbilityEnabled(abilityInfo1, (error, data) => { - expect(error).assertEqual(0); + expect(error.code).assertEqual(0); expect(data).assertFalse(); Bundle.isAbilityEnabled(abilityInfo2, (error, data) => { - expect(error).assertEqual(0); + expect(error.code).assertEqual(0); expect(data).assertFalse(); Bundle.isAbilityEnabled(abilityInfo3, (error, data) => { - expect(error).assertEqual(0); + expect(error.code).assertEqual(0); expect(data).assertFalse(); Bundle.isAbilityEnabled(abilityInfo7, (error, data) => { - expect(error).assertEqual(0); + expect(error.code).assertEqual(0); expect(data).assertFalse(); done(); }); @@ -144,26 +144,26 @@ export default function isAbilityEnabledETSUnit() { Bundle.isAbilityEnabled(abilityInfo4).then((data) => { expect(data).assertFail(); }).catch((error) => { - expect(error).assertEqual(2); + expect(error.code).assertEqual(2); }); Bundle.isAbilityEnabled(abilityInfo5).then((data) => { expect(data).assertFail(); }).catch((error) => { - expect(error).assertEqual(2); + expect(error.code).assertEqual(2); }); Bundle.isAbilityEnabled(abilityInfo6).then((data) => { expect(data).assertFail(); }).catch((error) => { - expect(error).assertEqual(2); + expect(error.code).assertEqual(2); }); Bundle.isAbilityEnabled(abilityInfo4, (error, data) => { - expect(error).assertEqual(2); + expect(error.code).assertEqual(2); expect(data).assertEqual(undefined); Bundle.isAbilityEnabled(abilityInfo5, (error, data) => { - expect(error).assertEqual(2); + expect(error.code).assertEqual(2); expect(data).assertEqual(undefined); Bundle.isAbilityEnabled(abilityInfo6, (error, data) => { - expect(error).assertEqual(2); + expect(error.code).assertEqual(2); expect(data).assertEqual(undefined); done(); }); @@ -184,7 +184,7 @@ export default function isAbilityEnabledETSUnit() { expect(error).assertFail(); }); Bundle.isAbilityEnabled(abilityInfo, (error, data) => { - expect(error).assertEqual(0); + expect(error.code).assertEqual(0); expect(data).assertTrue(); done(); }); diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/IsApplicationEnabledETSUnit.ets b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/IsApplicationEnabledETSUnit.ets index fa6979f6517cb8e73766bd35c3ad1b46c726a5bc..448d74aa3a7e33d5e2bac06a50d7998b886638dc 100644 --- a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/IsApplicationEnabledETSUnit.ets +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/IsApplicationEnabledETSUnit.ets @@ -42,7 +42,7 @@ export default function IsApplicationEnabledETSUnit() { Bundle.isApplicationEnabled(BUNDLE_NAME, (error, data) => { let timeNewStamp = Utils.getNowTime(); Utils.getDurationTime('[context_isApplicationEnabled_test_0200]', timeOldStamp, timeNewStamp); - expect(error).assertEqual(undefined); + expect(error.code).assertEqual(0); expect(data).assertTrue(); done(); }); @@ -67,16 +67,16 @@ export default function IsApplicationEnabledETSUnit() { await Bundle.isApplicationEnabled(undefined).then((data) => { expect(data).assertFail(); }).catch((error) => { - expect(error).assertEqual(2); + expect(error.code).assertEqual(2); }); Bundle.isApplicationEnabled(BUNDLE_NAME_ERROR, (error, data) => { - expect(error).assertEqual(undefined); + expect(error.code).assertEqual(0); expect(data).assertFalse(); Bundle.isApplicationEnabled("", (error, data) => { - expect(error).assertEqual(undefined); + expect(error.code).assertEqual(0); expect(data).assertFalse(); Bundle.isApplicationEnabled(undefined, (error, data) => { - expect(error).assertEqual(2); + expect(error.code).assertEqual(2); expect(data).assertEqual(undefined); done(); }); @@ -98,7 +98,7 @@ export default function IsApplicationEnabledETSUnit() { }); timeOldStamp = await Utils.getNowTime(); Bundle.isApplicationEnabled(BUNDLE_NAME_OTHER, (error, data) => { - expect(error).assertEqual(undefined); + expect(error.code).assertEqual(0); expect(data).assertTrue(); done(); }); diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/getAllApplicationInfoJsunit.test.ets b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/getAllApplicationInfoJsunit.test.ets index 29c9d49d1ef1b04e7faa1291c7a959b282a15fc7..5a9d7944dd5e0bfeafe973fe111a57922a9ac67f 100644 --- a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/getAllApplicationInfoJsunit.test.ets +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/getAllApplicationInfoJsunit.test.ets @@ -187,7 +187,7 @@ export default function getAllApplicationBundleTest() { Bundle.BundleFlag.GET_APPLICATION_INFO_WITH_PERMISSION, userId, (error, data) => { let endTime = Utils.getNowTime(); Utils.getDurationTime(TAG_TEST_0300_001, startTime, endTime); - if (error) { + if (error.code != 0) { expect(error).assertFail(); console.info(TAG_TEST_0300_001 + 'UserId callBack error: ' + error); } @@ -214,7 +214,7 @@ export default function getAllApplicationBundleTest() { Bundle.getAllApplicationInfo(Bundle.BundleFlag.GET_APPLICATION_INFO_WITH_PERMISSION, (error, data) => { let endTime = Utils.getNowTime(); Utils.getDurationTime(TAG_TEST_0400_001, startTime, endTime); - if (error) { + if (error.code != 0) { expect(error).assertFail(); console.info(TAG_TEST_0400_001 + 'UserId callBack error: ' + error); } @@ -249,7 +249,7 @@ export default function getAllApplicationBundleTest() { expect(error).assertFail(); }); Bundle.getAllApplicationInfo(DEFAULT_FLAG, (err, data) => { - expect(err).assertEqual(0); + expect(err.code).assertEqual(0); expect(data.length).assertLarger(10); let flag = 0; for(let i in data){ @@ -272,19 +272,17 @@ export default function getAllApplicationBundleTest() { await Bundle.getAllApplicationInfo(null).then((data) => { expect(data).assertFail(); }).catch((error) => { - expect(error).assertEqual(1); + expect(error.code).assertEqual(1); }); await Bundle.getAllApplicationInfo(undefined).then((data) => { expect(data).assertFail(); }).catch((error) => { - expect(error).assertEqual(1); + expect(error.code).assertEqual(1); }); Bundle.getAllApplicationInfo(undefined, (err, data) => { - expect(err).assertEqual(1); - expect(data).assertEqual("type mismatch"); + expect(err.code).assertEqual(1); Bundle.getAllApplicationInfo(null, (err, data) => { - expect(err).assertEqual(1); - expect(data).assertEqual("type mismatch"); + expect(err.code).assertEqual(1); done(); }); }); diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/getApplicationInfoJsunit.test.ets b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/getApplicationInfoJsunit.test.ets index 8d84520da79d7503dc2079c4b1961fb071eef38c..00d7bba432d32540b74f50641f53f04dd20756e9 100644 --- a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/getApplicationInfoJsunit.test.ets +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/getApplicationInfoJsunit.test.ets @@ -195,7 +195,7 @@ export default function applicationBundleJsunit() { let endTime = Utils.getNowTime(); Utils.getDurationTime(TAG_TEST_0300_001, startTime, endTime); errors = error; - if (errors) { + if (errors.code != 0) { expect(errors).assertFail(); console.info(TAG_TEST_0300_001 + 'UserId callBack error: ' + error); } @@ -223,7 +223,7 @@ export default function applicationBundleJsunit() { Bundle.BundleFlag.GET_APPLICATION_INFO_WITH_PERMISSION, (error, data) => { let endTime = Utils.getNowTime(); errors = error; - if (errors) { + if (errors.code != 0) { expect(errors).assertFail(); console.info(TAG_TEST_0400_001 + 'UserId callBack error: ' + error); } @@ -232,7 +232,7 @@ export default function applicationBundleJsunit() { datas = data; }); await Utils.sleep(2000); - console.info(TAG_TEST_0400_001 + 'noUserId callBack data is: ' + JSON.stringify(datas)); + console.info(TAG_TEST_0400_001 + 'noUserId callBack datas is: ' + JSON.stringify(datas)); expectData(TAG_TEST_0400_001, datas); getApplicationInfoSuccess(TAG_TEST_0400_001, datas); done(); @@ -254,7 +254,7 @@ export default function applicationBundleJsunit() { }).catch((error) => { console.info(TAG_TEST_0600_002 + 'other bundleName UserId promise error is: ' + error); errors = error - expect(errors).assertEqual(1); + expect(errors.code).assertEqual(1); }); let endTime = Utils.getNowTime(); Utils.getDurationTime(TAG_TEST_0600_002, startTime, endTime); @@ -284,7 +284,7 @@ export default function applicationBundleJsunit() { console.info(TAG_TEST_0600_003 + 'noUserId promise data is: ' + data); expectData(TAG_TEST_0600_003, data); getApplicationInfoSuccess_plus(TAG_TEST_0600_003, data); - expect(err).assertEqual(0); + expect(err.code).assertEqual(0); done(); }); }); @@ -303,7 +303,7 @@ export default function applicationBundleJsunit() { }); Bundle.getApplicationInfo(BUNDLE_OTHER, FLAG_DEFAULT, (err, data) => { console.info('noUserId promise data is: ' + data); - expect(err).assertEqual(0); + expect(err.code).assertEqual(0); getApplicationInfoSuccessOther(data); done(); }); @@ -319,7 +319,7 @@ export default function applicationBundleJsunit() { await Bundle.getApplicationInfo(BUNDLE_NOTEXIST, FLAG_DEFAULT).then((data) => { expect(data).assertFail(); }).catch((error) => { - expect(error).assertEqual(1); + expect(error.code).assertEqual(1); let endTime = Utils.getNowTime(); Utils.getDurationTime(TAG_TEST_0600_001, startTime, endTime); }); @@ -327,7 +327,7 @@ export default function applicationBundleJsunit() { await Bundle.getApplicationInfo(BUNDLE_NOTEXIST, FLAG_DEFAULT, (err, data) => { let endTime = Utils.getNowTime(); Utils.getDurationTime(TAG_TEST_0600_001, startTime, endTime); - expect(err).assertEqual(1); + expect(err.code).assertEqual(1); expect(JSON.stringify(data)).assertEqual(undefined); done(); }); @@ -342,27 +342,25 @@ export default function applicationBundleJsunit() { await Bundle.getApplicationInfo('', FLAG_DEFAULT).then((data) => { expect(data).assertFail(); }).catch((error) => { - expect(error).assertEqual(1); + expect(error.code).assertEqual(1); }); await Bundle.getApplicationInfo(null, FLAG_DEFAULT).then((data) => { expect(data).assertFail(); }).catch((error) => { - expect(error).assertEqual(1); + expect(error.code).assertEqual(1); }); await Bundle.getApplicationInfo(BUNDLE_NAME, null).then((data) => { expect(data).assertFail(); }).catch((error) => { - expect(error).assertEqual(1); + expect(error.code).assertEqual(1); }); Bundle.getApplicationInfo('', FLAG_DEFAULT, (err, data) => { - expect(err).assertEqual(1); + expect(err.code).assertEqual(1); expect(JSON.stringify(data)).assertEqual(undefined); Bundle.getApplicationInfo(null, FLAG_DEFAULT, (err, data) => { - expect(err).assertEqual(1); - expect(data).assertEqual("type mismatch"); + expect(err.code).assertEqual(1); Bundle.getApplicationInfo(BUNDLE_NAME, null, (err, data) => { - expect(err).assertEqual(1); - expect(data).assertEqual("type mismatch"); + expect(err.code).assertEqual(1); done(); }); }); @@ -393,7 +391,7 @@ export default function applicationBundleJsunit() { Bundle.getApplicationInfo(BUNDLE_NAME, Bundle.BundleFlag.GET_APPLICATION_INFO_WITH_CERTIFICATE_FINGERPRINT, (error, data) => { expect(data.fingerprint).assertEqual(TEST_DEMO); - expect(error).assertEqual(0); + expect(error.code).assertEqual(0); done(); }); }); diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/getBundleArchiveInfo.test.ets b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/getBundleArchiveInfo.test.ets index 6e2fed05a5a8f97748a2f68659255219dd6af7f1..fddc4d637ab3d3abf3ab0aadafa5ac52cb9c596f 100644 --- a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/getBundleArchiveInfo.test.ets +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/getBundleArchiveInfo.test.ets @@ -114,7 +114,7 @@ export default function getBundleArchiveInfo() { done() }).catch(err => { console.info("getBundleArchiveInfo fail" + JSON.stringify(err)) - expect(err).assertEqual(1) + expect(err.code).assertEqual(1) done() }) }) @@ -131,7 +131,7 @@ export default function getBundleArchiveInfo() { done() }).catch(err => { console.info("getBundleArchiveInfo fail" + JSON.stringify(err)) - expect(err).assertEqual(1) + expect(err.code).assertEqual(1) done() }) }) @@ -232,7 +232,7 @@ export default function getBundleArchiveInfo() { function OnReceiveEvent(err, datainfo) { if (err) { console.info("getBundleArchiveInfo error" + JSON.stringify(err)); - expect(err).assertEqual(1); + expect(err.code).assertEqual(1); done(); return; } @@ -252,7 +252,7 @@ export default function getBundleArchiveInfo() { function OnReceiveEvent(err, datainfo) { if (err) { console.info("getBundleArchiveInfo error" + JSON.stringify(err)); - expect(err).assertEqual(1); + expect(err.code).assertEqual(1); done(); return; } diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagertest/src/main/js/test/ExampleJsunit.test.js b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagertest/src/main/js/test/ExampleJsunit.test.js index 113ef2edcffb97b6fcafbb6fbe82765572c68165..835fc22aa2a2f404724295fcfa16e2154b78b03f 100644 --- a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagertest/src/main/js/test/ExampleJsunit.test.js +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagertest/src/main/js/test/ExampleJsunit.test.js @@ -739,7 +739,7 @@ describe('ActsBundleManagerTest', function () { await demo.getApplicationInfo(NAME1, demo.BundleFlag.GET_APPLICATION_INFO_WITH_PERMISSION | demo.BundleFlag.GET_APPLICATION_INFO_WITH_METADATA, userId, (error, datainfo) => { - if (error) { + if (error.code != 0) { console.info("testGetApplicationInfoMetaDataCallback fail:" + JSON.stringify(error)); expect(error).assertFail(); done(); @@ -909,7 +909,7 @@ describe('ActsBundleManagerTest', function () { done(); }).catch(err => { console.info("testGetApplicationInfoNotExistCallback err" + JSON.stringify(err)); - expect(err).assertEqual(1); + expect(err.code).assertEqual(1); done(); }); }) @@ -924,7 +924,7 @@ describe('ActsBundleManagerTest', function () { userId, (error, datainfo) => { if (error) { console.info("testGetApplicationInfoNotExistPromise fail" + JSON.stringify(error)); - expect(error).assertEqual(1); + expect(error.code).assertEqual(1); done(); return; } @@ -947,7 +947,7 @@ describe('ActsBundleManagerTest', function () { done(); }).catch(error => { console.info("testGetApplicationInfoInvalidParamPromise err" + JSON.stringify(error)); - expect(error).assertEqual(1); + expect(error.code).assertEqual(1); done(); }); }) @@ -962,7 +962,7 @@ describe('ActsBundleManagerTest', function () { userId, (error, datainfo) => { if (error) { console.info("testGetApplicationInfoInvalidParamCallback fail" + JSON.stringify(error)); - expect(error).assertEqual(1); + expect(error.code).assertEqual(1); done(); return; } @@ -1005,7 +1005,7 @@ describe('ActsBundleManagerTest', function () { */ it('testGetApplicationInfoDifferentParamCallback', 0, async function (done) { await demo.getApplicationInfo(NAME1, demo.BundleFlag.GET_BUNDLE_DEFAULT, userId, (error, datainfo) => { - if (error) { + if (error.code != 0) { console.info("testGetApplicationInfoDifferentParamCallback fail" + JSON.stringify(error)); expect(error).assertFail(); done(); @@ -1066,7 +1066,7 @@ describe('ActsBundleManagerTest', function () { it('testGetApplicationInfoCallback', 0, async function (done) { await demo.getApplicationInfo(NAME1, demo.BundleFlag.GET_APPLICATION_INFO_WITH_PERMISSION, userId, (error, datainfo) => { - if (error) { + if (error.code != 0) { console.info("testGetApplicationInfoCallback fail:" + JSON.stringify(error)); expect(error).assertFail(); done();