Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
e9aae81f
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
e9aae81f
编写于
10月 19, 2022
作者:
O
openharmony_ci
提交者:
Gitee
10月 19, 2022
浏览文件
操作
浏览文件
下载
差异文件
!5951 CreateModuleContext异常场景用例修复
Merge pull request !5951 from dy/update_CreateModuleContext_testcase
上级
9c6c3ca7
fa920e15
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
83 addition
and
19 deletion
+83
-19
ability/ability_runtime/context/actscreatemodulecontexttest/entry/src/main/ets/test/CreateModuleContext.test.ets
...test/entry/src/main/ets/test/CreateModuleContext.test.ets
+83
-19
未找到文件。
ability/ability_runtime/context/actscreatemodulecontexttest/entry/src/main/ets/test/CreateModuleContext.test.ets
浏览文件 @
e9aae81f
...
...
@@ -30,6 +30,8 @@ export default function actsCreateModuleContextTest() {
it("SUB_AA_CreateModuleContext_0100", 0, async function (done) {
console.info("SUB_AA_AbilityStage_0100 begin");
createModuleContext = null;
createModuleContext =
globalThis.abilityContext.createModuleContext("entry_test");
...
...
@@ -47,7 +49,9 @@ export default function actsCreateModuleContextTest() {
* @tc.level: 3
*/
it("SUB_AA_CreateModuleContext_0200", 0, async function (done) {
console.log("SUB_AA_AbilityStage_0100 begin");
console.log("SUB_AA_CreateModuleContext_0200 begin");
createModuleContext = null;
createModuleContext =
globalThis.abilityContext.createModuleContext("feature");
...
...
@@ -68,10 +72,19 @@ export default function actsCreateModuleContextTest() {
it("SUB_AA_CreateModuleContext_0300", 0, async function (done) {
console.info("SUB_AA_CreateModuleContext_0300 begin");
createModuleContext =
globalThis.abilityContext.createModuleContext("entry_assist");
createModuleContext = null;
try {
createModuleContext =
globalThis.abilityContext.createModuleContext("entry_assist");
} catch (err) {
let e = err.toString();
let errLog = "Invalid input parameter"
console.debug("====>e====>" + e);
expect(e.indexOf(errLog) >= 0).assertTrue();
}
expect(createModuleContext).assert
Undefined(
);
expect(createModuleContext).assert
Equal(null
);
done();
});
...
...
@@ -84,10 +97,19 @@ export default function actsCreateModuleContextTest() {
it("SUB_AA_CreateModuleContext_0400", 0, async function (done) {
console.info("SUB_AA_CreateModuleContext_0400 begin");
createModuleContext =
globalThis.abilityContext.createModuleContext("abc");
createModuleContext = null;
try {
createModuleContext =
globalThis.abilityContext.createModuleContext("abc");
} catch (err) {
let e = err.toString();
let errLog = "Invalid input parameter"
console.debug("====>e====>" + e);
expect(e.indexOf(errLog) >= 0).assertTrue();
}
expect(createModuleContext).assert
Undefined(
);
expect(createModuleContext).assert
Equal(null
);
done();
});
...
...
@@ -100,10 +122,20 @@ export default function actsCreateModuleContextTest() {
it("SUB_AA_CreateModuleContext_0500", 0, async function (done) {
console.info("SUB_AA_CreateModuleContext_0500 begin");
createModuleContext =
globalThis.abilityContext.createModuleContext(undefined);
createModuleContext = null;
try {
createModuleContext =
globalThis.abilityContext.createModuleContext(undefined);
} catch (err) {
let e = err.toString();
let errLog = "Invalid input parameter"
console.info("SUB_AA_CreateModuleContext_0500 createModuleContext is " + JSON.stringify(createModuleContext));
console.debug("====>e====>" + e);
expect(e.indexOf(errLog) >= 0).assertTrue();
}
expect(createModuleContext).assert
Undefined(
);
expect(createModuleContext).assert
Equal(null
);
done();
});
...
...
@@ -117,6 +149,8 @@ export default function actsCreateModuleContextTest() {
it("SUB_AA_CreateModuleContext_0600", 0, async function (done) {
console.info("SUB_AA_CreateModuleContext_0600 begin");
createModuleContext = null;
createModuleContext =
globalThis.abilityStageContext.createModuleContext("entry_test");
...
...
@@ -136,6 +170,8 @@ export default function actsCreateModuleContextTest() {
it("SUB_AA_CreateModuleContext_0700", 0, async function (done) {
console.info("SUB_AA_CreateModuleContext_0700 begin");
createModuleContext = null;
createModuleContext =
globalThis.abilityStageContext.createModuleContext("feature");
...
...
@@ -155,10 +191,19 @@ export default function actsCreateModuleContextTest() {
it("SUB_AA_CreateModuleContext_0800", 0, async function (done) {
console.info("SUB_AA_CreateModuleContext_0800 begin");
createModuleContext =
globalThis.abilityContext.createModuleContext("entry_assist");
createModuleContext = null;
try {
createModuleContext =
globalThis.abilityContext.createModuleContext("entry_assist");
} catch (err) {
let e = err.toString();
let errLog = "Invalid input parameter"
console.debug("====>e====>" + e);
expect(e.indexOf(errLog) >= 0).assertTrue();
}
expect(createModuleContext).assert
Undefined(
);
expect(createModuleContext).assert
Equal(null
);
done();
});
...
...
@@ -171,10 +216,19 @@ export default function actsCreateModuleContextTest() {
it("SUB_AA_CreateModuleContext_0900", 0, async function (done) {
console.info("SUB_AA_CreateModuleContext_0900 begin");
createModuleContext =
globalThis.abilityContext.createModuleContext("createmodue");
createModuleContext = null;
try {
createModuleContext =
globalThis.abilityContext.createModuleContext("createmodue");
} catch (err) {
let e = err.toString();
let errLog = "Invalid input parameter"
console.debug("====>e====>" + e);
expect(e.indexOf(errLog) >= 0).assertTrue();
}
expect(createModuleContext).assert
Undefined(
);
expect(createModuleContext).assert
Equal(null
);
done();
});
...
...
@@ -187,10 +241,20 @@ export default function actsCreateModuleContextTest() {
it("SUB_AA_CreateModuleContext_1000", 0, async function (done) {
console.info("SUB_AA_CreateModuleContext_1000 begin");
createModuleContext =
globalThis.abilityStageContext.createModuleContext(undefined);
createModuleContext = null;
try {
createModuleContext =
globalThis.abilityStageContext.createModuleContext(undefined);
} catch (err) {
let e = err.toString();
let errLog = "Invalid input parameter"
console.info("SUB_AA_CreateModuleContext_1000 createModuleContext is " + JSON.stringify(createModuleContext));
console.debug("====>e====>" + e);
expect(e.indexOf(errLog) >= 0).assertTrue();
}
expect(createModuleContext).assert
Undefined(
);
expect(createModuleContext).assert
Equal(null
);
done();
});
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录