未验证 提交 4b794e09 编写于 作者: O openharmony_ci 提交者: Gitee

!7114 add taskpool cancel xts for weekly

Merge pull request !7114 from bwx1148593/weekly_20230103
{
"app": {
"bundleName": "com.example.childprocess",
"bundleName": "com.example.taskpool",
"vendor": "example",
"version": {
"code": 1000000,
......@@ -13,7 +13,7 @@
},
"deviceConfig": {},
"module": {
"package": "com.example.childprocess",
"package": "com.example.taskpool",
"name": ".entry",
"srcPath": "",
"mainAbility": ".MainAbility",
......
......@@ -19,7 +19,7 @@ export default function TaskPoolTest() {
describe('ActsAbilityTest', function () {
// Defines a test suite. Two parameters are supported: test suite name and test suite function.
it('TaskPoolTestClass001', 0, async function () {
it('TaskPoolTestClass001', 0, async function (done) {
function Sum(value1, value2) {
return value1 + value2;
}
......@@ -28,7 +28,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass002', 0, async function () {
it('TaskPoolTestClass002', 0, async function (done) {
function Add(value1, value2) {
if (value1 & value2)
return true;
......@@ -40,7 +40,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass003', 0, async function () {
it('TaskPoolTestClass003', 0, async function (done) {
function StrCat(value1, value2) {
return value1 + value2;
}
......@@ -49,7 +49,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass004', 0, async function () {
it('TaskPoolTestClass004', 0, async function (done) {
function StrCat(value1, value2) {
return value1 + value2;
}
......@@ -59,7 +59,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass005', 0, async function () {
it('TaskPoolTestClass005', 0, async function (done) {
function Sum(value1, value2) {
function StrCat(value1, value2) {
return value1 + value2;
......@@ -71,7 +71,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass006', 0, async function () {
it('TaskPoolTestClass006', 0, async function (done) {
function Sum(arg1, arg2) {
let value = [];
value[0] = arg1[0] + arg2[0];
......@@ -84,7 +84,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass007', 0, async function () {
it('TaskPoolTestClass007', 0, async function (done) {
function Sum(arg1, arg2) {
let value = arg1;
value.a = arg1.a + arg2.a;
......@@ -96,7 +96,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass008', 0, async function () {
it('TaskPoolTestClass008', 0, async function (done) {
function Sum(value1, value2) {
return value1 + value2;
}
......@@ -105,7 +105,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass009', 0, async function () {
it('TaskPoolTestClass009', 0, async function (done) {
function Sum(value1, value2) {
return value1 + value2;
}
......@@ -114,7 +114,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass010', 0, async function () {
it('TaskPoolTestClass010', 0, async function (done) {
function Sum(value1, value2) {
return value1 + value2;
}
......@@ -125,7 +125,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass011', 0, async function () {
it('TaskPoolTestClass011', 0, async function (done) {
function Sum(value1, value2) {
return value1 + value2;
}
......@@ -136,7 +136,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass012', 0, async function () {
it('TaskPoolTestClass012', 0, async function (done) {
function Sum(value1, value2) {
return value1 + value2;
}
......@@ -154,7 +154,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass013', 0, async function () {
it('TaskPoolTestClass013', 0, async function (done) {
function Sum(value1, value2) {
return value1 + value2;
}
......@@ -164,7 +164,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass014', 0, async function () {
it('TaskPoolTestClass014', 0, async function (done) {
function Add(value1, value2) {
if (value1 & value2)
return true;
......@@ -177,7 +177,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass015', 0, async function () {
it('TaskPoolTestClass015', 0, async function (done) {
function StrCat(value1, value2) {
return value1 + value2;
}
......@@ -187,7 +187,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass016', 0, async function () {
it('TaskPoolTestClass016', 0, async function (done) {
function Sum(value1, value2) {
function StrCat(value1, value2) {
return value1 + value2;
......@@ -200,7 +200,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass017', 0, async function () {
it('TaskPoolTestClass017', 0, async function (done) {
function Sum(arg1, arg2) {
let value = [];
value[0] = arg1[0] + arg2[0];
......@@ -214,7 +214,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass018', 0, async function () {
it('TaskPoolTestClass018', 0, async function (done) {
function Sum(arg1, arg2) {
let value = arg1;
value.a = arg1.a + arg2.a;
......@@ -227,7 +227,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass019', 0, async function () {
it('TaskPoolTestClass019', 0, async function (done) {
function Sum(value1, value2) {
return value1 + value2;
}
......@@ -237,7 +237,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass020', 0, async function () {
it('TaskPoolTestClass020', 0, async function (done) {
function Sum(value1, value2) {
return value1 + value2;
}
......@@ -247,7 +247,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass021', 0, async function () {
it('TaskPoolTestClass021', 0, async function (done) {
function Sum(value1, value2) {
return value1 + value2;
}
......@@ -259,7 +259,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass022', 0, async function () {
it('TaskPoolTestClass022', 0, async function (done) {
function Sum(value1, value2) {
return value1 + value2;
}
......@@ -272,7 +272,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass023', 0, async function () {
it('TaskPoolTestClass023', 0, async function (done) {
function Sum(value1, value2) {
return value1 + value2;
}
......@@ -285,7 +285,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass024', 0, async function () {
it('TaskPoolTestClass024', 0, async function (done) {
function Sum(value1, value2) {
return value1 + value2;
}
......@@ -307,7 +307,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass025', 0, async function () {
it('TaskPoolTestClass025', 0, async function (done) {
function Sum(value1, value2) {
return value1 + value2;
}
......@@ -318,7 +318,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass026', 0, async function () {
it('TaskPoolTestClass026', 0, async function (done) {
function Add(value1, value2) {
if (value1 & value2)
return true;
......@@ -332,7 +332,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass027', 0, async function () {
it('TaskPoolTestClass027', 0, async function (done) {
function StrCat(value1, value2) {
return value1 + value2;
}
......@@ -343,7 +343,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass028', 0, async function () {
it('TaskPoolTestClass028', 0, async function (done) {
function Sum(value1, value2) {
function StrCat(value1, value2) {
return value1 + value2;
......@@ -357,7 +357,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass029', 0, async function () {
it('TaskPoolTestClass029', 0, async function (done) {
function Sum(arg1, arg2) {
let value = [];
value[0] = arg1[0] + arg2[0];
......@@ -372,7 +372,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass030', 0, async function () {
it('TaskPoolTestClass030', 0, async function (done) {
function Sum(arg1, arg2) {
let value = arg1;
value.a = arg1.a + arg2.a;
......@@ -386,7 +386,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass031', 0, async function () {
it('TaskPoolTestClass031', 0, async function (done) {
function Sum(value1, value2) {
return value1 + value2;
}
......@@ -397,7 +397,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass032', 0, async function () {
it('TaskPoolTestClass032', 0, async function (done) {
function Sum(value1, value2) {
return value1 + value2;
}
......@@ -408,7 +408,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass033', 0, async function () {
it('TaskPoolTestClass033', 0, async function (done) {
function Sum(value1, value2) {
return value1 + value2;
}
......@@ -424,7 +424,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass034', 0, async function () {
it('TaskPoolTestClass034', 0, async function (done) {
function Sum(value1, value2) {
return value1 + value2;
}
......@@ -440,7 +440,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass035', 0, async function () {
it('TaskPoolTestClass035', 0, async function (done) {
function Sum(value1, value2) {
return value1 + value2;
}
......@@ -454,7 +454,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass036', 0, async function () {
it('TaskPoolTestClass036', 0, async function (done) {
function Sum(value1, value2) {
return value1 + value2;
}
......@@ -481,7 +481,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass037', 0, async function () {
it('TaskPoolTestClass037', 0, async function (done) {
function Sum(value1, value2) {
return value1 + value2;
}
......@@ -491,7 +491,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass038', 0, async function () {
it('TaskPoolTestClass038', 0, async function (done) {
function Add(value1, value2) {
if (value1 & value2)
return true;
......@@ -504,7 +504,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass039', 0, async function () {
it('TaskPoolTestClass039', 0, async function (done) {
function StrCat(value1, value2) {
return value1 + value2;
}
......@@ -514,7 +514,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass040', 0, async function () {
it('TaskPoolTestClass040', 0, async function (done) {
function Sum(value1, value2) {
function StrCat(value1, value2) {
return value1 + value2;
......@@ -527,7 +527,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass041', 0, async function () {
it('TaskPoolTestClass041', 0, async function (done) {
function Sum(arg1, arg2) {
let value = [];
value[0] = arg1[0] + arg2[0];
......@@ -541,7 +541,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass042', 0, async function () {
it('TaskPoolTestClass042', 0, async function (done) {
function Sum(arg1, arg2) {
let value = arg1;
value.a = arg1.a + arg2.a;
......@@ -554,7 +554,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass043', 0, async function () {
it('TaskPoolTestClass043', 0, async function (done) {
function Sum(value1, value2) {
return value1 + value2;
}
......@@ -564,7 +564,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass044', 0, async function () {
it('TaskPoolTestClass044', 0, async function (done) {
function Sum(value1, value2) {
return value1 + value2;
}
......@@ -574,7 +574,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass045', 0, async function () {
it('TaskPoolTestClass045', 0, async function (done) {
function Sum(value1, value2) {
return value1 + value2;
}
......@@ -587,7 +587,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass046', 0, async function () {
it('TaskPoolTestClass046', 0, async function (done) {
function Sum(value1, value2) {
return value1 + value2;
}
......@@ -600,7 +600,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass047', 0, async function () {
it('TaskPoolTestClass047', 0, async function (done) {
function Sum(value1, value2) {
return value1 + value2;
}
......@@ -623,7 +623,7 @@ describe('ActsAbilityTest', function () {
done();
})
it('TaskPoolTestClass048', 0, async function () {
it('TaskPoolTestClass048', 0, async function (done) {
function Sum(value1, value2) {
return value1 + value2;
}
......@@ -634,5 +634,451 @@ describe('ActsAbilityTest', function () {
}
done();
})
/**
* @tc.number : TaskPoolTestClass049
* @tc.name : Async Function Cancel task
* @tc.desc : Cancel tasks that have not been executed
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('TaskPoolTestClass049', 0, async function (done) {
function addition(arg) {
return arg + 1;
}
function additionDelay(arg) {
var start = new Date().getTime();
while (new Date().getTime() - start < 3000) {
continue;
}
return arg + 1;
}
try {
var task1 = new taskpool.Task(additionDelay, 100);
var task2 = new taskpool.Task(additionDelay, 200);
var task3 = new taskpool.Task(addition, 300);
var result1 = taskpool.execute(task1);
var result2 = taskpool.execute(task2);
var result3 = taskpool.execute(task3);
taskpool.cancel(task3);
}
catch (e) {
expect(e.toString()).assertEqual("");
}
done();
})
/**
* @tc.number : TaskPoolTestClass050
* @tc.name : Sync Function Cancel task
* @tc.desc : Cancel tasks that have not been executed
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('TaskPoolTestClass050', 0, function (done) {
function addition(arg) {
return arg + 1;
}
function additionDelay(arg) {
var start = new Date().getTime();
while (new Date().getTime() - start < 3000) {
continue;
}
return arg + 1;
}
try {
var task1 = new taskpool.Task(additionDelay, 100);
var task2 = new taskpool.Task(additionDelay, 200);
var task3 = new taskpool.Task(addition, 300);
var result1 = taskpool.execute(task1);
var result2 = taskpool.execute(task2);
var result3 = taskpool.execute(task3);
taskpool.cancel(task3);
}
catch (e) {
expect(e.toString()).assertEqual("");
}
done();
})
/**
* @tc.number : TaskPoolTestClass051
* @tc.name : Async Function Cancel task
* @tc.desc : Cancel the task in progress
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('TaskPoolTestClass051', 0, async function (done) {
function addition(arg) {
return arg + 1;
}
function additionDelay(arg) {
var start = new Date().getTime();
while (new Date().getTime() - start < 3000) {
continue;
}
return arg + 1;
}
try {
var task1 = new taskpool.Task(additionDelay, 100);
var task2 = new taskpool.Task(additionDelay, 200);
var task3 = new taskpool.Task(addition, 300);
var result1 = taskpool.execute(task1);
var result2 = taskpool.execute(task2);
var result3 = taskpool.execute(task3);
var start = new Date().getTime();
while (new Date().getTime() - start < 1000) {
continue;
}
taskpool.cancel(task1);
}
catch (e) {
expect(e.toString()).assertEqual("BusinessError: taskpool:: can not cancel the running task");
}
done();
})
/**
* @tc.number : TaskPoolTestClass052
* @tc.name : Sync Function Cancel task
* @tc.desc : Cancel the task in progress
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('TaskPoolTestClass052', 0, function (done) {
function addition(arg) {
return arg + 1;
}
function additionDelay(arg) {
var start = new Date().getTime();
while (new Date().getTime() - start < 3000) {
continue;
}
return arg + 1;
}
try {
var task1 = new taskpool.Task(additionDelay, 100);
var task2 = new taskpool.Task(additionDelay, 200);
var task3 = new taskpool.Task(addition, 300);
var result1 = taskpool.execute(task1);
var result2 = taskpool.execute(task2);
var result3 = taskpool.execute(task3);
var start = new Date().getTime();
while (new Date().getTime() - start < 1000) {
continue;
}
taskpool.cancel(task1);
}
catch (e) {
expect(e.toString()).assertEqual("BusinessError: taskpool:: can not cancel the running task");
}
done();
})
/**
* @tc.number : TaskPoolTestClass053
* @tc.name : Async Function Cancel task
* @tc.desc : Cancel the executed task
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('TaskPoolTestClass053', 0, async function (done) {
function addition(arg) {
return arg + 1;
}
try {
var task1 = new taskpool.Task(addition, 100);
var task2 = new taskpool.Task(addition, 200);
var task3 = new taskpool.Task(addition, 300);
var result1 = taskpool.execute(task1);
var result2 = taskpool.execute(task2);
var result3 = taskpool.execute(task3);
var start = new Date().getTime();
while (new Date().getTime() - start < 1000) {
continue;
}
taskpool.cancel(task1);
}
catch (e) {
expect(e.toString()).assertEqual("BusinessError: taskpool:: can not find the task");
}
done();
})
/**
* @tc.number : TaskPoolTestClass054
* @tc.name : Sync Function Cancel task
* @tc.desc : Cancel the executed task
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('TaskPoolTestClass054', 0, function (done) {
function addition(arg) {
return arg + 1;
}
try {
var task1 = new taskpool.Task(addition, 100);
var task2 = new taskpool.Task(addition, 200);
var task3 = new taskpool.Task(addition, 300);
var task4 = new taskpool.Task(addition, 400);
var task5 = new taskpool.Task(addition, 500);
var task6 = new taskpool.Task(addition, 600);
var result1 = taskpool.execute(task1);
var result2 = taskpool.execute(task2);
var result3 = taskpool.execute(task3);
var result4 = taskpool.execute(task4);
var result5 = taskpool.execute(task5);
var result6 = taskpool.execute(task6);
var start = new Date().getTime();
while (new Date().getTime() - start < 1000) {
continue;
}
taskpool.cancel(task3);
}
catch (e) {
expect(e.toString()).assertEqual("BusinessError: taskpool:: can not find the task");
}
done();
})
/**
* @tc.number : TaskPoolTestClass055
* @tc.name : Async Function Cancel task
* @tc.desc : Cancel nonexistent task
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('TaskPoolTestClass055', 0, async function (done) {
function addition(arg) {
return arg + 1;
}
try {
var task1 = new taskpool.Task(addition, 100);
var task2 = new taskpool.Task(addition, 200);
var task3 = new taskpool.Task(addition, 300);
var result1 = taskpool.execute(task1);
var result2 = taskpool.execute(task2);
taskpool.cancel(task3);
}
catch (e) {
expect(e.toString()).assertEqual("BusinessError: taskpool:: can not find the task");
}
done();
})
/**
* @tc.number : TaskPoolTestClass056
* @tc.name : Sync Function Cancel task
* @tc.desc : Cancel nonexistent task
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('TaskPoolTestClass056', 0, function (done) {
function addition(arg) {
return arg + 1;
}
try {
var task1 = new taskpool.Task(addition, 100);
var task2 = new taskpool.Task(addition, 200);
var task3 = new taskpool.Task(addition, 300);
var result1 = taskpool.execute(task1);
var result2 = taskpool.execute(task2);
taskpool.cancel(task3);
}
catch (e) {
expect(e.toString()).assertEqual("BusinessError: taskpool:: can not find the task");
}
done();
})
/**
* @tc.number : TaskPoolTestClass057
* @tc.name : Async Function Cancel task
* @tc.desc : Canceling unexecuted tasks multiple times
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('TaskPoolTestClass057', 0, async function (done) {
function addition(arg) {
return arg + 1;
}
function additionDelay(arg) {
var start = new Date().getTime();
while (new Date().getTime() - start < 3000) {
continue;
}
return arg + 1;
}
try {
var task1 = new taskpool.Task(additionDelay, 100);
var task2 = new taskpool.Task(additionDelay, 200);
var task3 = new taskpool.Task(addition, 300);
var result1 = taskpool.execute(task1);
var result2 = taskpool.execute(task2);
var result3 = taskpool.execute(task3);
var start = new Date().getTime();
while (new Date().getTime() - start < 1000) {
continue;
}
taskpool.cancel(task3);
taskpool.cancel(task3);
}
catch (e) {
expect(e.toString()).assertEqual("BusinessError: taskpool:: can not find the task");
}
done();
})
/**
* @tc.number : TaskPoolTestClass058
* @tc.name : Sync Function Cancel task
* @tc.desc : Canceling unexecuted tasks multiple times
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('TaskPoolTestClass058', 0, function (done) {
function addition(arg) {
return arg + 1;
}
function additionDelay(arg) {
var start = new Date().getTime();
while (new Date().getTime() - start < 3000) {
continue;
}
return arg + 1;
}
try {
var task1 = new taskpool.Task(additionDelay, 100);
var task2 = new taskpool.Task(additionDelay, 200);
var task3 = new taskpool.Task(addition, 300);
var result1 = taskpool.execute(task1);
var result2 = taskpool.execute(task2);
var result3 = taskpool.execute(task3);
var start = new Date().getTime();
while (new Date().getTime() - start < 1000) {
continue;
}
taskpool.cancel(task3);
taskpool.cancel(task3);
}
catch (e) {
expect(e.toString()).assertEqual("BusinessError: taskpool:: can not find the task");
}
done();
})
/**
* @tc.number : TaskPoolTestClass059
* @tc.name : Async Function Cancel task
* @tc.desc : Cancel all tasks in sequence
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('TaskPoolTestClass059', 0, async function (done) {
function addition(arg) {
return arg + 1;
}
try {
var task1 = new taskpool.Task(addition, 100);
var task2 = new taskpool.Task(addition, 200);
var task3 = new taskpool.Task(addition, 300);
var task4 = new taskpool.Task(addition, 400);
var task5 = new taskpool.Task(addition, 500);
var task6 = new taskpool.Task(addition, 600);
var result1 = taskpool.execute(task1);
var result2 = taskpool.execute(task2);
var result3 = taskpool.execute(task3);
var result4 = taskpool.execute(task4);
var result5 = taskpool.execute(task5);
var result6 = taskpool.execute(task6);
taskpool.cancel(task6);
taskpool.cancel(task5);
taskpool.cancel(task4);
taskpool.cancel(task3);
taskpool.cancel(task2);
}
catch (e) {
expect(e.toString()).assertEqual("BusinessError: taskpool:: can not find the task");
}
done();
})
/**
* @tc.number : TaskPoolTestClass060
* @tc.name : Sync Function Cancel task
* @tc.desc : Cancel all tasks in sequence
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('TaskPoolTestClass060', 0, function (done) {
function addition(arg) {
return arg + 1;
}
try {
var task1 = new taskpool.Task(addition, 100);
var task2 = new taskpool.Task(addition, 200);
var task3 = new taskpool.Task(addition, 300);
var task4 = new taskpool.Task(addition, 400);
var task5 = new taskpool.Task(addition, 500);
var task6 = new taskpool.Task(addition, 600);
var result1 = taskpool.execute(task1);
var result2 = taskpool.execute(task2);
var result3 = taskpool.execute(task3);
var result4 = taskpool.execute(task4);
var result5 = taskpool.execute(task5);
var result6 = taskpool.execute(task6);
taskpool.cancel(task6);
taskpool.cancel(task5);
taskpool.cancel(task4);
taskpool.cancel(task3);
taskpool.cancel(task2);
}
catch (e) {
expect(e.toString()).assertEqual("BusinessError: taskpool:: can not find the task");
}
done();
})
})
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册