Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
90d6f087
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看板
未验证
提交
90d6f087
编写于
3月 01, 2022
作者:
O
openharmony_ci
提交者:
Gitee
3月 01, 2022
浏览文件
操作
浏览文件
下载
差异文件
!2139 【Distributeddatamgr】【Master】API覆盖率补齐
Merge pull request !2139 from 杨立峰/master
上级
88a5e326
50dc1ea0
变更
5
展开全部
显示空白变更内容
内联
并排
Showing
5 changed file
with
1598 addition
and
4 deletion
+1598
-4
distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/DataAbilityPredicatesJsunit.test.js
.../main/js/default/test/DataAbilityPredicatesJsunit.test.js
+270
-3
distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/DataShareJsunit.test.js
...test/hap/src/main/js/default/test/DataShareJsunit.test.js
+1081
-0
distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/List.test.js
...ppdatamgrjstest/hap/src/main/js/default/test/List.test.js
+2
-0
distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbStoreDistributedJsunit.test.js
...rc/main/js/default/test/RdbStoreDistributedJsunit.test.js
+4
-1
distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbstorePredicatesJsunit.test.js
...src/main/js/default/test/RdbstorePredicatesJsunit.test.js
+241
-0
未找到文件。
distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/DataAbilityPredicatesJsunit.test.js
浏览文件 @
90d6f087
...
...
@@ -27,7 +27,7 @@ const CREATE_TABLE_ALL_DATA_TYPE_SQL = "CREATE TABLE IF NOT EXISTS AllDataType "
+
"
primBooleanValue INTEGER , primByteValue INTEGER , primCharValue TEXT, `order` INTEGER);
"
;
const
STORE_CONFIG
=
{
name
:
"
DataAbility
Predicates.db
"
,
name
:
"
Predicates.db
"
,
}
var
rdbStore
=
undefined
;
var
DOUBLE_MAX
=
9223372036854775807
;
...
...
@@ -53,7 +53,7 @@ describe('dataAbilityPredicatesTest', function () {
afterAll
(
async
function
()
{
console
.
info
(
TAG
+
'
afterAll
'
)
rdbStore
=
null
await
dataRdb
.
deleteRdbStore
(
"
DataAbility
Predicates.db
"
);
await
dataRdb
.
deleteRdbStore
(
"
Predicates.db
"
);
})
function
resultSize
(
resultSet
)
{
...
...
@@ -1238,6 +1238,216 @@ describe('dataAbilityPredicatesTest', function () {
console
.
log
(
TAG
+
"
************* testBetween0008 end *************
"
);
})
/**
* @tc.name testNotBetween0001
* @tc.number I4JWCV
* @tc.desc test string value with notBetween.
*/
it
(
'
testNotBetween0001
'
,
0
,
async
function
(
done
)
{
console
.
log
(
TAG
+
"
************* testNotBetween0001 start *************
"
);
{
let
dataAbilityPredicates
=
await
new
dataAbility
.
DataAbilityPredicates
();
dataAbilityPredicates
.
notBetween
(
"
stringValue
"
,
"
ABB
"
,
"
ABD
"
);
let
predicates
=
dataAbility
.
createRdbPredicates
(
"
AllDataType
"
,
dataAbilityPredicates
);
let
result
=
await
rdbStore
.
query
(
predicates
);
expect
(
0
).
assertEqual
(
result
.
rowCount
);
result
.
close
();
result
=
null
}
done
();
console
.
log
(
TAG
+
"
************* testNotBetween0001 end *************
"
);
})
/**
* @tc.name testNotBetween0002
* @tc.number I4JWCV
* @tc.desc test double value with notBetween.
*/
it
(
'
testNotBetween0002
'
,
0
,
async
function
(
done
)
{
console
.
log
(
TAG
+
"
************* testNotBetween0002 start *************
"
);
{
let
dataAbilityPredicates
=
await
new
dataAbility
.
DataAbilityPredicates
();
dataAbilityPredicates
.
notBetween
(
"
doubleValue
"
,
0.0
,
DOUBLE_MAX
);
let
predicates
=
dataAbility
.
createRdbPredicates
(
"
AllDataType
"
,
dataAbilityPredicates
);
let
result
=
await
rdbStore
.
query
(
predicates
);
expect
(
0
).
assertEqual
(
result
.
rowCount
);
result
.
close
();
result
=
null
}
done
();
console
.
log
(
TAG
+
"
************* testNotBetween0002 end *************
"
);
})
/**
* @tc.name testNotBetween0003
* @tc.number I4JWCV
* @tc.desc test integer value with notBetween.
*/
it
(
'
testNotBetween0003
'
,
0
,
async
function
(
done
)
{
console
.
log
(
TAG
+
"
************* testNotBetween0003 start *************
"
);
{
let
dataAbilityPredicates
=
await
new
dataAbility
.
DataAbilityPredicates
();
dataAbilityPredicates
.
notBetween
(
"
integerValue
"
,
0
,
1
);
let
predicates
=
dataAbility
.
createRdbPredicates
(
"
AllDataType
"
,
dataAbilityPredicates
);
let
result
=
await
rdbStore
.
query
(
predicates
);
expect
(
2
).
assertEqual
(
result
.
rowCount
);
result
.
close
();
result
=
null
}
done
();
console
.
log
(
TAG
+
"
************* testNotBetween0003 end *************
"
);
})
/**
* @tc.name testNotBetween0004
* @tc.number I4JWCV
* @tc.desc test long value with notBetween.
*/
it
(
'
testNotBetween0004
'
,
0
,
async
function
(
done
)
{
console
.
log
(
TAG
+
"
************* testNotBetween0004 start *************
"
);
{
let
dataAbilityPredicates
=
await
new
dataAbility
.
DataAbilityPredicates
();
dataAbilityPredicates
.
notBetween
(
"
longValue
"
,
0
,
2
);
let
predicates
=
dataAbility
.
createRdbPredicates
(
"
AllDataType
"
,
dataAbilityPredicates
);
let
result
=
await
rdbStore
.
query
(
predicates
);
expect
(
2
).
assertEqual
(
result
.
rowCount
);
result
.
close
();
result
=
null
}
done
();
console
.
log
(
TAG
+
"
************* testNotBetween0004 end *************
"
);
})
/**
* @tc.name testGlob0001
* @tc.number I4JWCV
* @tc.desc end with ? by glob.
*/
it
(
'
testGlob0001
'
,
0
,
async
function
(
done
)
{
console
.
log
(
TAG
+
"
************* testGlob0001 start *************
"
);
{
let
dataAbilityPredicates
=
await
new
dataAbility
.
DataAbilityPredicates
();
dataAbilityPredicates
.
glob
(
"
stringValue
"
,
"
ABC*
"
);
let
predicates
=
dataAbility
.
createRdbPredicates
(
"
AllDataType
"
,
dataAbilityPredicates
);
let
result
=
await
rdbStore
.
query
(
predicates
);
expect
(
3
).
assertEqual
(
result
.
rowCount
);
result
.
close
();
result
=
null
}
done
();
console
.
log
(
TAG
+
"
************* testGlob0001 end *************
"
);
})
/**
* @tc.name testGlob0002
* @tc.number I4JWCV
* @tc.desc begin with * by glob.
*/
it
(
'
testGlob0002
'
,
0
,
async
function
(
done
)
{
console
.
log
(
TAG
+
"
************* testGlob0002 start *************
"
);
{
let
dataAbilityPredicates
=
await
new
dataAbility
.
DataAbilityPredicates
();
dataAbilityPredicates
.
glob
(
"
stringValue
"
,
"
*LMN
"
);
let
predicates
=
dataAbility
.
createRdbPredicates
(
"
AllDataType
"
,
dataAbilityPredicates
);
let
result
=
await
rdbStore
.
query
(
predicates
);
expect
(
3
).
assertEqual
(
result
.
rowCount
);
result
.
close
();
result
=
null
}
done
();
console
.
log
(
TAG
+
"
************* testGlob0002 end *************
"
);
})
/**
* @tc.name testGlob0003
* @tc.number I4JWCV
* @tc.desc end with ? by glob.
*/
it
(
'
testGlob0003
'
,
0
,
async
function
(
done
)
{
console
.
log
(
TAG
+
"
************* testGlob0003 start *************
"
);
{
let
dataAbilityPredicates
=
await
new
dataAbility
.
DataAbilityPredicates
();
dataAbilityPredicates
.
glob
(
"
stringValue
"
,
"
ABCDEFGHIJKLM?
"
);
let
predicates
=
dataAbility
.
createRdbPredicates
(
"
AllDataType
"
,
dataAbilityPredicates
);
let
result
=
await
rdbStore
.
query
(
predicates
);
expect
(
3
).
assertEqual
(
result
.
rowCount
);
result
.
close
();
result
=
null
}
done
();
console
.
log
(
TAG
+
"
************* testGlob0003 end *************
"
);
})
/**
* @tc.name testGlob0004
* @tc.number I4JWCV
* @tc.desc begin with ? by glob.
*/
it
(
'
testGlob0004
'
,
0
,
async
function
(
done
)
{
console
.
log
(
TAG
+
"
************* testGlob0004 start *************
"
);
{
let
dataAbilityPredicates
=
await
new
dataAbility
.
DataAbilityPredicates
();
dataAbilityPredicates
.
glob
(
"
stringValue
"
,
"
?BCDEFGHIJKLMN
"
);
let
predicates
=
dataAbility
.
createRdbPredicates
(
"
AllDataType
"
,
dataAbilityPredicates
);
let
result
=
await
rdbStore
.
query
(
predicates
);
expect
(
3
).
assertEqual
(
result
.
rowCount
);
result
.
close
();
result
=
null
}
done
();
console
.
log
(
TAG
+
"
************* testGlob0004 end *************
"
);
})
/**
* @tc.name testGlob0005
* @tc.number I4JWCV
* @tc.desc begin and end with * by glob.
*/
it
(
'
testGlob0005
'
,
0
,
async
function
(
done
)
{
console
.
log
(
TAG
+
"
************* testGlob0005 start *************
"
);
{
let
dataAbilityPredicates
=
await
new
dataAbility
.
DataAbilityPredicates
();
dataAbilityPredicates
.
glob
(
"
stringValue
"
,
"
*FGHI*
"
);
let
predicates
=
dataAbility
.
createRdbPredicates
(
"
AllDataType
"
,
dataAbilityPredicates
);
let
result
=
await
rdbStore
.
query
(
predicates
);
expect
(
3
).
assertEqual
(
result
.
rowCount
);
result
.
close
();
result
=
null
}
done
();
console
.
log
(
TAG
+
"
************* testGlob0005 end *************
"
);
})
/**
* @tc.name testGlob0006
* @tc.number I4JWCV
* @tc.desc begin and end with ? by glob.
*/
it
(
'
testGlob0006
'
,
0
,
async
function
(
done
)
{
console
.
log
(
TAG
+
"
************* testGlob0006 start *************
"
);
{
let
dataAbilityPredicates
=
await
new
dataAbility
.
DataAbilityPredicates
();
dataAbilityPredicates
.
glob
(
"
stringValue
"
,
"
?BCDEFGHIJKLM?
"
);
let
predicates
=
dataAbility
.
createRdbPredicates
(
"
AllDataType
"
,
dataAbilityPredicates
);
let
result
=
await
rdbStore
.
query
(
predicates
);
expect
(
3
).
assertEqual
(
result
.
rowCount
);
result
.
close
();
result
=
null
}
done
();
console
.
log
(
TAG
+
"
************* testGlob0006 end *************
"
);
})
/**
* @tc.name predicates contains normal test
* @tc.number SUB_DDM_AppDataFWK_JSRDB_DataAbilityPredicates_0100
...
...
@@ -2098,5 +2308,62 @@ describe('dataAbilityPredicatesTest', function () {
done
();
console
.
log
(
TAG
+
"
************* testIndexedBy0002 end *************
"
);
})
/**
* @tc.name testNotIn0001
* @tc.number I4JWCV
* @tc.desc the common and min value test with notin.
*/
it
(
'
testNotIn0001
'
,
0
,
async
function
(
done
)
{
console
.
log
(
TAG
+
"
************* testNotIn0001 start *************
"
);
var
values
=
[
1
,
-
2147483648
];
let
dataAbilityPredicates
=
await
new
dataAbility
.
DataAbilityPredicates
();
dataAbilityPredicates
.
notIn
(
"
integerValue
"
,
values
);
let
predicates
=
dataAbility
.
createRdbPredicates
(
"
AllDataType
"
,
dataAbilityPredicates
);
let
result
=
await
rdbStore
.
query
(
predicates
);
expect
(
1
).
assertEqual
(
result
.
rowCount
);
result
.
close
();
done
();
console
.
log
(
TAG
+
"
************* testNotIn0001 end *************
"
);
})
/**
* @tc.name testNotIn0002
* @tc.number I4JWCV
* @tc.desc the common and max value test with notin.
*/
it
(
'
testNotIn0002
'
,
0
,
async
function
(
done
)
{
console
.
log
(
TAG
+
"
************* testNotIn0002 start *************
"
);
let
values
=
[
1
,
2147483647
];
let
dataAbilityPredicates
=
await
new
dataAbility
.
DataAbilityPredicates
();
dataAbilityPredicates
.
notIn
(
"
integerValue
"
,
values
);
let
predicates
=
dataAbility
.
createRdbPredicates
(
"
AllDataType
"
,
dataAbilityPredicates
);
let
result
=
await
rdbStore
.
query
(
predicates
);
expect
(
1
).
assertEqual
(
result
.
rowCount
);
result
.
close
();
done
();
console
.
log
(
TAG
+
"
************* testNotIn0002 end *************
"
);
})
/**
* @tc.name testNotIn0003
* @tc.number I4JWCV
* @tc.desc the min and max value test with notin.
*/
it
(
'
testNotIn0003
'
,
0
,
async
function
(
done
)
{
console
.
log
(
TAG
+
"
************* testNotIn0003 start *************
"
);
var
values
=
[
-
2147483648
,
2147483647
];
let
dataAbilityPredicates
=
await
new
dataAbility
.
DataAbilityPredicates
();
dataAbilityPredicates
.
notIn
(
"
integerValue
"
,
values
);
let
predicates
=
dataAbility
.
createRdbPredicates
(
"
AllDataType
"
,
dataAbilityPredicates
);
let
result
=
await
rdbStore
.
query
(
predicates
);
expect
(
1
).
assertEqual
(
result
.
rowCount
);
result
.
close
();
done
();
console
.
log
(
TAG
+
"
************* testNotIn0003 end *************
"
);
})
console
.
log
(
TAG
+
"
*************Unit Test End*************
"
);
})
distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/DataShareJsunit.test.js
0 → 100644
浏览文件 @
90d6f087
此差异已折叠。
点击以展开。
distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/List.test.js
浏览文件 @
90d6f087
...
...
@@ -27,3 +27,5 @@ require('./DataAbilityPredicatesJsunit.test.js')
require
(
'
./RdbstoreTransactionJsunit.test.js
'
)
require
(
'
./RdbstorePredicatesJoinJsunit.test.js
'
)
require
(
'
./RdbStoreDistributedJsunit.test.js
'
)
require
(
'
./DataShareJsunit.test.js
'
)
distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbStoreDistributedJsunit.test.js
浏览文件 @
90d6f087
...
...
@@ -301,7 +301,10 @@ describe('rdbStoreDistributedTest', function () {
let
predicates
=
new
dataRdb
.
RdbPredicates
(
"
employee
"
)
predicates
=
predicates
.
inDevices
(
"
12345678abcd
"
);
rdbStore
.
sync
(
dataRdb
.
SyncMode
.
SYNC_MODE_PUSH
,
predicates
);
console
.
log
(
TAG
+
"
sync success
"
);
console
.
log
(
TAG
+
"
sync push success
"
);
expect
(
rdbStore
).
assertEqual
(
rdbStore
);
rdbStore
.
sync
(
dataRdb
.
SyncMode
.
SYNC_MODE_PULL
,
predicates
);
console
.
log
(
TAG
+
"
sync pull success
"
);
expect
(
rdbStore
).
assertEqual
(
rdbStore
);
done
();
console
.
log
(
TAG
+
"
************* testRdbStoreDistributed0011 end *************
"
);
...
...
distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbstorePredicatesJsunit.test.js
浏览文件 @
90d6f087
...
...
@@ -1121,6 +1121,196 @@ describe('rdbPredicatesTest', function () {
console
.
log
(
TAG
+
"
************* testBetween0008 end *************
"
);
})
/**
* @tc.name testNotBetween0001
* @tc.number I4JWCV
* @tc.desc test string value with notBetween.
*/
it
(
'
testNotBetween0001
'
,
0
,
async
function
(
done
)
{
console
.
log
(
TAG
+
"
************* testNotBetween0001 start *************
"
);
{
let
predicates
=
await
new
dataRdb
.
RdbPredicates
(
"
AllDataType
"
);
predicates
.
notBetween
(
"
stringValue
"
,
"
ABB
"
,
"
ABD
"
);
let
result
=
await
rdbStore
.
query
(
predicates
);
expect
(
0
).
assertEqual
(
result
.
rowCount
);
result
.
close
();
result
=
null
}
done
();
console
.
log
(
TAG
+
"
************* testNotBetween0001 end *************
"
);
})
/**
* @tc.name testNotBetween0002
* @tc.number I4JWCV
* @tc.desc test double value with notBetween.
*/
it
(
'
testNotBetween0002
'
,
0
,
async
function
(
done
)
{
console
.
log
(
TAG
+
"
************* testNotBetween0002 start *************
"
);
{
let
predicates
=
await
new
dataRdb
.
RdbPredicates
(
"
AllDataType
"
);
predicates
.
notBetween
(
"
doubleValue
"
,
0.0
,
DOUBLE_MAX
);
let
result
=
await
rdbStore
.
query
(
predicates
);
expect
(
0
).
assertEqual
(
result
.
rowCount
);
result
.
close
();
result
=
null
}
done
();
console
.
log
(
TAG
+
"
************* testNotBetween0002 end *************
"
);
})
/**
* @tc.name testNotBetween0003
* @tc.number I4JWCV
* @tc.desc test integer value with notBetween.
*/
it
(
'
testNotBetween0003
'
,
0
,
async
function
(
done
)
{
console
.
log
(
TAG
+
"
************* testNotBetween0003 start *************
"
);
{
let
predicates
=
await
new
dataRdb
.
RdbPredicates
(
"
AllDataType
"
);
predicates
.
notBetween
(
"
integerValue
"
,
0
,
1
);
let
result
=
await
rdbStore
.
query
(
predicates
);
expect
(
2
).
assertEqual
(
result
.
rowCount
);
result
.
close
();
result
=
null
}
done
();
console
.
log
(
TAG
+
"
************* testNotBetween0003 end *************
"
);
})
/**
* @tc.name testNotBetween0004
* @tc.number I4JWCV
* @tc.desc test long value with notBetween.
*/
it
(
'
testNotBetween0004
'
,
0
,
async
function
(
done
)
{
console
.
log
(
TAG
+
"
************* testNotBetween0004 start *************
"
);
{
let
predicates
=
await
new
dataRdb
.
RdbPredicates
(
"
AllDataType
"
);
predicates
.
notBetween
(
"
longValue
"
,
0
,
2
);
let
result
=
await
rdbStore
.
query
(
predicates
);
expect
(
2
).
assertEqual
(
result
.
rowCount
);
result
.
close
();
result
=
null
}
done
();
console
.
log
(
TAG
+
"
************* testNotBetween0004 end *************
"
);
})
/**
* @tc.name testGlob0001
* @tc.number I4JWCV
* @tc.desc end with ? by glob.
*/
it
(
'
testGlob0001
'
,
0
,
async
function
(
done
)
{
console
.
log
(
TAG
+
"
************* testGlob0001 start *************
"
);
{
let
predicates
=
await
new
dataRdb
.
RdbPredicates
(
"
AllDataType
"
);
predicates
.
glob
(
"
stringValue
"
,
"
ABC*
"
);
let
result
=
await
rdbStore
.
query
(
predicates
);
expect
(
3
).
assertEqual
(
result
.
rowCount
);
result
.
close
();
result
=
null
}
done
();
console
.
log
(
TAG
+
"
************* testGlob0001 end *************
"
);
})
/**
* @tc.name testGlob0002
* @tc.number I4JWCV
* @tc.desc begin with * by glob.
*/
it
(
'
testGlob0002
'
,
0
,
async
function
(
done
)
{
console
.
log
(
TAG
+
"
************* testGlob0002 start *************
"
);
{
let
predicates
=
await
new
dataRdb
.
RdbPredicates
(
"
AllDataType
"
);
predicates
.
glob
(
"
stringValue
"
,
"
*LMN
"
);
let
result
=
await
rdbStore
.
query
(
predicates
);
expect
(
3
).
assertEqual
(
result
.
rowCount
);
result
.
close
();
result
=
null
}
done
();
console
.
log
(
TAG
+
"
************* testGlob0002 end *************
"
);
})
/**
* @tc.name testGlob0003
* @tc.number I4JWCV
* @tc.desc end with ? by glob.
*/
it
(
'
testGlob0003
'
,
0
,
async
function
(
done
)
{
console
.
log
(
TAG
+
"
************* testGlob0003 start *************
"
);
{
let
predicates
=
await
new
dataRdb
.
RdbPredicates
(
"
AllDataType
"
);
predicates
.
glob
(
"
stringValue
"
,
"
ABCDEFGHIJKLM?
"
);
let
result
=
await
rdbStore
.
query
(
predicates
);
expect
(
3
).
assertEqual
(
result
.
rowCount
);
result
.
close
();
result
=
null
}
done
();
console
.
log
(
TAG
+
"
************* testGlob0003 end *************
"
);
})
/**
* @tc.name testGlob0004
* @tc.number I4JWCV
* @tc.desc begin with ? by glob.
*/
it
(
'
testGlob0004
'
,
0
,
async
function
(
done
)
{
console
.
log
(
TAG
+
"
************* testGlob0004 start *************
"
);
{
let
predicates
=
await
new
dataRdb
.
RdbPredicates
(
"
AllDataType
"
);
predicates
.
glob
(
"
stringValue
"
,
"
?BCDEFGHIJKLMN
"
);
let
result
=
await
rdbStore
.
query
(
predicates
);
expect
(
3
).
assertEqual
(
result
.
rowCount
);
result
.
close
();
result
=
null
}
done
();
console
.
log
(
TAG
+
"
************* testGlob0004 end *************
"
);
})
/**
* @tc.name testGlob0005
* @tc.number I4JWCV
* @tc.desc begin and end with * by glob.
*/
it
(
'
testGlob0005
'
,
0
,
async
function
(
done
)
{
console
.
log
(
TAG
+
"
************* testGlob0005 start *************
"
);
{
let
predicates
=
await
new
dataRdb
.
RdbPredicates
(
"
AllDataType
"
);
predicates
.
glob
(
"
stringValue
"
,
"
*FGHI*
"
);
let
result
=
await
rdbStore
.
query
(
predicates
);
expect
(
3
).
assertEqual
(
result
.
rowCount
);
result
.
close
();
result
=
null
}
done
();
console
.
log
(
TAG
+
"
************* testGlob0005 end *************
"
);
})
/**
* @tc.name testGlob0006
* @tc.number I4JWCV
* @tc.desc begin and end with ? by glob.
*/
it
(
'
testGlob0006
'
,
0
,
async
function
(
done
)
{
console
.
log
(
TAG
+
"
************* testGlob0006 start *************
"
);
{
let
predicates
=
await
new
dataRdb
.
RdbPredicates
(
"
AllDataType
"
);
predicates
.
glob
(
"
stringValue
"
,
"
?BCDEFGHIJKLM?
"
);
let
result
=
await
rdbStore
.
query
(
predicates
);
expect
(
3
).
assertEqual
(
result
.
rowCount
);
result
.
close
();
result
=
null
}
done
();
console
.
log
(
TAG
+
"
************* testGlob0006 end *************
"
);
})
/**
* @tc.name predicates contains normal test
* @tc.number SUB_DDM_AppDataFWK_JSRDB_Predicates_0100
...
...
@@ -1866,6 +2056,57 @@ describe('rdbPredicatesTest', function () {
console
.
log
(
TAG
+
"
************* testIn0004 end *************
"
);
})
/**
* @tc.name testNotIn0001
* @tc.number I4JWCV
* @tc.desc the common and min value test with notin.
*/
it
(
'
testNotIn0001
'
,
0
,
async
function
(
done
)
{
console
.
log
(
TAG
+
"
************* testNotIn0001 start *************
"
);
var
values
=
[
1
,
-
2147483648
];
let
predicates
=
await
new
dataRdb
.
RdbPredicates
(
"
AllDataType
"
);
predicates
.
notIn
(
"
integerValue
"
,
values
);
let
result
=
await
rdbStore
.
query
(
predicates
);
expect
(
1
).
assertEqual
(
result
.
rowCount
);
result
.
close
();
done
();
console
.
log
(
TAG
+
"
************* testNotIn0001 end *************
"
);
})
/**
* @tc.name testNotIn0002
* @tc.number I4JWCV
* @tc.desc the common and max value test with notin.
*/
it
(
'
testNotIn0002
'
,
0
,
async
function
(
done
)
{
console
.
log
(
TAG
+
"
************* testNotIn0002 start *************
"
);
let
values
=
[
1
,
2147483647
];
let
predicates
=
await
new
dataRdb
.
RdbPredicates
(
"
AllDataType
"
);
predicates
.
notIn
(
"
integerValue
"
,
values
);
let
result
=
await
rdbStore
.
query
(
predicates
);
expect
(
1
).
assertEqual
(
result
.
rowCount
);
result
.
close
();
done
();
console
.
log
(
TAG
+
"
************* testNotIn0002 end *************
"
);
})
/**
* @tc.name testNotIn0003
* @tc.number I4JWCV
* @tc.desc the min and max value test with notin.
*/
it
(
'
testNotIn0003
'
,
0
,
async
function
(
done
)
{
console
.
log
(
TAG
+
"
************* testNotIn0003 start *************
"
);
var
values
=
[
-
2147483648
,
2147483647
];
let
predicates
=
await
new
dataRdb
.
RdbPredicates
(
"
AllDataType
"
);
predicates
.
notIn
(
"
integerValue
"
,
values
);
let
result
=
await
rdbStore
.
query
(
predicates
);
expect
(
1
).
assertEqual
(
result
.
rowCount
);
result
.
close
();
done
();
console
.
log
(
TAG
+
"
************* testNotIn0003 end *************
"
);
})
/**
* @tc.name predicates constructor test
* @tc.number SUB_DDM_AppDataFWK_JSRDB_Predicates_0200
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录