Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
751c0807
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看板
未验证
提交
751c0807
编写于
8月 28, 2023
作者:
O
openharmony_ci
提交者:
Gitee
8月 28, 2023
浏览文件
操作
浏览文件
下载
差异文件
!9874 [新需求]: 同步接口补充xts用例
Merge pull request !9874 from junyi233/myfeature
上级
9f807d36
28a79873
变更
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
浏览文件 @
751c0807
...
...
@@ -31,6 +31,7 @@ const PROFILE_JSON_STRING = "{\"src\":[\"MainAbility/pages/index/index\",\"MainA
const ERROR_ABILITY_NOT_EXIST = 17700003
const ERROR_PROFILE_NOT_EXIST = 17700024
const ERROR_MODULE_NOT_EXIST = 17700002
const PARAM_ERROR_CODE = 401;
export default function getProfileByAbility() {
describe('getProfileByAbility', function () {
...
...
@@ -419,5 +420,161 @@ export default function getProfileByAbility() {
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
浏览文件 @
751c0807
...
...
@@ -31,6 +31,7 @@ const PROFILE_JSON_STRING = "{\"src\":[\"MainAbility/pages/index/index\",\"MainA
const ERROR_ABILITY_NOT_EXIST = 17700003
const ERROR_PROFILE_NOT_EXIST = 17700024
const ERROR_MODULE_NOT_EXIST = 17700002
const PARAM_ERROR_CODE = 401;
export default function getProfileByExtensionAbility() {
describe('getProfileByExtensionAbility', function () {
...
...
@@ -420,5 +421,160 @@ export default function getProfileByExtensionAbility() {
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录