Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
581e1a85
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
581e1a85
编写于
12月 06, 2022
作者:
I
inter515
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
适配queryAbilityByWant接口用例
Signed-off-by:
N
inter515
<
ry.renyi@huawei.com
>
上级
defc1768
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
1066 addition
and
989 deletion
+1066
-989
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/GetQueryAbilityByWant.test.ets
...st/entry/src/main/ets/test/GetQueryAbilityByWant.test.ets
+1066
-989
未找到文件。
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/GetQueryAbilityByWant.test.ets
浏览文件 @
581e1a85
...
...
@@ -17,999 +17,1076 @@ import account from '@ohos.account.osAccount'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'hypium/index'
const BUNDLE_NAME1 = 'com.example.third1';
const BUNDLE_NAME2 = 'com.example.third7';
const SYSTEM_NAME = 'com.example.system2';
const ABILITIY_NAME8 = 'com.example.system2.MainAbility';
let userId: number = 0;
const INVALID_CODE: number = 1;
export default function ActsBmsQueryAbilityByWant() {
describe('ActsBmsQueryAbilityByWant', function () {
beforeAll(async function (done) {
await account.getAccountManager().getOsAccountLocalIdFromProcess().then(account => {
console.info("getOsAccountLocalIdFromProcess userid ==========" + account);
userId = account;
done();
}).catch(err => {
console.info("getOsAccountLocalIdFromProcess err ==========" + JSON.stringify(err));
done();
})
});
/*
* @tc.number: bms_queryAbilityByWant_0100
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_0100', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": ""
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
expect(res).assertFail()
done()
}).catch(err => {
expect(err).assertEqual(INVALID_CODE)
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_0200
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_0200', 0, async function (done) {
bundle.queryAbilityByWant(
{}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
expect(res).assertFail()
done()
}).catch(err => {
expect(err).assertEqual(INVALID_CODE)
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_0300
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_0300', 0, async function (done) {
bundle.queryAbilityByWant(
{
action: "action_a"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_0300'+ JSON.stringify(res))
expect(res[0].name).assertEqual('com.example.third7.actionSingleString')
expect(res[0].description).assertEqual('actionSingleString')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_0300' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_0400
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_0400', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "action_b2"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_0400'+ JSON.stringify(res))
expect(res[0].name).assertEqual('com.example.third7.actionDoubleString')
expect(res[0].description).assertEqual('actionDoubleString')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_0400' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_0500
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_0500', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "action_c1"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_0500'+ JSON.stringify(res))
expect(res[0].name).assertEqual('com.example.third7.actionDoubleSkill')
expect(res[0].description).assertEqual('actionDoubleSkill')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_0500' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_0600
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third appl
*/
it('bms_queryAbilityByWant_0600', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "action_d2"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_0600'+ JSON.stringify(res))
expect(res[0].name).assertEqual('com.example.third7.actionDoubleSkill')
expect(res[0].description).assertEqual('actionDoubleSkill')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_0600' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_0700
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_0700', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "action_not_exist"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
expect(res).assertFail()
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_0700' + JSON.stringify(err))
expect(err).assertEqual(INVALID_CODE)
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_0800
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_0800', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "entity_reserved",
"entities": []
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_0800 '+ JSON.stringify(res))
const list = ['entityDoubleSkill','entityDoubleString','entitySingleString','entityEmpty']
if(res && res.length) {
for(let i = 0; i < res.length; i++) {
expect(list.includes(res[i].description)).assertEqual(true)
}
}
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_0800 ' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_0900
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_0900', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "entity_reserved",
"entities": [""]
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
expect(res).assertFail()
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_0900' + JSON.stringify(err))
expect(err).assertEqual(INVALID_CODE)
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_1000
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_1000', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "entity_reserved",
"entities": ["entity_a"]
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_1000'+ JSON.stringify(res))
expect(res[0].name).assertEqual('com.example.third7.entitySingleString')
expect(res[0].description).assertEqual('entitySingleString')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_1000' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_1100
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_1100', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "entity_reserved",
"entities": ["entity_b2"]
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_1100'+ JSON.stringify(res))
expect(res[0].name).assertEqual('com.example.third7.entityDoubleString')
expect(res[0].description).assertEqual('entityDoubleString')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_1100' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_1200
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_1200', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "entity_reserved",
"entities": ["entity_d1"]
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_1200'+ JSON.stringify(res))
expect(res[0].name).assertEqual('com.example.third7.entityDoubleSkill')
expect(res[0].description).assertEqual('entityDoubleSkill')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_1200' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_1300
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_1300', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "entity_reserved",
"entities": ["entity_c1", "entity_c2"]
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_1300'+ JSON.stringify(res))
expect(res[0].name).assertEqual('com.example.third7.entityDoubleSkill')
expect(res[0].description).assertEqual('entityDoubleSkill')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_1300' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_1400
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_1400', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "entity_reserved",
"entities": ["entity_b1", "entity_not_exist"]
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
expect(res).assertFail()
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_1400' + JSON.stringify(err))
expect(err).assertEqual(INVALID_CODE)
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_1500
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_1500', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "entity_reserved",
"entities": ["entity_b1", "entity_b2", "entity_not_exist"]
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
expect(res).assertFail()
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_1500' + JSON.stringify(err))
expect(err).assertEqual(INVALID_CODE)
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_1600
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_1600', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "entity_reserved",
"entities": ["entity_not_exist"]
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
expect(res).assertFail()
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_1600' + JSON.stringify(err))
expect(err).assertEqual(INVALID_CODE)
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_1700
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_1700', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "entity_reserved",
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_1700 '+ JSON.stringify(res))
const list = ['entityDoubleSkill','entityDoubleString','entitySingleString','entityEmpty']
if(res && res.length) {
for(let i = 0; i < res.length; i++) {
expect(list.includes(res[i].description)).assertEqual(true)
}
}
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_1700 ' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_1800
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_1800', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "uri_reserved",
"uri": ""
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_1800 '+ JSON.stringify(res))
const list = ['uriEmpty','uriSchemeEmpty']
if(res && res.length) {
for(let i = 0; i < res.length; i++) {
expect(list.includes(res[i].description)).assertEqual(true)
}
}
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_1800 ' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_1900
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_1900', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "uri_reserved",
"uri": "content"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_1900 '+ JSON.stringify(res))
const list = ['uriHostEmpty','uriScheme']
if(res && res.length) {
for(let i = 0; i < res.length; i++) {
expect(list.includes(res[i].description)).assertEqual(true)
}
}
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_1900 ' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_2000
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_2000', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "uri_reserved",
"uri": "content://www.test.com"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_2000 '+ JSON.stringify(res))
expect(res[0].description).assertEqual('uriSchemeHost')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_2000 ' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_2100
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_2100', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "uri_reserved",
"uri": "content://www.test.com:8080"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_2100 '+ JSON.stringify(res))
expect(res[0].description).assertEqual('uriSchemeHostPort')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_2100 ' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_2200
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_2200', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "uri_reserved",
"uri": "content://www.test.com:8080/query/student/name"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_2200 '+ JSON.stringify(res))
const list = ['uriSchemeHostPortPath','uriSchemeHostPortPathStartWith','uriSchemeHostPortPathRegx']
if(res && res.length) {
for(let i = 0; i < res.length; i++) {
expect(list.includes(res[i].description)).assertEqual(true)
}
}
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_2200 ' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_2300
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_2300', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "uri_reserved",
"uri": "content://www.test.com/query/student/name"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_2300 '+ JSON.stringify(res))
const list = ['uriPortEmptyWithPath','uriPortEmptyWithPathStartWith','uriPortEmptyWithPathRegx']
if(res && res.length) {
for(let i = 0; i < res.length; i++) {
expect(list.includes(res[i].description)).assertEqual(true)
}
}
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_2300 ' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_2400
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_2400', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "uri_reserved",
"uri": "content://www.test.com:8080/query/teacher/name"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_2400 '+ JSON.stringify(res))
expect(res[0].description).assertEqual('uriSchemeHostPortPathRegx')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_2400 ' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_2500
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_2500', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "uri_reserved",
"uri": "content://www.test.com:8080/query/student/jack"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_2500 '+ JSON.stringify(res))
expect(res[0].description).assertEqual('uriSchemeHostPortPathStartWith')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_2500 ' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_2600
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_2600', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "uri_reserved",
"uri": "file://www.test.com:8080/query/student/name"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_2600 '+ JSON.stringify(res))
expect(res[0].description).assertEqual('uriMultiPath')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_2600 ' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_2700
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_2700', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "uri_reserved",
"uri": "file://www.test.com:8080/query/teacher/hello"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_2700 '+ JSON.stringify(res))
expect(res[0].description).assertEqual('uriMultiPath')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_2700 ' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_2800
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_2800', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "uri_reserved",
"uri": "content://abc"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
expect(res).assertFail()
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_2800' + JSON.stringify(err))
expect(err).assertEqual(INVALID_CODE)
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_2900
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_2900', 0, async function (done) {
bundle.queryAbilityByWant(
{
"type": "*/*"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_2900 '+ JSON.stringify(res))
const list = ['TypeDoubleWildCard','TypeSingleWildCard','TypeString', 'TypeStringExt']
let cnt = 0;
if (res && res.length) {
for (let i = 0; i < res.length; i++) {
if (list.includes(res[i].description)) {
cnt++;
}
}
}
expect(cnt).assertEqual(list.length)
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_2900' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_3000
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_3000', 0, async function (done) {
bundle.queryAbilityByWant(
{
"type": "prefixType/*"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_3000 '+ JSON.stringify(res))
const list = ['TypeDoubleWildCard','TypeSingleWildCard','TypeString']
if(res && res.length) {
for(let i = 0; i < res.length; i++) {
expect(list.includes(res[i].description)).assertEqual(true)
}
}
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_3000 ' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_3100
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_3100', 0, async function (done) {
bundle.queryAbilityByWant(
{
"type": "prefixType/suffixType"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_3100 '+ JSON.stringify(res))
const list = ['TypeDoubleWildCard','TypeSingleWildCard','TypeString']
if(res && res.length) {
for(let i = 0; i < res.length; i++) {
expect(list.includes(res[i].description)).assertEqual(true)
}
}
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_3100' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_3200
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_3200', 0, async function (done) {
bundle.queryAbilityByWant(
{
"type": "prefixTypeExt/suffixTypeExt"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_3200 '+ JSON.stringify(res))
const list = ['TypeStringExt','TypeDoubleWildCard']
if(res && res.length) {
for(let i = 0; i < res.length; i++) {
expect(list.includes(res[i].description)).assertEqual(true)
}
}
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_3200' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_3300
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_3300', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "type_reserved"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_3300 '+ JSON.stringify(res))
const list = ['TypeEmpty','TypeEmptyExt']
if(res && res.length) {
for(let i = 0; i < res.length; i++) {
expect(list.includes(res[i].description)).assertEqual(true)
}
}
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_3300 ' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_3400
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_3400', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "type_reserved",
"type": ""
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_3400 '+ JSON.stringify(res))
const list = ['TypeEmpty','TypeEmptyExt']
if(res && res.length) {
for(let i = 0; i < res.length; i++) {
expect(list.includes(res[i].description)).assertEqual(true)
}
}
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_3400 ' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_3500
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_3500', 0, async function (done) {
bundle.queryAbilityByWant(
{
"type": "none/none"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_3500'+ JSON.stringify(res))
expect(res[0].description).assertEqual('TypeDoubleWildCard')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_3500' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_3600
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_3600', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "all_action_a",
"entities":["all_entity_a"]
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_3600'+ JSON.stringify(res))
expect(res[0].description).assertEqual('allAE')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_3600' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_3700
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_3700', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "all_action_b",
"entities":["all_entity_b1", "all_entity_b2"]
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_3700'+ JSON.stringify(res))
expect(res[0].description).assertEqual('allAEs')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_3700' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_3800
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_3800', 0, async function (done) {
bundle.queryAbilityByWant(
{
"uri" :"http://www.test.com:8080/query/student/name",
"type":"text/plain"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_3800'+ JSON.stringify(res))
expect(res[0].description).assertEqual('allUT')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_3800' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_3900
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_3900', 0, async function (done) {
bundle.queryAbilityByWant(
{
"uri" :"http://www.test.com:8080/query/student/name",
"type":"text/*"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_3900'+ JSON.stringify(res))
expect(res[0].description).assertEqual('allUT')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_3900' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_4000
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_4000', 0, async function (done) {
bundle.queryAbilityByWant(
{
"uri" :"http://www.test.com:8080/query/teacher",
"type":"text/plain"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_4000'+ JSON.stringify(res))
expect(res[0].description).assertEqual('allUT')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_4000' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_4100
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_4100', 0, async function (done) {
bundle.queryAbilityByWant(
{
"uri" :"http://www.test.com:8080/query/teacher/hello",
"type":"text/plain"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_4100'+ JSON.stringify(res))
expect(res[0].description).assertEqual('allUT')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_4100' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_4200
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_4200', 0, async function (done) {
bundle.queryAbilityByWant(
{
"uri" :"http://www.test.com:8080/update/hello/world/name",
"type":"text/plain"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_4200 '+ JSON.stringify(res))
expect(res[0].description).assertEqual('allUT')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_4200 ' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_4300
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_4300', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action":"all_action_c",
"entities":["all_entity_c1"],
"uri" :"https://www.test.com:8080/query/student/name",
"type":"text/plain"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_4300 '+ JSON.stringify(res))
expect(res[0].description).assertEqual('allAEUT')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_4300 ' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_4400
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_4400', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action":"all_action_c",
"entities":["all_entity_c1", "all_entity_c2"],
"uri" :"https://www.test.com:8080/query/student/name",
"type":"text/*"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_4400 '+ JSON.stringify(res))
expect(res[0].description).assertEqual('allAEUT')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_4400 ' + JSON.stringify(err))
expect().assertFail()
done()
})
});
})
describe('ActsBmsQueryAbilityByWant', function () {
beforeAll(async function (done) {
await account.getAccountManager().getOsAccountLocalIdFromProcess().then(account => {
console.info("getOsAccountLocalIdFromProcess userid ==========" + account);
userId = account;
done();
}).catch(err => {
console.info("getOsAccountLocalIdFromProcess err ==========" + JSON.stringify(err));
done();
})
});
/*
* @tc.number: bms_queryAbilityByWant_0100
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_0100', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": ""
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
expect(res).assertFail()
done()
}).catch(err => {
expect(err).assertEqual(INVALID_CODE)
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_0200
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_0200', 0, async function (done) {
bundle.queryAbilityByWant(
{}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
expect(res).assertFail()
done()
}).catch(err => {
expect(err).assertEqual(INVALID_CODE)
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_0300
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_0300', 0, async function (done) {
bundle.queryAbilityByWant(
{
action: "action_a"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_0300' + JSON.stringify(res))
expect(res[0].name).assertEqual('com.example.third7.actionSingleString')
expect(res[0].description).assertEqual('actionSingleString')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_0300' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_0400
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_0400', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "action_b2"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_0400' + JSON.stringify(res))
expect(res[0].name).assertEqual('com.example.third7.actionDoubleString')
expect(res[0].description).assertEqual('actionDoubleString')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_0400' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_0500
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_0500', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "action_c1"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_0500' + JSON.stringify(res))
expect(res[0].name).assertEqual('com.example.third7.actionDoubleSkill')
expect(res[0].description).assertEqual('actionDoubleSkill')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_0500' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_0600
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third appl
*/
it('bms_queryAbilityByWant_0600', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "action_d2"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_0600' + JSON.stringify(res))
expect(res[0].name).assertEqual('com.example.third7.actionDoubleSkill')
expect(res[0].description).assertEqual('actionDoubleSkill')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_0600' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_0700
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_0700', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "action_not_exist"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
expect(res).assertFail()
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_0700' + JSON.stringify(err))
expect(err).assertEqual(INVALID_CODE)
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_0800
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_0800', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "entity_reserved",
"entities": []
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_0800 ' + JSON.stringify(res))
const list = ['entityDoubleSkill', 'entityDoubleString', 'entitySingleString', 'entityEmpty']
if (res && res.length) {
for (let i = 0; i < res.length; i++) {
expect(list.includes(res[i].description)).assertEqual(true)
}
}
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_0800 ' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_0900
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_0900', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "entity_reserved",
"entities": [""]
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
expect(res).assertFail()
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_0900' + JSON.stringify(err))
expect(err).assertEqual(INVALID_CODE)
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_1000
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_1000', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "entity_reserved",
"entities": ["entity_a"]
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_1000' + JSON.stringify(res))
expect(res[0].name).assertEqual('com.example.third7.entitySingleString')
expect(res[0].description).assertEqual('entitySingleString')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_1000' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_1100
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_1100', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "entity_reserved",
"entities": ["entity_b2"]
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_1100' + JSON.stringify(res))
expect(res[0].name).assertEqual('com.example.third7.entityDoubleString')
expect(res[0].description).assertEqual('entityDoubleString')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_1100' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_1200
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_1200', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "entity_reserved",
"entities": ["entity_d1"]
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_1200' + JSON.stringify(res))
expect(res[0].name).assertEqual('com.example.third7.entityDoubleSkill')
expect(res[0].description).assertEqual('entityDoubleSkill')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_1200' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_1300
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_1300', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "entity_reserved",
"entities": ["entity_c1", "entity_c2"]
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_1300' + JSON.stringify(res))
expect(res[0].name).assertEqual('com.example.third7.entityDoubleSkill')
expect(res[0].description).assertEqual('entityDoubleSkill')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_1300' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_1400
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_1400', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "entity_reserved",
"entities": ["entity_b1", "entity_not_exist"]
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
expect(res).assertFail()
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_1400' + JSON.stringify(err))
expect(err).assertEqual(INVALID_CODE)
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_1500
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_1500', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "entity_reserved",
"entities": ["entity_b1", "entity_b2", "entity_not_exist"]
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
expect(res).assertFail()
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_1500' + JSON.stringify(err))
expect(err).assertEqual(INVALID_CODE)
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_1600
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_1600', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "entity_reserved",
"entities": ["entity_not_exist"]
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
expect(res).assertFail()
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_1600' + JSON.stringify(err))
expect(err).assertEqual(INVALID_CODE)
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_1700
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_1700', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "entity_reserved",
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_1700 ' + JSON.stringify(res))
const list = ['entityDoubleSkill', 'entityDoubleString', 'entitySingleString', 'entityEmpty']
if (res && res.length) {
for (let i = 0; i < res.length; i++) {
expect(list.includes(res[i].description)).assertEqual(true)
}
}
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_1700 ' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_1800
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_1800', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "uri_reserved",
"uri": ""
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_1800 ' + JSON.stringify(res))
const list = ['uriEmpty', 'uriSchemeEmpty']
if (res && res.length) {
for (let i = 0; i < res.length; i++) {
expect(list.includes(res[i].description)).assertEqual(true)
}
}
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_1800 ' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_1900
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_1900', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "uri_reserved",
"uri": "content"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_1900 ' + JSON.stringify(res))
const list = ['uriHostEmpty', 'uriScheme']
if (res && res.length) {
for (let i = 0; i < res.length; i++) {
expect(list.includes(res[i].description)).assertEqual(true)
}
}
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_1900 ' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_2000
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_2000', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "uri_reserved",
"uri": "content://www.test.com"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
expect(res.length).assertEqual(3);
for (let count = 0; count < 3; count++) {
if (res[count].name == BUNDLE_NAME2 + '.uriHostEmpty') {
expect(res[count].description).assertEqual('uriHostEmpty');
} else if (res[count].name == BUNDLE_NAME2 + '.uriScheme') {
expect(res[count].description).assertEqual('uriScheme');
} else {
expect(res[count].description).assertEqual('uriSchemeHost');
}
}
done();
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_2000 ' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_2100
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_2100', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "uri_reserved",
"uri": "content://www.test.com:8080"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_2100 ' + JSON.stringify(res))
expect(res.length).assertEqual(4);
for (let count = 0; count < 4; count++) {
if (res[count].name == BUNDLE_NAME2 + '.uriHostEmpty') {
expect(res[count].description).assertEqual('uriHostEmpty');
} else if (res[count].name == BUNDLE_NAME2 + '.uriScheme') {
expect(res[count].description).assertEqual('uriScheme');
} else if (res[count].name == BUNDLE_NAME2 + '.uriSchemeHostPort') {
expect(res[count].description).assertEqual('uriSchemeHostPort');
} else {
expect(res[count].description).assertEqual('uriSchemeHost');
}
}
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_2100 ' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_2200
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_2200', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "uri_reserved",
"uri": "content://www.test.com:8080/query/student/name"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_2200 ' + JSON.stringify(res))
const list = ['uriSchemeHostPortPath', 'uriSchemeHostPortPathStartWith', 'uriSchemeHostPortPathRegx']
expect(res.length).assertEqual(7);
for (let count = 0; count < 7; count++) {
if (res[count].name == BUNDLE_NAME2 + '.uriHostEmpty') {
expect(res[count].description).assertEqual('uriHostEmpty');
} else if (res[count].name == BUNDLE_NAME2 + '.uriScheme') {
expect(res[count].description).assertEqual('uriScheme');
} else if (res[count].name == BUNDLE_NAME2 + '.uriSchemeHostPort') {
expect(res[count].description).assertEqual('uriSchemeHostPort');
} else if (res[count].name == BUNDLE_NAME2 + '.uriSchemeHostPortPathStartWith') {
expect(res[count].description).assertEqual('uriSchemeHostPortPathStartWith');
} else if (res[count].name == BUNDLE_NAME2 + '.uriSchemeHostPortPathRegx') {
expect(res[count].description).assertEqual('uriSchemeHostPortPathRegx');
} else if (res[count].name == BUNDLE_NAME2 + '.uriSchemeHostPortPath') {
expect(res[count].description).assertEqual('uriSchemeHostPortPath');
} else {
expect(res[count].description).assertEqual('uriSchemeHost');
}
}
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_2200 ' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_2300
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_2300', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "uri_reserved",
"uri": "content://www.test.com/query/student/name"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_2300 ' + JSON.stringify(res))
const list = ['uriPortEmptyWithPath', 'uriPortEmptyWithPathStartWith', 'uriPortEmptyWithPathRegx']
expect(res.length).assertEqual(6);
for (let count = 0; count < 6; count++) {
if (res[count].name == BUNDLE_NAME2 + '.uriHostEmpty') {
expect(res[count].description).assertEqual('uriHostEmpty');
} else if (res[count].name == BUNDLE_NAME2 + '.uriScheme') {
expect(res[count].description).assertEqual('uriScheme');
} else if (res[count].name == BUNDLE_NAME2 + '.uriPortEmptyWithPath') {
expect(res[count].description).assertEqual('uriPortEmptyWithPath');
} else if (res[count].name == BUNDLE_NAME2 + '.uriPortEmptyWithPathStartWith') {
expect(res[count].description).assertEqual('uriPortEmptyWithPathStartWith');
} else if (res[count].name == BUNDLE_NAME2 + '.uriPortEmptyWithPathRegx') {
expect(res[count].description).assertEqual('uriPortEmptyWithPathRegx');
} else {
expect(res[count].description).assertEqual('uriSchemeHost');
}
}
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_2300 ' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_2400
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_2400', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "uri_reserved",
"uri": "content://www.test.com:8080/query/teacher/name"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_2400 ' + JSON.stringify(res))
expect(res.length).assertEqual(5);
for (let count = 0; count < 5; count++) {
if (res[count].name == BUNDLE_NAME2 + '.uriHostEmpty') {
expect(res[count].description).assertEqual('uriHostEmpty');
} else if (res[count].name == BUNDLE_NAME2 + '.uriScheme') {
expect(res[count].description).assertEqual('uriScheme');
} else if (res[count].name == BUNDLE_NAME2 + '.uriSchemeHostPort') {
expect(res[count].description).assertEqual('uriSchemeHostPort');
} else if (res[count].name == BUNDLE_NAME2 + '.uriSchemeHostPortPathRegx') {
expect(res[count].description).assertEqual('uriSchemeHostPortPathRegx');
} else {
expect(res[count].description).assertEqual('uriSchemeHost');
}
}
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_2400 ' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_2500
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_2500', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "uri_reserved",
"uri": "content://www.test.com:8080/query/student/jack"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_2500 ' + JSON.stringify(res))
expect(res.length).assertEqual(5);
for (let count = 0; count < 5; count++) {
if (res[count].name == BUNDLE_NAME2 + '.uriHostEmpty') {
expect(res[count].description).assertEqual('uriHostEmpty');
} else if (res[count].name == BUNDLE_NAME2 + '.uriScheme') {
expect(res[count].description).assertEqual('uriScheme');
} else if (res[count].name == BUNDLE_NAME2 + '.uriSchemeHostPort') {
expect(res[count].description).assertEqual('uriSchemeHostPort');
} else if (res[count].name == BUNDLE_NAME2 + '.uriSchemeHostPortPathStartWith') {
expect(res[count].description).assertEqual('uriSchemeHostPortPathStartWith');
} else {
expect(res[count].description).assertEqual('uriSchemeHost');
}
}
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_2500 ' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_2600
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_2600', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "uri_reserved",
"uri": "file://www.test.com:8080/query/student/name"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_2600 ' + JSON.stringify(res))
expect(res[0].description).assertEqual('uriMultiPath')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_2600 ' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_2700
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_2700', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "uri_reserved",
"uri": "file://www.test.com:8080/query/teacher/hello"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_2700 ' + JSON.stringify(res))
expect(res[0].description).assertEqual('uriMultiPath')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_2700 ' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_2800
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_2800', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "uri_reserved",
"uri": "content://abc"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
expect(res.length).assertEqual(2);
for (let count = 0; count < 2; count++) {
if (res[count].name == BUNDLE_NAME2 + '.uriHostEmpty') {
expect(res[count].description).assertEqual('uriHostEmpty');
} else {
expect(res[count].description).assertEqual('uriScheme');
}
}
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_2800' + JSON.stringify(err))
expect(err).assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_2900
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_2900', 0, async function (done) {
bundle.queryAbilityByWant(
{
"type": "*/*"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_2900 ' + JSON.stringify(res))
const list = ['TypeDoubleWildCard', 'TypeSingleWildCard', 'TypeString', 'TypeStringExt']
let cnt = 0;
if (res && res.length) {
for (let i = 0; i < res.length; i++) {
if (list.includes(res[i].description)) {
cnt++;
}
}
}
expect(cnt).assertEqual(list.length)
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_2900' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_3000
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_3000', 0, async function (done) {
bundle.queryAbilityByWant(
{
"type": "prefixType/*"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_3000 ' + JSON.stringify(res))
const list = ['TypeDoubleWildCard', 'TypeSingleWildCard', 'TypeString']
if (res && res.length) {
for (let i = 0; i < res.length; i++) {
expect(list.includes(res[i].description)).assertEqual(true)
}
}
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_3000 ' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_3100
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_3100', 0, async function (done) {
bundle.queryAbilityByWant(
{
"type": "prefixType/suffixType"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_3100 ' + JSON.stringify(res))
const list = ['TypeDoubleWildCard', 'TypeSingleWildCard', 'TypeString']
if (res && res.length) {
for (let i = 0; i < res.length; i++) {
expect(list.includes(res[i].description)).assertEqual(true)
}
}
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_3100' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_3200
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_3200', 0, async function (done) {
bundle.queryAbilityByWant(
{
"type": "prefixTypeExt/suffixTypeExt"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_3200 ' + JSON.stringify(res))
const list = ['TypeStringExt', 'TypeDoubleWildCard']
if (res && res.length) {
for (let i = 0; i < res.length; i++) {
expect(list.includes(res[i].description)).assertEqual(true)
}
}
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_3200' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_3300
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_3300', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "type_reserved"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_3300 ' + JSON.stringify(res))
const list = ['TypeEmpty', 'TypeEmptyExt']
if (res && res.length) {
for (let i = 0; i < res.length; i++) {
expect(list.includes(res[i].description)).assertEqual(true)
}
}
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_3300 ' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_3400
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_3400', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "type_reserved",
"type": ""
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_3400 ' + JSON.stringify(res))
const list = ['TypeEmpty', 'TypeEmptyExt']
if (res && res.length) {
for (let i = 0; i < res.length; i++) {
expect(list.includes(res[i].description)).assertEqual(true)
}
}
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_3400 ' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_3500
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_3500', 0, async function (done) {
bundle.queryAbilityByWant(
{
"type": "none/none"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_3500' + JSON.stringify(res))
expect(res[0].description).assertEqual('TypeDoubleWildCard')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_3500' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_3600
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_3600', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "all_action_a",
"entities": ["all_entity_a"]
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_3600' + JSON.stringify(res))
expect(res[0].description).assertEqual('allAE')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_3600' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_3700
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_3700', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "all_action_b",
"entities": ["all_entity_b1", "all_entity_b2"]
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_3700' + JSON.stringify(res))
expect(res[0].description).assertEqual('allAEs')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_3700' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_3800
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_3800', 0, async function (done) {
bundle.queryAbilityByWant(
{
"uri": "http://www.test.com:8080/query/student/name",
"type": "text/plain"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_3800' + JSON.stringify(res))
expect(res[0].description).assertEqual('allUT')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_3800' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_3900
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_3900', 0, async function (done) {
bundle.queryAbilityByWant(
{
"uri": "http://www.test.com:8080/query/student/name",
"type": "text/*"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_3900' + JSON.stringify(res))
expect(res[0].description).assertEqual('allUT')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_3900' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_4000
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_4000', 0, async function (done) {
bundle.queryAbilityByWant(
{
"uri": "http://www.test.com:8080/query/teacher",
"type": "text/plain"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_4000' + JSON.stringify(res))
expect(res[0].description).assertEqual('allUT')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_4000' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_4100
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_4100', 0, async function (done) {
bundle.queryAbilityByWant(
{
"uri": "http://www.test.com:8080/query/teacher/hello",
"type": "text/plain"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_4100' + JSON.stringify(res))
expect(res[0].description).assertEqual('allUT')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_4100' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_4200
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_4200', 0, async function (done) {
bundle.queryAbilityByWant(
{
"uri": "http://www.test.com:8080/update/hello/world/name",
"type": "text/plain"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_4200 ' + JSON.stringify(res))
expect(res[0].description).assertEqual('allUT')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_4200 ' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_4300
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_4300', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "all_action_c",
"entities": ["all_entity_c1"],
"uri": "https://www.test.com:8080/query/student/name",
"type": "text/plain"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_4300 ' + JSON.stringify(res))
expect(res[0].description).assertEqual('allAEUT')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_4300 ' + JSON.stringify(err))
expect().assertFail()
done()
})
});
/*
* @tc.number: bms_queryAbilityByWant_4400
* @tc.name: Use the implicit query method in queryAbilityByWant to get abilityInfos
* @tc.desc: queryAbilityByWant for third app
*/
it('bms_queryAbilityByWant_4400', 0, async function (done) {
bundle.queryAbilityByWant(
{
"action": "all_action_c",
"entities": ["all_entity_c1", "all_entity_c2"],
"uri": "https://www.test.com:8080/query/student/name",
"type": "text/*"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
console.info(' success bms_queryAbilityByWant_4400 ' + JSON.stringify(res))
expect(res[0].description).assertEqual('allAEUT')
done()
}).catch(err => {
console.error(' fail bms_queryAbilityByWant_4400 ' + JSON.stringify(err))
expect().assertFail()
done()
})
});
})
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录