Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
5c3e32cc
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,发现更多精彩内容 >>
未验证
提交
5c3e32cc
编写于
9月 07, 2022
作者:
O
openharmony_ci
提交者:
Gitee
9月 07, 2022
浏览文件
操作
浏览文件
下载
差异文件
!5399 【Distributeddatamgr】【master】用例优化
Merge pull request !5399 from 梁梁/master
上级
1f123e3b
f49ca804
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
56 addition
and
14 deletion
+56
-14
distributeddatamgr/Pasteboardjsapitest/entry/src/main/ets/test/PasteBoardEtsunitTest.ets
...apitest/entry/src/main/ets/test/PasteBoardEtsunitTest.ets
+4
-1
distributeddatamgr/dataSharejstest/hap/src/main/js/test/DataAbilityPredicatesJsunit.test.js
.../hap/src/main/js/test/DataAbilityPredicatesJsunit.test.js
+12
-1
distributeddatamgr/kvStoretest/kvStorejstest/hap/src/main/js/test/FieldNodeJsunit.test.js
...vStorejstest/hap/src/main/js/test/FieldNodeJsunit.test.js
+1
-0
distributeddatamgr/relationalStorejstest/hap/src/main/js/test/RdbstoreInsertJsunit.test.js
...ejstest/hap/src/main/js/test/RdbstoreInsertJsunit.test.js
+27
-12
distributeddatamgr/relationalStorejstest/hap/src/main/js/test/RdbstorePredicatesJsunit.test.js
...est/hap/src/main/js/test/RdbstorePredicatesJsunit.test.js
+12
-0
未找到文件。
distributeddatamgr/Pasteboardjsapitest/entry/src/main/ets/test/PasteBoardEtsunitTest.ets
浏览文件 @
5c3e32cc
...
...
@@ -3358,6 +3358,7 @@ export default function pasteBoardJEtsunitTest() {
console.info
('
f_test64
Checks
there
is
content
in
the
pasteboard
')
systemPasteboard.hasPasteData().then((data) =
>
{
console.info
('
f_test64
systemPasteboard.hasPasteData
promise
data =
' + data);
expect(data).assertTrue();
console.info('
f_test64
Checks
the
number
of
records
');
systemPasteboard.getPasteData().then((data) =
>
{
...
...
@@ -3365,12 +3366,14 @@ export default function pasteBoardJEtsunitTest() {
var pasteData1 = data;
var recordCount = pasteData1.getRecordCount();
console.info('
f_test64
recordCount =
' + recordCount);
expect(recordCount).assertEqual(1)
console.info('
f_test64
Removes
the
Record
')
pasteData1.removeRecordAt
(0)
console.info
('
f_test64
Checks
the
number
of
records
');
var
recordCount1 =
pasteData1.getRecordCount();
expect
(
recordCount1
).
assertEqual
(0);
console.info
('
f_test64
recordCount =
' + recordCount1);
console.info('
SUB_pasteBoard_function_JS_API_6400
end
');
...
...
@@ -3427,7 +3430,7 @@ export default function pasteBoardJEtsunitTest() {
systemPasteboard.hasPasteData().then((data) =
>
{
console.info
('
f_test65
systemPasteboard.hasPasteData
promise
data =
' + data);
console.info('
SUB_pasteBoard_function_JS_API_6
4
00
end
');
console.info('
SUB_pasteBoard_function_JS_API_6
5
00
end
');
done
();
});
});
...
...
distributeddatamgr/dataSharejstest/hap/src/main/js/test/DataAbilityPredicatesJsunit.test.js
浏览文件 @
5c3e32cc
...
...
@@ -1908,7 +1908,13 @@ describe('dataAbilityPredicatesTest', function () {
console
.
info
(
TAG
+
"
************* testAnd0003 start *************
"
);
{
let
dataAbilityPredicates
=
await
new
dataAbility
.
DataAbilityPredicates
();
var
dataAbilityPredicatesInit
=
dataAbilityPredicates
dataAbilityPredicates
.
equalTo
(
"
stringValue
"
,
"
ABCDEFGHIJKLMN
"
).
or
().
and
().
equalTo
(
"
integerValue
"
,
1
);
if
(
dataAbilityPredicatesInit
==
dataAbilityPredicates
){
expect
(
true
).
assertTrue
();
}
else
{
expect
(
null
).
assertFail
();
}
let
predicates
=
dataAbility
.
createRdbPredicates
(
"
AllDataType
"
,
dataAbilityPredicates
);
console
.
info
(
TAG
+
"
you should not start a request
"
+
"
with
\"
and
\"
or use or() before this function
"
);
...
...
@@ -1926,9 +1932,14 @@ describe('dataAbilityPredicatesTest', function () {
console
.
info
(
TAG
+
"
************* testAnd0004 start *************
"
);
{
let
dataAbilityPredicates
=
await
new
dataAbility
.
DataAbilityPredicates
();
var
dataAbilityPredicatesInit
=
dataAbilityPredicates
dataAbilityPredicates
.
equalTo
(
"
stringValue
"
,
"
ABCDEFGHIJKLMN
"
).
or
().
or
().
equalTo
(
"
integerValue
"
,
1
);
let
predicates
=
dataAbility
.
createRdbPredicates
(
"
AllDataType
"
,
dataAbilityPredicates
);
if
(
dataAbilityPredicatesInit
==
dataAbilityPredicates
){
expect
(
true
).
assertTrue
();
}
else
{
expect
(
null
).
assertFail
();
}
console
.
info
(
TAG
+
"
you are starting a sql request with predicate or or,
"
+
"
using function or() immediately after another or(). that is ridiculous.
"
);
}
...
...
distributeddatamgr/kvStoretest/kvStorejstest/hap/src/main/js/test/FieldNodeJsunit.test.js
浏览文件 @
5c3e32cc
...
...
@@ -57,6 +57,7 @@ describe('fieldNodeTest', function() {
node
=
null
;
}
catch
(
e
)
{
console
.
info
(
"
testAppendChild002
"
+
e
);
expect
(
null
).
assertFail
();
}
done
();
})
...
...
distributeddatamgr/relationalStorejstest/hap/src/main/js/test/RdbstoreInsertJsunit.test.js
浏览文件 @
5c3e32cc
...
...
@@ -597,12 +597,15 @@ describe('rdbstoreInsertTest', function () {
}
const
valueBuckets
=
[
valueBucket1
,
valueBucket2
,
valueBucket3
]
try
{
await
rdbStore
.
batchInsert
(
"
test6
"
,
"
valueBuckets
"
).
catch
((
err
)
=>
{
expect
(
err
!=
null
).
assertTrue
();
await
rdbStore
.
batchInsert
(
"
test6
"
,
"
valueBuckets
"
).
then
((
number
)
=>
{
console
.
info
(
TAG
+
"
Affect row is
"
+
number
)
expect
(
number
).
assertEqual
(
-
1
)
}).
catch
((
err
)
=>
{
expect
(
err
==
null
).
assertTrue
();
})
}
catch
(
err
){
console
.
info
(
TAG
+
"
Batch insert data error:
"
+
err
)
expect
(
err
!
=
null
).
assertTrue
();
expect
(
err
=
=
null
).
assertTrue
();
}
done
()
console
.
info
(
TAG
+
"
************* testRdbStorebatchInsertPromise0006 end *************
"
);
...
...
@@ -617,12 +620,15 @@ describe('rdbstoreInsertTest', function () {
console
.
info
(
TAG
+
"
************* testRdbStorebatchInsertPromise0007 start *************
"
);
await
rdbStore
.
executeSql
(
CREATE_TABLE_NAME
+
"
7
"
+
CREATE_TABLE
)
try
{
await
rdbStore
.
batchInsert
(
"
test7
"
).
catch
((
err
)
=>
{
expect
(
err
!=
null
).
assertTrue
();
await
rdbStore
.
batchInsert
(
"
test7
"
).
then
((
number
)
=>
{
console
.
info
(
TAG
+
"
BatchInsert without data,affect row number is
"
+
number
)
expect
(
number
).
assertEqual
(
0
)
}).
catch
((
err
)
=>
{
expect
(
err
==
null
).
assertTrue
();
})
}
catch
(
err
){
console
.
info
(
TAG
+
"
Batch insert data error:
"
+
err
)
expect
(
err
!
=
null
).
assertTrue
();
expect
(
err
=
=
null
).
assertTrue
();
}
done
()
console
.
info
(
TAG
+
"
************* testRdbStorebatchInsertPromise0007 end *************
"
);
...
...
@@ -1036,16 +1042,17 @@ describe('rdbstoreInsertTest', function () {
const
valueBuckets
=
[
valueBucket1
,
valueBucket2
,
valueBucket3
]
await
rdbStore
.
executeSql
(
CREATE_TABLE_NAME
+
"
Callback6
"
+
CREATE_TABLE
).
then
(
async
()
=>
{
try
{
await
rdbStore
.
batchInsert
(
"
testCallback6
"
,
"
valueBuckets
"
,
(
err
,
data
)
=>
{
rdbStore
.
batchInsert
(
"
testCallback6
"
,
"
valueBuckets
"
,
(
err
,
data
)
=>
{
console
.
info
(
TAG
+
"
Affect row is
"
+
data
)
if
(
err
!=
null
){
expect
(
err
!
=
null
).
assertTrue
()
expect
(
err
=
=
null
).
assertTrue
()
}
else
{
expect
(
false
).
assertTrue
(
)
expect
(
data
).
assertEqual
(
-
1
)
}
})
}
catch
(
err
){
console
.
info
(
TAG
+
"
Batch insert data error:
"
+
err
)
expect
(
err
!
=
null
).
assertTrue
();
expect
(
err
=
=
null
).
assertTrue
();
}
})
...
...
@@ -1064,14 +1071,22 @@ describe('rdbstoreInsertTest', function () {
try
{
await
rdbStore
.
executeSql
(
CREATE_TABLE_NAME
+
"
Callback7
"
+
CREATE_TABLE
).
then
(
async
()
=>
{
await
rdbStore
.
batchInsert
(
"
testCallback7
"
,
(
err
,
data
)
=>
{
console
.
info
(
TAG
+
"
Affect row is
"
+
data
)
if
(
err
!=
null
){
expect
(
err
!=
null
).
assertTrue
();
expect
(
err
==
null
).
assertTrue
();
}
else
{
expect
(
data
).
assertEqual
(
-
1
)
}
}).
then
((
data
)
=>
{
console
.
info
(
TAG
+
"
Batch insert fail ,affect row number is:
"
+
data
)
expect
(
data
).
assertEqual
(
-
1
)
})
}).
then
((
err
)
=>
{
expect
(
err
==
null
).
assertTrue
();
})
}
catch
(
err
){
console
.
info
(
TAG
+
"
Batch insert data error:
"
+
err
)
expect
(
err
!
=
null
).
assertTrue
();
expect
(
err
=
=
null
).
assertTrue
();
}
done
()
console
.
info
(
TAG
+
"
************* testRdbStorebatchInsertCallback0007 end *************
"
);
...
...
distributeddatamgr/relationalStorejstest/hap/src/main/js/test/RdbstorePredicatesJsunit.test.js
浏览文件 @
5c3e32cc
...
...
@@ -1725,7 +1725,13 @@ describe('rdbPredicatesTest', function () {
console
.
info
(
TAG
+
"
************* testAnd0003 start *************
"
);
{
let
predicates
=
await
new
dataRdb
.
RdbPredicates
(
"
AllDataType
"
);
var
predicatesInit
=
predicates
predicates
.
equalTo
(
"
stringValue
"
,
"
ABCDEFGHIJKLMN
"
).
or
().
and
().
equalTo
(
"
integerValue
"
,
1
);
if
(
predicates
==
predicatesInit
){
expect
(
true
).
assertTrue
();
}
else
{
expect
(
null
).
assertFail
();
}
console
.
info
(
TAG
+
"
you should not start a request
"
+
"
with
\"
and
\"
or use or() before this function
"
);
}
done
();
...
...
@@ -1741,7 +1747,13 @@ describe('rdbPredicatesTest', function () {
console
.
info
(
TAG
+
"
************* testAnd0004 start *************
"
);
{
let
predicates
=
await
new
dataRdb
.
RdbPredicates
(
"
AllDataType
"
);
var
predicatesInit
=
predicates
predicates
.
equalTo
(
"
stringValue
"
,
"
ABCDEFGHIJKLMN
"
).
or
().
or
().
equalTo
(
"
integerValue
"
,
1
);
if
(
predicates
==
predicatesInit
){
expect
(
true
).
assertTrue
();
}
else
{
expect
(
null
).
assertFail
();
}
console
.
info
(
TAG
+
"
you are starting a sql request with predicate or or,
"
+
"
using function or() immediately after another or(). that is ridiculous.
"
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录