提交 aa5be150 编写于 作者: L liangzhenyu123

copyright整改,createKVManagerV9增加异常用例

Signed-off-by: Nliangzhenyu123 <liangzhenyu6@huawei.com>
上级 f8bd3d86
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* 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
......
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* 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
......
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* 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
......
......@@ -18,8 +18,7 @@
"mainAbility": ".MainAbility",
"deviceType": [
"default",
"tablet",
"phone"
"tablet"
],
"distro": {
"deliveryWithInstall": true,
......@@ -110,4 +109,4 @@
},
"srcPath": ""
}
}
\ No newline at end of file
}
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-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
......
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Copyright (C) 2021-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
......
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2021-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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-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
......
......@@ -496,5 +496,85 @@ describe('kvManagerCallbackTest', function () {
done();
}
})
/**
* @tc.number SUB_DDM_DKV_KVMANAGER_CREATEKVMANAGER_0100
* @tc.desc Test Js Api createKVManager() testcase 001
* @tc.type: FUNC
* @tc.name Test Js Api createKVManager() testcase 001
*/
it('SUB_DDM_DKV_KVMANAGER_CREATEKVMANAGER_0100', 0, async function (done) {
console.info('SUB_DDM_DKV_KVMANAGER_CREATEKVMANAGER_0100 start');
let kvManagerConfig = {
bundleName : [TEST_BUNDLE_NAME],
context: context
}
try{
factory.createKVManager(kvManagerConfig);
expect(false).assertTrue();
}catch(err){
console.info(`Create kvManager error: error code is ${err.code}, error message is ${err.message}`);
expect(err.code).assertEqual("401");
}
done();
})
/**
* @tc.number SUB_DDM_DKV_KVMANAGER_CREATEKVMANAGER_0200
* @tc.desc Test Js Api createKVManager() testcase 002
* @tc.type: FUNC
* @tc.name Test Js Api createKVManager() testcase 002
*/
it('SUB_DDM_DKV_KVMANAGER_CREATEKVMANAGER_0200', 0, async function (done) {
console.info('SUB_DDM_DKV_KVMANAGER_CREATEKVMANAGER_0200 start ');
let kvManagerConfig = {
bundleName : TEST_BUNDLE_NAME,
context: "context"
}
try{
factory.createKVManager(kvManagerConfig);
expect(false).assertTrue();
}catch(err){
console.info(`Create kvManager error: error code is ${err.code}, error message is ${err.message}`);
expect(err.code).assertEqual("401");
}
done();
})
/**
* @tc.number SUB_DDM_DKV_KVMANAGER_CREATEKVMANAGER_0300
* @tc.desc Test Js Api createKVManager() testcase 003
* @tc.type: FUNC
* @tc.name Test Js Api createKVManager() testcase 003
*/
it('SUB_DDM_DKV_KVMANAGER_CREATEKVMANAGER_0300', 0, async function (done) {
console.info('SUB_DDM_DKV_KVMANAGER_CREATEKVMANAGER_0300 start ');
try{
factory.createKVManager("kvManagerConfig");
expect(false).assertTrue();
}catch(err){
console.info(`Create kvManager error: error code is ${err.code}, error message is ${err.message}`);
expect(err.code).assertEqual("401");
}
done();
})
/**
* @tc.number SUB_DDM_DKV_KVMANAGER_CREATEKVMANAGER_0400
* @tc.desc Test Js Api createKVManager() testcase 004
* @tc.type: FUNC
* @tc.name Test Js Api createKVManager() testcase 004
*/
it('SUB_DDM_DKV_KVMANAGER_CREATEKVMANAGER_0400', 0, async function (done) {
console.info('SUB_DDM_DKV_KVMANAGER_CREATEKVMANAGER_0400 start ');
try{
factory.createKVManager();
expect(false).assertTrue();
}catch(err){
console.info(`Create kvManager error: error code is ${err.code}, error message is ${err.message}`);
expect(err.code).assertEqual("401");
}
done();
})
})
}
\ No newline at end of file
......@@ -909,7 +909,7 @@ describe('kvManagerCallbackTest', function () {
done();
}
})
/**
* @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORE_PUT_CALLBACK_1000
* @tc.name [JS-API8]KVStore.Put
......@@ -939,5 +939,56 @@ describe('kvManagerCallbackTest', function () {
done();
}
})
/**
* @tc.number SUB_DISTRIBUTEDDATAMGR_CREATEKVMANAGER_CALLBACK_0100
* @tc.name [JS-API8]createKVManager
* @tc.desc Test Js Api createKVManager testcase 001
*/
it('SUB_DISTRIBUTEDDATAMGR_CREATEKVMANAGER_CALLBACK_0100', 0, async function (done) {
console.info('SUB_DISTRIBUTEDDATAMGR_CREATEKVMANAGER_CALLBACK_0100 start');
const kvManagerConfig = {
bundleName: [TEST_BUNDLE_NAME],
userInfo: {
userId: '0',
userType: factory.UserType.SAME_USER_ID
}
}
factory.createKVManager(kvManagerConfig, (err, data) => {
if(err != null){
console.info(`Create kvManager error: ${err}`)
done()
}else{
console.info("Create kvManager success")
expect(false).assertTrue();
done();
}
})
})
/**
* @tc.number SUB_DISTRIBUTEDDATAMGR_CREATEKVMANAGER_CALLBACK_0200
* @tc.name [JS-API8]createKVManager
* @tc.desc Test Js Api createKVManager testcase 001
*/
it('SUB_DISTRIBUTEDDATAMGR_CREATEKVMANAGER_CALLBACK_0200', 0, async function (done) {
console.info('SUB_DISTRIBUTEDDATAMGR_CREATEKVMANAGER_CALLBACK_0200 start');
try{
factory.createKVManager("kvManagerConfig", (err, data) => {
if(err != null){
console.info(`Create kvManager error: ${err}`)
done()
}else{
console.info("Create kvManager success")
expect(false).assertTrue();
done();
}
})
}catch(err){
console.info(`Create kvManager error: ${err}`)
expect(err != null).assertTrue();
done();
}
})
})
}
\ No newline at end of file
......@@ -845,5 +845,47 @@ describe('kvManagerPromiseTest', function () {
done();
})
/**
* @tc.number SUB_DISTRIBUTEDDATAMGR_CREATEKVMANAGER_PROMISE_0100
* @tc.name [JS-API8]createKVManager
* @tc.desc Test Js Api createKVManager testcase 001
*/
it('SUB_DISTRIBUTEDDATAMGR_CREATEKVMANAGER_PROMISE_0100', 0, async function (done) {
console.info('SUB_DISTRIBUTEDDATAMGR_CREATEKVMANAGER_PROMISE_0100 start');
const kvManagerConfig = {
bundleName: [TEST_BUNDLE_NAME],
userInfo: {
userId: '0',
userType: factory.UserType.SAME_USER_ID
},
context:contextApplication
}
factory.createKVManager(kvManagerConfig).then((manager) => {
console.info("Create kvManager success")
expect(false).assertTrue();
done();
}).catch((err) => {
console.info(`Create kvManager error: ${err}`)
done()
})
})
/**
* @tc.number SUB_DISTRIBUTEDDATAMGR_CREATEKVMANAGER_PROMISE_0200
* @tc.name [JS-API8]createKVManager
* @tc.desc Test Js Api createKVManager testcase 001
*/
it('SUB_DISTRIBUTEDDATAMGR_CREATEKVMANAGER_PROMISE_0200', 0, async function (done) {
console.info('SUB_DISTRIBUTEDDATAMGR_CREATEKVMANAGER_PROMISE_0200 start');
factory.createKVManager("kvManagerConfig").then((manager) => {
console.info("Create kvManager success")
expect(false).assertTrue();
done();
}).catch((err) => {
console.info(`Create kvManager error: ${err}`)
expect(err != null).assertTrue();
done();
})
})
})
}
\ No newline at end of file
......@@ -2263,6 +2263,8 @@ describe('singleKvStoreCallbackTest', function () {
*/
it('testSingleKvStoreCloseResultSet104', 0, async function (done) {
console.info('SingleKvStoreCloseResultSetCallbackTest004');
kvStore.closeResultSet("",(err, data) => {
if(err != undefined){
console.info(`SingleKvStoreCloseResultSetCallbackTest004 close result error, error is ${err}`)
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-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
......
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2021-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
......
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2021-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
......
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2021-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
......
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2021-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
......
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2021-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
......
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2021-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
......
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2021-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
......
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2021-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
......
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2021-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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册