提交 9bcb4d71 编写于 作者: Y yuxiaoya2

【xts_acts】【monthly_0816】ability/dmsfwk 测试套参数覆盖

Signed-off-by: Nyuxiaoya2 <yuxiaoya@huawei.com>
上级 b09c3afa
......@@ -16,6 +16,9 @@ import("//build/ohos_var.gni")
group("ability") {
testonly = true
if (is_standard_system) {
deps = [ "ability_runtime:ability_runtime" ]
deps = [
"ability_runtime:ability_runtime",
"dmsfwk:dmsfwk",
]
}
}
......@@ -9,7 +9,7 @@
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import("//build/ohos_var.gni")
......
......@@ -21,6 +21,8 @@ ohos_js_hap_suite("continuationmanager_js_test") {
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsContinuationManagerJsTest"
subsystem_name = "ability"
part_name = "dmsfwk"
}
ohos_js_assets("continuationmanager_js_assets") {
js2abc = true
......
......@@ -19,8 +19,8 @@ const TEST_DEVICE_ID = "test_deviceId";
const TEST_CONNECT_STATUS = continuationManager.DeviceConnectState.CONNECTED;
let token = -1;
export default function ContinuationManagerTest() {
describe('ContinuationManagerTest', function() {
export default function continuationManagerTest() {
describe('continuationManagerTest', function() {
beforeAll(async function (done) {
console.info('beforeAll');
......@@ -58,6 +58,7 @@ describe('ContinuationManagerTest', function() {
*/
it('testRegister001', 0, async function(done) {
try {
console.info("testRegister001Begin ");
continuationManager.register(function (err, data) {
expect(err.code == 0).assertTrue();
expect(data - token == 1).assertTrue();
......@@ -85,7 +86,7 @@ describe('ContinuationManagerTest', function() {
authInfo: {}
};
continuationManager.register(continuationExtraParams, function(err, data){
console.info("testRegister002 " + err.message)
console.info("testRegister002 " + err.message);
expect(err.message == "Invalidate params.").assertTrue();
done();
});
......@@ -133,7 +134,7 @@ describe('ContinuationManagerTest', function() {
deviceType: ["00E"],
description: "description",
filter: {"name": "authInfo","length": 8},
continuationMode: continuationManager.ContinuationMode.COLLABORATION_MUTIPLE,
continuationMode: continuationManager.ContinuationMode.COLLABORATION_MULTIPLE,
authInfo: {"name": "authInfo","length": 8}
};
continuationManager.register(continuationExtraParams, function(err, data) {
......@@ -149,6 +150,160 @@ describe('ContinuationManagerTest', function() {
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0500
* @tc.name [JS-API8]ContinuationManager.register().
* @tc.desc Test Js Api ContinuationManager.register() testcase 005
*/
it('testRegister005', 0, async function(done) {
try {
let continuationExtraParams = {
deviceType: ["00E"],
description: "description",
filter: {"name": "authInfo","length": 8},
continuationMode: continuationManager.ContinuationMode.COLLABORATION_SINGLE,
authInfo: {"name": "authInfo","length": 8}
};
continuationManager.register(continuationExtraParams, function(err, data) {
expect(err.code == 0).assertTrue();
expect(data - token == 1).assertTrue();
done();
});
} catch (e) {
console.info("testRegister005 " + e);
expect(null).assertFail();
done();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0600
* @tc.name [JS-API8]ContinuationManager.register().
* @tc.desc Test Js Api ContinuationManager.register() testcase 006
*/
it('testRegister006', 0, async function(done) {
try {
let continuationExtraParams = {
deviceType: ["00E"],
description: "description",
filter: {"name": "authInfo","length": 8},
continuationMode: continuationManager.ContinuationMode.COLLABORATION_SINGLE,
authInfo: {"name": "authInfo","length": 8}
};
continuationManager.register(continuationExtraParams).then((data) => {
expect(data - token == 1).assertTrue();
}).catch((err) => {
expect(err.code == 29360210).assertTrue();
});
} catch (e) {
console.info("testRegister006 " + e);
expect(null).assertFail();
}
done();
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0700
* @tc.name [JS-API8]ContinuationManager.register().
* @tc.desc Test Js Api ContinuationManager.register() testcase 007
*/
it('testRegister007', 0, async function(done) {
try {
let continuationExtraParams = {
deviceType: ["00E"],
description: "description",
filter: {"name": "authInfo","length": 8},
continuationMode: continuationManager.ContinuationMode.COLLABORATION_MULTIPLE,
authInfo: {"name": "authInfo","length": 8}
};
continuationManager.register(continuationExtraParams).then((data) => {
expect(data - token == 1).assertTrue();
}).catch((err) => {
expect(err.code == 29360210).assertTrue();
});
} catch (e) {
console.info("testRegister007 " + e);
expect(null).assertFail();
}
done();
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0800
* @tc.name [JS-API8]ContinuationManager.register().
* @tc.desc Test Js Api ContinuationManager.register() testcase 008
*/
it('testRegister008', 0, async function(done) {
try {
let continuationExtraParams = {
deviceType: [],
description: "",
filter: "",
continuationMode: null,
authInfo: {}
};
continuationManager.register(continuationExtraParams).then((data) => {
expect(data - token != 1).assertTrue();
}).catch((err) => {
expect(err.code == 29360210).assertTrue();
});
} catch (e) {
console.info("testRegister008 " + e);
expect(null).assertFail();
}
done();
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0900
* @tc.name [JS-API8]ContinuationManager.register().
* @tc.desc Test Js Api ContinuationManager.register() testcase 009
*/
it('testRegister009', 0, async function(done) {
try {
let continuationExtraParams = {
deviceType: ["00E"],
description: "description",
filter: {"name": "authInfo","length": 8},
continuationMode: 10,
authInfo: {"name": "authInfo","length": 8}
};
continuationManager.register(continuationExtraParams).then((data) => {
expect(data - token != 1).assertTrue();
}).catch((err) => {
expect(err.code == 29360210).assertTrue();
});
done();
} catch (e) {
console.info("testRegister009 " + e);
expect(null).assertFail();
done();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_1000
* @tc.name [JS-API8]ContinuationManager.register().
* @tc.desc Test Js Api ContinuationManager.register() testcase 010
*/
it('testRegister010', 0, async function(done) {
try {
continuationManager.register().then((data) => {
expect(data - token == 1).assertTrue();
}).catch((err) => {
expect(err.code == 29360210).assertTrue();
});
} catch (e) {
console.info("testRegister010 " + e);
expect(null).assertFail();
}
done();
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UNREGISTER_0100
* @tc.name [JS-API8]ContinuationManager.unregister().
......@@ -208,6 +363,46 @@ describe('ContinuationManagerTest', function() {
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UNREGISTER_0400
* @tc.name [JS-API8]ContinuationManager.unregister().
* @tc.desc Test Js Api ContinuationManager.unregister() testcase 004
*/
it('testUnregister004', 0, async function(done) {
try {
continuationManager.unregister(300, function (data) {
expect(data.code == 29360208).assertTrue();
})
done();
} catch (e) {
console.info("testUnregister004 " + e);
expect(null).assertFail();
done();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UNREGISTER_0500
* @tc.name [JS-API8]ContinuationManager.unregister().
* @tc.desc Test Js Api ContinuationManager.unregister() testcase 005
*/
it('testUnregister005', 0, async function(done) {
try {
continuationManager.unregister(token, function (data) {
console.info("testUnregister005 " + JSON.stringify(data));
expect(data.code == 0).assertTrue();
})
done();
} catch (e) {
console.info("testUnregister005 " + e);
expect(null).assertFail();
done();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_ON_0100
* @tc.name [JS-API8]ContinuationManager.on().
......@@ -397,7 +592,7 @@ describe('ContinuationManagerTest', function() {
deviceType: ["00E"],
description: "description",
filter: {"name": "authInfo","length": 8},
continuationMode: continuationManager.ContinuationMode.COLLABORATION_MUTIPLE,
continuationMode: continuationManager.ContinuationMode.COLLABORATION_MULTIPLE,
authInfo: {"name": "authInfo","length": 8}
};
continuationManager.startDeviceManager(null, continuationExtraParams, function (err, data) {
......@@ -423,7 +618,7 @@ describe('ContinuationManagerTest', function() {
deviceType: ["00E"],
description: "description",
filter: {"name": "authInfo","length": 8},
continuationMode: continuationManager.ContinuationMode.COLLABORATION_MUTIPLE,
continuationMode: continuationManager.ContinuationMode.COLLABORATION_MULTIPLE,
authInfo: {"name": "authInfo","length": 8}
};
continuationManager.startDeviceManager(52, continuationExtraParams, function (err, data) {
......@@ -513,6 +708,54 @@ describe('ContinuationManagerTest', function() {
done();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0800
* @tc.name [JS-API8]ContinuationManager.startDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startDeviceManager() testcase 008
*/
it('testStartDeviceManager008', 0, async function(done) {
try {
let continuationExtraParams = {
deviceType: ["00E"],
description: "description",
filter: {"name": "authInfo","length": 8},
continuationMode: continuationManager.ContinuationMode.COLLABORATION_SINGLE,
authInfo: {"name": "authInfo","length": 8}
};
continuationManager.startDeviceManager(token, continuationExtraParams).then((data) => {
expect(data == undefined).assertTrue();
}).catch((err) => {
expect(err.code == 29360210).assertTrue();
});
done();
} catch (e) {
console.info("testStartDeviceManager008 " + e);
expect(null).assertFail();
done();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0900
* @tc.name [JS-API8]ContinuationManager.startDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startDeviceManager() testcase 009
*/
it('testStartDeviceManager009', 0, async function(done) {
try {
continuationManager.startDeviceManager(token).then((data) => {
expect(data == undefined).assertTrue();
}).catch((err) => {
expect(err.code == 29360210).assertTrue();
});
done();
} catch (e) {
console.info("testStartDeviceManager009 " + e);
expect(null).assertFail();
done();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0100
......@@ -572,4 +815,74 @@ describe('ContinuationManagerTest', function() {
done();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0400
* @tc.name [JS-API8]ContinuationManager.updateConnectStatus().
* @tc.desc Test Js Api ContinuationManager.updateConnectStatus() testcase 004
*/
it('testUpdateConnectStatus004', 0, async function(done) {
try {
console.info('testUpdateConnectStatus004 begin');
continuationManager.updateConnectStatus(token, TEST_DEVICE_ID,
continuationManager.DeviceConnectState.IDLE).then((data) => {
expect(data == undefined).assertTrue();
}).catch((err) => {
expect(err.code == 29360210).assertTrue();
});
done();
} catch (e) {
console.info("testUpdateConnectStatus004 " + e);
expect(null).assertFail();
done();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0500
* @tc.name [JS-API8]ContinuationManager.updateConnectStatus().
* @tc.desc Test Js Api ContinuationManager.updateConnectStatus() testcase 005
*/
it('testUpdateConnectStatus005', 0, async function(done) {
try {
console.info('testUpdateConnectStatus005 begin');
continuationManager.updateConnectStatus(token, TEST_DEVICE_ID,
continuationManager.DeviceConnectState.CONNECTING).then((data) => {
expect(data == undefined).assertTrue();
}).catch((err) => {
expect(err.code == 29360210).assertTrue();
});
done();
} catch (e) {
console.info("testUpdateConnectStatus005 " + e);
expect(null).assertFail();
done();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0600
* @tc.name [JS-API8]ContinuationManager.updateConnectStatus().
* @tc.desc Test Js Api ContinuationManager.updateConnectStatus() testcase 006
*/
it('testUpdateConnectStatus006', 0, async function(done) {
try {
continuationManager.updateConnectStatus(token, TEST_DEVICE_ID,
continuationManager.DeviceConnectState.DISCONNECTING).then((data) => {
expect(data == undefined).assertTrue();
}).catch((err) => {
expect(err.code == 29360210).assertTrue();
});
done();
} catch (e) {
console.info("testUpdateConnectStatus006 " + e);
expect(null).assertFail();
done();
}
})
})}
......@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import ContinuationManagerTest from './ContinuationManagerJsunit.test.js'
import continuationManagerTest from './ContinuationManagerJsunit.test.js'
export default function testsuite() {
ContinuationManagerTest()
continuationManagerTest()
}
# Copyright (c) 2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//build/ohos_var.gni")
group("systemabilitymgr") {
testonly = true
if (is_standard_system) {
deps = [ "dmsfwk:dmsfwk" ]
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册