Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
28a79873
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看板
提交
28a79873
编写于
8月 25, 2023
作者:
J
junyi233
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增xts用例
Signed-off-by:
N
junyi233
<
zhengjun29@huawei.com
>
上级
681a8b48
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
313 addition
and
0 deletion
+313
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/GetProfileByAbility.test.ets
...test/entry/src/main/ets/test/GetProfileByAbility.test.ets
+157
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/GetProfileByExtensionAbility.test.ets
...y/src/main/ets/test/GetProfileByExtensionAbility.test.ets
+156
-0
未找到文件。
bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/GetProfileByAbility.test.ets
浏览文件 @
28a79873
...
@@ -31,6 +31,7 @@ const PROFILE_JSON_STRING = "{\"src\":[\"MainAbility/pages/index/index\",\"MainA
...
@@ -31,6 +31,7 @@ const PROFILE_JSON_STRING = "{\"src\":[\"MainAbility/pages/index/index\",\"MainA
const ERROR_ABILITY_NOT_EXIST = 17700003
const ERROR_ABILITY_NOT_EXIST = 17700003
const ERROR_PROFILE_NOT_EXIST = 17700024
const ERROR_PROFILE_NOT_EXIST = 17700024
const ERROR_MODULE_NOT_EXIST = 17700002
const ERROR_MODULE_NOT_EXIST = 17700002
const PARAM_ERROR_CODE = 401;
export default function getProfileByAbility() {
export default function getProfileByAbility() {
describe('getProfileByAbility', function () {
describe('getProfileByAbility', function () {
...
@@ -419,5 +420,161 @@ export default function getProfileByAbility() {
...
@@ -419,5 +420,161 @@ export default function getProfileByAbility() {
done();
done();
});
});
})
})
/*
* @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0047
* @tc.name: getProfileByAbilitySyncSuccess
* @tc.desc: profile is json (by sync)
* @tc.level 0
*/
it('getProfileByAbilitySyncSuccess', 0, async function (done) {
try {
let data = manager.getProfileByAbilitySync(MODULE_NAME, ABILITY_NAME, METADATA_NAME);
console.info("getProfileByAbilitySync success" + JSON.stringify(data));
expect(Array.isArray(data)).assertTrue();
expect(data.length).assertEqual(1);
expect(typeof data[0]).assertEqual("string");
expect(data[0]).assertEqual(PROFILE_JSON_STRING);
done();
} catch (err) {
console.info("getProfileByAbilitySyncSuccessTest failed" + JSON.stringify(err));
expect(err).assertFail();
done();
}
})
/*
* @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0048
* @tc.name: getProfileByAbilitySyncSuccessEmptyMetaData
* @tc.desc: profile is json (by sync)
* @tc.level 0
*/
it('getProfileByAbilitySyncSuccessEmptyMetaData', 0, async function (done) {
try {
let data = manager.getProfileByAbilitySync(MODULE_NAME, ABILITY_NAME, '');
console.info("getProfileByAbilitySyncSuccessEmptyMetaData success" + JSON.stringify(data));
expect(Array.isArray(data)).assertTrue();
expect(data.length).assertEqual(3);
expect(typeof data[0]).assertEqual("string");
expect(data[0]).assertEqual(PROFILE_JSON_STRING);
expect(typeof data[1]).assertEqual("string");
expect(data[1]).assertEqual(PROFILE_JSON_STRING);
expect(typeof data[2]).assertEqual("string");
expect(data[2]).assertEqual(PROFILE_JSON_STRING);
done();
} catch (err) {
console.info("getProfileByAbilitySyncSuccessEmptyMetaData failed" + JSON.stringify(err));
expect(err).assertFail();
done();
}
})
/*
* @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0049
* @tc.name: getProfileByAbilitySyncByEmptyModuleName
* @tc.desc: Check the empty moduleName (by sync)
* @tc.level 0
*/
it('getProfileByAbilitySyncByEmptyModuleName', 0, async function (done) {
try {
manager.getProfileByAbilitySync('', ABILITY_NAME, METADATA_NAME);
expect().assertFail();
done();
} catch (err) {
console.info("getProfileByAbilitySyncByEmptyModuleName failed" + JSON.stringify(err));
expect(err.code).assertEqual(ERROR_MODULE_NOT_EXIST);
done();
}
})
/*
* @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0050
* @tc.name: getProfileByAbilitySyncByEmptyModuleName
* @tc.desc: Check the invalid moduleName (by sync)
* @tc.level 0
*/
it('getProfileByAbilitySyncByInvalidModuleName', 0, async function (done) {
try {
manager.getProfileByAbilitySync('INVALID_NAME', ABILITY_NAME, METADATA_NAME);
expect().assertFail();
done();
} catch (err) {
console.info("getProfileByAbilitySyncByInvalidModuleName failed" + JSON.stringify(err));
expect(err.code).assertEqual(ERROR_ABILITY_NOT_EXIST);
done();
}
})
/*
* @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0051
* @tc.name: getProfileByAbilitySyncByEmptyAbilityName
* @tc.desc: Check the empty abilityName (by sync)
* @tc.level 0
*/
it('getProfileByAbilitySyncByEmptyAbilityName', 0, async function (done) {
try {
manager.getProfileByAbilitySync(MODULE_NAME_TEST, '', METADATA_NAME);
expect().assertFail();
done();
} catch (err) {
console.info("getProfileByAbilitySyncByEmptyAbilityName failed" + JSON.stringify(err));
expect(err.code).assertEqual(ERROR_ABILITY_NOT_EXIST);
done();
}
})
/*
* @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0052
* @tc.name: getProfileByAbilitySyncByEmptyAbilityName
* @tc.desc: Check the invalid abilityName (by sync)
* @tc.level 0
*/
it('getProfileByAbilitySyncByInvalidAbilityName', 0, async function (done) {
try {
manager.getProfileByAbilitySync(MODULE_NAME_TEST, 'INVALID_NAME', METADATA_NAME);
expect().assertFail();
done();
} catch (err) {
console.info("getProfileByAbilitySyncByInvalidAbilityName failed" + JSON.stringify(err));
expect(err.code).assertEqual(ERROR_ABILITY_NOT_EXIST);
done();
}
})
/*
* @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0053
* @tc.name: getProfileByAbilitySyncNoProfile
* @tc.desc: Check resource has no prefix (by sync)
* @tc.level 0
*/
it('getProfileByAbilitySyncNoProfile', 0, async function (done) {
try {
manager.getProfileByAbilitySync(MODULE_NAME, ABILITY_NAME, METADATA_NAME2);
expect().assertFail();
done();
} catch (err) {
console.info("getProfileByAbilitySyncNoProfile failed" + JSON.stringify(err));
expect(err.code).assertEqual(ERROR_PROFILE_NOT_EXIST);
done();
}
})
/*
* @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0054
* @tc.name: getProfileByAbilitySyncParamError
* @tc.desc: Check param number is failed (by sync)
* @tc.level 0
*/
it('getProfileByAbilitySyncParamError', 0, async function (done) {
try {
manager.getProfileByAbilitySync(null, null);
expect().assertFail();
done();
} catch (err) {
console.info("getProfileByAbilitySyncParamError failed" + JSON.stringify(err));
expect(err.code).assertEqual(PARAM_ERROR_CODE);
done();
}
})
})
})
}
}
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/GetProfileByExtensionAbility.test.ets
浏览文件 @
28a79873
...
@@ -31,6 +31,7 @@ const PROFILE_JSON_STRING = "{\"src\":[\"MainAbility/pages/index/index\",\"MainA
...
@@ -31,6 +31,7 @@ const PROFILE_JSON_STRING = "{\"src\":[\"MainAbility/pages/index/index\",\"MainA
const ERROR_ABILITY_NOT_EXIST = 17700003
const ERROR_ABILITY_NOT_EXIST = 17700003
const ERROR_PROFILE_NOT_EXIST = 17700024
const ERROR_PROFILE_NOT_EXIST = 17700024
const ERROR_MODULE_NOT_EXIST = 17700002
const ERROR_MODULE_NOT_EXIST = 17700002
const PARAM_ERROR_CODE = 401;
export default function getProfileByExtensionAbility() {
export default function getProfileByExtensionAbility() {
describe('getProfileByExtensionAbility', function () {
describe('getProfileByExtensionAbility', function () {
...
@@ -420,5 +421,160 @@ export default function getProfileByExtensionAbility() {
...
@@ -420,5 +421,160 @@ export default function getProfileByExtensionAbility() {
done();
done();
});
});
})
})
/*
* @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0047
* @tc.name: getProfileByExtensionAbilitySyncSuccess
* @tc.desc: profile is json (by sync)
* @tc.level 0
*/
it('getProfileByExtensionAbilitySyncSuccess', 0, async function (done) {
try {
let data = manager.getProfileByExtensionAbilitySync(MODULE_NAME, ABILITY_NAME, METADATA_NAME3);
console.info("getProfileByExtensionAbilitySync success" + JSON.stringify(data));
expect(Array.isArray(data)).assertTrue();
expect(data.length).assertEqual(1);
expect(typeof data[0]).assertEqual("string");
done();
} catch (err) {
console.info("getProfileByExtensionAbilitySyncSuccessTest failed" + JSON.stringify(err));
expect(err).assertFail();
done();
}
})
/*
* @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0048
* @tc.name: getProfileByExtensionAbilitySyncSuccessEmptyMetaData
* @tc.desc: Check the empty metadataName
* @tc.level 0
*/
it('getProfileByExtensionAbilitySyncSuccessEmptyMetaData', 0, async function (done) {
try {
let data = manager.getProfileByExtensionAbilitySync(MODULE_NAME, ABILITY_NAME, '');
console.info("getProfileByExtensionAbilitySyncSuccessEmptyMetaData success" + JSON.stringify(data));
expect(Array.isArray(data)).assertTrue();
expect(data.length).assertEqual(3);
expect(typeof data[0]).assertEqual("string");
expect(data[0]).assertEqual(PROFILE_JSON_STRING);
expect(typeof data[1]).assertEqual("string");
expect(data[1]).assertEqual(PROFILE_JSON_STRING);
expect(typeof data[2]).assertEqual("string");
expect(data[2]).assertEqual(PROFILE_JSON_STRING);
done();
} catch (err) {
console.info("getProfileByExtensionAbilitySyncSuccessEmptyMetaData failed" + JSON.stringify(err));
expect(err).assertFail();
done();
}
})
/*
* @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0049
* @tc.name: getProfileByExtensionAbilitySyncByEmptyModuleName
* @tc.desc: Check the empty moduleName (by sync)
* @tc.level 0
*/
it('getProfileByExtensionAbilitySyncByEmptyModuleName', 0, async function (done) {
try {
manager.getProfileByExtensionAbilitySync('', ABILITY_NAME, METADATA_NAME);
expect().assertFail();
done();
} catch (err) {
console.info("getProfileByExtensionAbilitySyncByEmptyModuleName failed" + JSON.stringify(err));
expect(err.code).assertEqual(ERROR_MODULE_NOT_EXIST);
done();
}
})
/*
* @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0050
* @tc.name: getProfileByExtensionAbilitySyncByEmptyModuleName
* @tc.desc: Check the invalid moduleName (by sync)
* @tc.level 0
*/
it('getProfileByExtensionAbilitySyncByInvalidModuleName', 0, async function (done) {
try {
manager.getProfileByExtensionAbilitySync('INVALID_NAME', ABILITY_NAME, METADATA_NAME);
expect().assertFail();
done();
} catch (err) {
console.info("getProfileByExtensionAbilitySyncByInvalidModuleName failed" + JSON.stringify(err));
expect(err.code).assertEqual(ERROR_ABILITY_NOT_EXIST);
done();
}
})
/*
* @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0051
* @tc.name: getProfileByExtensionAbilitySyncByEmptyAbilityName
* @tc.desc: Check the empty abilityName (by sync)
* @tc.level 0
*/
it('getProfileByExtensionAbilitySyncByEmptyAbilityName', 0, async function (done) {
try {
manager.getProfileByExtensionAbilitySync(MODULE_NAME_TEST, '', METADATA_NAME);
expect().assertFail();
done();
} catch (err) {
console.info("getProfileByExtensionAbilitySyncByEmptyAbilityName failed" + JSON.stringify(err));
expect(err.code).assertEqual(ERROR_ABILITY_NOT_EXIST);
done();
}
})
/*
* @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0052
* @tc.name: getProfileByExtensionAbilitySyncByEmptyAbilityName
* @tc.desc: Check the invalid abilityName (by sync)
* @tc.level 0
*/
it('getProfileByExtensionAbilitySyncByInvalidAbilityName', 0, async function (done) {
try {
manager.getProfileByExtensionAbilitySync(MODULE_NAME_TEST, 'INVALID_NAME', METADATA_NAME);
expect().assertFail();
done();
} catch (err) {
console.info("getProfileByExtensionAbilitySyncByInvalidAbilityName failed" + JSON.stringify(err));
expect(err.code).assertEqual(ERROR_ABILITY_NOT_EXIST);
done();
}
})
/*
* @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0053
* @tc.name: getProfileByExtensionAbilitySyncNoProfile
* @tc.desc: Check resource has no prefix (by sync)
* @tc.level 0
*/
it('getProfileByExtensionAbilitySyncNoProfile', 0, async function (done) {
try {
manager.getProfileByExtensionAbilitySync(MODULE_NAME, ABILITY_NAME, METADATA_NAME2);
expect().assertFail();
done();
} catch (err) {
console.info("getProfileByExtensionAbilitySyncNoProfile failed" + JSON.stringify(err));
expect(err.code).assertEqual(ERROR_PROFILE_NOT_EXIST);
done();
}
})
/*
* @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0054
* @tc.name: getProfileByExtensionAbilitySyncParamError
* @tc.desc: Check param number is failed (by sync)
* @tc.level 0
*/
it('getProfileByExtensionAbilitySyncParamError', 0, async function (done) {
try {
manager.getProfileByExtensionAbilitySync(null, null);
expect().assertFail();
done();
} catch (err) {
console.info("getProfileByExtensionAbilitySyncParamError failed" + JSON.stringify(err));
expect(err.code).assertEqual(PARAM_ERROR_CODE);
done();
}
})
})
})
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录