Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
59d0f350
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
59d0f350
编写于
5月 21, 2022
作者:
B
bayanxing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加分布式数据库、位置服务、安全(用户认证)、轻量级存储相关用例
Signed-off-by:
N
bayanxing
<
bayanxing@kaihongdigi.com
>
上级
28b808e3
变更
5
展开全部
隐藏空白更改
内联
并排
Showing
5 changed file
with
1432 addition
and
71 deletion
+1432
-71
distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/StorageHelperJsunit.test.js
.../hap/src/main/js/default/test/StorageHelperJsunit.test.js
+23
-2
distributeddatamgr/distributeddatamgrjstest/hap/src/main/js/default/test/KvManagerCallbackJsunit.test.js
.../src/main/js/default/test/KvManagerCallbackJsunit.test.js
+172
-29
distributeddatamgr/distributeddatamgrjstest/hap/src/main/js/default/test/KvManagerPromiseJsunit.test.js
...p/src/main/js/default/test/KvManagerPromiseJsunit.test.js
+103
-20
location/geolocation_standard/src/main/js/default/test/GeocoderTest.test.js
...on_standard/src/main/js/default/test/GeocoderTest.test.js
+589
-0
useriam/face_auth/js_api_test/function_test/userauth/entry/src/main/js/test/execute.js
.../function_test/userauth/entry/src/main/js/test/execute.js
+545
-20
未找到文件。
distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/StorageHelperJsunit.test.js
浏览文件 @
59d0f350
...
...
@@ -80,9 +80,9 @@ describe('storageTest', function () {
})
/**
* @tc.name removeStorageFromCache interface test
* @tc.name removeStorageFromCache
promise
interface test
* @tc.number SUB_DDM_AppDataFWK_JSPreferences_Storage_Helper_0040
* @tc.desc removeStorageFromCache interface test
* @tc.desc removeStorageFromCache
promise
interface test
*/
it
(
'
testRemoveStorageFromCache002
'
,
0
,
async
function
(
done
)
{
let
perf
=
storage
.
getStorageSync
(
'
/data/test_storage2
'
);
...
...
@@ -96,6 +96,27 @@ describe('storageTest', function () {
done
();
})
/**
* @tc.name removeStorageFromCache callback interface test
* @tc.number SUB_DDM_AppDataFWK_JSPreferences_Storage_Helper_0041
* @tc.desc removeStorageFromCache callback interface test
*/
it
(
'
testRemoveStorageFromCache003
'
,
0
,
function
(
done
)
{
let
perf
=
storage
.
getStorageSync
(
'
/data/test_storage2
'
);
storage
.
removeStorageFromCache
(
perf
,
function
(
err
)
{
if
(
err
)
{
console
.
info
(
"
removeStorageFromCache callback interface test failed.
"
);
expect
(
null
).
assertFail
();
done
();
return
}
console
.
info
(
"
removeStorageFromCache callback interface test successfully.
"
);
expect
(
true
).
assertTrue
();
done
();
})
})
/**
* @tc.name deleteStorageSync interface test
* @tc.number SUB_DDM_AppDataFWK_JSPreferences_Storage_Helper_0050
...
...
distributeddatamgr/distributeddatamgrjstest/hap/src/main/js/default/test/KvManagerCallbackJsunit.test.js
浏览文件 @
59d0f350
...
...
@@ -17,8 +17,11 @@ import factory from '@ohos.data.distributedData';
const
TEST_BUNDLE_NAME
=
'
ohos.acts.distributeddatamgr
'
;
const
TEST_STORE_ID
=
'
storeId
'
;
const
STORE_KEY
=
'
key_test_string
'
;
const
STORE_VALUE
=
'
value-test-string
'
;
var
kvManager
=
null
;
var
kvStore
=
null
;
var
kvStoreNew
=
null
;
describe
(
'
KVManagerCallbackTest
'
,
function
()
{
const
config
=
{
...
...
@@ -43,7 +46,10 @@ describe('KVManagerCallbackTest', function () {
console
.
log
(
'
beforeAll
'
);
await
factory
.
createKVManager
(
config
,
function
(
err
,
manager
)
{
kvManager
=
manager
;
done
();
kvManager
.
getKVStore
(
TEST_STORE_ID
,
options
,
function
(
err
,
store
)
{
kvStoreNew
=
store
;
done
();
});
});
console
.
log
(
'
beforeAll end
'
);
})
...
...
@@ -125,9 +131,9 @@ describe('KVManagerCallbackTest', function () {
encrypt
:
false
,
backup
:
false
,
autoSync
:
true
,
kvStoreType
:
factory
.
KVStoreType
.
SINGLE_VERS
ION
,
kvStoreType
:
factory
.
KVStoreType
.
DEVICE_COLLABORAT
ION
,
schema
:
''
,
securityLevel
:
factory
.
SecurityLevel
.
S2
,
securityLevel
:
factory
.
SecurityLevel
.
NO_LEVEL
,
}
try
{
await
kvManager
.
getKVStore
(
TEST_STORE_ID
,
optionsInfo
,
function
(
err
,
store
)
{
...
...
@@ -156,9 +162,9 @@ describe('KVManagerCallbackTest', function () {
encrypt
:
false
,
backup
:
false
,
autoSync
:
true
,
kvStoreType
:
factory
.
KVStoreType
.
SINGLE_VERS
ION
,
kvStoreType
:
factory
.
KVStoreType
.
DEVICE_COLLABORAT
ION
,
schema
:
''
,
securityLevel
:
factory
.
SecurityLevel
.
S
2
,
securityLevel
:
factory
.
SecurityLevel
.
S
0
,
}
try
{
await
kvManager
.
getKVStore
(
TEST_STORE_ID
,
optionsInfo
,
function
(
err
,
store
)
{
...
...
@@ -188,9 +194,9 @@ describe('KVManagerCallbackTest', function () {
encrypt
:
true
,
backup
:
false
,
autoSync
:
true
,
kvStoreType
:
factory
.
KVStoreType
.
SINGLE_VERS
ION
,
kvStoreType
:
factory
.
KVStoreType
.
DEVICE_COLLABORAT
ION
,
schema
:
''
,
securityLevel
:
factory
.
SecurityLevel
.
S
2
,
securityLevel
:
factory
.
SecurityLevel
.
S
1
,
}
try
{
await
kvManager
.
getKVStore
(
TEST_STORE_ID
,
optionsInfo
,
function
(
err
,
store
)
{
...
...
@@ -218,7 +224,7 @@ describe('KVManagerCallbackTest', function () {
encrypt
:
false
,
backup
:
false
,
autoSync
:
true
,
kvStoreType
:
factory
.
KVStoreType
.
SINGLE_VERS
ION
,
kvStoreType
:
factory
.
KVStoreType
.
DEVICE_COLLABORAT
ION
,
schema
:
''
,
securityLevel
:
factory
.
SecurityLevel
.
S2
,
}
...
...
@@ -248,9 +254,9 @@ describe('KVManagerCallbackTest', function () {
encrypt
:
false
,
backup
:
true
,
autoSync
:
true
,
kvStoreType
:
factory
.
KVStoreType
.
SINGLE_VERS
ION
,
kvStoreType
:
factory
.
KVStoreType
.
DEVICE_COLLABORAT
ION
,
schema
:
''
,
securityLevel
:
factory
.
SecurityLevel
.
S
2
,
securityLevel
:
factory
.
SecurityLevel
.
S
3
,
}
try
{
await
kvManager
.
getKVStore
(
TEST_STORE_ID
,
optionsInfo
,
function
(
err
,
store
)
{
...
...
@@ -278,9 +284,9 @@ describe('KVManagerCallbackTest', function () {
encrypt
:
false
,
backup
:
false
,
autoSync
:
true
,
kvStoreType
:
factory
.
KVStoreType
.
SINGLE_VERS
ION
,
kvStoreType
:
factory
.
KVStoreType
.
DEVICE_COLLABORAT
ION
,
schema
:
''
,
securityLevel
:
factory
.
SecurityLevel
.
S
2
,
securityLevel
:
factory
.
SecurityLevel
.
S
4
,
}
try
{
await
kvManager
.
getKVStore
(
TEST_STORE_ID
,
optionsInfo
,
function
(
err
,
store
)
{
...
...
@@ -310,7 +316,7 @@ describe('KVManagerCallbackTest', function () {
autoSync
:
true
,
kvStoreType
:
factory
.
KVStoreType
.
SINGLE_VERSION
,
schema
:
''
,
securityLevel
:
factory
.
SecurityLevel
.
S2
,
securityLevel
:
factory
.
SecurityLevel
.
NO_LEVEL
,
}
try
{
await
kvManager
.
getKVStore
(
TEST_STORE_ID
,
optionsInfo
,
function
(
err
,
store
)
{
...
...
@@ -340,7 +346,7 @@ describe('KVManagerCallbackTest', function () {
autoSync
:
false
,
kvStoreType
:
factory
.
KVStoreType
.
SINGLE_VERSION
,
schema
:
''
,
securityLevel
:
factory
.
SecurityLevel
.
S
2
,
securityLevel
:
factory
.
SecurityLevel
.
S
0
,
}
try
{
await
kvManager
.
getKVStore
(
TEST_STORE_ID
,
optionsInfo
,
function
(
err
,
store
)
{
...
...
@@ -370,7 +376,7 @@ describe('KVManagerCallbackTest', function () {
autoSync
:
true
,
kvStoreType
:
factory
.
KVStoreType
.
SINGLE_VERSION
,
schema
:
''
,
securityLevel
:
factory
.
SecurityLevel
.
S
2
,
securityLevel
:
factory
.
SecurityLevel
.
S
1
,
}
try
{
await
kvManager
.
getKVStore
(
TEST_STORE_ID
,
optionsInfo
,
function
(
err
,
store
)
{
...
...
@@ -398,7 +404,7 @@ describe('KVManagerCallbackTest', function () {
encrypt
:
false
,
backup
:
false
,
autoSync
:
true
,
kvStoreType
:
factory
.
KVStoreType
.
DEVICE_COLLABORAT
ION
,
kvStoreType
:
factory
.
KVStoreType
.
SINGLE_VERS
ION
,
schema
:
''
,
securityLevel
:
factory
.
SecurityLevel
.
S2
,
}
...
...
@@ -428,9 +434,9 @@ describe('KVManagerCallbackTest', function () {
encrypt
:
false
,
backup
:
false
,
autoSync
:
true
,
kvStoreType
:
factory
.
KVStoreType
.
MULTI
_VERSION
,
kvStoreType
:
factory
.
KVStoreType
.
SINGLE
_VERSION
,
schema
:
''
,
securityLevel
:
factory
.
SecurityLevel
.
S
2
,
securityLevel
:
factory
.
SecurityLevel
.
S
3
,
}
try
{
await
kvManager
.
getKVStore
(
TEST_STORE_ID
,
optionsInfo
,
function
(
err
,
store
)
{
...
...
@@ -462,7 +468,7 @@ describe('KVManagerCallbackTest', function () {
autoSync
:
true
,
kvStoreType
:
factory
.
KVStoreType
.
SINGLE_VERSION
,
schema
:
''
,
securityLevel
:
factory
.
SecurityLevel
.
NO_LEVEL
,
securityLevel
:
factory
.
SecurityLevel
.
S4
,
}
try
{
await
kvManager
.
getKVStore
(
TEST_STORE_ID
,
optionsInfo
,
function
(
err
,
store
)
{
...
...
@@ -490,9 +496,9 @@ describe('KVManagerCallbackTest', function () {
encrypt
:
false
,
backup
:
false
,
autoSync
:
true
,
kvStoreType
:
factory
.
KVStoreType
.
SINGLE
_VERSION
,
kvStoreType
:
factory
.
KVStoreType
.
MULTI
_VERSION
,
schema
:
''
,
securityLevel
:
factory
.
SecurityLevel
.
S0
,
securityLevel
:
factory
.
SecurityLevel
.
NO_LEVEL
,
}
try
{
await
kvManager
.
getKVStore
(
TEST_STORE_ID
,
optionsInfo
,
function
(
err
,
store
)
{
...
...
@@ -520,9 +526,9 @@ describe('KVManagerCallbackTest', function () {
encrypt
:
false
,
backup
:
false
,
autoSync
:
true
,
kvStoreType
:
factory
.
KVStoreType
.
SINGLE
_VERSION
,
kvStoreType
:
factory
.
KVStoreType
.
MULTI
_VERSION
,
schema
:
''
,
securityLevel
:
factory
.
SecurityLevel
.
S
1
,
securityLevel
:
factory
.
SecurityLevel
.
S
0
,
}
try
{
await
kvManager
.
getKVStore
(
TEST_STORE_ID
,
optionsInfo
,
function
(
err
,
store
)
{
...
...
@@ -550,9 +556,9 @@ describe('KVManagerCallbackTest', function () {
encrypt
:
false
,
backup
:
false
,
autoSync
:
true
,
kvStoreType
:
factory
.
KVStoreType
.
SINGLE
_VERSION
,
kvStoreType
:
factory
.
KVStoreType
.
MULTI
_VERSION
,
schema
:
''
,
securityLevel
:
factory
.
SecurityLevel
.
S
2
,
securityLevel
:
factory
.
SecurityLevel
.
S
1
,
}
try
{
await
kvManager
.
getKVStore
(
TEST_STORE_ID
,
optionsInfo
,
function
(
err
,
store
)
{
...
...
@@ -580,9 +586,9 @@ describe('KVManagerCallbackTest', function () {
encrypt
:
false
,
backup
:
false
,
autoSync
:
true
,
kvStoreType
:
factory
.
KVStoreType
.
SINGLE
_VERSION
,
kvStoreType
:
factory
.
KVStoreType
.
MULTI
_VERSION
,
schema
:
''
,
securityLevel
:
factory
.
SecurityLevel
.
S
3
,
securityLevel
:
factory
.
SecurityLevel
.
S
2
,
}
try
{
await
kvManager
.
getKVStore
(
TEST_STORE_ID
,
optionsInfo
,
function
(
err
,
store
)
{
...
...
@@ -610,9 +616,9 @@ describe('KVManagerCallbackTest', function () {
encrypt
:
false
,
backup
:
false
,
autoSync
:
true
,
kvStoreType
:
factory
.
KVStoreType
.
SINGLE
_VERSION
,
kvStoreType
:
factory
.
KVStoreType
.
MULTI
_VERSION
,
schema
:
''
,
securityLevel
:
factory
.
SecurityLevel
.
S
4
,
securityLevel
:
factory
.
SecurityLevel
.
S
3
,
}
try
{
await
kvManager
.
getKVStore
(
TEST_STORE_ID
,
optionsInfo
,
function
(
err
,
store
)
{
...
...
@@ -628,6 +634,36 @@ describe('KVManagerCallbackTest', function () {
}
})
/**
* @tc.number SUB_DISTRIBUTEDDATAMGR_KVMANAGER_GETKVSTORE_1200
* @tc.name [JS-API8]KVManager.GetKVStore.
* @tc.desc Test Js Api KVManager.GetKVStore testcase 120
*/
it
(
'
testKVManagerGetKVStore120
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
testKVManagerGetKVStore120
'
);
const
optionsInfo
=
{
createIfMissing
:
true
,
encrypt
:
false
,
backup
:
false
,
autoSync
:
true
,
kvStoreType
:
factory
.
KVStoreType
.
MULTI_VERSION
,
schema
:
''
,
securityLevel
:
factory
.
SecurityLevel
.
S4
,
}
try
{
await
kvManager
.
getKVStore
(
TEST_STORE_ID
,
optionsInfo
,
function
(
err
,
store
)
{
console
.
log
(
'
testKVManagerGetKVStore120 getKVStore success
'
);
expect
((
err
==
undefined
)
&&
(
store
!=
null
)).
assertTrue
();
kvStore
=
store
;
done
();
});
}
catch
(
e
)
{
console
.
log
(
'
testKVManagerGetKVStore119 getKVStore e
'
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDDATAMGR_KVMANAGER_CLOSEKVSTORE_1100
* @tc.name [JS-API8]KVManager.CloseKVStore.
...
...
@@ -878,4 +914,111 @@ describe('KVManagerCallbackTest', function () {
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORE_PUT_1000
* @tc.name [JS-API8]KVStore.Put
* @tc.desc Test Js Api KVManager.Put testcase 100
*/
it
(
'
testKVStorePut100
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
testKVStorePut100
'
);
try
{
await
kvStoreNew
.
put
(
STORE_KEY
,
STORE_VALUE
,
function
(
err
,
data
)
{
if
(
err
!=
undefined
){
console
.
log
(
'
testKVStorePut100 put callback fail
'
);
}
else
{
console
.
log
(
'
testKVStorePut100 put callback success
'
);
expect
(
null
).
assertFail
();
}
done
();
});
}
catch
(
e
)
{
console
.
log
(
'
testKVStorePut100 callback e
'
+
e
);
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORE_DELETE_1000
* @tc.name [JS-API8]KVStore.Delete
* @tc.desc Test Js Api KVManager.Delete testcase 100
*/
it
(
'
testKVStoreDelete100
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
testKVStoreDelete100
'
);
try
{
await
KVStoreNew
.
put
(
STORE_KEY
,
STORE_VALUE
,
async
function
(
err
,
data
)
{
console
.
log
(
'
testKVStoreDelete100 put success
'
);
try
{
kvStore
.
delete
(
STORE_KEY
,
function
(
err
,
data
)
{
if
(
err
==
undefined
)
{
console
.
log
(
'
testKVStoreDelete100 callback delete success
'
);
expect
(
null
).
assertFail
();
}
else
{
console
.
log
(
'
testKVStoreDelete100 callback delete fail
'
);
}
done
();
});
}
catch
(
e
)
{
console
.
log
(
'
testKVStoreDelete100 callback delete e
'
+
e
);
done
();
}
});
}
catch
(
ee
)
{
console
.
log
(
'
testKVStoreDelete100 callback delete ee
'
+
ee
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORE_ON_1000
* @tc.name [JS-API8]KVStore.On
* @tc.desc Test Js Api KVManager.On testcase 100
*/
it
(
'
testKVStoreOn100
'
,
0
,
async
function
(
done
)
{
kvStoreNew
.
on
(
'
dataChange
'
,
0
,
function
(
data
)
{
console
.
log
(
"
testKVStoreOn100 callback call data:
"
+
JSON
.
stringify
(
data
));
expect
(
true
).
assertTrue
();
});
done
();
})
/**
* @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORE_ON_1100
* @tc.name [JS-API8]KVStore.On
* @tc.desc Test Js Api KVManager.On testcase 101
*/
it
(
'
testKVStoreOn101
'
,
0
,
async
function
(
done
)
{
kvStoreNew
.
on
(
'
dataChange
'
,
1
,
function
(
data
)
{
console
.
log
(
"
testKVStoreOn101 callback call data:
"
+
JSON
.
stringify
(
data
));
expect
(
true
).
assertTrue
();
});
done
();
})
/**
* @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORE_ON_1200
* @tc.name [JS-API8]KVStore.On
* @tc.desc Test Js Api KVManager.On testcase 102
*/
it
(
'
testKVStoreOn102
'
,
0
,
async
function
(
done
)
{
kvStoreNew
.
on
(
'
dataChange
'
,
2
,
function
(
data
)
{
console
.
log
(
"
testKVStoreOn102 callback call data:
"
+
JSON
.
stringify
(
data
));
expect
(
true
).
assertTrue
();
});
done
();
})
/**
* @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORE_ON_1300
* @tc.name [JS-API8]KVStore.On
* @tc.desc Test Js Api KVManager.On testcase 103
*/
it
(
'
testKVStoreOn103
'
,
0
,
async
function
(
done
)
{
kvStoreNew
.
on
(
'
syncComplete
'
,
function
(
data
)
{
console
.
log
(
"
testKVStoreOn103 callback call data:
"
+
data
);
expect
(
true
).
assertTrue
();
});
done
();
})
})
\ No newline at end of file
distributeddatamgr/distributeddatamgrjstest/hap/src/main/js/default/test/KvManagerPromiseJsunit.test.js
浏览文件 @
59d0f350
...
...
@@ -19,6 +19,9 @@ const TEST_BUNDLE_NAME = 'ohos.acts.distributeddatamgr';
const
TEST_STORE_ID
=
'
storeId
'
;
var
kvManager
=
null
;
var
kvStore
=
null
;
const
STORE_KEY
=
'
key_test_string
'
;
const
STORE_VALUE
=
'
value-test-string
'
;
var
kvStoreNew
=
null
;
describe
(
'
KVManagerPromiseTest
'
,
function
()
{
const
config
=
{
...
...
@@ -44,6 +47,12 @@ describe('KVManagerPromiseTest', function () {
await
factory
.
createKVManager
(
config
).
then
((
manager
)
=>
{
kvManager
=
manager
;
console
.
log
(
'
beforeAll createKVManager success
'
);
kvManager
.
getKVStore
(
TEST_STORE_ID
,
options
).
then
((
store
)
=>
{
console
.
log
(
"
beforeAll getKVStore success
"
);
kvStoreNew
=
store
;
}).
catch
((
err
)
=>
{
console
.
log
(
"
beforeAll getKVStore err:
"
+
JSON
.
stringify
(
err
));
});
}).
catch
((
err
)
=>
{
console
.
log
(
'
beforeAll createKVManager err
'
+
err
);
});
...
...
@@ -131,7 +140,7 @@ describe('KVManagerPromiseTest', function () {
autoSync
:
true
,
kvStoreType
:
factory
.
KVStoreType
.
SINGLE_VERSION
,
schema
:
''
,
securityLevel
:
factory
.
SecurityLevel
.
S2
,
securityLevel
:
factory
.
SecurityLevel
.
NO_LEVEL
,
}
await
kvManager
.
getKVStore
(
TEST_STORE_ID
,
optionsInfo
).
then
((
store
)
=>
{
console
.
log
(
'
testKVManagerGetKVStore003 getKVStore success
'
);
...
...
@@ -158,7 +167,7 @@ describe('KVManagerPromiseTest', function () {
autoSync
:
true
,
kvStoreType
:
factory
.
KVStoreType
.
SINGLE_VERSION
,
schema
:
''
,
securityLevel
:
factory
.
SecurityLevel
.
S
2
,
securityLevel
:
factory
.
SecurityLevel
.
S
1
,
}
await
kvManager
.
getKVStore
(
TEST_STORE_ID
,
optionsInfo
).
then
((
store
)
=>
{
console
.
log
(
'
testKVManagerGetKVStore004 getKVStore success
'
);
...
...
@@ -210,7 +219,7 @@ describe('KVManagerPromiseTest', function () {
autoSync
:
true
,
kvStoreType
:
factory
.
KVStoreType
.
SINGLE_VERSION
,
schema
:
''
,
securityLevel
:
factory
.
SecurityLevel
.
S
2
,
securityLevel
:
factory
.
SecurityLevel
.
S
3
,
}
await
kvManager
.
getKVStore
(
TEST_STORE_ID
,
optionsInfo
).
then
((
store
)
=>
{
console
.
log
(
'
testKVManagerGetKVStore006 getKVStore success
'
);
...
...
@@ -237,7 +246,7 @@ describe('KVManagerPromiseTest', function () {
autoSync
:
true
,
kvStoreType
:
factory
.
KVStoreType
.
SINGLE_VERSION
,
schema
:
''
,
securityLevel
:
factory
.
SecurityLevel
.
S
2
,
securityLevel
:
factory
.
SecurityLevel
.
S
4
,
}
await
kvManager
.
getKVStore
(
TEST_STORE_ID
,
optionsInfo
).
then
((
store
)
=>
{
console
.
log
(
'
testKVManagerGetKVStore007 getKVStore success
'
);
...
...
@@ -262,9 +271,9 @@ describe('KVManagerPromiseTest', function () {
encrypt
:
false
,
backup
:
false
,
autoSync
:
true
,
kvStoreType
:
factory
.
KVStoreType
.
SINGLE_VERS
ION
,
kvStoreType
:
factory
.
KVStoreType
.
DEVICE_COLLABORAT
ION
,
schema
:
''
,
securityLevel
:
factory
.
SecurityLevel
.
S2
,
securityLevel
:
factory
.
SecurityLevel
.
NO_LEVEL
,
}
await
kvManager
.
getKVStore
(
TEST_STORE_ID
,
optionsInfo
).
then
((
store
)
=>
{
console
.
log
(
'
testKVManagerGetKVStore008 getKVStore success
'
);
...
...
@@ -289,9 +298,9 @@ describe('KVManagerPromiseTest', function () {
encrypt
:
false
,
backup
:
false
,
autoSync
:
true
,
kvStoreType
:
factory
.
KVStoreType
.
SINGLE_VERS
ION
,
kvStoreType
:
factory
.
KVStoreType
.
DEVICE_COLLABORAT
ION
,
schema
:
''
,
securityLevel
:
factory
.
SecurityLevel
.
S
2
,
securityLevel
:
factory
.
SecurityLevel
.
S
0
,
}
await
kvManager
.
getKVStore
(
TEST_STORE_ID
,
optionsInfo
).
then
((
store
)
=>
{
console
.
log
(
'
testKVManagerGetKVStore009 getKVStore success
'
);
...
...
@@ -316,9 +325,9 @@ describe('KVManagerPromiseTest', function () {
encrypt
:
false
,
backup
:
false
,
autoSync
:
false
,
kvStoreType
:
factory
.
KVStoreType
.
SINGLE_VERS
ION
,
kvStoreType
:
factory
.
KVStoreType
.
DEVICE_COLLABORAT
ION
,
schema
:
''
,
securityLevel
:
factory
.
SecurityLevel
.
S
2
,
securityLevel
:
factory
.
SecurityLevel
.
S
1
,
}
await
kvManager
.
getKVStore
(
TEST_STORE_ID
,
optionsInfo
).
then
((
store
)
=>
{
console
.
log
(
'
testKVManagerGetKVStore010 getKVStore success
'
);
...
...
@@ -343,7 +352,7 @@ describe('KVManagerPromiseTest', function () {
encrypt
:
false
,
backup
:
false
,
autoSync
:
true
,
kvStoreType
:
factory
.
KVStoreType
.
SINGLE_VERS
ION
,
kvStoreType
:
factory
.
KVStoreType
.
DEVICE_COLLABORAT
ION
,
schema
:
''
,
securityLevel
:
factory
.
SecurityLevel
.
S2
,
}
...
...
@@ -372,7 +381,7 @@ describe('KVManagerPromiseTest', function () {
autoSync
:
true
,
kvStoreType
:
factory
.
KVStoreType
.
DEVICE_COLLABORATION
,
schema
:
''
,
securityLevel
:
factory
.
SecurityLevel
.
S
2
,
securityLevel
:
factory
.
SecurityLevel
.
S
3
,
}
await
kvManager
.
getKVStore
(
TEST_STORE_ID
,
optionsInfo
).
then
((
store
)
=>
{
console
.
log
(
'
testKVManagerGetKVStore012 getKVStore success
'
);
...
...
@@ -397,9 +406,9 @@ describe('KVManagerPromiseTest', function () {
encrypt
:
false
,
backup
:
false
,
autoSync
:
true
,
kvStoreType
:
factory
.
KVStoreType
.
MULTI_VERS
ION
,
kvStoreType
:
factory
.
KVStoreType
.
DEVICE_COLLABORAT
ION
,
schema
:
''
,
securityLevel
:
factory
.
SecurityLevel
.
S
2
,
securityLevel
:
factory
.
SecurityLevel
.
S
4
,
}
try
{
await
kvManager
.
getKVStore
(
TEST_STORE_ID
,
optionsInfo
).
then
((
store
)
=>
{
...
...
@@ -426,7 +435,7 @@ describe('KVManagerPromiseTest', function () {
encrypt
:
false
,
backup
:
false
,
autoSync
:
true
,
kvStoreType
:
factory
.
KVStoreType
.
SINGLE
_VERSION
,
kvStoreType
:
factory
.
KVStoreType
.
MULTI
_VERSION
,
schema
:
''
,
securityLevel
:
factory
.
SecurityLevel
.
NO_LEVEL
,
}
...
...
@@ -453,7 +462,7 @@ describe('KVManagerPromiseTest', function () {
encrypt
:
false
,
backup
:
false
,
autoSync
:
true
,
kvStoreType
:
factory
.
KVStoreType
.
SINGLE
_VERSION
,
kvStoreType
:
factory
.
KVStoreType
.
MULTI
_VERSION
,
schema
:
''
,
securityLevel
:
factory
.
SecurityLevel
.
S0
,
}
...
...
@@ -480,7 +489,7 @@ describe('KVManagerPromiseTest', function () {
encrypt
:
false
,
backup
:
false
,
autoSync
:
true
,
kvStoreType
:
factory
.
KVStoreType
.
SINGLE
_VERSION
,
kvStoreType
:
factory
.
KVStoreType
.
MULTI
_VERSION
,
schema
:
''
,
securityLevel
:
factory
.
SecurityLevel
.
S1
,
}
...
...
@@ -507,7 +516,7 @@ describe('KVManagerPromiseTest', function () {
encrypt
:
false
,
backup
:
false
,
autoSync
:
true
,
kvStoreType
:
factory
.
KVStoreType
.
SINGLE
_VERSION
,
kvStoreType
:
factory
.
KVStoreType
.
MULTI
_VERSION
,
schema
:
''
,
securityLevel
:
factory
.
SecurityLevel
.
S2
,
}
...
...
@@ -534,7 +543,7 @@ describe('KVManagerPromiseTest', function () {
encrypt
:
false
,
backup
:
false
,
autoSync
:
true
,
kvStoreType
:
factory
.
KVStoreType
.
SINGLE
_VERSION
,
kvStoreType
:
factory
.
KVStoreType
.
MULTI
_VERSION
,
schema
:
''
,
securityLevel
:
factory
.
SecurityLevel
.
S3
,
}
...
...
@@ -561,7 +570,7 @@ describe('KVManagerPromiseTest', function () {
encrypt
:
false
,
backup
:
false
,
autoSync
:
true
,
kvStoreType
:
factory
.
KVStoreType
.
SINGLE
_VERSION
,
kvStoreType
:
factory
.
KVStoreType
.
MULTI
_VERSION
,
schema
:
''
,
securityLevel
:
factory
.
SecurityLevel
.
S4
,
}
...
...
@@ -915,4 +924,78 @@ describe('KVManagerPromiseTest', function () {
kvManager
.
off
(
'
distributedDataServiceDie
'
);
done
();
})
/**
* @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORE_PUT_1000
* @tc.name [JS-API8]KVStore.Put
* @tc.desc Test Js Api KVManager.Put testcase 001
*/
it
(
'
testKVStorePut001
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
testKVStorePut001
'
);
try
{
await
kvStoreNew
.
put
(
TEST_BUNDLE_NAME
,
TEST_STORE_ID
).
then
((
data
)
=>
{
if
(
err
!=
undefined
){
console
.
log
(
'
testKVStorePut001 put promise fail
'
);
}
else
{
console
.
log
(
'
testKVStorePut001 put promise success
'
);
expect
(
null
).
assertFail
();
}
done
();
});
}
catch
(
e
)
{
console
.
log
(
'
testKVStorePut001 e
'
+
e
);
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORE_DELETE_1000
* @tc.name [JS-API8]KVStore.Delete
* @tc.desc Test Js Api KVManager.Delete testcase 001
*/
it
(
'
testKVStorePut001
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
testKVStorePut001
'
);
try
{
await
kvStoreNew
.
put
(
TEST_BUNDLE_NAME
,
TEST_STORE_ID
).
then
((
data
)
=>
{
if
(
err
!=
undefined
){
console
.
log
(
'
testKVStorePut001 put promise fail
'
);
}
else
{
console
.
log
(
'
testKVStorePut001 put promise success
'
);
expect
(
null
).
assertFail
();
}
done
();
});
}
catch
(
e
)
{
console
.
log
(
'
testKVStorePut001 e
'
+
e
);
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORE_DELETE_1000
* @tc.name [JS-API8]KVStore.Delete
* @tc.desc Test Js Api KVManager.Delete testcase 001
*/
it
(
'
testKVStoreDelete001
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
testKVStoreDelete001
'
);
try
{
kvStoreNew
.
put
(
STORE_KEY
,
STORE_VALUE
).
then
((
data
)
=>
{
console
.
log
(
'
testKVStoreDelete001 getKVStore success
'
);
kvStoreNew
.
delete
(
STORE_KEY
).
then
((
data
)
=>
{
console
.
log
(
"
testKVStoreDelete001 promise delete success
"
);
expect
(
null
).
assertFail
();
}).
catch
((
err
)
=>
{
console
.
log
(
'
testKVStoreDelete001 promise delete fail err
'
+
err
);
});
}).
catch
((
err
)
=>
{
console
.
log
(
'
testKVStoreDelete001 promise delete fail err
'
+
err
);
});
}
catch
(
e
)
{
console
.
log
(
'
testKVStoreDelete001 promise delete fail err
'
+
err
);
}
done
();
})
})
\ No newline at end of file
location/geolocation_standard/src/main/js/default/test/GeocoderTest.test.js
浏览文件 @
59d0f350
此差异已折叠。
点击以展开。
useriam/face_auth/js_api_test/function_test/userauth/entry/src/main/js/test/execute.js
浏览文件 @
59d0f350
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录