提交 39b80d2a 编写于 作者: B buzhuyu

modify xts for taskpool.cancel

description:
modify xts for taskpool.cancel

issue:https://gitee.com/openharmony/xts_acts/issues/I69V6KSigned-off-by: Nbuzhuyu <buzhuyu@huawei.com>
上级 32f2c89c
......@@ -965,7 +965,8 @@ describe('ActsAbilityTest', function () {
taskpool.cancel(task1);
}
catch (e) {
expect(e.toString()).assertEqual("BusinessError: taskpool:: can not cancel the running task");
expect(e.toString()).assertEqual(
"BusinessError: The task is executing when it is canceled, taskpool:: can not cancel the running task");
}
done();
})
......@@ -1006,7 +1007,8 @@ describe('ActsAbilityTest', function () {
taskpool.cancel(task1);
}
catch (e) {
expect(e.toString()).assertEqual("BusinessError: taskpool:: can not cancel the running task");
expect(e.toString()).assertEqual(
"BusinessError: The task is executing when it is canceled, taskpool:: can not cancel the running task");
}
done();
})
......@@ -1040,7 +1042,8 @@ describe('ActsAbilityTest', function () {
taskpool.cancel(task1);
}
catch (e) {
expect(e.toString()).assertEqual("BusinessError: taskpool:: can not find the task");
expect(e.toString()).assertEqual(
"BusinessError: The task does not exist when it is canceled, taskpool:: can not find the task");
}
done();
})
......@@ -1080,7 +1083,8 @@ describe('ActsAbilityTest', function () {
taskpool.cancel(task3);
}
catch (e) {
expect(e.toString()).assertEqual("BusinessError: taskpool:: can not find the task");
expect(e.toString()).assertEqual(
"BusinessError: The task does not exist when it is canceled, taskpool:: can not find the task");
}
done();
})
......@@ -1108,7 +1112,8 @@ describe('ActsAbilityTest', function () {
taskpool.cancel(task3);
}
catch (e) {
expect(e.toString()).assertEqual("BusinessError: taskpool:: can not find the task");
expect(e.toString()).assertEqual(
"BusinessError: The task does not exist when it is canceled, taskpool:: can not find the task");
}
done();
})
......@@ -1136,7 +1141,8 @@ describe('ActsAbilityTest', function () {
taskpool.cancel(task3);
}
catch (e) {
expect(e.toString()).assertEqual("BusinessError: taskpool:: can not find the task");
expect(e.toString()).assertEqual(
"BusinessError: The task does not exist when it is canceled, taskpool:: can not find the task");
}
done();
})
......@@ -1178,7 +1184,8 @@ describe('ActsAbilityTest', function () {
taskpool.cancel(task3);
}
catch (e) {
expect(e.toString()).assertEqual("BusinessError: taskpool:: can not find the task");
expect(e.toString()).assertEqual(
"BusinessError: The task does not exist when it is canceled, taskpool:: can not find the task");
}
done();
})
......@@ -1220,7 +1227,8 @@ describe('ActsAbilityTest', function () {
taskpool.cancel(task3);
}
catch (e) {
expect(e.toString()).assertEqual("BusinessError: taskpool:: can not find the task");
expect(e.toString()).assertEqual(
"BusinessError: The task does not exist when it is canceled, taskpool:: can not find the task");
}
done();
})
......@@ -1252,6 +1260,11 @@ describe('ActsAbilityTest', function () {
var result5 = taskpool.execute(task5);
var result6 = taskpool.execute(task6);
var start = new Date().getTime();
while (new Date().getTime() - start < 100) {
continue;
}
taskpool.cancel(task6);
taskpool.cancel(task5);
taskpool.cancel(task4);
......@@ -1259,7 +1272,8 @@ describe('ActsAbilityTest', function () {
taskpool.cancel(task2);
}
catch (e) {
expect(e.toString()).assertEqual("BusinessError: taskpool:: can not find the task");
expect(e.toString()).assertEqual(
"BusinessError: The task does not exist when it is canceled, taskpool:: can not find the task");
}
done();
})
......@@ -1291,6 +1305,11 @@ describe('ActsAbilityTest', function () {
var result5 = taskpool.execute(task5);
var result6 = taskpool.execute(task6);
var start = new Date().getTime();
while (new Date().getTime() - start < 100) {
continue;
}
taskpool.cancel(task6);
taskpool.cancel(task5);
taskpool.cancel(task4);
......@@ -1298,7 +1317,8 @@ describe('ActsAbilityTest', function () {
taskpool.cancel(task2);
}
catch (e) {
expect(e.toString()).assertEqual("BusinessError: taskpool:: can not find the task");
expect(e.toString()).assertEqual(
"BusinessError: The task does not exist when it is canceled, taskpool:: can not find the task");
}
done();
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册