Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
0a6eabe2
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看板
未验证
提交
0a6eabe2
编写于
8月 31, 2022
作者:
O
openharmony_ci
提交者:
Gitee
8月 31, 2022
浏览文件
操作
浏览文件
下载
差异文件
!5322 profile can be txt suffix
Merge pull request !5322 from SoftSquirrel/master
上级
08774ae7
bb3e1d08
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
99 addition
and
10 deletion
+99
-10
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/test/GetProfileByAbility.test.ets
...test/entry/src/main/ets/test/GetProfileByAbility.test.ets
+42
-5
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/test/GetProfileByExtensionAbility.test.ets
...y/src/main/ets/test/GetProfileByExtensionAbility.test.ets
+42
-5
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/module.json
...dlemanager/actsbmsstageetstest/entry/src/main/module.json
+10
-0
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/resources/base/profile/invalid.txt
...etstest/entry/src/main/resources/base/profile/invalid.txt
+5
-0
未找到文件。
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/test/GetProfileByAbility.test.ets
浏览文件 @
0a6eabe2
...
...
@@ -25,6 +25,7 @@ const METADATA_NAME = "ohos.ability.form"
const METADATA_NAME1 = "ohos.ability.form1"
const METADATA_NAME2 = "ohos.ability.form2"
const METADATA_NAME3 = "ohos.ability.form3"
const METADATA_NAME4 = "ohos.ability.form4"
const METADATA_NAME_TEST = "ohos.test.form"
const PROFILE_JSON_STRING = "{\"src\":[\"MainAbility/pages/index/index\",\"MainAbility/pages/second/second\"]}"
...
...
@@ -379,17 +380,18 @@ export default function getProfileByAbility() {
/*
* @tc.number: getProfileByAbility_2200
* @tc.name: getProfileByAbility : The profile is obtained by specified ability
* @tc.desc: profile is
not json-format
(by promise)
* @tc.desc: profile is
.txt suffix
(by promise)
* @tc.level 0
*/
it('getProfileByAbility_2200', 0, async function (done) {
await bundle.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME3).then(data => {
console.info('[getProfileByAbility_2200] getApplicationInfo callback data is: ' + JSON.stringify(data));
expect(data).assertFail()
expect(Array.isArray(data)).assertTrue();
expect(typeof data[0]).assertEqual("string");
done();
}).catch(err => {
console.error('[getProfileByAbility_2200]Operation failed. Cause: ' + JSON.stringify(err));
expect(
err).assertEqual(1
);
expect(
).assertFail(
);
done();
})
})
...
...
@@ -397,16 +399,51 @@ export default function getProfileByAbility() {
/*
* @tc.number: getProfileByAbility_2300
* @tc.name: getProfileByAbility : The profile is obtained by specified ability
* @tc.desc: profile is
not json-format
(by callback)
* @tc.desc: profile is
.txt suffix
(by callback)
* @tc.level 0
*/
it('getProfileByAbility_2300', 0, async function (done) {
bundle.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME3, (err, data) => {
if (err) {
console.error('[getProfileByAbility_2300]Operation failed. Cause: ' + JSON.stringify(err));
expect(
err).assertEqual(1
);
expect(
).assertFail(
);
}
console.info('[getProfileByAbility_2300] getApplicationInfo callback data is: ' + JSON.stringify(data));
expect(Array.isArray(data)).assertTrue();
expect(typeof data[0]).assertEqual("string");
done();
});
})
/*
* @tc.number: getProfileByAbility_2400
* @tc.name: getProfileByAbility : The profile is obtained by specified ability
* @tc.desc: profile is invalid json format (by promise)
* @tc.level 0
*/
it('getProfileByAbility_2400', 0, async function (done) {
await bundle.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME4).then(data => {
console.info('[getProfileByAbility_2400] data is: ' + JSON.stringify(data));
expect().assertFail();
done();
}).catch(err => {
console.error('[getProfileByAbility_2400] Operation failed. Cause: ' + JSON.stringify(err));
expect(err).assertEqual(1);
done();
})
})
/*
* @tc.number: getProfileByAbility_2500
* @tc.name: getProfileByAbility : The profile is obtained by specified ability
* @tc.desc: profile is invalid json format (by callback)
* @tc.level 0
*/
it('getProfileByAbility_2500', 0, async function (done) {
bundle.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME4, (err, data) => {
console.info('[getProfileByAbility_2500] err: ' + JSON.stringify(err));
expect(err).assertEqual(1);
console.info('[getProfileByAbility_2500] data is: ' + JSON.stringify(data));
expect(typeof data).assertEqual("string");
expect(data).assertEqual("GetProfile failed");
done();
...
...
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/test/GetProfileByExtensionAbility.test.ets
浏览文件 @
0a6eabe2
...
...
@@ -25,6 +25,7 @@ const METADATA_NAME = "ohos.extension.form"
const METADATA_NAME1 = "ohos.extension.form1"
const METADATA_NAME2 = "ohos.extension.form2"
const METADATA_NAME3 = "ohos.extension.form3"
const METADATA_NAME4 = "ohos.extension.form4"
const METADATA_NAME_TEST = "ohos.test.form"
const PROFILE_JSON_STRING = "{\"src\":[\"MainAbility/pages/index/index\",\"MainAbility/pages/second/second\"]}"
...
...
@@ -379,17 +380,18 @@ export default function getProfileByExtensionAbility() {
/*
* @tc.number: getProfileByExtensionAbility_2200
* @tc.name: getProfileByExtensionAbility : The profile is obtained by specified ability
* @tc.desc: profile is
not json-format
(by promise)
* @tc.desc: profile is
.txt suffix
(by promise)
* @tc.level 0
*/
it('getProfileByExtensionAbility_2200', 0, async function (done) {
await bundle.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME3).then(data => {
console.info('[getProfileByExtensionAbility_2200] getApplicationInfo callback data is: ' + JSON.stringify(data));
expect(data).assertFail()
expect(Array.isArray(data)).assertTrue();
expect(typeof data[0]).assertEqual("string");
done();
}).catch(err => {
console.error('[getProfileByExtensionAbility_2200]Operation failed. Cause: ' + JSON.stringify(err));
expect(
err).assertEqual(1
);
expect(
).assertFail(
);
done();
})
})
...
...
@@ -397,16 +399,51 @@ export default function getProfileByExtensionAbility() {
/*
* @tc.number: getProfileByExtensionAbility_2300
* @tc.name: getProfileByExtensionAbility : The profile is obtained by specified ability
* @tc.desc: profile is
not json-
format (by callback)
* @tc.desc: profile is
invalid json
format (by callback)
* @tc.level 0
*/
it('getProfileByExtensionAbility_2300', 0, async function (done) {
bundle.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME3, (err, data) => {
if (err) {
console.error('[getProfileByExtensionAbility_2300]Operation failed. Cause: ' + JSON.stringify(err));
expect(
err).assertEqual(1
);
expect(
).assertFail(
);
}
console.info('[getProfileByExtensionAbility_2300] getApplicationInfo callback data is: ' + JSON.stringify(data));
expect(Array.isArray(data)).assertTrue();
expect(typeof data[0]).assertEqual("string");
done();
});
})
/*
* @tc.number: getProfileByExtensionAbility_2400
* @tc.name: getProfileByExtensionAbility : The profile is obtained by specified ability
* @tc.desc: profile is invalid json format (by promise)
* @tc.level 0
*/
it('getProfileByExtensionAbility_2400', 0, async function (done) {
await bundle.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME4).then(data => {
console.info('[getProfileByExtensionAbility_2400] data is: ' + JSON.stringify(data));
expect().assertFail();
done();
}).catch(err => {
console.error('[getProfileByExtensionAbility_2400] Operation failed. Cause: ' + JSON.stringify(err));
expect(err).assertEqual(1);
done();
})
})
/*
* @tc.number: getProfileByExtensionAbility_2500
* @tc.name: getProfileByExtensionAbility : The profile is obtained by specified ability
* @tc.desc: profile is invalid json format (by callback)
* @tc.level 0
*/
it('getProfileByExtensionAbility_2500', 0, async function (done) {
bundle.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME4, (err, data) => {
console.info('[getProfileByExtensionAbility_2500] err: ' + JSON.stringify(err));
expect(err).assertEqual(1);
console.info('[getProfileByExtensionAbility_2500] data is: ' + JSON.stringify(data));
expect(typeof data).assertEqual("string");
expect(data).assertEqual("GetProfile failed");
done();
...
...
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/module.json
浏览文件 @
0a6eabe2
...
...
@@ -51,6 +51,11 @@
"name"
:
"ohos.ability.form3"
,
"value"
:
""
,
"resource"
:
"$profile:form_config1"
},
{
"name"
:
"ohos.ability.form4"
,
"value"
:
""
,
"resource"
:
"$profile:invalid"
}
]
},
...
...
@@ -91,6 +96,11 @@
"name"
:
"ohos.extension.form3"
,
"value"
:
""
,
"resource"
:
"$profile:form_config1"
},
{
"name"
:
"ohos.extension.form4"
,
"value"
:
""
,
"resource"
:
"$profile:invalid"
}
],
"name"
:
"Form"
,
...
...
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/resources/base/profile/invalid.txt
0 → 100644
浏览文件 @
0a6eabe2
{
"src": [
"MainAbility/pages/index/index",
"MainAbility/pages/second/second"
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录