Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
641152c8
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看板
未验证
提交
641152c8
编写于
10月 17, 2022
作者:
O
openharmony_ci
提交者:
Gitee
10月 17, 2022
浏览文件
操作
浏览文件
下载
差异文件
!5922 【包管理子系统 master】新增xts用例
Merge pull request !5922 from ry/master
上级
0830ffc9
9626ec94
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
148 addition
and
7 deletion
+148
-7
bundlemanager/bundle_standard/bundlemanager/actsbmsetsunpermissiontest/entry/src/main/ets/test/ActsBmsEtsUnPermissionTest.test.ets
...try/src/main/ets/test/ActsBmsEtsUnPermissionTest.test.ets
+1
-1
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/Test.json
...ndle_standard/bundlemanager/actsbmsstageetstest/Test.json
+1
-1
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/test/GetProfileByAbility.test.ets
...test/entry/src/main/ets/test/GetProfileByAbility.test.ets
+1
-1
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/test/GetProfileByExtensionAbility.test.ets
...y/src/main/ets/test/GetProfileByExtensionAbility.test.ets
+1
-1
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/module.json
...dlemanager/actsbmsstageetstest/entry/src/main/module.json
+1
-1
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/getAllApplicationInfoJsunit.test.ets
...ry/src/main/ets/test/getAllApplicationInfoJsunit.test.ets
+69
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/getApplicationInfoJsunit.test.ets
...entry/src/main/ets/test/getApplicationInfoJsunit.test.ets
+73
-1
bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsgetinfosseventhscene/src/main/config.json
...sceneProject/bmsgetinfosseventhscene/src/main/config.json
+1
-1
未找到文件。
bundlemanager/bundle_standard/bundlemanager/actsbmsetsunpermissiontest/entry/src/main/ets/test/ActsBmsEtsUnPermissionTest.test.ets
浏览文件 @
641152c8
...
...
@@ -170,7 +170,7 @@ export default function actsBmsJsUnPermissionTest() {
* @tc.name: getAbilityInfoUnPermissionSelf
* @tc.desc: test getAbilityInfo
*/
it
(
'getAbilityInfo
_200
'
,
0
,
async
function
(
done
)
{
it
(
'getAbilityInfo
UnPermissionSelf
'
,
0
,
async
function
(
done
)
{
await
bundle
.
getAbilityInfo
(
SELF_BUNDLENAME
,
SELF_ABILITYNAME
)
.
then
(
res
=>
{
console
.
info
(
'actwsBundleManager getAbilityInfo promise success res:'
+
JSON
.
stringify
(
res
));
for
(
const
item
in
res
)
{
...
...
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/Test.json
浏览文件 @
641152c8
...
...
@@ -4,7 +4,7 @@
"type"
:
"OHJSUnitTest"
,
"test-timeout"
:
"180000"
,
"bundle-name"
:
"ohos.acts.bundle.stage.test"
,
"module-name"
:
"
phone
"
,
"module-name"
:
"
entry
"
,
"shell-timeout"
:
"600000"
,
"testcase-timeout"
:
70000
},
...
...
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/test/GetProfileByAbility.test.ets
浏览文件 @
641152c8
...
...
@@ -16,7 +16,7 @@
import bundle from '@ohos.bundle';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium"
const MODULE_NAME = "
phone
"
const MODULE_NAME = "
entry
"
const MODULE_NAME_TEST = "phone1"
const ABILITY_NAME = "ohos.acts.bundle.stage.test.MainAbility"
const ABILITY_NAME1 = "ohos.acts.bundle.stage.test.MainAbility1"
...
...
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/test/GetProfileByExtensionAbility.test.ets
浏览文件 @
641152c8
...
...
@@ -16,7 +16,7 @@
import bundle from '@ohos.bundle';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium"
const MODULE_NAME = "
phone
"
const MODULE_NAME = "
entry
"
const MODULE_NAME_TEST = "phone1"
const ABILITY_NAME = "Form"
const ABILITY_NAME1 = "Form1"
...
...
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/module.json
浏览文件 @
641152c8
{
"module"
:
{
"name"
:
"
phone
"
,
"name"
:
"
entry
"
,
"type"
:
"entry"
,
"srcEntrance"
:
"./ets/Application/AbilityStage.ts"
,
"description"
:
"$string:phone_entry_dsc"
,
...
...
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/getAllApplicationInfoJsunit.test.ets
浏览文件 @
641152c8
...
...
@@ -288,6 +288,42 @@ export default function getAllApplicationBundleTest() {
});
});
/**
* @tc.number: SUB_BMS_APPINFO_QUERY_0060
* @tc.name: getAllApplicationInfoNoMetaData
* @tc.desc: Check the return value of the interface
*/
it('getAllApplicationInfoNoMetaData', 0, async function (done) {
await Bundle.getAllApplicationInfo(DEFAULT_FLAG,userId).then((data) => {
expect(data.length).assertLarger(10);
let flag = 0;
for(let i in data){
if (data[i].name == BUNDLE_OTHER){
flag = 1;
getAllApplicationInfoSuccessOther(data[i]);
expect(JSON.stringify(data[i].metaData)).assertEqual("{}");
}
}
expect(flag).assertEqual(1);
}).catch((error) => {
expect(error).assertFail();
});
Bundle.getAllApplicationInfo(DEFAULT_FLAG,userId, (err, data) => {
expect(err.code).assertEqual(0);
expect(data.length).assertLarger(10);
let flag = 0;
for(let i in data){
if (data[i].name == BUNDLE_OTHER){
flag = 1;
getAllApplicationInfoSuccessOther(data[i]);
expect(JSON.stringify(data[i].metaData)).assertEqual("{}");
}
}
expect(flag).assertEqual(1);
done();
});
});
function expectData(msg, data) {
console.info(msg + 'commonTest data length [' + data.length + ']');
for (let i = 0; i < data.length; i++) {
...
...
@@ -393,6 +429,39 @@ export default function getAllApplicationBundleTest() {
console.info('check end');
}
function getAllApplicationInfoSuccessOther(data) {
expect(data.name).assertEqual(BUNDLE_OTHER);
expect(data.codePath).assertEqual(PATH + '/' + BUNDLE_OTHER);
expect(data.accessTokenId).assertLarger(0);
expect(data.description).assertEqual('$string:entry_description');
expect(data.descriptionId).assertLarger(0);
expect(data.icon).assertEqual('$media:icon');
expect(data.iconId).assertLarger(0);
expect(data.iconIndex).assertLarger(0);
expect(data.iconIndex).assertEqual(data.iconId);
expect(data.label).assertEqual('$string:app_name');
expect(data.labelId).assertLarger(0);
expect(data.labelIndex).assertLarger(0);
expect(data.labelIndex).assertEqual(data.labelId);
expect(data.systemApp).assertFalse();
expect(data.supportedModes).assertEqual(0);
expect(data.process).assertEqual(BUNDLE_OTHER);
expect(data.entryDir).assertEqual(PATH + '/' + BUNDLE_OTHER + '/' + BUNDLE_OTHER + '.entry');
expect(data.permissions.length).assertEqual(0);
expect(data.moduleSourceDirs.length).assertEqual(1);
expect(data.moduleSourceDirs[0]).assertEqual(PATH + '/' + BUNDLE_OTHER + '/' + BUNDLE_OTHER + '.entry');
expect(data.moduleInfos.length).assertEqual(1);
expect(data.moduleInfos[0].moduleName).assertEqual('entry');
expect(data.moduleInfos[0].moduleSourceDir).assertEqual(PATH + '/' +
BUNDLE_OTHER + '/' + BUNDLE_OTHER + '.entry');
expect(data.enabled).assertTrue();
expect(data.uid).assertLarger(0);
expect(data.entityType).assertEqual('unspecified');
expect(data.removable).assertTrue();
expect(data.fingerprint).assertEqual("");
console.info('check end');
}
});
}
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/getApplicationInfoJsunit.test.ets
浏览文件 @
641152c8
...
...
@@ -422,6 +422,46 @@ export default function applicationBundleJsunit() {
});
})
/**
* @tc.number: SUB_BMS_APPINFO_QUERY_0059
* @tc.name: getApplicationInfoNoMetaData
* @tc.desc: Check the return value of the interface
*/
it('getApplicationInfoNoMetaData', 0, async function (done) {
await Bundle.getApplicationInfo(BUNDLE_OTHER, FLAG_DEFAULT ,userId).then((data) => {
getApplicationInfoSuccessOther_METADATA(data);
expect(JSON.stringify(data.metaData)).assertEqual("{}");
expect(JSON.stringify(data.metadata)).assertEqual("{}");
}).catch((error) => {
expect(error).assertFail();
});
Bundle.getApplicationInfo(BUNDLE_OTHER, FLAG_DEFAULT,userId, (err, data) => {
expect(err.code).assertEqual(0);
getApplicationInfoSuccessOther_METADATA(data);
expect(JSON.stringify(data.metaData)).assertEqual("{}");
expect(JSON.stringify(data.metadata)).assertEqual("{}");
done();
});
});
/**
* @tc.number: SUB_BMS_APPINFO_QUERY_0005
* @tc.name: getApplicationInfoNotExistBundleName
* @tc.desc: Check the return value of the interface
*/
it('getApplicationInfoNotExistBundleName', 0, async function (done) {
await Bundle.getApplicationInfo(BUNDLE_NOTEXIST, FLAG_DEFAULT, userId).then((data) => {
expect(data).assertFail();
}).catch((error) => {
expect(error.code).assertEqual(1);
});
await Bundle.getApplicationInfo(BUNDLE_NOTEXIST, FLAG_DEFAULT, userId, (err, data) => {
expect(err.code).assertEqual(1);
expect(JSON.stringify(data)).assertEqual(undefined);
done();
});
});
function expectData(msg, data) {
expect(typeof (data)).assertEqual('object');
expect(typeof (data.name)).assertEqual('string');
...
...
@@ -554,6 +594,38 @@ export default function applicationBundleJsunit() {
console.info('check end');
}
});
function getApplicationInfoSuccessOther_METADATA(data) {
expect(data.name).assertEqual(BUNDLE_OTHER);
expect(data.codePath).assertEqual(PATH + '/' + BUNDLE_OTHER);
expect(data.accessTokenId).assertLarger(0);
expect(data.description).assertEqual('$string:entry_description');
expect(data.descriptionId).assertLarger(0);
expect(data.icon).assertEqual('$media:icon');
expect(data.iconId).assertLarger(0);
expect(data.iconIndex).assertLarger(0);
expect(data.iconIndex).assertEqual(data.iconId);
expect(data.label).assertEqual('$string:app_name');
expect(data.labelId).assertLarger(0);
expect(data.labelIndex).assertLarger(0);
expect(data.labelIndex).assertEqual(data.labelId);
expect(data.systemApp).assertFalse();
expect(data.supportedModes).assertEqual(0);
expect(data.process).assertEqual(BUNDLE_OTHER);
expect(data.entryDir).assertEqual(PATH + '/' + BUNDLE_OTHER + '/' + BUNDLE_OTHER + '.entry');
expect(data.permissions.length).assertEqual(0);
expect(data.moduleSourceDirs.length).assertEqual(1);
expect(data.moduleSourceDirs[0]).assertEqual(PATH + '/' + BUNDLE_OTHER + '/' + BUNDLE_OTHER + '.entry');
expect(data.moduleInfos.length).assertEqual(1);
expect(data.moduleInfos[0].moduleName).assertEqual('entry');
expect(data.moduleInfos[0].moduleSourceDir).assertEqual(PATH + '/' +
BUNDLE_OTHER + '/' + BUNDLE_OTHER + '.entry');
expect(data.enabled).assertTrue();
expect(data.uid).assertLarger(0);
expect(data.entityType).assertEqual('unspecified');
expect(data.removable).assertTrue();
expect(data.fingerprint).assertEqual("");
console.info('check end');
}
});
}
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsgetinfosseventhscene/src/main/config.json
浏览文件 @
641152c8
...
...
@@ -909,7 +909,7 @@
"type"
:
"pageAbility"
},
"pages"
:
[
"pages/index"
"pages/index
/index
"
],
"name"
:
".MainAbility"
,
"window"
:
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录