未验证 提交 130c7e59 编写于 作者: O openharmony_ci 提交者: Gitee

!6243 【账号】测试套名称修改,遗留属性覆盖

Merge pull request !6243 from 何海涛/modify_suits_name
......@@ -27,6 +27,7 @@ const LOGOUTINFO = {
id: '12345',
event: "Ohos.account.event.LOGOUT"
}
const LIMIT = 1024
export default function ActsDAGetSetTest() {
describe('ActsDAGetSetTest', function () {
beforeEach(function () {
......@@ -35,7 +36,7 @@ export default function ActsDAGetSetTest() {
})
/**
* @tc.number ActsDistributedAccountDeviceId_0100
* @tc.number ActsDADeviceId_0100
* @tc.name Test query the distribruted id by callback.
* @tc.desc Test distributedAccount.getOsAccountDistributedInfo API functionality by callback.
*/
......@@ -61,7 +62,7 @@ export default function ActsDAGetSetTest() {
})
/**
* @tc.number SUB_Account_distributedAccount_JS_API_0100
* @tc.number getDistributedAccountAbility_test
* @tc.name Test distributedAccount.getDistributedAccountAbility.
* @tc.desc Test distributedAccount.getDistributedAccountAbility API functionality.
*/
......@@ -77,7 +78,7 @@ export default function ActsDAGetSetTest() {
})
/**
* @tc.number SUB_Account_distributedAccount_JS_API_0200
* @tc.number getOsAccountDistributedInfo_test001
* @tc.name Test distributedAccount.getOsAccountDistributedInfo.
* @tc.desc Test distributedAccount.getOsAccountDistributedInfo API functionality.
*/
......@@ -92,7 +93,7 @@ export default function ActsDAGetSetTest() {
})
/**
* @tc.number SUB_Account_distributedAccount_JS_API_0300
* @tc.number getOsAccountDistributedInfo_test002
* @tc.name Test distributedAccount.getOsAccountDistributedInfo by callback.
* @tc.desc Test distributedAccount.getOsAccountDistributedInfo API functionality by callback.
*/
......@@ -109,7 +110,7 @@ export default function ActsDAGetSetTest() {
})
/**
* @tc.number SUB_Account_distributedAccount_JS_API_0400
* @tc.number setOsAccountDistributedInfo_test001
* @tc.name Test distributedAccount.setOsAccountDistributedInfo.
* @tc.desc Test distributedAccount.setOsAccountDistributedInfo API functionality.
*/
......@@ -144,7 +145,7 @@ export default function ActsDAGetSetTest() {
})
/**
* @tc.number SUB_Account_distributedAccount_JS_API_0500
* @tc.number setOsAccountDistributedInfo_test002
* @tc.name Test distributedAccount.setOsAccountDistributedInfo by callback.
* @tc.desc Test distributedAccount.setOsAccountDistributedInfo API functionality by callback.
*/
......@@ -175,11 +176,11 @@ export default function ActsDAGetSetTest() {
})
/**
* @tc.number SUB_Account_distributedAccount_JS_API_0300
* @tc.number setOsAccountDistributedInfo_test003
* @tc.name Test distributedAccount.setOsAccountDistributedInfo by callback.
* @tc.desc Test distributedAccount.setOsAccountDistributedInfo API functionality by callback.
*/
it('setOsAccountDistributedInfo_test003', 0, function () {
it('setOsAccountDistributedInfo_test003', 0, async function (done) {
const accountAbility = account.getDistributedAccountAbility()
let obj = {
id: '12345',
......@@ -187,22 +188,19 @@ export default function ActsDAGetSetTest() {
event: 'Ohos.account.event.TOKEN_INVALID',
scalableData:{}
};
accountAbility.setOsAccountDistributedInfo(obj, function (result) {
console.debug("====>setOsAccountDistributedInfo_test003 update_err:" + JSON.stringify(result))
accountAbility.getOsAccountDistributedInfo(obj).then(function (data) {
console.debug("====>setOsAccountDistributedInfo_test003 data:" + JSON.stringify(data))
expect(data.name).assertNull()
accountAbility.setOsAccountDistributedInfo(obj, async (err)=> {
console.debug("====>setOsAccountDistributedInfo_test003 set_err:" + JSON.stringify(err))
expect(err.code).assertEqual(12300001)
done();
})
});
})
/**
* @tc.number SUB_Account_distributedAccount_JS_API_0500
* @tc.number setOsAccountDistributedInfo_test004
* @tc.name Test distributedAccount.setOsAccountDistributedInfo by callback.
* @tc.desc Test distributedAccount.setOsAccountDistributedInfo API functionality by callback.
*/
it('setOsAccountDistributedInfo_test004', 0, function () {
it('setOsAccountDistributedInfo_test004', 0, async function (done) {
const accountAbility = account.getDistributedAccountAbility()
let obj = {
id: '12345',
......@@ -210,9 +208,9 @@ export default function ActsDAGetSetTest() {
event: 'Ohos.account.event.LOGIN',
scalableData:{}
};
accountAbility.setOsAccountDistributedInfo(obj, function (err) {
accountAbility.setOsAccountDistributedInfo(obj, async (err)=>{
console.debug("====>setOsAccountDistributedInfo_test004 update_err:" + JSON.stringify(err))
accountAbility.getOsAccountDistributedInfo(function (err, data) {
accountAbility.getOsAccountDistributedInfo(async (err, data) => {
console.debug("====>setOsAccountDistributedInfo_test004 query_err:" + JSON.stringify(err))
console.debug("====>setOsAccountDistributedInfo_test004 query_data:" + JSON.stringify(data))
expect(data.name).assertEqual('ZhangSan')
......@@ -222,76 +220,380 @@ export default function ActsDAGetSetTest() {
name: 'ZhangSan',
event: 'Ohos.account.event.LOGOFF'
};
accountAbility.setOsAccountDistributedInfo(obj).then(function (result) {
expect(err).assert(null)
try{
await accountAbility.setOsAccountDistributedInfo(obj)
console.debug('====>setOsAccountDistributedInfo_test004 end')
done();
});
}catch(err){
console.debug('====>setOsAccountDistributedInfo_test004 err:' + JSON.stringify(err))
expect().assertFail();
done();
}
});
});
})
/**
* @tc.number SUB_Account_distributedAccount_JS_API_0600
* @tc.number setOsAccountDistributedInfo_test005
* @tc.name Test distributedAccount.setOsAccountDistributedInfo by callback.
* @tc.desc Test distributedAccount.setOsAccountDistributedInfo API functionality by callback.
* normal nickname
*/
it('setOsAccountDistributedInfo_test005', 0, function () {
it('setOsAccountDistributedInfo_test005', 0, async function (done) {
const accountAbility = account.getDistributedAccountAbility()
let obj = {
id: '12345',
name: 'ZhangSan',
event: 'Ohos.account.event.LOGIN',
scalableData:{age:'12'}
scalableData:{},
nickname:'test'
};
accountAbility.setOsAccountDistributedInfo(obj, function (err) {
console.debug("====>setOsAccountDistributedInfo_test005 update_err:" + JSON.stringify(err))
accountAbility.getOsAccountDistributedInfo(function (err, data) {
console.debug("====>setOsAccountDistributedInfo_test005 query_err:" + JSON.stringify(err))
console.debug("====>setOsAccountDistributedInfo_test005 query_data:" + JSON.stringify(data))
expect(data.scalableData.age).assertEqual('12')
console.debug("====>updateOsAccountDistributedInfo_test005 set_err:" + JSON.stringify(err))
accountAbility.getOsAccountDistributedInfo(async (err, data) => {
console.debug("====>updateOsAccountDistributedInfo_test005 get_err:" + JSON.stringify(err))
console.debug("====>updateOsAccountDistributedInfo_test005 get_data:" + JSON.stringify(data))
expect(data.name).assertEqual('ZhangSan')
expect(data.id).assertEqual('5994471ABB01112AFCC18159F6CC74B4F511B99806DA59B3CAF5A9C173CACFC5')
let obj = {
id: '12345',
name: 'ZhangSan',
event: 'Ohos.account.event.LOGOFF'
};
accountAbility.setOsAccountDistributedInfo(obj).then(function (result) {
expect(err).assert(null)
console.debug("====>start LOGOFF")
try{
await accountAbility.setOsAccountDistributedInfo(obj)
console.debug('====>setOsAccountDistributedInfo_test005 end')
done();
}catch(err){
console.debug('====>setOsAccountDistributedInfo_test005 err:' + JSON.stringify(err))
expect().assertFail();
done();
}
});
});
})
/**
* @tc.number setOsAccountDistributedInfo_test006
* @tc.name Test distributedAccount.setOsAccountDistributedInfo by promise.
* @tc.desc Test distributedAccount.setOsAccountDistributedInfo API functionality by promise.
* normal nickname
*/
it('setOsAccountDistributedInfo_test006', 0, async function (done) {
const accountAbility = account.getDistributedAccountAbility()
let obj = {
id: '12345',
name: 'ZhangSan',
event: 'Ohos.account.event.LOGIN',
scalableData: {},
nickname: 'test'
};
accountAbility.setOsAccountDistributedInfo(obj).then(() => {
accountAbility.getOsAccountDistributedInfo(function (err, data) {
console.debug("====>setOsAccountDistributedInfo_test006 get_err:" + JSON.stringify(err))
console.debug("====>setOsAccountDistributedInfo_test006 get_data:" + JSON.stringify(data))
expect(data.name).assertEqual('ZhangSan')
expect(data.id).assertEqual('5994471ABB01112AFCC18159F6CC74B4F511B99806DA59B3CAF5A9C173CACFC5')
let obj = {
id: '12345',
name: 'ZhangSan',
event: 'Ohos.account.event.LOGOFF'
};
console.debug("====>start LOGOFF")
accountAbility.setOsAccountDistributedInfo(obj).then(function (err) {
console.debug("====>LOGOFF err:" + JSON.stringify(err))
expect(err).assertEqual(null)
done();
});
})
.catch((err) => {
console.debug("====>setOsAccountDistributedInfo_test006 update_err:" + JSON.stringify(err))
expect().assertFail();
done();
})
})
})
/**
* @tc.number SUB_Account_distributedAccount_JS_API_0700
* @tc.number setOsAccountDistributedInfo_test007
* @tc.name Test distributedAccount.setOsAccountDistributedInfo by callback.
* @tc.desc Test distributedAccount.setOsAccountDistributedInfo API functionality by callback.
* normal avatar
*/
it('setOsAccountDistributedInfo_test006', 0, function () {
it('setOsAccountDistributedInfo_test007', 0, async function (done) {
const accountAbility = account.getDistributedAccountAbility()
let obj = {
id: '12345',
name: 'ZhangSan',
event: 'Ohos.account.event.LOGIN',
scalableData:{age:'12'}
scalableData:{},
avatar:'test'
};
accountAbility.setOsAccountDistributedInfo(obj, function (err) {
console.debug("====>setOsAccountDistributedInfo_test006 update_err:" + JSON.stringify(err))
accountAbility.getOsAccountDistributedInfo(function (err, data) {
console.debug("====>setOsAccountDistributedInfo_test006 query_err:" + JSON.stringify(err))
console.debug("====>setOsAccountDistributedInfo_test006 query_data:" + JSON.stringify(data))
expect(data.scalableData.age).assertEqual('12')
accountAbility.setOsAccountDistributedInfo(obj, (err) => {
console.debug("====>setOsAccountDistributedInfo_test007 set_err:" + JSON.stringify(err))
accountAbility.getOsAccountDistributedInfo(async (err, data) =>{
console.debug("====>setOsAccountDistributedInfo_test007 get_err:" + JSON.stringify(err))
console.debug("====>setOsAccountDistributedInfo_test007 get_data:" + JSON.stringify(data))
expect(data.name).assertEqual('ZhangSan')
expect(data.id).assertEqual('5994471ABB01112AFCC18159F6CC74B4F511B99806DA59B3CAF5A9C173CACFC5')
let obj = {
id: '12345',
name: 'ZhangSan',
event: 'Ohos.account.event.LOGOFF'
};
accountAbility.setOsAccountDistributedInfo(obj).then(function (result) {
expect(err).assert(null)
console.debug("====>start LOGOFF")
try{
await accountAbility.setOsAccountDistributedInfo(obj)
console.debug('====>setOsAccountDistributedInfo_test007 end')
done();
}catch(err){
console.debug('====>setOsAccountDistributedInfo_test007 err:' + JSON.stringify(err))
expect().assertFail();
done();
}
});
});
})
/**
* @tc.number setOsAccountDistributedInfo_test008
* @tc.name Test distributedAccount.setOsAccountDistributedInfo by promise.
* @tc.desc Test distributedAccount.setOsAccountDistributedInfo API functionality by promise.
* normal avatar
*/
it('setOsAccountDistributedInfo_test008', 0, async function (done) {
const accountAbility = account.getDistributedAccountAbility()
let obj = {
id: '12345',
name: 'ZhangSan',
event: 'Ohos.account.event.LOGIN',
scalableData:{},
avatar:'test'
};
accountAbility.setOsAccountDistributedInfo(obj).then(() => {
accountAbility.getOsAccountDistributedInfo((err, data) => {
console.debug("====>setOsAccountDistributedInfo_test008 get_err:" + JSON.stringify(err))
console.debug("====>setOsAccountDistributedInfo_test008 get_data:" + JSON.stringify(data))
expect(data.name).assertEqual('ZhangSan')
expect(data.id).assertEqual('5994471ABB01112AFCC18159F6CC74B4F511B99806DA59B3CAF5A9C173CACFC5')
let obj = {
id: '12345',
name: 'ZhangSan',
event: 'Ohos.account.event.LOGOFF'
};
console.debug("====>start LOGOFF")
accountAbility.setOsAccountDistributedInfo(obj).then(() => {
console.debug('====>setOsAccountDistributedInfo_test008 end')
done();
}).catch((err) => {
console.debug('====>setOsAccountDistributedInfo_test008 err:' + JSON.stringify(err))
expect().assertFail();
done();
})
});
}).catch(() => {
console.debug("====>setOsAccountDistributedInfo_test008 throw_err:" + JSON.stringify(err))
expect().assertFail();
done();
})
})
/**
* @tc.number setOsAccountDistributedInfo_test009
* @tc.name Test distributedAccount.setOsAccountDistributedInfo by callback.
* @tc.desc Test distributedAccount.setOsAccountDistributedInfo API functionality by callback.
* overlength nickname 21
*/
it('setOsAccountDistributedInfo_test009', 0, async function (done) {
const accountAbility = account.getDistributedAccountAbility()
var limitNickName = '';
for (var i = 0; i < 21; i++) {
limitNickName += 'n';
}
let obj = {
id: '12345',
name: 'ZhangSan',
event: 'Ohos.account.event.LOGIN',
scalableData:{},
nickname:limitNickName,
avatar:'test'
};
accountAbility.setOsAccountDistributedInfo(obj, (err)=>{
console.debug("====>setOsAccountDistributedInfo_test009 set_err:" + JSON.stringify(err))
expect(err.code).assertEqual(12300001);
done();
})
})
/**
* @tc.number setOsAccountDistributedInfo_test010
* @tc.name Test distributedAccount.setOsAccountDistributedInfo by promise.
* @tc.desc Test distributedAccount.setOsAccountDistributedInfo API functionality by promise.
* overlength nickname 21
*/
it('setOsAccountDistributedInfo_test010', 0, async function (done) {
const accountAbility = account.getDistributedAccountAbility()
var limitNickName = '';
for (var i = 0; i < 21; i++) {
limitNickName += 'n';
}
let obj = {
id: '12345',
name: 'ZhangSan',
event: 'Ohos.account.event.LOGIN',
scalableData:{},
nickname:limitNickName,
avatar:'test'
};
accountAbility.setOsAccountDistributedInfo(obj).then(() => {
console.debug("====>setOsAccountDistributedInfo_test010 err:" + JSON.stringify(err))
expect().assertFail()
done();
}).catch((err) => {
console.debug("====>setOsAccountDistributedInfo_test010 throw_err:" + JSON.stringify(err))
expect(err.code).assertEqual(12300001);
done();
})
})
/**
* @tc.number setOsAccountDistributedInfo_test011
* @tc.name Test distributedAccount.setOsAccountDistributedInfo by callback.
* @tc.desc Test distributedAccount.setOsAccountDistributedInfo API functionality by callback.
* overlength avatar 3*1024*1024+1
*/
it('setOsAccountDistributedInfo_test011', 0, async function (done) {
const accountAbility = account.getDistributedAccountAbility()
var limitAvatar = '';
for (var i = 0; i < LIMIT*3; i++) {
limitAvatar +=
'0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789' +
'0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789' +
'0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789' +
'0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789' +
'0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789' +
'0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789' +
'0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789' +
'0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789' +
'0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789' +
'0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789' +
'012345678901234567890123';
}
limitAvatar += 'n'
console.debug(limitAvatar.length)
let obj = {
id: '12345',
name: 'ZhangSan',
event: 'Ohos.account.event.LOGIN',
scalableData:{},
avatar: limitAvatar
};
console.debug(JSON.stringify(obj))
accountAbility.setOsAccountDistributedInfo(obj, (err)=>{
console.debug("====>setOsAccountDistributedInfo_test011 update_err:" + JSON.stringify(err))
expect(err.code).assertEqual(12300001);
done();
})
})
/**
* @tc.number setOsAccountDistributedInfo_test012
* @tc.name Test distributedAccount.setOsAccountDistributedInfo by peomise.
* @tc.desc Test distributedAccount.setOsAccountDistributedInfo API functionality by peomise.
* overlength avatar 3*1024*1024+1
*/
it('setOsAccountDistributedInfo_test012', 0, async function (done) {
const accountAbility = account.getDistributedAccountAbility()
var limitAvatar = '';
for (var i = 0; i < LIMIT*3; i++) {
limitAvatar +=
'0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789' +
'0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789' +
'0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789' +
'0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789' +
'0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789' +
'0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789' +
'0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789' +
'0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789' +
'0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789' +
'0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789' +
'012345678901234567890123';
}
limitAvatar += 'n'
console.debug(limitAvatar.length)
let obj = {
id: '12345',
name: 'ZhangSan',
event: 'Ohos.account.event.LOGIN',
scalableData:{},
avatar: limitAvatar
};
try{
await accountAbility.setOsAccountDistributedInfo(obj)
console.debug("====>setOsAccountDistributedInfo_test012 set_err:" + JSON.stringify(err))
expect().assertFail()
done();
}catch(err){
console.debug("====>setOsAccountDistributedInfo_test012 throw_err:" + JSON.stringify(err))
expect(err.code).assertEqual(12300001);
done();
}
})
/**
* @tc.number setOsAccountDistributedInfo_test013
* @tc.name Test distributedAccount.setOsAccountDistributedInfo by callback.
* @tc.desc Test distributedAccount.setOsAccountDistributedInfo API functionality by callback.
* overlength scalableData
*/
it('setOsAccountDistributedInfo_test013', 0, async function (done) {
const accountAbility = account.getDistributedAccountAbility()
var limitInfo = {};
for (var i = 0; i < 513; i++) {
limitInfo = Object.assign(limitInfo, {[i]:i})
}
let obj = {
id: '12345',
name: 'ZhangSan',
event: 'Ohos.account.event.LOGIN',
scalableData:limitInfo,
};
console.debug(JSON.stringify(obj))
accountAbility.setOsAccountDistributedInfo(obj, (err)=>{
console.debug("====>setOsAccountDistributedInfo_test013 update_err:" + JSON.stringify(err))
expect(err.code).assertEqual(12300001);
done();
})
})
/**
* @tc.number setOsAccountDistributedInfo_test014
* @tc.name Test distributedAccount.setOsAccountDistributedInfo by promise.
* @tc.desc Test distributedAccount.setOsAccountDistributedInfo API functionality by promise.
* overlength scalableData
*/
it('setOsAccountDistributedInfo_test014', 0, async function (done) {
const accountAbility = account.getDistributedAccountAbility()
var limitInfo = {};
for (var i = 0; i < 513; i++) {
limitInfo = Object.assign(limitInfo, {[i]:i})
}
let obj = {
id: '12345',
name: 'ZhangSan',
event: 'Ohos.account.event.LOGIN',
scalableData:limitInfo,
};
try{
await accountAbility.setOsAccountDistributedInfo(obj)
expect().assertFail()
done();
}catch(err){
console.debug("====>setOsAccountDistributedInfo_test014 throw_err:" + JSON.stringify(err))
expect(err.code).assertEqual(12300001)
done();
}
})
})
}
......@@ -50,6 +50,18 @@ export default function ActsAccountAppAccess() {
await sleep(1500)
done();
});
beforeEach(async (done)=>{
console.debug("====>afterEach start====");
var appAccountManager = account.getAccountManager();
var accounts = await appAccountManager.getAllAccountByOwner(owner)
for (i=0;i<accounts.length;i++){
var localName = accounts[i].name
if(localName == 'zhangsan'){
await appAccountManager.removeAccount(localName)
}
}
done();
})
/*
* @tc.number : ActsAccountCheckAccountLabels_0100
* @tc.name : Check Account Labels callback form
......@@ -347,37 +359,37 @@ export default function ActsAccountAppAccess() {
/*
* @tc.number : ActsAccountDeleteAccountCredential_0100
* @tc.number : ActsAccountDeleteCredential_0100
* @tc.name : Delete Account Credential callback form
* @tc.desc :
*/
it('ActsAccountDeleteAccountCredential_0100', 0, async function (done) {
console.debug("====>ActsAccountDeleteAccountCredential_0100 start====");
it('ActsAccountDeleteCredential_0100', 0, async function (done) {
console.debug("====>ActsAccountDeleteCredential_0100 start====");
var appAccountManager = account.createAppAccountManager();
console.debug("====>start finish====");
appAccountManager.createAccount(name, (err)=>{
console.debug("====>ActsAccountDeleteAccountCredential_0100 add_account_err:" + JSON.stringify(err));
console.debug("====>ActsAccountDeleteCredential_0100 add_account_err:" + JSON.stringify(err));
expect(err).assertEqual(null);
appAccountManager.setCredential(name, "PIN", "credential1", (err)=>{
console.debug("====>ActsAccountDeleteAccountCredential_0100 setAccountCredential_err:" + JSON.stringify(err));
console.debug("====>ActsAccountDeleteCredential_0100 setAccountCredential_err:" + JSON.stringify(err));
expect(err).assertEqual(null);
appAccountManager.getCredential(name, "PIN", (err, data) =>{
console.debug("====>ActsAccountDeleteAccountCredential_0100 getAccountCredential_err:" + JSON.stringify(err))
console.debug("====>ActsAccountDeleteCredential_0100 getAccountCredential_err:" + JSON.stringify(err))
expect(err).assertEqual(null);
console.debug("====>ActsAccountDeleteAccountCredential_0100 getAccountCredential_success:" + JSON.stringify(data));
appAccountManager.deleteAccountCredential(name, "PIN", (err, data)=>{
console.debug("====>ActsAccountDeleteAccountCredential_0100 deleteAccountCredential_err:" + JSON.stringify(err));
console.debug("====>ActsAccountDeleteCredential_0100 getAccountCredential_success:" + JSON.stringify(data));
appAccountManager.deleteCredential(name, "PIN", (err, data)=>{
console.debug("====>ActsAccountDeleteCredential_0100 deleteCredential_err:" + JSON.stringify(err));
expect(err).assertEqual(null);
expect(data).assertEqual(undefined);
console.debug("====>ActsAccountDeleteAccountCredential_0100 deleteAccountCredential_data:" + JSON.stringify(data));
console.debug("====>ActsAccountDeleteCredential_0100 deleteCredential_data:" + JSON.stringify(data));
expect(data).assertEqual(null);
try{
appAccountManager.removeAccount(name)
console.debug('====>ActsAccountDeleteAccountCredential_0100 removeAccount_success')
console.debug('====>ActsAccountDeleteCredential_0100 removeAccount_success')
done();
}
catch{
console.debug('====>ActsAccountDeleteAccountCredential_0100 removeAccount_err')
console.debug('====>ActsAccountDeleteCredential_0100 removeAccount_err')
expect().assertFail()
done();
}
......@@ -388,48 +400,48 @@ export default function ActsAccountAppAccess() {
});
/*
* @tc.number : ActsAccountDeleteAccountCredential_0200
* @tc.number : ActsAccountDeleteCredential_0200
* @tc.name : Delete Account Credential promise form
* @tc.desc :
*/
it('ActsAccountDeleteAccountCredential_0200', 0, async function (done) {
console.debug("====>ActsAccountDeleteAccountCredential_0200 start====");
it('ActsAccountDeleteCredential_0200', 0, async function (done) {
console.debug("====>ActsAccountDeleteCredential_0200 start====");
var appAccountManager = account.createAppAccountManager();
appAccountManager.createAccount(name, createAccountOptions).then((data) =>{
console.debug("====>ActsAccountDeleteAccountCredential_0200 add_account_success");
console.debug("====>ActsAccountDeleteCredential_0200 add_account_success");
appAccountManager.setCredential(name, "PIN", "credential2").then(() =>{
console.debug("====>ActsAccountDeleteAccountCredential_0200 setAccountCredential_success");
console.debug("====>ActsAccountDeleteCredential_0200 setAccountCredential_success");
appAccountManager.getCredential(name, "PIN").then((data) =>{
console.debug("====>ActsAccountDeleteAccountCredential_0200 getAccountCredential_data:" + JSON.stringify(data));
appAccountManager.deleteAccountCredential(name, "PIN").then((data) =>{
console.debug("====>ActsAccountDeleteAccountCredential_0200 data:" + JSON.stringify(data));
console.debug("====>ActsAccountDeleteCredential_0200 getAccountCredential_data:" + JSON.stringify(data));
appAccountManager.deleteCredential(name, "PIN").then((data) =>{
console.debug("====>ActsAccountDeleteCredential_0200 data:" + JSON.stringify(data));
try{
appAccountManager.removeAccount(name)
console.debug('====>ActsAccountDeleteAccountCredential_0200 removeAccount_success')
console.debug('====>ActsAccountDeleteCredential_0200 removeAccount_success')
done();
}
catch{
console.debug('====>ActsAccountDeleteAccountCredential_0200 removeAccount_err')
console.debug('====>ActsAccountDeleteCredential_0200 removeAccount_err')
expect().assertFail()
}
}).catch((err) =>{
console.debug("====>ActsAccountDeleteAccountCredential_0200 err:" + JSON.stringify(err));
console.debug("====>ActsAccountDeleteCredential_0200 err:" + JSON.stringify(err));
expect().assertFail();
done();
})
}).catch((err)=>{
console.debug("====>ActsAccountDeleteAccountCredential_0200 getAccountCredential_err:" + JSON.stringify(err));
console.debug("====>ActsAccountDeleteCredential_0200 getAccountCredential_err:" + JSON.stringify(err));
expect().assertFail();
done();
})
}).catch((err) =>{
console.debug("====>ActsAccountDeleteAccountCredential_0200 setAccountCredential_err:" + JSON.stringify(err));
console.debug("====>ActsAccountDeleteCredential_0200 setAccountCredential_err:" + JSON.stringify(err));
expect().assertFail();
done();
})
}).catch((err) => {
console.debug("====>ActsAccountDeleteAccountCredential_0200 createAccount_err:" + JSON.stringify(err));
console.debug("====>ActsAccountDeleteCredential_0200 createAccount_err:" + JSON.stringify(err));
expect().assertFail();
done();
})
......@@ -702,7 +714,7 @@ export default function ActsAccountAppAccess() {
it('ActsAccountCreateAccountImplicitly_0100', 0, async function (done) {
console.debug("====>ActsAccountCreateAccountImplicitly_0100 start====");
var appAccountManager = account.createAppAccountManager();
var options = {authType: "PIN"}
var options = {authType: "PIN", requiredLabels:['male', '30-40'], parameters: ['sex', 'age']}
console.debug("====>start finish====");
appAccountManager.createAccountImplicitly("com.example.accountauthenticator", options, {
onResult: async (resultCode, resultData)=>{
......
......@@ -44,9 +44,9 @@ export default function ActsAccountCustomData() {
/*
* @tc.number : ActsAccountCustomData_0100
* @tc.name : The correct calls setAssociatedData and getAssociatedData get the value
* @tc.name : The correct calls setAssociatedData and getCustomData get the value
* @tc.desc : The setAssociatedData setting valueis called when the forwarding parameters
* are correct, and then getAssociatedData is called for the value(callback)
* are correct, and then getCustomData is called for the value(callback)
*/
it('ActsAccountCustomData_0100', 0, async function (done) {
console.debug("====>ActsAccountCustomData_0100 start====");
......@@ -58,9 +58,9 @@ export default function ActsAccountCustomData() {
appAccountManager.setAssociatedData("account_name_0100", "key1", "value1", (err)=>{
console.debug("====>setAssociatedData ActsAccountCustomData_0100 err:" + JSON.stringify(err));
expect(err).assertEqual(null);
appAccountManager.getAssociatedData("account_name_0100", "key1", (err, data)=>{
console.debug("====>getAssociatedData 0100 err:" + JSON.stringify(err));
console.debug("====>getAssociatedData 0100 data:" + JSON.stringify(data));
appAccountManager.getCustomData("account_name_0100", "key1", (err, data)=>{
console.debug("====>getCustomData 0100 err:" + JSON.stringify(err));
console.debug("====>getCustomData 0100 data:" + JSON.stringify(data));
expect(err).assertEqual(null);
expect(data).assertEqual("value1");
appAccountManager.removeAccount("account_name_0100", (err)=>{
......@@ -76,9 +76,9 @@ export default function ActsAccountCustomData() {
/*
* @tc.number : ActsAccountCustomData_0200
* @tc.name : The correct calls setAssociatedData and getAssociatedData get the value
* @tc.name : The correct calls setAssociatedData and getCustomData get the value
* @tc.desc : The setAssociatedData setting value is called when the forwarding parameters
* are correct, and then getAssociatedData is called for the value(promise)
* are correct, and then getCustomData is called for the value(promise)
*/
it('ActsAccountCustomData_0200', 0, async function (done) {
console.debug("====>ActsAccountCustomData_0200 start====");
......@@ -102,16 +102,16 @@ export default function ActsAccountCustomData() {
expect().assertFail();
done();
}
console.debug("====>getAssociatedData ActsAccountCustomData_0200 start====");
console.debug("====>getCustomData ActsAccountCustomData_0200 start====");
try{
var data = await appAccountManager.getAssociatedData("account_name_0200", "key2");
var data = await appAccountManager.getCustomData("account_name_0200", "key2");
}
catch(err){
console.error("====>getAssociatedData ActsAccountCustomData_0200 err:" + JSON.stringify(err));
console.error("====>getCustomData ActsAccountCustomData_0200 err:" + JSON.stringify(err));
expect().assertFail();
done();
}
console.debug("====>getAssociatedData ActsAccountCustomData_0200 data:" + JSON.stringify(data));
console.debug("====>getCustomData ActsAccountCustomData_0200 data:" + JSON.stringify(data));
expect(data).assertEqual("value2");
console.debug("====>delete account ActsAccountCustomData_0200 start====");
try{
......@@ -129,7 +129,7 @@ export default function ActsAccountCustomData() {
/*
* @tc.number : ActsAccountCustomData_0300
* @tc.name : Get it directly without setting value
* @tc.desc : Call getAssociatedData directly to get value without calling setAssociatedData(callback)
* @tc.desc : Call getCustomData directly to get value without calling setAssociatedData(callback)
*/
it('ActsAccountCustomData_0300', 0, async function (done) {
console.debug("====>ActsAccountCustomData_0300 start====");
......@@ -138,9 +138,9 @@ export default function ActsAccountCustomData() {
appAccountManager.createAccount("account_name_0300", (err)=>{
console.debug("====>add account ActsAccountCustomData_0300 err:" + JSON.stringify(err));
expect(err).assertEqual(null);
appAccountManager.getAssociatedData("account_name_0300", "key3", (err, data)=>{
console.debug("====>getAssociatedData 0300 err:" + JSON.stringify(err));
console.debug("====>getAssociatedData 0300 data:" + JSON.stringify(data));
appAccountManager.getCustomData("account_name_0300", "key3", (err, data)=>{
console.debug("====>getCustomData 0300 err:" + JSON.stringify(err));
console.debug("====>getCustomData 0300 data:" + JSON.stringify(data));
expect(err.code != 0).assertEqual(true);
expect(data).assertEqual(null);
appAccountManager.removeAccount("account_name_0300", (err)=>{
......@@ -156,7 +156,7 @@ export default function ActsAccountCustomData() {
/*
* @tc.number : ActsAccountCustomData_0400
* @tc.name : Get it directly without setting value
* @tc.desc : Call getAssociatedData directly to get value without calling setAssociatedData(promise)
* @tc.desc : Call getCustomData directly to get value without calling setAssociatedData(promise)
*/
it('ActsAccountCustomData_0400', 0, async function (done) {
console.debug("====>ActsAccountCustomData_0400 start====");
......@@ -172,13 +172,13 @@ export default function ActsAccountCustomData() {
done();
}
try{
await appAccountManager.getAssociatedData("account_name_0400", "key4");
console.error("====>getAssociatedData fail ActsAccountCustomData_0400====");
await appAccountManager.getCustomData("account_name_0400", "key4");
console.error("====>getCustomData fail ActsAccountCustomData_0400====");
expect().assertFail();
done();
}
catch(err){
console.debug("====>getAssociatedData ActsAccountCustomData_0400 err:" + JSON.stringify(err));
console.debug("====>getCustomData ActsAccountCustomData_0400 err:" + JSON.stringify(err));
expect(err.code != 0).assertEqual(true);
console.debug("====>delete account ActsAccountCustomData_0400 start====");
try{
......@@ -196,9 +196,9 @@ export default function ActsAccountCustomData() {
/*
* @tc.number : ActsAccountCustomData_0500
* @tc.name : Call getAssociatedData to get value when passing in the error parameter
* @tc.name : Call getCustomData to get value when passing in the error parameter
* @tc.desc : After calling setAssociatedData setting value correctly,
* call the getAssociatedData of the pass error to check if you get the value(callback)
* call the getCustomData of the pass error to check if you get the value(callback)
*/
it('ActsAccountCustomData_0500', 0, async function (done) {
console.debug("====>ActsAccountCustomData_0500 start====");
......@@ -210,9 +210,9 @@ export default function ActsAccountCustomData() {
appAccountManager.setAssociatedData("account_name_0500", "key5", "value5", (err)=>{
console.debug("====>setAssociatedData ActsAccountCustomData_0500 err:" + JSON.stringify(err));
expect(err).assertEqual(null);
appAccountManager.getAssociatedData("account_name_0500", "keyerr", (err, data)=>{
console.debug("====>getAssociatedData 0500 err:" + JSON.stringify(err));
console.debug("====>getAssociatedData 0500 data:" + JSON.stringify(data));
appAccountManager.getCustomData("account_name_0500", "keyerr", (err, data)=>{
console.debug("====>getCustomData 0500 err:" + JSON.stringify(err));
console.debug("====>getCustomData 0500 data:" + JSON.stringify(data));
expect(err.code != 0).assertEqual(true);
appAccountManager.removeAccount("account_name_0500", (err)=>{
console.debug("====>delete Account 0500 err:" + JSON.stringify(err));
......@@ -227,9 +227,9 @@ export default function ActsAccountCustomData() {
/*
* @tc.number : ActsAccountCustomData_0600
* @tc.name : Call getAssociatedData to get value when passing in the error parameter
* @tc.name : Call getCustomData to get value when passing in the error parameter
* @tc.desc : After calling setAssociatedData setting value correctly,
* call the getAssociatedData of the pass error to check if you get the value(promise)
* call the getCustomData of the pass error to check if you get the value(promise)
*/
it('ActsAccountCustomData_0600', 0, async function (done) {
console.debug("====>ActsAccountCustomData_0600 start====");
......@@ -246,10 +246,10 @@ export default function ActsAccountCustomData() {
}
await appAccountManager.setAssociatedData("account_name_0600", "key6", "value6");
try{
var data = await appAccountManager.getAssociatedData("account_name_0600", "keyerr");
var data = await appAccountManager.getCustomData("account_name_0600", "keyerr");
}
catch(err){
console.debug("====>getAssociatedData 0600 err:" + JSON.stringify(err));
console.debug("====>getCustomData 0600 err:" + JSON.stringify(err));
expect(err.code != 0).assertEqual(true);
console.debug("====>delete account ActsAccountCustomData_0600 start====");
try{
......@@ -267,9 +267,9 @@ export default function ActsAccountCustomData() {
/*
* @tc.number : ActsAccountCustomData_0700
* @tc.name : Whether getAssociatedData can get the correct value when calling setAssociatedData multiple times
* @tc.name : Whether getCustomData can get the correct value when calling setAssociatedData multiple times
* @tc.desc : When the first setAssociatedData is called and the second setAssociatedData
* is called,the setting of the value is different if the call getAssociatedData
* is called,the setting of the value is different if the call getCustomData
* can get the second value(callback)
*/
it('ActsAccountCustomData_0700', 0, async function (done) {
......@@ -285,9 +285,9 @@ export default function ActsAccountCustomData() {
appAccountManager.setAssociatedData("account_name_0700", "key7", "newvalue7", (err)=>{
console.debug("====>setAssociatedDatafir second time 0700 err:" + JSON.stringify(err));
expect(err).assertEqual(null);
appAccountManager.getAssociatedData("account_name_0700", "key7", (err, data)=>{
console.debug("====>getAssociatedData 0700 err:" + JSON.stringify(err));
console.debug("====>getAssociatedData 0700 data:" + JSON.stringify(data));
appAccountManager.getCustomData("account_name_0700", "key7", (err, data)=>{
console.debug("====>getCustomData 0700 err:" + JSON.stringify(err));
console.debug("====>getCustomData 0700 data:" + JSON.stringify(data));
expect(err).assertEqual(null);
expect(data).assertEqual("newvalue7");
appAccountManager.removeAccount("account_name_0700", (err)=>{
......@@ -304,9 +304,9 @@ export default function ActsAccountCustomData() {
/*
* @tc.number : ActsAccountCustomData_0800
* @tc.name : Whether getAssociatedData can get the correct value when calling setAssociatedData multiple times
* @tc.name : Whether getCustomData can get the correct value when calling setAssociatedData multiple times
* @tc.desc : When the first setAssociatedData is called and the second setAssociatedData
* is called,the setting of the value is different if the call getAssociatedData
* is called,the setting of the value is different if the call getCustomData
* can get the second value(promise)
*/
it('ActsAccountCustomData_0800', 0, async function (done) {
......@@ -330,14 +330,14 @@ export default function ActsAccountCustomData() {
done();
}
try{
var data = await appAccountManager.getAssociatedData("account_name_0800", "key8");
var data = await appAccountManager.getCustomData("account_name_0800", "key8");
}
catch(err){
console.error("====>getAssociatedData ActsAccountCustomData_0800 err:" + JSON.stringify(err));
console.error("====>getCustomData ActsAccountCustomData_0800 err:" + JSON.stringify(err));
expect().assertFail();
done();
}
console.debug("====>getAssociatedData ActsAccountCustomData_0800 data:" + JSON.stringify(data));
console.debug("====>getCustomData ActsAccountCustomData_0800 data:" + JSON.stringify(data));
expect(data).assertEqual("newvalue8");
console.debug("====>delete account ActsAccountCustomData_0800 start====");
try{
......@@ -354,9 +354,9 @@ export default function ActsAccountCustomData() {
/*
* @tc.number : ActsAccountCustomData_0900
* @tc.name : Whether getAssociatedData can get the correct value when calling setAssociatedData multiple times
* @tc.name : Whether getCustomData can get the correct value when calling setAssociatedData multiple times
* @tc.desc : When the first setAssociatedData is called and the second setAssociatedData
* is called,the setting of the value is same if the call getAssociatedData
* is called,the setting of the value is same if the call getCustomData
* can get the second value(callback)
*/
it('ActsAccountCustomData_0900', 0, async function (done) {
......@@ -372,9 +372,9 @@ export default function ActsAccountCustomData() {
appAccountManager.setAssociatedData("account_name_0900", "key9", "value9", (err)=>{
console.debug("====>setAssociatedData second time 0900 err:" + JSON.stringify(err));
expect(err).assertEqual(null);
appAccountManager.getAssociatedData("account_name_0900", "key9", (err, data)=>{
console.debug("====>getAssociatedData 0900 err:" + JSON.stringify(err));
console.debug("====>getAssociatedData 0900 data:" + JSON.stringify(data));
appAccountManager.getCustomData("account_name_0900", "key9", (err, data)=>{
console.debug("====>getCustomData 0900 err:" + JSON.stringify(err));
console.debug("====>getCustomData 0900 data:" + JSON.stringify(data));
expect(err).assertEqual(null);
expect(data).assertEqual("value9");
appAccountManager.removeAccount("account_name_0900", (err)=>{
......@@ -391,9 +391,9 @@ export default function ActsAccountCustomData() {
/*
* @tc.number : ActsAccountCustomData_1000
* @tc.name : Whether getAssociatedData can get the correct value when calling setAssociatedData multiple times
* @tc.name : Whether getCustomData can get the correct value when calling setAssociatedData multiple times
* @tc.desc : When the first setAssociatedData is called and the second setAssociatedData
* is called,the setting of the value is same if the call getAssociatedData
* is called,the setting of the value is same if the call getCustomData
* can get the second value(promise)
*/
it('ActsAccountCustomData_1000', 0, async function (done) {
......@@ -419,14 +419,14 @@ export default function ActsAccountCustomData() {
done();
}
try{
var data = await appAccountManager.getAssociatedData("account_name_1000", "key10");
var data = await appAccountManager.getCustomData("account_name_1000", "key10");
}
catch(err){
console.error("====>getAssociatedData ActsAccountCustomData_1000 err:" + JSON.stringify(err));
console.error("====>getCustomData ActsAccountCustomData_1000 err:" + JSON.stringify(err));
expect().assertFail();
done();
}
console.debug("====>getAssociatedData 1000 data:" + JSON.stringify(data));
console.debug("====>getCustomData 1000 data:" + JSON.stringify(data));
expect(data).assertEqual("value10");
console.debug("====>delete account ActsAccountCustomData_1000 start====");
try{
......@@ -443,9 +443,9 @@ export default function ActsAccountCustomData() {
/*
* @tc.number : ActsAccountCustomData_1100
* @tc.name : Call multiple setAssociatedData calls multiple times getAssociatedData gets the value separately
* @tc.name : Call multiple setAssociatedData calls multiple times getCustomData gets the value separately
* @tc.desc : Call setAssociatedData setting value again after calling setAssociatedData setting
* different value, and then call getAssociatedData twice to get the set value(callback)
* different value, and then call getCustomData twice to get the set value(callback)
*/
it('ActsAccountCustomData_1100', 0, async function (done) {
console.debug("====>ActsAccountCustomData_1100 start====");
......@@ -460,14 +460,14 @@ export default function ActsAccountCustomData() {
appAccountManager.setAssociatedData("account_name_1100", "key11_second", "value11_second", (err)=>{
console.debug("====>setAssociatedData second time 1100 err:" + JSON.stringify(err));
expect(err).assertEqual(null);
appAccountManager.getAssociatedData("account_name_1100", "key11_first", (err,data)=>{
console.debug("====>getAssociatedData key11_first 1100 err:" + JSON.stringify(err));
console.debug("====>getAssociatedData key11_first 1100 data:" + JSON.stringify(data));
appAccountManager.getCustomData("account_name_1100", "key11_first", (err,data)=>{
console.debug("====>getCustomData key11_first 1100 err:" + JSON.stringify(err));
console.debug("====>getCustomData key11_first 1100 data:" + JSON.stringify(data));
expect(err).assertEqual(null);
expect(data).assertEqual("value11_first");
appAccountManager.getAssociatedData("account_name_1100", "key11_second", (err,data)=>{
console.debug("====>getAssociatedData key11_second 1100 err:" + JSON.stringify(err));
console.debug("====>getAssociatedData key11_second 1100 data:" + JSON.stringify(data));
appAccountManager.getCustomData("account_name_1100", "key11_second", (err,data)=>{
console.debug("====>getCustomData key11_second 1100 err:" + JSON.stringify(err));
console.debug("====>getCustomData key11_second 1100 data:" + JSON.stringify(data));
expect(err).assertEqual(null);
expect(data).assertEqual("value11_second");
appAccountManager.removeAccount("account_name_1100", (err)=>{
......@@ -484,9 +484,9 @@ export default function ActsAccountCustomData() {
/*
* @tc.number : ActsAccountCustomData_1200
* @tc.name : Call multiple setAssociatedData calls multiple times getAssociatedData gets the value separately
* @tc.name : Call multiple setAssociatedData calls multiple times getCustomData gets the value separately
* @tc.desc : Call setAssociatedData setting value again after calling setAssociatedData setting
* different value, and then call getAssociatedData twice to get the set value(promise)
* different value, and then call getCustomData twice to get the set value(promise)
*/
it('ActsAccountCustomData_1200', 0, async function (done) {
console.debug("====>ActsAccountCustomData_1200 start====");
......@@ -511,17 +511,17 @@ export default function ActsAccountCustomData() {
done();
}
try{
var dataFir = await appAccountManager.getAssociatedData("account_name_1200", "key12_first");
var dataSec = await appAccountManager.getAssociatedData("account_name_1200", "key12_second");
var dataFir = await appAccountManager.getCustomData("account_name_1200", "key12_first");
var dataSec = await appAccountManager.getCustomData("account_name_1200", "key12_second");
}
catch(err){
console.error("====>getAssociatedData ActsAccountCustomData_1200 err:" + JSON.stringify(err));
console.error("====>getCustomData ActsAccountCustomData_1200 err:" + JSON.stringify(err));
expect().assertFail();
done();
}
console.debug("====>ActsAccountCustomData_1200 getAssociatedData dataFir:" + JSON.stringify(dataFir));
console.debug("====>ActsAccountCustomData_1200 getCustomData dataFir:" + JSON.stringify(dataFir));
expect(dataFir).assertEqual("value12_first");
console.debug("====>ActsAccountCustomData_1200 getAssociatedData dataSec:" + JSON.stringify(dataSec));
console.debug("====>ActsAccountCustomData_1200 getCustomData dataSec:" + JSON.stringify(dataSec));
expect(dataSec).assertEqual("value12_second");
console.debug("====>delete account ActsAccountCustomData_1200 start====");
try{
......@@ -673,8 +673,8 @@ export default function ActsAccountCustomData() {
/*
* @tc.number : ActsAccountCustomData_1700
* @tc.name : setAssociatedData and getAssociatedData are called when the argument is spaced
* @tc.desc : Call setAssociatedData and then getAssociatedData when the incoming key is a space(callback)
* @tc.name : setAssociatedData and getCustomData are called when the argument is spaced
* @tc.desc : Call setAssociatedData and then getCustomData when the incoming key is a space(callback)
*/
it('ActsAccountCustomData_1700', 0, async function (done) {
console.debug("====>ActsAccountCustomData_1700 start====");
......@@ -686,9 +686,9 @@ export default function ActsAccountCustomData() {
appAccountManager.setAssociatedData("account_name_1700", " ", "value17", (err)=>{
console.debug("====>ActsAccountCustomData_1700 setAssociatedData:" + JSON.stringify(err));
expect(err).assertEqual(null);
appAccountManager.getAssociatedData("account_name_1700", " ", (err, data)=>{
console.debug("====>getAssociatedData 1700 err:" + JSON.stringify(err));
console.debug("====>getAssociatedData 1700 data:" + JSON.stringify(data));
appAccountManager.getCustomData("account_name_1700", " ", (err, data)=>{
console.debug("====>getCustomData 1700 err:" + JSON.stringify(err));
console.debug("====>getCustomData 1700 data:" + JSON.stringify(data));
expect(err).assertEqual(null);
expect(data).assertEqual("value17");
appAccountManager.removeAccount("account_name_1700", (err)=>{
......@@ -704,8 +704,8 @@ export default function ActsAccountCustomData() {
/*
* @tc.number : ActsAccountCustomData_1800
* @tc.name : setAssociatedData and getAssociatedData are called when the argument is spaced
* @tc.desc : Call setAssociatedData and then getAssociatedData when the incoming key is a space(promise)
* @tc.name : setAssociatedData and getCustomData are called when the argument is spaced
* @tc.desc : Call setAssociatedData and then getCustomData when the incoming key is a space(promise)
*/
it('ActsAccountCustomData_1800', 0, async function (done) {
console.debug("====>ActsAccountCustomData_1800 start====");
......@@ -722,14 +722,14 @@ export default function ActsAccountCustomData() {
}
await appAccountManager.setAssociatedData("account_name_1800", " ", "value18");
try{
var data = await appAccountManager.getAssociatedData("account_name_1800", " ");
var data = await appAccountManager.getCustomData("account_name_1800", " ");
}
catch(err){
console.error("====>setAssociatedData ActsAccountCustomData_1800 fail err:" + JSON.stringify(err));
expect().assertFail();
done();
}
console.debug("====>getAssociatedData ActsAccountCustomData_1800 data:" + JSON.stringify(data));
console.debug("====>getCustomData ActsAccountCustomData_1800 data:" + JSON.stringify(data));
expect(data).assertEqual("value18");
console.debug("====>delete account ActsAccountCustomData_1800 start====");
try{
......@@ -746,8 +746,8 @@ export default function ActsAccountCustomData() {
/*
* @tc.number : ActsAccountCustomData_1900
* @tc.name : setAssociatedData and getAssociatedData are called when the argument is spaced
* @tc.desc : Call setAssociatedData and then getAssociatedData when the incoming value is null(callback)
* @tc.name : setAssociatedData and getCustomData are called when the argument is spaced
* @tc.desc : Call setAssociatedData and then getCustomData when the incoming value is null(callback)
*/
it('ActsAccountCustomData_1900', 0, async function (done) {
console.debug("====>ActsAccountCustomData_1900 start====");
......@@ -759,9 +759,9 @@ export default function ActsAccountCustomData() {
appAccountManager.setAssociatedData("account_name_1900", "key19", "", (err)=>{
console.debug("====>setAssociatedData ActsAccountCustomData_1900 err:" + JSON.stringify(err));
expect(err).assertEqual(null);
appAccountManager.getAssociatedData("account_name_1900", "key19", (err, data)=>{
console.debug("====>getAssociatedData 1900 err:" + JSON.stringify(err));
console.debug("====>getAssociatedData 1900 data:" + JSON.stringify(data));
appAccountManager.getCustomData("account_name_1900", "key19", (err, data)=>{
console.debug("====>getCustomData 1900 err:" + JSON.stringify(err));
console.debug("====>getCustomData 1900 data:" + JSON.stringify(data));
expect(err).assertEqual(null);
expect(data).assertEqual("");
appAccountManager.removeAccount("account_name_1900", (err)=>{
......@@ -777,8 +777,8 @@ export default function ActsAccountCustomData() {
/*
* @tc.number : ActsAccountCustomData_2000
* @tc.name : setAssociatedData and getAssociatedData are called when the argument is spaced
* @tc.desc : Call setAssociatedData and then getAssociatedData when the incoming value is null(promise)
* @tc.name : setAssociatedData and getCustomData are called when the argument is spaced
* @tc.desc : Call setAssociatedData and then getCustomData when the incoming value is null(promise)
*/
it('ActsAccountCustomData_2000', 0, async function (done) {
console.debug("====>ActsAccountCustomData_2000 start====");
......@@ -802,14 +802,14 @@ export default function ActsAccountCustomData() {
done();
}
try{
var data = await appAccountManager.getAssociatedData("account_name_2000", "key20");
var data = await appAccountManager.getCustomData("account_name_2000", "key20");
}
catch(err){
console.error("====>getAssociatedData 2000 err:" + JSON.stringify(err));
console.error("====>getCustomData 2000 err:" + JSON.stringify(err));
expect().assertFail();
done();
}
console.debug("====>getAssociatedData ActsAccountCustomData_2000 data:" + JSON.stringify(data));
console.debug("====>getCustomData ActsAccountCustomData_2000 data:" + JSON.stringify(data));
expect(data).assertEqual("");
console.debug("====>delete account ActsAccountCustomData_2000 start====");
try{
......@@ -896,8 +896,8 @@ export default function ActsAccountCustomData() {
/*
* @tc.number : ActsAccountCustomData_2300
* @tc.name : setAssociatedData and getAssociatedData are called when the argument is spaced
* @tc.desc : Call setAssociatedData and then getAssociatedData when the incoming value is a space(callback)
* @tc.name : setAssociatedData and getCustomData are called when the argument is spaced
* @tc.desc : Call setAssociatedData and then getCustomData when the incoming value is a space(callback)
*/
it('ActsAccountCustomData_2300', 0, async function (done) {
console.debug("====>ActsAccountCustomData_2300 start====");
......@@ -909,9 +909,9 @@ export default function ActsAccountCustomData() {
appAccountManager.setAssociatedData("account_name_2300", "key23", " ", (err)=>{
console.debug("====>setAssociatedData ActsAccountCustomData_2300 err:" + JSON.stringify(err));
expect(err).assertEqual(null);
appAccountManager.getAssociatedData("account_name_2300", "key23", (err, data)=>{
console.debug("====>getAssociatedData 2300 err:" + JSON.stringify(err));
console.debug("====>getAssociatedData 2300 data:" + JSON.stringify(data));
appAccountManager.getCustomData("account_name_2300", "key23", (err, data)=>{
console.debug("====>getCustomData 2300 err:" + JSON.stringify(err));
console.debug("====>getCustomData 2300 data:" + JSON.stringify(data));
expect(err).assertEqual(null);
expect(data).assertEqual(" ");
appAccountManager.removeAccount("account_name_2300", (err)=>{
......@@ -927,8 +927,8 @@ export default function ActsAccountCustomData() {
/*
* @tc.number : ActsAccountCustomData_2400
* @tc.name : setAssociatedData and getAssociatedData are called when the argument is spaced
* @tc.desc : Call setAssociatedData and then getAssociatedData when the incoming value is a space(promise)
* @tc.name : setAssociatedData and getCustomData are called when the argument is spaced
* @tc.desc : Call setAssociatedData and then getCustomData when the incoming value is a space(promise)
*/
it('ActsAccountCustomData_2400', 0, async function (done) {
console.debug("====>ActsAccountCustomData_2400 start====");
......@@ -945,14 +945,14 @@ export default function ActsAccountCustomData() {
}
await appAccountManager.setAssociatedData("account_name_2400", "key24", " ");
try{
var data = await appAccountManager.getAssociatedData("account_name_2400", "key24");
var data = await appAccountManager.getCustomData("account_name_2400", "key24");
}
catch(err){
console.error("====>getAssociatedData 2400 fail err:" + JSON.stringify(err));
console.error("====>getCustomData 2400 fail err:" + JSON.stringify(err));
expect().assertFail();
done();
}
console.debug("====>getAssociatedData 2400 err:" + JSON.stringify(data));
console.debug("====>getCustomData 2400 err:" + JSON.stringify(data));
expect(data).assertEqual(" ");
console.debug("====>delete account ActsAccountCustomData_2400 start====");
try{
......@@ -969,8 +969,8 @@ export default function ActsAccountCustomData() {
/*
* @tc.number : ActsAccountCustomData_2500
* @tc.name : setAssociatedData and getAssociatedData are called when the argument is spaced
* @tc.desc : Call setAssociatedData and then getAssociatedData when the incoming name is null(callback)
* @tc.name : setAssociatedData and getCustomData are called when the argument is spaced
* @tc.desc : Call setAssociatedData and then getCustomData when the incoming name is null(callback)
*/
it('ActsAccountCustomData_2500', 0, async function (done) {
console.debug("====>ActsAccountCustomData_2500 start====");
......@@ -994,8 +994,8 @@ export default function ActsAccountCustomData() {
/*
* @tc.number : ActsAccountCustomData_2600
* @tc.name : setAssociatedData and getAssociatedData are called when the argument is spaced
* @tc.desc : Call setAssociatedData and then getAssociatedData when the incoming name is null(promise)
* @tc.name : setAssociatedData and getCustomData are called when the argument is spaced
* @tc.desc : Call setAssociatedData and then getCustomData when the incoming name is null(promise)
*/
it('ActsAccountCustomData_2600', 0, async function (done) {
console.debug("====>ActsAccountCustomData_2600 start====");
......@@ -1103,8 +1103,8 @@ export default function ActsAccountCustomData() {
/*
* @tc.number : ActsAccountCustomData_2900
* @tc.name : setAssociatedData and getAssociatedData are called when the argument is spaced
* @tc.desc : Call setAssociatedData and then getAssociatedData when the incoming name is a space(callback)
* @tc.name : setAssociatedData and getCustomData are called when the argument is spaced
* @tc.desc : Call setAssociatedData and then getCustomData when the incoming name is a space(callback)
*/
it('ActsAccountCustomData_2900', 0, async function (done) {
console.debug("====>ActsAccountCustomData_2900 start====");
......@@ -1116,9 +1116,9 @@ export default function ActsAccountCustomData() {
appAccountManager.setAssociatedData(" ", "key29", "value29", (err)=>{
console.debug("====>setAssociatedData ActsAccountCustomData_2900 err:" + JSON.stringify(err));
expect(err.code != 0).assertEqual(true);
appAccountManager.getAssociatedData(" ", "key29", (err, data)=>{
console.debug("====>getAssociatedData 2900 err:" + JSON.stringify(err));
console.debug("====>getAssociatedData 2900 data:" + JSON.stringify(data));
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====");
......@@ -1130,8 +1130,8 @@ export default function ActsAccountCustomData() {
/*
* @tc.number : ActsAccountCustomData_3000
* @tc.name : setAssociatedData and getAssociatedData are called when the argument is spaced
* @tc.desc : Call setAssociatedData and then getAssociatedData when the incoming name is a space(promise)
* @tc.name : setAssociatedData and getCustomData are called when the argument is spaced
* @tc.desc : Call setAssociatedData and then getCustomData when the incoming name is a space(promise)
*/
it('ActsAccountCustomData_3000', 0, async function (done) {
console.debug("====>ActsAccountCustomData_3000 start====");
......@@ -1150,10 +1150,10 @@ export default function ActsAccountCustomData() {
console.error("====>setAssociatedData ActsAccountCustomData_3000 err:" + JSON.stringify(err));
expect(err.code != 0).assertEqual(true);
try{
await appAccountManager.getAssociatedData(" ", "key30");
await appAccountManager.getCustomData(" ", "key30");
}
catch(err){
console.error("====>getAssociatedData ActsAccountCustomData_3000 err:" + JSON.stringify(err));
console.error("====>getCustomData ActsAccountCustomData_3000 err:" + JSON.stringify(err));
expect(err.code != 0).assertEqual(true);
console.debug("====>ActsAccountCustomData_3000 end====");
done();
......@@ -1165,9 +1165,9 @@ export default function ActsAccountCustomData() {
/*
* @tc.number : ActsAccountCustomData_3100
* @tc.name : The correct calls setAssociatedData and getAssociatedData get the value
* @tc.name : The correct calls setAssociatedData and getCustomData get the value
* @tc.desc : The setAssociatedData setting valueis called when the forwarding parameters
* are correct, and then getAssociatedData is called for the value(callback)
* are correct, and then getCustomData is called for the value(callback)
*/
it('ActsAccountCustomData_3100', 0, async function (done) {
console.debug("====>ActsAccountCustomData_3100 start====");
......@@ -1179,8 +1179,8 @@ export default function ActsAccountCustomData() {
appAccountManager.setAssociatedData("account_name_3100", "key31", "value31", (err)=>{
console.debug("====>setAssociatedData ActsAccountCustomData_3100 err:" + JSON.stringify(err));
expect(err).assertEqual(null);
var result = appAccountManager.getAssociatedDataSync("account_name_3100", "key31")
console.debug("====>getAssociatedData ActsAccountCustomData_3100 result:" + JSON.stringify(result));
var result = appAccountManager.getCustomDataSync("account_name_3100", "key31")
console.debug("====>getCustomData ActsAccountCustomData_3100 result:" + JSON.stringify(result));
expect(result).assertEqual("value31");
appAccountManager.removeAccount("account_name_3100", (err)=>{
console.debug("====>delete Account 0100 err:" + JSON.stringify(err));
......
......@@ -17,8 +17,8 @@ group("getallaccounts") {
testonly = true
if (is_standard_system) {
deps = [
"getallaccountsnoparameter:GetAllAccountsNoParameter",
"getmultipleaccounts:GetMultipleAccountsTest",
"actsgetallaccountsnoparameter:ActsGetAllAccountsNoParameter",
"actsgetmultipleaccounts:ActsGetMultipleAccountsTest",
]
}
}
......@@ -13,14 +13,14 @@
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("GetMultipleAccountsTest") {
ohos_js_hap_suite("ActsGetAllAccountsNoParameter") {
hap_profile = "./src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "GetMultipleAccountsTest"
hap_name = "ActsGetAllAccountsNoParameter"
subsystem_name = "account"
part_name = "os_account"
}
......
......@@ -10,7 +10,7 @@
"kits": [
{
"test-file-name": [
"GetAllAccountsNoParameter.hap",
"ActsGetAllAccountsNoParameter.hap",
"ActsAccountSceneAccessible.hap"
],
"type": "AppInstallKit",
......
......@@ -13,14 +13,14 @@
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("GetAllAccountsNoParameter") {
ohos_js_hap_suite("ActsGetMultipleAccountsTest") {
hap_profile = "./src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "GetAllAccountsNoParameter"
hap_name = "ActsGetMultipleAccountsTest"
subsystem_name = "account"
part_name = "os_account"
}
......
......@@ -10,7 +10,7 @@
"kits": [
{
"test-file-name": [
"GetMultipleAccountsTest.hap",
"ActsGetMultipleAccountsTest.hap",
"ActsAccountAccessibleFirst.hap",
"ActsAccountAccessibleSecond.hap"
],
......
......@@ -14,7 +14,6 @@
*/
import account from '@ohos.account.appAccount'
import featureAbility from '@ohos.ability.featureAbility'
import app from '../../../../../../../../../getallaccounts/getallaccountsnoparameter/src/main/js/TestAbility/app'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册