Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
a842ddf0
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看板
未验证
提交
a842ddf0
编写于
1月 10, 2023
作者:
O
openharmony_ci
提交者:
Gitee
1月 10, 2023
浏览文件
操作
浏览文件
下载
差异文件
!7170 implicit query capacity enhancement
Merge pull request !7170 from Lotol/monthly_20221018
上级
8ed53902
3ca1a610
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
93 addition
and
16 deletion
+93
-16
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/GetQueryAbilityByWant.test.ets
...st/entry/src/main/ets/test/GetQueryAbilityByWant.test.ets
+93
-16
未找到文件。
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/GetQueryAbilityByWant.test.ets
浏览文件 @
a842ddf0
...
...
@@ -17,6 +17,7 @@ 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;
...
...
@@ -457,9 +458,17 @@ export default function ActsBmsQueryAbilityByWant() {
"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()
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()
...
...
@@ -479,7 +488,18 @@ export default function ActsBmsQueryAbilityByWant() {
"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')
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))
...
...
@@ -500,10 +520,23 @@ export default function ActsBmsQueryAbilityByWant() {
"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)
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()
...
...
@@ -526,10 +559,21 @@ export default function ActsBmsQueryAbilityByWant() {
"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)
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()
...
...
@@ -552,7 +596,20 @@ export default function ActsBmsQueryAbilityByWant() {
"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')
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))
...
...
@@ -573,7 +630,20 @@ export default function ActsBmsQueryAbilityByWant() {
"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')
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))
...
...
@@ -635,11 +705,18 @@ export default function ActsBmsQueryAbilityByWant() {
"action": "uri_reserved",
"uri": "content://abc"
}, bundle.BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => {
expect(res).assertFail()
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).assert
Equal(INVALID_CODE
)
expect(err).assert
Fail(
)
done()
})
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录