Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
5570d11a
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看板
未验证
提交
5570d11a
编写于
7月 11, 2023
作者:
O
openharmony_ci
提交者:
Gitee
7月 11, 2023
浏览文件
操作
浏览文件
下载
差异文件
!9235 modify taskpool xts throw error information
Merge pull request !9235 from buzhuyu/master
上级
f6b43765
9b50f3e2
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
23 addition
and
17 deletion
+23
-17
commonlibrary/ets_utils/taskpool_lib_standard/entry/src/main/ets/test/TaskPool.test.js
...ool_lib_standard/entry/src/main/ets/test/TaskPool.test.js
+23
-17
未找到文件。
commonlibrary/ets_utils/taskpool_lib_standard/entry/src/main/ets/test/TaskPool.test.js
浏览文件 @
5570d11a
...
@@ -1173,12 +1173,25 @@ describe('ActsAbilityTest', function () {
...
@@ -1173,12 +1173,25 @@ describe('ActsAbilityTest', function () {
it
(
'
TaskPoolTestClass056
'
,
0
,
async
function
(
done
)
{
it
(
'
TaskPoolTestClass056
'
,
0
,
async
function
(
done
)
{
function
inspectStatus
(
arg
)
{
function
inspectStatus
(
arg
)
{
"
use concurrent
"
"
use concurrent
"
let
start
=
new
Date
().
getTime
();
while
(
new
Date
().
getTime
()
-
start
<
1000
)
{
continue
;
}
return
arg
;
return
arg
;
}
}
let
task
=
new
taskpool
.
Task
(
inspectStatus
,
100
);
let
task1
=
new
taskpool
.
Task
(
inspectStatus
,
100
);
taskpool
.
execute
(
task
);
let
task2
=
new
taskpool
.
Task
(
inspectStatus
,
200
);
taskpool
.
cancel
(
task
);
let
task3
=
new
taskpool
.
Task
(
inspectStatus
,
300
);
let
task4
=
new
taskpool
.
Task
(
inspectStatus
,
400
);
taskpool
.
execute
(
task1
);
taskpool
.
execute
(
task2
);
taskpool
.
execute
(
task3
);
taskpool
.
execute
(
task4
);
setTimeout
(()
=>
{
taskpool
.
cancel
(
task4
);},
500
);
expect
(
taskpool
.
Task
.
isCanceled
()
==
false
);
expect
(
taskpool
.
Task
.
isCanceled
()
==
false
);
done
();
done
();
})
})
...
@@ -1214,8 +1227,7 @@ describe('ActsAbilityTest', function () {
...
@@ -1214,8 +1227,7 @@ describe('ActsAbilityTest', function () {
taskpool
.
execute
(
task1
);
taskpool
.
execute
(
task1
);
taskpool
.
cancel
(
task1
);
taskpool
.
cancel
(
task1
);
}
catch
(
e
)
{
}
catch
(
e
)
{
expect
(
e
.
toString
()).
assertEqual
(
expect
(
e
.
toString
()).
assertEqual
(
"
BusinessError: The task does not exist when it is canceled
"
);
"
BusinessError: The task does not exist when it is canceled, taskpool:: can not find the task
"
);
}
}
expect
(
taskpool
.
Task
.
isCanceled
()
==
false
);
expect
(
taskpool
.
Task
.
isCanceled
()
==
false
);
done
();
done
();
...
@@ -1251,8 +1263,7 @@ describe('ActsAbilityTest', function () {
...
@@ -1251,8 +1263,7 @@ describe('ActsAbilityTest', function () {
taskpool
.
cancel
(
task1
);
taskpool
.
cancel
(
task1
);
}
}
catch
(
e
)
{
catch
(
e
)
{
expect
(
e
.
toString
()).
assertEqual
(
expect
(
e
.
toString
()).
assertEqual
(
"
BusinessError: The task does not exist when it is canceled
"
);
"
BusinessError: The task does not exist when it is canceled, taskpool:: can not find the task
"
);
}
}
done
();
done
();
})
})
...
@@ -1281,8 +1292,7 @@ describe('ActsAbilityTest', function () {
...
@@ -1281,8 +1292,7 @@ describe('ActsAbilityTest', function () {
taskpool
.
cancel
(
task3
);
taskpool
.
cancel
(
task3
);
}
}
catch
(
e
)
{
catch
(
e
)
{
expect
(
e
.
toString
()).
assertEqual
(
expect
(
e
.
toString
()).
assertEqual
(
"
BusinessError: The task does not exist when it is canceled
"
);
"
BusinessError: The task does not exist when it is canceled, taskpool:: can not find the task
"
);
}
}
done
();
done
();
})
})
...
@@ -1326,8 +1336,7 @@ describe('ActsAbilityTest', function () {
...
@@ -1326,8 +1336,7 @@ describe('ActsAbilityTest', function () {
taskpool
.
cancel
(
task3
);
taskpool
.
cancel
(
task3
);
}
}
catch
(
e
)
{
catch
(
e
)
{
expect
(
e
.
toString
()).
assertEqual
(
expect
(
e
.
toString
()).
assertEqual
(
"
BusinessError: The task does not exist when it is canceled
"
);
"
BusinessError: The task does not exist when it is canceled, taskpool:: can not find the task
"
);
}
}
done
();
done
();
})
})
...
@@ -1372,8 +1381,7 @@ describe('ActsAbilityTest', function () {
...
@@ -1372,8 +1381,7 @@ describe('ActsAbilityTest', function () {
taskpool
.
cancel
(
task2
);
taskpool
.
cancel
(
task2
);
}
}
catch
(
e
)
{
catch
(
e
)
{
expect
(
e
.
toString
()).
assertEqual
(
expect
(
e
.
toString
()).
assertEqual
(
"
BusinessError: The task does not exist when it is canceled
"
);
"
BusinessError: The task does not exist when it is canceled, taskpool:: can not find the task
"
);
}
}
done
();
done
();
})
})
...
@@ -1472,8 +1480,7 @@ describe('ActsAbilityTest', function () {
...
@@ -1472,8 +1480,7 @@ describe('ActsAbilityTest', function () {
taskpool
.
cancel
(
taskGroup
);
taskpool
.
cancel
(
taskGroup
);
}
catch
(
e
)
{
}
catch
(
e
)
{
expect
(
e
.
toString
()).
assertEqual
(
expect
(
e
.
toString
()).
assertEqual
(
"
BusinessError: The task group does not exist when it is canceled
"
);
"
BusinessError: The task group does not exist when it is canceled, taskpool:: can not find the taskGroup
"
);
}
}
done
();
done
();
})
})
...
@@ -1513,8 +1520,7 @@ describe('ActsAbilityTest', function () {
...
@@ -1513,8 +1520,7 @@ describe('ActsAbilityTest', function () {
try
{
try
{
taskpool
.
cancel
(
taskGroup1
);
taskpool
.
cancel
(
taskGroup1
);
}
catch
(
e
)
{
}
catch
(
e
)
{
expect
(
e
.
toString
()).
assertEqual
(
expect
(
e
.
toString
()).
assertEqual
(
"
BusinessError: The task group does not exist when it is canceled
"
);
"
BusinessError: The task group does not exist when it is canceled, taskpool:: can not find the taskGroup
"
);
}
}
},
3000
);
},
3000
);
done
();
done
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录