From 1934abbd329cfce0fe98158cc2f69b2ed13803d9 Mon Sep 17 00:00:00 2001 From: SoftSquirrel Date: Wed, 31 Aug 2022 15:35:22 +0800 Subject: [PATCH] Issue:#I5OZGT Description: add testcase : call get profile interface with invalid json format Sig: SIG_ApplicaitonFramework Feature or Bugfix: Feature Binary Source: No Signed-off-by: SoftSquirrel --- .../entry/src/main/ets/test/GetProfileByAbility.test.ets | 6 ++---- .../src/main/ets/test/GetProfileByExtensionAbility.test.ets | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/test/GetProfileByAbility.test.ets b/bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/test/GetProfileByAbility.test.ets index 383d09bd9..95aa314b0 100644 --- a/bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/test/GetProfileByAbility.test.ets +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/test/GetProfileByAbility.test.ets @@ -441,10 +441,8 @@ export default function getProfileByAbility() { */ it('getProfileByAbility_2500', 0, async function (done) { bundle.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME4, (err, data) => { - if (err) { - console.error('[getProfileByAbility_2500] Operation failed. Cause: ' + JSON.stringify(err)); - expect(err).assertEqual(1); - } + console.error('[getProfileByAbility_2500] Operation failed. Cause: ' + JSON.stringify(err)); + expect(err).assertEqual(1); console.info('[getProfileByAbility_2500] data is: ' + JSON.stringify(data)); expect(typeof data).assertEqual("string"); expect(data).assertEqual("GetProfile failed"); diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/test/GetProfileByExtensionAbility.test.ets b/bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/test/GetProfileByExtensionAbility.test.ets index 53a37182a..65bbd927e 100644 --- a/bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/test/GetProfileByExtensionAbility.test.ets +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/test/GetProfileByExtensionAbility.test.ets @@ -441,10 +441,8 @@ export default function getProfileByExtensionAbility() { */ it('getProfileByExtensionAbility_2500', 0, async function (done) { bundle.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME4, (err, data) => { - if (err) { - console.error('[getProfileByExtensionAbility_2500] Operation failed. Cause: ' + JSON.stringify(err)); - expect(err).assertEqual(1); - } + console.error('[getProfileByExtensionAbility_2500] Operation failed. Cause: ' + JSON.stringify(err)); + expect(err).assertEqual(1); console.info('[getProfileByExtensionAbility_2500] data is: ' + JSON.stringify(data)); expect(typeof data).assertEqual("string"); expect(data).assertEqual("GetProfile failed"); -- GitLab