Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
b4eff4c2
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看板
未验证
提交
b4eff4c2
编写于
8月 09, 2023
作者:
O
openharmony_ci
提交者:
Gitee
8月 09, 2023
浏览文件
操作
浏览文件
下载
差异文件
!9709 【Distributeddatamgr】【Master】用例优化rdb/relationalstore用例优化
Merge pull request !9709 from yanglifeng/master
上级
6c5bebd8
a1bd719c
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
42 addition
and
42 deletion
+42
-42
distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbStoreDistributedJsunit.test.js
...st/hap/src/main/js/test/RdbStoreDistributedJsunit.test.js
+19
-18
distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RelationalStoreDistributedJsunit.test.js
...src/main/js/test/RelationalStoreDistributedJsunit.test.js
+23
-24
未找到文件。
distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbStoreDistributedJsunit.test.js
浏览文件 @
b4eff4c2
...
@@ -264,14 +264,15 @@ describe('rdbStoreDistributedTest', function () {
...
@@ -264,14 +264,15 @@ describe('rdbStoreDistributedTest', function () {
console
.
info
(
TAG
+
"
************* testRdbStoreDistributed0009 start *************
"
);
console
.
info
(
TAG
+
"
************* testRdbStoreDistributed0009 start *************
"
);
let
predicates
=
new
dataRdb
.
RdbPredicates
(
"
employee
"
)
let
predicates
=
new
dataRdb
.
RdbPredicates
(
"
employee
"
)
try
{
try
{
predicates
=
predicates
.
inDevices
(
"
1234567890
"
);
let
pr
=
predicates
.
inDevices
([
'
1234567890
'
]);
console
.
info
(
TAG
+
"
inDevices success
"
);
console
.
info
(
TAG
+
"
inDevices success
"
+
pr
);
expect
(
predicates
).
assertEqual
(
predicates
);
expect
(
pr
!==
null
).
assertTrue
();
done
();
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
info
(
TAG
+
"
inDevices failed
"
);
console
.
info
(
TAG
+
"
inDevices failed
"
);
expect
(
null
).
assertFail
();
expect
(
null
).
assertFail
();
}
done
();
done
();
}
console
.
info
(
TAG
+
"
************* testRdbStoreDistributed0009 end *************
"
);
console
.
info
(
TAG
+
"
************* testRdbStoreDistributed0009 end *************
"
);
})
})
...
@@ -303,13 +304,14 @@ describe('rdbStoreDistributedTest', function () {
...
@@ -303,13 +304,14 @@ describe('rdbStoreDistributedTest', function () {
it
(
'
testRdbStoreDistributed0011
'
,
0
,
async
function
(
done
)
{
it
(
'
testRdbStoreDistributed0011
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
"
************* testRdbStoreDistributed0011 start *************
"
);
console
.
info
(
TAG
+
"
************* testRdbStoreDistributed0011 start *************
"
);
let
predicates
=
new
dataRdb
.
RdbPredicates
(
"
employee
"
)
let
predicates
=
new
dataRdb
.
RdbPredicates
(
"
employee
"
)
predicates
=
predicates
.
inDevices
(
"
12345678abcd
"
);
let
pr
=
predicates
.
inDevices
([
'
12345678abcd
'
]);
rdbStore
.
sync
(
dataRdb
.
SyncMode
.
SYNC_MODE_PUSH
,
predicates
);
console
.
info
(
TAG
+
"
testRdbStoreDistributed0011
"
+
pr
);
let
push
=
rdbStore
.
sync
(
dataRdb
.
SyncMode
.
SYNC_MODE_PUSH
,
predicates
);
console
.
info
(
TAG
+
"
sync push success
"
);
console
.
info
(
TAG
+
"
sync push success
"
);
expect
(
rdbStore
).
assertEqual
(
rdbStore
);
expect
(
push
!==
null
).
assertTrue
(
);
rdbStore
.
sync
(
dataRdb
.
SyncMode
.
SYNC_MODE_PULL
,
predicates
);
let
pull
=
rdbStore
.
sync
(
dataRdb
.
SyncMode
.
SYNC_MODE_PULL
,
predicates
);
console
.
info
(
TAG
+
"
sync pull success
"
);
console
.
info
(
TAG
+
"
sync pull success
"
);
expect
(
rdbStore
).
assertEqual
(
rdbStore
);
expect
(
pull
!==
null
).
assertTrue
(
);
done
();
done
();
console
.
info
(
TAG
+
"
************* testRdbStoreDistributed0011 end *************
"
);
console
.
info
(
TAG
+
"
************* testRdbStoreDistributed0011 end *************
"
);
})
})
...
@@ -325,18 +327,17 @@ describe('rdbStoreDistributedTest', function () {
...
@@ -325,18 +327,17 @@ describe('rdbStoreDistributedTest', function () {
return
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
ms
));
return
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
ms
));
}
}
let
predicates
=
new
dataRdb
.
RdbPredicates
(
"
employee
"
)
let
predicates
=
new
dataRdb
.
RdbPredicates
(
"
employee
"
)
predicates
=
predicates
.
inDevices
(
"
12345678abcd
"
);
let
pr
=
predicates
.
inDevices
([
'
12345678abcd
'
]);
rdbStore
.
sync
(
dataRdb
.
SyncMode
.
SYNC_MODE_PUSH
,
predicates
,(
err
,
ret
)
=>
{
console
.
info
(
TAG
+
"
testRdbStoreDistributedCallback0011 pr =
"
+
pr
);
console
.
info
(
TAG
+
"
sync push success
"
);
await
rdbStore
.
sync
(
dataRdb
.
SyncMode
.
SYNC_MODE_PUSH
,
predicates
,
async
(
err
,
ret
)
=>
{
expect
(
rdbStore
).
assertEqual
(
rdbStore
);
rdbStore
.
sync
(
dataRdb
.
SyncMode
.
SYNC_MODE_PULL
,
predicates
,(
err
,
ret
)
=>
{
console
.
info
(
TAG
+
"
sync push success
"
);
console
.
info
(
TAG
+
"
sync push success
"
);
expect
(
rdbStore
).
assertEqual
(
rdbStore
);
expect
(
err
!==
null
).
assertTrue
();
});
await
rdbStore
.
sync
(
dataRdb
.
SyncMode
.
SYNC_MODE_PULL
,
predicates
,(
err
,
ret
)
=>
{
console
.
info
(
TAG
+
"
sync pull success
"
);
expect
(
err
!==
null
).
assertTrue
();
done
();
done
();
});
});
await
sleep
(
2000
)
});
done
();
console
.
info
(
TAG
+
"
************* testRdbStoreDistributedCallback0011 end *************
"
);
console
.
info
(
TAG
+
"
************* testRdbStoreDistributedCallback0011 end *************
"
);
})
})
...
...
distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RelationalStoreDistributedJsunit.test.js
浏览文件 @
b4eff4c2
...
@@ -298,14 +298,15 @@ describe('relationalStoreDistributedTest', function () {
...
@@ -298,14 +298,15 @@ describe('relationalStoreDistributedTest', function () {
console
.
info
(
TAG
+
"
************* testRdbStoreDistributed0009 start *************
"
);
console
.
info
(
TAG
+
"
************* testRdbStoreDistributed0009 start *************
"
);
let
predicates
=
new
data_Rdb
.
RdbPredicates
(
"
employee
"
)
let
predicates
=
new
data_Rdb
.
RdbPredicates
(
"
employee
"
)
try
{
try
{
predicates
=
predicates
.
inDevices
(
"
1234567890
"
);
let
pr
=
predicates
.
inDevices
([
"
1234567890
"
]
);
console
.
info
(
TAG
+
"
inDevices success
"
);
console
.
info
(
TAG
+
"
inDevices success
"
);
expect
(
predicates
).
assertEqual
(
predicates
);
expect
(
pr
!==
null
).
assertTrue
();
done
();
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
info
(
TAG
+
"
inDevices failed
"
);
console
.
info
(
TAG
+
"
inDevices failed
"
);
expect
(
null
).
assertFail
();
expect
(
null
).
assertFail
();
}
done
();
done
();
}
console
.
info
(
TAG
+
"
************* testRdbStoreDistributed0009 end *************
"
);
console
.
info
(
TAG
+
"
************* testRdbStoreDistributed0009 end *************
"
);
})
})
...
@@ -337,13 +338,13 @@ describe('relationalStoreDistributedTest', function () {
...
@@ -337,13 +338,13 @@ describe('relationalStoreDistributedTest', function () {
it
(
'
testRdbStoreDistributed0011
'
,
0
,
async
function
(
done
)
{
it
(
'
testRdbStoreDistributed0011
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
"
************* testRdbStoreDistributed0011 start *************
"
);
console
.
info
(
TAG
+
"
************* testRdbStoreDistributed0011 start *************
"
);
let
predicates
=
new
data_Rdb
.
RdbPredicates
(
"
employee
"
)
let
predicates
=
new
data_Rdb
.
RdbPredicates
(
"
employee
"
)
predicates
=
predicates
.
inDevices
(
"
12345678abcd
"
);
let
pr
=
predicates
.
inDevices
([
"
12345678abcd
"
]);
rdbStore
.
sync
(
data_Rdb
.
SyncMode
.
SYNC_MODE_PUSH
,
predicates
);
let
push
=
rdbStore
.
sync
(
data_Rdb
.
SyncMode
.
SYNC_MODE_PUSH
,
predicates
);
expect
(
push
!==
null
).
assertTrue
();
console
.
info
(
TAG
+
"
sync push success
"
);
console
.
info
(
TAG
+
"
sync push success
"
);
expect
(
rdbStore
).
assertEqual
(
rdbStore
);
let
pull
=
rdbStore
.
sync
(
data_Rdb
.
SyncMode
.
SYNC_MODE_PULL
,
predicates
);
rdbStore
.
sync
(
data_Rdb
.
SyncMode
.
SYNC_MODE_PULL
,
predicates
);
console
.
info
(
TAG
+
"
sync pull success
"
);
console
.
info
(
TAG
+
"
sync pull success
"
);
expect
(
rdbStore
).
assertEqual
(
rdbStore
);
expect
(
pull
!==
null
).
assertTrue
(
);
done
();
done
();
console
.
info
(
TAG
+
"
************* testRdbStoreDistributed0011 end *************
"
);
console
.
info
(
TAG
+
"
************* testRdbStoreDistributed0011 end *************
"
);
})
})
...
@@ -359,18 +360,16 @@ describe('relationalStoreDistributedTest', function () {
...
@@ -359,18 +360,16 @@ describe('relationalStoreDistributedTest', function () {
return
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
ms
));
return
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
ms
));
}
}
let
predicates
=
new
data_Rdb
.
RdbPredicates
(
"
employee
"
)
let
predicates
=
new
data_Rdb
.
RdbPredicates
(
"
employee
"
)
predicates
=
predicates
.
inDevices
(
"
12345678abcd
"
);
predicates
=
predicates
.
inDevices
(
[
"
12345678abcd
"
]
);
rdbStore
.
sync
(
data_Rdb
.
SyncMode
.
SYNC_MODE_PUSH
,
predicates
,
(
err
,
ret
)
=>
{
await
rdbStore
.
sync
(
data_Rdb
.
SyncMode
.
SYNC_MODE_PUSH
,
predicates
,
async
(
err
,
ret
)
=>
{
console
.
info
(
TAG
+
"
sync push success
"
);
console
.
info
(
TAG
+
"
sync push success
"
);
expect
(
rdbStore
).
assertEqual
(
rdbStore
);
expect
(
err
!==
null
).
assertTrue
(
);
rdbStore
.
sync
(
data_Rdb
.
SyncMode
.
SYNC_MODE_PULL
,
predicates
,(
err
,
ret
)
=>
{
await
rdbStore
.
sync
(
data_Rdb
.
SyncMode
.
SYNC_MODE_PULL
,
predicates
,(
err
,
ret
)
=>
{
console
.
info
(
TAG
+
"
sync push success
"
);
console
.
info
(
TAG
+
"
sync push success
"
);
expect
(
rdbStore
).
assertEqual
(
rdbStore
);
expect
(
err
!==
null
).
assertTrue
();
});
done
();
done
();
});
});
await
sleep
(
2000
)
});
done
();
console
.
info
(
TAG
+
"
************* testRdbStoreDistributedCallback0011 end *************
"
);
console
.
info
(
TAG
+
"
************* testRdbStoreDistributedCallback0011 end *************
"
);
})
})
...
@@ -458,7 +457,7 @@ describe('relationalStoreDistributedTest', function () {
...
@@ -458,7 +457,7 @@ describe('relationalStoreDistributedTest', function () {
*/
*/
it
(
'
SUB_DDM_AppDataFWK_JSRelationalStore_Distributed_016
'
,
0
,
function
(
done
)
{
it
(
'
SUB_DDM_AppDataFWK_JSRelationalStore_Distributed_016
'
,
0
,
function
(
done
)
{
let
predicates
=
new
data_Rdb
.
RdbPredicates
(
"
employee
"
)
let
predicates
=
new
data_Rdb
.
RdbPredicates
(
"
employee
"
)
predicates
=
predicates
.
inDevices
(
"
12345678abcd
"
);
predicates
=
predicates
.
inDevices
(
[
"
12345678abcd
"
]
);
console
.
info
(
TAG
+
`SYNC_MODE_TIME_FIRST = `
+
data_Rdb
.
SyncMode
.
SYNC_MODE_TIME_FIRST
);
console
.
info
(
TAG
+
`SYNC_MODE_TIME_FIRST = `
+
data_Rdb
.
SyncMode
.
SYNC_MODE_TIME_FIRST
);
expect
(
data_Rdb
.
SyncMode
.
SYNC_MODE_TIME_FIRST
).
assertEqual
(
4
);
expect
(
data_Rdb
.
SyncMode
.
SYNC_MODE_TIME_FIRST
).
assertEqual
(
4
);
console
.
info
(
TAG
+
"
DATA_CHANGE =
"
+
data_Rdb
.
ChangeType
.
DATA_CHANGE
);
console
.
info
(
TAG
+
"
DATA_CHANGE =
"
+
data_Rdb
.
ChangeType
.
DATA_CHANGE
);
...
@@ -488,7 +487,7 @@ describe('relationalStoreDistributedTest', function () {
...
@@ -488,7 +487,7 @@ describe('relationalStoreDistributedTest', function () {
*/
*/
it
(
'
SUB_DDM_AppDataFWK_JSRelationalStore_Distributed_017
'
,
0
,
function
(
done
)
{
it
(
'
SUB_DDM_AppDataFWK_JSRelationalStore_Distributed_017
'
,
0
,
function
(
done
)
{
let
predicates
=
new
data_Rdb
.
RdbPredicates
(
"
employee
"
)
let
predicates
=
new
data_Rdb
.
RdbPredicates
(
"
employee
"
)
predicates
=
predicates
.
inDevices
(
"
12345678abcd
"
);
predicates
=
predicates
.
inDevices
(
[
"
12345678abcd
"
]
);
console
.
info
(
TAG
+
`SYNC_MODE_NATIVE_FIRST = `
+
data_Rdb
.
SyncMode
.
SYNC_MODE_NATIVE_FIRST
);
console
.
info
(
TAG
+
`SYNC_MODE_NATIVE_FIRST = `
+
data_Rdb
.
SyncMode
.
SYNC_MODE_NATIVE_FIRST
);
expect
(
data_Rdb
.
SyncMode
.
SYNC_MODE_NATIVE_FIRST
).
assertEqual
(
5
);
expect
(
data_Rdb
.
SyncMode
.
SYNC_MODE_NATIVE_FIRST
).
assertEqual
(
5
);
try
{
try
{
...
@@ -514,7 +513,7 @@ describe('relationalStoreDistributedTest', function () {
...
@@ -514,7 +513,7 @@ describe('relationalStoreDistributedTest', function () {
*/
*/
it
(
'
SUB_DDM_AppDataFWK_JSRelationalStore_Distributed_018
'
,
0
,
function
(
done
)
{
it
(
'
SUB_DDM_AppDataFWK_JSRelationalStore_Distributed_018
'
,
0
,
function
(
done
)
{
let
predicates
=
new
data_Rdb
.
RdbPredicates
(
"
employee
"
)
let
predicates
=
new
data_Rdb
.
RdbPredicates
(
"
employee
"
)
predicates
=
predicates
.
inDevices
(
"
12345678abcd
"
);
predicates
=
predicates
.
inDevices
(
[
"
12345678abcd
"
]
);
console
.
info
(
TAG
+
`SYNC_MODE_CLOUD_FIRST = `
+
data_Rdb
.
SyncMode
.
SYNC_MODE_CLOUD_FIRST
);
console
.
info
(
TAG
+
`SYNC_MODE_CLOUD_FIRST = `
+
data_Rdb
.
SyncMode
.
SYNC_MODE_CLOUD_FIRST
);
expect
(
data_Rdb
.
SyncMode
.
SYNC_MODE_CLOUD_FIRST
).
assertEqual
(
6
);
expect
(
data_Rdb
.
SyncMode
.
SYNC_MODE_CLOUD_FIRST
).
assertEqual
(
6
);
try
{
try
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录