Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
d6696fca
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,发现更多精彩内容 >>
未验证
提交
d6696fca
编写于
12月 07, 2022
作者:
O
openharmony_ci
提交者:
Gitee
12月 07, 2022
浏览文件
操作
浏览文件
下载
差异文件
!6722 【Distributeddatamgr】【master】适配api变更
Merge pull request !6722 from 梁梁/master
上级
f5599a7f
3739d5e1
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
62 addition
and
123 deletion
+62
-123
distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/DeviceKvStoreKVCallbackJsTest.js
...est/hap/src/main/js/test/DeviceKvStoreKVCallbackJsTest.js
+1
-6
distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/DeviceKvStoreKVPromiseJsTest.js
...test/hap/src/main/js/test/DeviceKvStoreKVPromiseJsTest.js
+1
-6
distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/KvManagerKVCallbackJsTest.js
...ejstest/hap/src/main/js/test/KvManagerKVCallbackJsTest.js
+2
-4
distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/KvManagerKVPromiseJsTest.js
...rejstest/hap/src/main/js/test/KvManagerKVPromiseJsTest.js
+35
-50
distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/KvStoreBackupCallbackJsTest.js
...stest/hap/src/main/js/test/KvStoreBackupCallbackJsTest.js
+7
-16
distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/KvStoreBackupPromiseJsTest.js
...jstest/hap/src/main/js/test/KvStoreBackupPromiseJsTest.js
+7
-16
distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/KvStoreResultSetKVJsTest.js
...rejstest/hap/src/main/js/test/KvStoreResultSetKVJsTest.js
+1
-6
distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/SchemaJsTest.js
...ributedKVStorejstest/hap/src/main/js/test/SchemaJsTest.js
+4
-8
distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/SingleKvStoreKVCallbackJsTest.js
...est/hap/src/main/js/test/SingleKvStoreKVCallbackJsTest.js
+3
-5
distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/SingleKvStoreKVPromiseJsTest.js
...test/hap/src/main/js/test/SingleKvStoreKVPromiseJsTest.js
+1
-6
未找到文件。
distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/DeviceKvStoreKVCallbackJsTest.js
浏览文件 @
d6696fca
...
...
@@ -76,12 +76,7 @@ describe('deviceKvStoreCallbackTest', function () {
beforeAll
(
async
function
(
done
)
{
console
.
info
(
'
beforeAll config:
'
+
JSON
.
stringify
(
config
));
await
factory
.
createKVManager
(
config
).
then
((
manager
)
=>
{
kvManager
=
manager
;
console
.
info
(
'
beforeAll createKVManager success
'
);
}).
catch
((
err
)
=>
{
console
.
error
(
'
beforeAll createKVManager err
'
+
`, error code is
${
err
.
code
}
, message is
${
err
.
message
}
`
);
});
kvManager
=
factory
.
createKVManager
(
config
)
await
kvManager
.
getKVStore
(
TEST_STORE_ID
,
options
).
then
((
store
)
=>
{
kvStore
=
store
;
console
.
info
(
'
beforeAll getKVStore for getDeviceId success
'
);
...
...
distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/DeviceKvStoreKVPromiseJsTest.js
浏览文件 @
d6696fca
...
...
@@ -76,12 +76,7 @@ describe('deviceKvStorePromiseTest', function () {
beforeAll
(
async
function
(
done
)
{
console
.
info
(
'
beforeAll config:
'
+
JSON
.
stringify
(
config
));
await
factory
.
createKVManager
(
config
).
then
((
manager
)
=>
{
kvManager
=
manager
;
console
.
info
(
'
beforeAll createKVManager success
'
);
}).
catch
((
err
)
=>
{
console
.
error
(
'
beforeAll createKVManager err
'
+
`, error code is
${
err
.
code
}
, message is
${
err
.
message
}
`
);
});
kvManager
=
factory
.
createKVManager
(
config
);
await
kvManager
.
getKVStore
(
TEST_STORE_ID
,
options
).
then
((
store
)
=>
{
kvStore
=
store
;
console
.
info
(
'
beforeAll getKVStore for getDeviceId success
'
);
...
...
distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/KvManagerKVCallbackJsTest.js
浏览文件 @
d6696fca
...
...
@@ -42,11 +42,9 @@ describe('kvManagerCallbackTest', function () {
beforeAll
(
async
function
(
done
)
{
console
.
info
(
'
beforeAll
'
);
await
factory
.
createKVManager
(
config
,
function
(
err
,
manager
)
{
kvManager
=
manager
;
done
();
});
kvManager
=
factory
.
createKVManager
(
config
);
console
.
info
(
'
beforeAll end
'
);
done
();
})
afterAll
(
async
function
(
done
)
{
...
...
distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/KvManagerKVPromiseJsTest.js
浏览文件 @
d6696fca
...
...
@@ -45,17 +45,12 @@ describe('KVManagerPromiseTest', function () {
beforeAll
(
async
function
(
done
)
{
console
.
info
(
'
beforeAll
'
);
await
factory
.
createKVManager
(
config
).
then
((
manager
)
=>
{
kvManager
=
manager
;
console
.
info
(
'
beforeAll createKVManager success
'
);
kvManager
.
getKVStore
(
TEST_STORE_ID
,
options
).
then
((
store
)
=>
{
console
.
info
(
"
beforeAll getKVStore success
"
);
kvStoreNew
=
store
;
}).
catch
((
err
)
=>
{
console
.
info
(
"
beforeAll getKVStore err:
"
+
JSON
.
stringify
(
err
));
});
kvManager
=
factory
.
createKVManager
(
config
)
kvManager
.
getKVStore
(
TEST_STORE_ID
,
options
).
then
((
store
)
=>
{
console
.
info
(
"
beforeAll getKVStore success
"
);
kvStoreNew
=
store
;
}).
catch
((
err
)
=>
{
console
.
error
(
'
beforeAll createKVManager err
'
+
`, error code is
${
err
.
code
}
, message is
${
err
.
message
}
`
);
console
.
info
(
"
beforeAll getKVStore err:
"
+
JSON
.
stringify
(
err
)
);
});
console
.
info
(
'
beforeAll end
'
);
done
();
...
...
@@ -394,36 +389,30 @@ describe('KVManagerPromiseTest', function () {
context
:
context
}
try
{
await
factory
.
createKVManager
(
config
).
then
(
async
(
manager
)
=>
{
kvManager
=
manager
;
expect
(
manager
!=
null
).
assertTrue
();
console
.
info
(
'
SUB_DDM_DKV_KVMANAGER_CREATEKVMANAGER_PROMISE_0100 createKVManager success
'
);
await
kvManager
.
getKVStore
(
TEST_STORE_ID
,
options
).
then
(
async
(
store
)
=>
{
console
.
info
(
"
testcreateKVManager001 getKVStore success
"
);
await
store
.
put
(
STORE_KEY
,
STORE_VALUE
).
then
(
async
(
data
)
=>
{
console
.
info
(
'
SUB_DDM_DKV_KVMANAGER_CREATEKVMANAGER_PROMISE_0100 put data success
'
);
await
store
.
get
(
STORE_KEY
).
then
((
data
)
=>
{
console
.
info
(
"
testcreateKVManager001 get data success
"
);
expect
(
data
).
assertEqual
(
STORE_VALUE
);
}).
catch
((
err
)
=>
{
console
.
error
(
'
SUB_DDM_DKV_KVMANAGER_CREATEKVMANAGER_PROMISE_0100 get data err
'
+
`, error code is
${
err
.
code
}
, message is
${
err
.
message
}
`
);
});
kvManager
=
factory
.
createKVManager
(
config
)
kvManager
.
getKVStore
(
TEST_STORE_ID
,
options
).
then
(
async
(
store
)
=>
{
console
.
info
(
"
testcreateKVManager001 getKVStore success
"
);
store
.
put
(
STORE_KEY
,
STORE_VALUE
).
then
(
async
(
data
)
=>
{
console
.
info
(
'
SUB_DDM_DKV_KVMANAGER_CREATEKVMANAGER_PROMISE_0100 put data success
'
);
store
.
get
(
STORE_KEY
).
then
((
data
)
=>
{
console
.
info
(
"
testcreateKVManager001 get data success
"
);
expect
(
data
).
assertEqual
(
STORE_VALUE
);
done
();
}).
catch
((
err
)
=>
{
console
.
error
(
'
SUB_DDM_DKV_KVMANAGER_CREATEKVMANAGER_PROMISE_0100
pu
t data err
'
+
`, error code is
${
err
.
code
}
, message is
${
err
.
message
}
`
);
console
.
error
(
'
SUB_DDM_DKV_KVMANAGER_CREATEKVMANAGER_PROMISE_0100
ge
t data err
'
+
`, error code is
${
err
.
code
}
, message is
${
err
.
message
}
`
);
});
}).
catch
((
err
)
=>
{
console
.
info
(
"
testcreateKVManager001 getKVStore err:
"
+
JSON
.
stringify
(
err
));
expect
(
null
).
assertFail
();
console
.
error
(
'
SUB_DDM_DKV_KVMANAGER_CREATEKVMANAGER_PROMISE_0100 put data err
'
+
`, error code is
${
err
.
code
}
, message is
${
err
.
message
}
`
);
});
}).
catch
((
err
)
=>
{
console
.
error
(
'
SUB_DDM_DKV_KVMANAGER_CREATEKVMANAGER_PROMISE_0100 createKVManager err
'
+
`, error code is
${
err
.
code
}
, message is
${
err
.
message
}
`
);
expect
(
null
).
assertFail
()
console
.
info
(
"
testcreateKVManager001 getKVStore err:
"
+
JSON
.
stringify
(
err
)
);
expect
(
null
).
assertFail
()
;
});
}
catch
(
e
)
{
console
.
error
(
'
SUB_DDM_DKV_KVMANAGER_CREATEKVMANAGER_PROMISE_0100 promise delete fail err
'
+
`, error code is
${
e
rr
.
code
}
, message is
${
err
.
message
}
`
);
console
.
error
(
'
SUB_DDM_DKV_KVMANAGER_CREATEKVMANAGER_PROMISE_0100 promise delete fail err
'
+
`, error code is
${
e
.
code
}
, message is
${
e
.
message
}
`
);
expect
(
null
).
assertFail
();
}
done
();
})
/**
...
...
@@ -439,35 +428,31 @@ describe('KVManagerPromiseTest', function () {
context
:
contextApplication
}
try
{
await
factory
.
createKVManager
(
config
).
then
(
async
(
manager
)
=>
{
kvManager
=
manager
;
console
.
info
(
'
SUB_DDM_DKV_KVMANAGER_CREATEKVMANAGER_PROMISE_0200 createKVManager success
'
);
await
kvManager
.
getKVStore
(
TEST_STORE_ID
,
options
).
then
(
async
(
store
)
=>
{
console
.
info
(
"
testcreateKVManager002 getKVStore success
"
);
await
store
.
put
(
STORE_KEY
,
STORE_VALUE
).
then
(
async
(
data
)
=>
{
console
.
info
(
'
SUB_DDM_DKV_KVMANAGER_CREATEKVMANAGER_PROMISE_0200 put data success
'
);
await
store
.
get
(
STORE_KEY
).
then
((
data
)
=>
{
console
.
info
(
"
testcreateKVManager002 get data success
"
);
expect
(
data
).
assertEqual
(
STORE_VALUE
);
}).
catch
((
err
)
=>
{
console
.
error
(
'
SUB_DDM_DKV_KVMANAGER_CREATEKVMANAGER_PROMISE_0200 get data err
'
+
`, error code is
${
err
.
code
}
, message is
${
err
.
message
}
`
);
});
kvManager
=
factory
.
createKVManager
(
config
)
kvManager
.
getKVStore
(
TEST_STORE_ID
,
options
).
then
(
async
(
store
)
=>
{
console
.
info
(
"
testcreateKVManager002 getKVStore success
"
);
store
.
put
(
STORE_KEY
,
STORE_VALUE
).
then
(
async
(
data
)
=>
{
console
.
info
(
'
SUB_DDM_DKV_KVMANAGER_CREATEKVMANAGER_PROMISE_0200 put data success
'
);
store
.
get
(
STORE_KEY
).
then
((
data
)
=>
{
console
.
info
(
"
testcreateKVManager002 get data success
"
);
expect
(
data
).
assertEqual
(
STORE_VALUE
);
done
();
}).
catch
((
err
)
=>
{
console
.
error
(
'
SUB_DDM_DKV_KVMANAGER_CREATEKVMANAGER_PROMISE_0200
pu
t data err
'
+
`, error code is
${
err
.
code
}
, message is
${
err
.
message
}
`
);
console
.
error
(
'
SUB_DDM_DKV_KVMANAGER_CREATEKVMANAGER_PROMISE_0200
ge
t data err
'
+
`, error code is
${
err
.
code
}
, message is
${
err
.
message
}
`
);
});
}).
catch
((
err
)
=>
{
console
.
info
(
"
testcreateKVManager002 getKVStore err:
"
+
JSON
.
stringify
(
err
));
expect
(
null
).
assertFail
();
console
.
error
(
'
SUB_DDM_DKV_KVMANAGER_CREATEKVMANAGER_PROMISE_0200 put data err
'
+
`, error code is
${
err
.
code
}
, message is
${
err
.
message
}
`
);
});
}).
catch
((
err
)
=>
{
console
.
error
(
'
SUB_DDM_DKV_KVMANAGER_CREATEKVMANAGER_PROMISE_0200 createKVManager err
'
+
`, error code is
${
err
.
code
}
, message is
${
err
.
message
}
`
);
expect
(
null
).
assertFail
()
console
.
info
(
"
testcreateKVManager002 getKVStore err:
"
+
JSON
.
stringify
(
err
)
);
expect
(
null
).
assertFail
()
;
});
}
catch
(
e
)
{
console
.
error
(
'
SUB_DDM_DKV_KVMANAGER_CREATEKVMANAGER_PROMISE_0200 promise delete fail err
'
+
`, error code is
${
err
.
code
}
, message is
${
err
.
message
}
`
);
expect
(
null
).
assertFail
();
}
done
();
})
})
}
\ No newline at end of file
distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/KvStoreBackupCallbackJsTest.js
浏览文件 @
d6696fca
...
...
@@ -35,25 +35,16 @@ function sleep(ms) {
function
publicgetKvStore
(
optionsp
){
console
.
log
(
`Test getKvStore `
)
return
new
Promise
(
function
(
resolve
,
reject
)
{
distributedData
.
createKVManager
(
mKVMgrConfig
,
(
err
,
data
)
=>
{
console
.
info
(
'
Test createKVManager begin
'
)
kvManager
=
distributedData
.
createKVManager
(
mKVMgrConfig
);
kvManager
.
getKVStore
(
STORE_ID
,
optionsp
,
(
err
,
data
)
=>
{
console
.
info
(
'
Test getKVStore begin
'
)
if
(
err
)
{
console
.
info
(
'
Test
createKVManager err =
'
+
err
);
console
.
info
(
'
Test
getKVStore err =
'
+
err
);
reject
(
err
);
}
console
.
info
(
'
Test createKVManager data =
'
+
data
);
kvManager
=
data
;
data
.
getKVStore
(
STORE_ID
,
optionsp
,
(
err
,
data
)
=>
{
console
.
info
(
'
Test getKVStore begin
'
)
if
(
err
)
{
console
.
info
(
'
Test getKVStore err =
'
+
err
);
reject
(
err
);
}
console
.
info
(
'
Test getKVStore data =
'
+
data
);
kvStore
=
data
;
resolve
(
data
);
});
console
.
info
(
'
Test getKVStore data =
'
+
data
);
kvStore
=
data
;
resolve
(
data
);
});
})
}
...
...
distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/KvStoreBackupPromiseJsTest.js
浏览文件 @
d6696fca
...
...
@@ -32,25 +32,16 @@ let mKVMgrConfig = {
function
publicgetKvStore
(
optionsp
){
console
.
log
(
`Test getKvStore `
)
return
new
Promise
(
function
(
resolve
,
reject
)
{
distributedData
.
createKVManager
(
mKVMgrConfig
,
(
err
,
data
)
=>
{
console
.
info
(
'
Test createKVManager begin
'
)
kvManager
=
distributedData
.
createKVManager
(
mKVMgrConfig
);
kvManager
.
getKVStore
(
STORE_ID
,
optionsp
,
(
err
,
data
)
=>
{
console
.
info
(
'
Test getKVStore begin
'
)
if
(
err
)
{
console
.
info
(
'
Test
createKVManager err =
'
+
err
);
console
.
info
(
'
Test
getKVStore err =
'
+
err
);
reject
(
err
);
}
console
.
info
(
'
Test createKVManager data =
'
+
data
);
kvManager
=
data
;
data
.
getKVStore
(
STORE_ID
,
optionsp
,
(
err
,
data
)
=>
{
console
.
info
(
'
Test getKVStore begin
'
)
if
(
err
)
{
console
.
info
(
'
Test getKVStore err =
'
+
err
);
reject
(
err
);
}
console
.
info
(
'
Test getKVStore data =
'
+
data
);
kvStore
=
data
;
resolve
(
data
);
});
console
.
info
(
'
Test getKVStore data =
'
+
data
);
kvStore
=
data
;
resolve
(
data
);
});
})
}
...
...
distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/KvStoreResultSetKVJsTest.js
浏览文件 @
d6696fca
...
...
@@ -42,12 +42,7 @@ export default function KvStoreResultSetTest(){
beforeAll
(
async
function
(
done
)
{
console
.
info
(
'
beforeAll
'
);
console
.
info
(
'
beforeAll config:
'
+
JSON
.
stringify
(
config
));
await
factory
.
createKVManager
(
config
).
then
((
manager
)
=>
{
kvManager
=
manager
;
console
.
info
(
'
beforeAll createKVManager success
'
);
}).
catch
((
err
)
=>
{
console
.
error
(
'
beforeAll createKVManager err
'
+
`, error code is
${
err
.
code
}
, message is
${
err
.
message
}
`
);
});
kvManager
=
factory
.
createKVManager
(
config
);
await
kvManager
.
getAllKVStoreId
(
TEST_BUNDLE_NAME
).
then
(
async
(
data
)
=>
{
console
.
info
(
'
beforeAll getAllKVStoreId size =
'
+
data
.
length
);
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
...
...
distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/SchemaJsTest.js
浏览文件 @
d6696fca
...
...
@@ -104,18 +104,14 @@ describe('schemaTest', function() {
beforeAll
(
async
function
(
done
)
{
try
{
console
.
info
(
"
beforeAll: createKVManager (single) with
"
+
JSON
.
stringify
(
options
));
await
ddm
.
createKVManager
(
config
).
then
((
manager
)
=>
{
kvManager
=
manager
;
console
.
info
(
'
beforeAll createKVManager success
'
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
beforeAll createKVManager err
'
+
err
);
});
console
.
info
(
"
beforeAll: createKVManager (single) with
"
+
JSON
.
stringify
(
config
));
kvManager
=
ddm
.
createKVManager
(
config
)
done
();
}
catch
(
e
)
{
console
.
info
(
"
fail on exception:
"
+
e
);
expect
(
null
).
assertFail
();
}
done
();
})
afterAll
(
async
function
(
done
)
{
...
...
distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/SingleKvStoreKVCallbackJsTest.js
浏览文件 @
d6696fca
...
...
@@ -75,11 +75,8 @@ describe('SingleKvStoreCallbackTest', function () {
beforeAll
(
async
function
(
done
)
{
console
.
info
(
'
beforeAll config:
'
+
JSON
.
stringify
(
config
));
await
factory
.
createKVManager
(
config
,
function
(
err
,
manager
)
{
kvManager
=
manager
;
console
.
info
(
'
beforeAll createKVManager success
'
);
done
();
})
kvManager
=
factory
.
createKVManager
(
config
)
done
();
})
afterAll
(
async
function
(
done
)
{
...
...
@@ -2337,6 +2334,7 @@ describe('SingleKvStoreCallbackTest', function () {
*/
it
(
'
SUB_DDM_DKV_SINGLEKVSTORE_CLOSERESULT_CALLBACK_8200
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
SingleKvStoreCloseResultSetCallbackTest004
'
);
try
{
kvStore
.
closeResultSet
(
""
,(
err
,
data
)
=>
{
console
.
info
(
'
SingleKvStoreCloseResultSetCallbackTest004 close result finish
'
)
...
...
distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/SingleKvStoreKVPromiseJsTest.js
浏览文件 @
d6696fca
...
...
@@ -75,12 +75,7 @@ describe('SingleKvStorePromiseTest', function () {
beforeAll
(
async
function
(
done
)
{
console
.
info
(
'
beforeAll config:
'
+
JSON
.
stringify
(
config
));
await
factory
.
createKVManager
(
config
).
then
((
manager
)
=>
{
kvManager
=
manager
;
console
.
info
(
'
beforeAll createKVManager success
'
);
}).
catch
((
err
)
=>
{
console
.
error
(
'
beforeAll createKVManager err
'
+
`, error code is
${
err
.
code
}
, message is
${
err
.
message
}
`
);
});
kvManager
=
factory
.
createKVManager
(
config
)
console
.
info
(
'
beforeAll end
'
);
done
();
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录