diff --git a/account/appaccount/actsaccountoperatetest/src/main/js/test/CreateAccount.test.js b/account/appaccount/actsaccountoperatetest/src/main/js/test/CreateAccount.test.js index 3a10bb9a0ea84db3f549ca5212adb551a1916ef7..403efa69c9493d96ca580c00d89ae851abe23ec9 100644 --- a/account/appaccount/actsaccountoperatetest/src/main/js/test/CreateAccount.test.js +++ b/account/appaccount/actsaccountoperatetest/src/main/js/test/CreateAccount.test.js @@ -339,13 +339,18 @@ export default function ActsAccountCreateAccount() { console.debug("====>ActsAccountCreateAccount_1500 start===="); var appAccountManager = account.createAppAccountManager(); var specialStr = " "; - try{ + try { appAccountManager.createAccount(specialStr, createAccountOptions, (err)=>{ - expect(err.code == 12300002).assertEqual(true); + console.error("====>createAccount ActsAccountCreateAccount_1500 err:" + JSON.stringify(err)); + expect(err).assertEqual(null); console.debug("====>ActsAccountCreateAccount_1500 end===="); - done(); + appAccountManager.removeAccount(" ", (err)=>{ + console.error("====>removeAccount ActsAccountCreateAccount_1500 err:" + JSON.stringify(err)); + expect(err).assertEqual(null); + done(); + }); }); - }catch(err){ + } catch (err) { expect().assertFail(); done(); } @@ -360,14 +365,13 @@ export default function ActsAccountCreateAccount() { console.debug("====>ActsAccountCreateAccount_1600 start===="); var appAccountManager = account.createAppAccountManager(); var specialStr = " "; - try{ + try { await appAccountManager.createAccount(specialStr, createAccountOptions); - expect().assertFail(); + await appAccountManager.removeAccount(specialStr); done(); - } - catch(err){ - console.debug("====>add Account ActsAccountCreateAccount_1600 err:" + JSON.stringify(err)); - expect(err.code == 12300002).assertEqual(true); + } catch (err) { + console.debug("====>createAccount ActsAccountCreateAccount_1600 err:" + JSON.stringify(err)); + expect().assertFail(); console.debug("====>ActsAccountCreateAccount_1600 end===="); done(); } diff --git a/account/appaccount/actsaccountoperatetest/src/main/js/test/CustomData.test.js b/account/appaccount/actsaccountoperatetest/src/main/js/test/CustomData.test.js index 1b1c604713a54b3a0a6d0fe24cb43afe92fada20..339cea5fb8048a03f205bd75b6379eee2d56cdd6 100644 --- a/account/appaccount/actsaccountoperatetest/src/main/js/test/CustomData.test.js +++ b/account/appaccount/actsaccountoperatetest/src/main/js/test/CustomData.test.js @@ -1087,18 +1087,21 @@ export default function ActsAccountCustomData() { var appAccountManager = account.createAppAccountManager(); console.debug("====>creat finish===="); appAccountManager.createAccount(" ", (err)=>{ - console.debug("====>add account ActsAccountCustomData_2900 err:" + JSON.stringify(err)); - expect(err.code != 0).assertEqual(true); + console.debug("====>createAccount ActsAccountCustomData_2900 err:" + JSON.stringify(err)); + expect(err).assertEqual(null); appAccountManager.setCustomData(" ", "key29", "value29", (err)=>{ console.debug("====>setCustomData ActsAccountCustomData_2900 err:" + JSON.stringify(err)); - expect(err.code != 0).assertEqual(true); + expect(err).assertEqual(null); appAccountManager.getCustomData(" ", "key29", (err, data)=>{ console.debug("====>getCustomData 2900 err:" + JSON.stringify(err)); console.debug("====>getCustomData 2900 data:" + JSON.stringify(data)); - expect(err.code != 0).assertEqual(true); - expect(data).assertEqual(null); - console.debug("====>ActsAccountCustomData_2900 end===="); - done(); + expect(err).assertEqual(null); + expect(data).assertEqual("value29"); + appAccountManager.removeAccount(" ", (err)=>{ + console.error("====>removeAccount ActsAccountCustomData_2900 err:" + JSON.stringify(err)); + expect(err).assertEqual(null); + done(); + }); }); }); }); @@ -1113,28 +1116,18 @@ export default function ActsAccountCustomData() { console.debug("====>ActsAccountCustomData_3000 start===="); var appAccountManager = account.createAppAccountManager(); console.debug("====>creat finish===="); - try{ + try { await appAccountManager.createAccount(" "); - } - catch(err){ - console.debug("====>add account ActsAccountCustomData_3000 err:" + JSON.stringify(err)); - expect(err.code != 0).assertEqual(true); - try{ - await appAccountManager.setCustomData(" ", "key30", "value30"); - } - catch(err){ - console.error("====>setCustomData ActsAccountCustomData_3000 err:" + JSON.stringify(err)); - expect(err.code != 0).assertEqual(true); - try{ - await appAccountManager.getCustomData(" ", "key30"); - } - catch(err){ - console.error("====>getCustomData ActsAccountCustomData_3000 err:" + JSON.stringify(err)); - expect(err.code != 0).assertEqual(true); - console.debug("====>ActsAccountCustomData_3000 end===="); - done(); - } - } + await appAccountManager.setCustomData(" ", "key30", "value30"); + var data = await appAccountManager.getCustomData(" ", "key30"); + console.error("====>getCustomData ActsAccountCustomData_3000 data:" + JSON.stringify(data)); + expect(data).assertEqual("value30"); + await appAccountManager.removeAccount(" "); + done(); + } catch (err) { + console.error("====>ActsAccountCustomData_3000 fail err:" + JSON.stringify(err)); + expect().assertFail(); + done(); } })