Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
25c87eed
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看板
未验证
提交
25c87eed
编写于
7月 17, 2023
作者:
O
openharmony_ci
提交者:
Gitee
7月 17, 2023
浏览文件
操作
浏览文件
下载
差异文件
!9353 新增getBundleInfoForSelfSync接口用例
Merge pull request !9353 from wangtiantian/aaa
上级
3204a6e3
2b750444
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
146 addition
and
1 deletion
+146
-1
bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/test/GetBundleInfoForSelf.test.ets
...est/entry/src/main/ets/test/GetBundleInfoForSelf.test.ets
+31
-1
bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/GetBundleInfoForSelf.test.ets
...est/entry/src/main/ets/test/GetBundleInfoForSelf.test.ets
+115
-0
未找到文件。
bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/test/GetBundleInfoForSelf.test.ets
浏览文件 @
25c87eed
...
...
@@ -56,6 +56,36 @@ export default function getBundleInfoForSelf() {
})
})
/*
* @tc.number: SUB_BMS_SERVICE_SPLIT_0032
* @tc.name: getBundleInfoForSelfSyncAtomicService
* @tc.desc: Test getBundleInfoForSelfSync with AtomicService
*/
it('getBundleInfoForSelfSyncAtomicService', 0, async function (done) {
let data = bundle.getBundleInfoForSelfSync(bundle.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION |
bundle.BundleFlag.GET_BUNDLE_INFO_WITH_HAP_MODULE);
let preloadItemTest: bundle.PreloadItem = data.hapModulesInfo[2].preloads[0];
expect(typeof (preloadItemTest.moduleName)).assertEqual('string');
let dependencyTest: bundle.Dependency = data.hapModulesInfo[2].dependencies[0];
expect(typeof (dependencyTest.moduleName)).assertEqual('string');
console.info("getBundleInfoForSelfApplicationPro" + JSON.stringify(data.appInfo));
for (let i = 0; i < data.hapModulesInfo.length; i++) {
console.info("getBundleInfoForSelfApplicationPro : " + i + " ==" + JSON.stringify(data.hapModulesInfo[i]));
}
expect(data.appInfo.bundleType).assertEqual(bundle.BundleType.ATOMIC_SERVICE);
expect(data.hapModulesInfo[0].type).assertEqual(bundle.ModuleType.FEATURE);
expect(data.hapModulesInfo[0].preloads.length).assertEqual(0);
expect(data.hapModulesInfo[0].dependencies.length).assertEqual(0);
expect(data.hapModulesInfo[1].type).assertEqual(bundle.ModuleType.SHARED);
expect(data.hapModulesInfo[1].preloads.length).assertEqual(0);
expect(data.hapModulesInfo[1].dependencies.length).assertEqual(0);
expect(data.hapModulesInfo[2].type).assertEqual(bundle.ModuleType.ENTRY);
expect(data.hapModulesInfo[2].preloads.length).assertEqual(2);
expect(data.hapModulesInfo[2].preloads[0].moduleName).assertEqual("feature");
expect(data.hapModulesInfo[2].preloads[1].moduleName).assertEqual("shared");
expect(data.hapModulesInfo[2].dependencies.length).assertEqual(1);
expect(data.hapModulesInfo[2].dependencies[0].moduleName).assertEqual("feature");
done();
})
})
}
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/GetBundleInfoForSelf.test.ets
浏览文件 @
25c87eed
...
...
@@ -1034,6 +1034,121 @@ export default function getBundleInfoForSelf() {
}
})
/*
* @tc.number: SUB_BMS_APPINFO_QUERY_0138
* @tc.name: getBundleInfoForSelfSyncParamErrCal
* @tc.desc: Test getBundleInfoForSelfSync with error param.
*/
it('getBundleInfoForSelfSyncParamErrCal', 0, async function (done) {
try {
let bundleInfo = bundle.getBundleInfoForSelfSync(null);
expect(bundleInfo).assertFail();
} catch (err) {
console.info("ParamErrCal null fail2 " + JSON.stringify(err));
expect(err.code).assertEqual(PARAM_ERROR_CODE);
}
try {
let bundleInfo = bundle.getBundleInfoForSelfSync(undefined);
expect(bundleInfo).assertFail();
} catch (err) {
console.info("ParamErrCal undefined fail2 " + JSON.stringify(err));
expect(err.code).assertEqual(PARAM_ERROR_CODE);
done();
}
})
/*
* @tc.number: SUB_BMS_APPINFO_QUERY_0139
* @tc.name: getBundleInfoForSelfSyncDisCal
* @tc.desc: Test getBundleInfoForSelfSync with disable flag.
*/
it('getBundleInfoForSelfSyncDisCal', 0, async function (done) {
let data = bundle.getBundleInfoForSelfSync(bundle.BundleFlag.GET_BUNDLE_INFO_WITH_DISABLE);
console.info("DisCal" + JSON.stringify(data));
checkCommonBundleInfo(data);
expect(data.appInfo).assertEqual(null);
expect(data.hapModulesInfo.length).assertEqual(0);
expect(data.reqPermissionDetails.length).assertEqual(0);
expect(data.permissionGrantStates.length).assertEqual(0);
expect(data.signatureInfo).assertEqual(null);
done();
})
/*
* @tc.number: SUB_BMS_APPINFO_QUERY_0140
* @tc.name: getBundleInfoForSelfSyncSigCal
* @tc.desc: Test getBundleInfoForSelfSync with signatureInfo flag.
*/
it('getBundleInfoForSelfSyncSigCal', 0, async function (done) {
let data = bundle.getBundleInfoForSelfSync(bundle.BundleFlag.GET_BUNDLE_INFO_WITH_SIGNATURE_INFO);
console.info("SigCal" + JSON.stringify(data.signatureInfo));
checkCommonBundleInfo(data);
expect(data.appInfo).assertEqual(null);
expect(data.hapModulesInfo.length).assertEqual(0);
expect(data.reqPermissionDetails.length).assertEqual(0);
expect(data.permissionGrantStates.length).assertEqual(0);
expect(data.signatureInfo.appId).assertEqual(APPID);
expect(data.signatureInfo.fingerprint).assertEqual(FINGERPRINT);
done();
})
/*
* @tc.number: SUB_BMS_APPINFO_QUERY_0141
* @tc.name: getBundleInfoForSelfSyncModuleCal
* @tc.desc: Test getBundleInfoForSelfSync with hapModuleInfo flag.
*/
it('getBundleInfoForSelfSyncModuleCal', 0, async function (done) {
let data = bundle.getBundleInfoForSelfSync(bundle.BundleFlag.GET_BUNDLE_INFO_WITH_HAP_MODULE);
console.info("getBundleInfoForSelfSyncPro" + JSON.stringify(data.hapModulesInfo));
checkCommonBundleInfo(data);
expect(data.appInfo).assertEqual(null);
expect(data.hapModulesInfo.length).assertEqual(1);
expect(data.hapModulesInfo[0].name).assertEqual("testModule");
expect(data.hapModulesInfo[0].icon).assertEqual("$media:icon");
expect(data.hapModulesInfo[0].iconId).assertLarger(0);
expect(data.hapModulesInfo[0].label).assertEqual("$string:entry_label");
expect(data.hapModulesInfo[0].labelId).assertLarger(0);
expect(data.hapModulesInfo[0].description).assertEqual("$string:testModule_entry_dsc");
expect(data.hapModulesInfo[0].descriptionId).assertLarger(0);
expect(data.hapModulesInfo[0].mainElementName).assertEqual(ABILITY_NAME);
expect(data.hapModulesInfo[0].abilitiesInfo.length).assertEqual(0);
expect(data.hapModulesInfo[0].extensionAbilitiesInfo.length).assertEqual(0);
expect(data.hapModulesInfo[0].metadata.length).assertEqual(0);
expect(data.hapModulesInfo[0].deviceTypes.length).assertEqual(2);
expect(data.hapModulesInfo[0].deviceTypes[0]).assertEqual("default");
expect(data.hapModulesInfo[0].deviceTypes[1]).assertEqual("tablet");
expect(data.hapModulesInfo[0].installationFree).assertFalse();
expect(data.hapModulesInfo[0].hashValue).assertEqual("");
expect(data.reqPermissionDetails.length).assertEqual(0);
expect(data.permissionGrantStates.length).assertEqual(0);
expect(data.signatureInfo).assertEqual(null);
done();
})
/*
* @tc.number: SUB_BMS_APPINFO_QUERY_0142
* @tc.name: getBundleInfoForSelfSyncCal
* @tc.desc: Test getBundleInfoForSelfSync with default flag
*/
it('getBundleInfoForSelfSyncCal', 0, async function (done) {
let data = bundle.getBundleInfoForSelfSync(bundle.BundleFlag.GET_BUNDLE_INFO_DEFAULT);
console.info("getBundleInfoForSelfSyncCal" + JSON.stringify(data));
expect(data.name).assertEqual(BUNDLE_NAME);
expect(data.vendor).assertEqual(VENDOR);
expect(data.versionCode).assertEqual(1000000);
expect(data.versionName).assertEqual("1.0.0");
expect(data.minCompatibleVersionCode).assertEqual(1000000);
expect(data.targetVersion).assertEqual(9);
expect(data.installTime).assertLarger(0);
expect(data.updateTime).assertLarger(0);
expect(data.appInfo).assertEqual(null);
expect(data.hapModulesInfo.length).assertEqual(0);
expect(data.reqPermissionDetails.length).assertEqual(0);
expect(data.permissionGrantStates.length).assertEqual(0);
expect(data.signatureInfo).assertEqual(null);
done();
})
function checkCommonBundleInfo(data) {
expect(data.name).assertEqual(BUNDLE_NAME);
expect(data.vendor).assertEqual(VENDOR);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录