Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
3c22a5db
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看板
未验证
提交
3c22a5db
编写于
7月 07, 2023
作者:
O
openharmony_ci
提交者:
Gitee
7月 07, 2023
浏览文件
操作
浏览文件
下载
差异文件
!9243 【Distributeddatamgr】【Master】rdb用例补充
Merge pull request !9243 from lina123456/master
上级
b2b649fc
2c74ff57
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
170 addition
and
84 deletion
+170
-84
distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstorePredicatesJsunit.test.js
...est/hap/src/main/js/test/RdbstorePredicatesJsunit.test.js
+83
-42
distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RelationalStorePredicatesJsunit.test.js
.../src/main/js/test/RelationalStorePredicatesJsunit.test.js
+87
-42
未找到文件。
distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstorePredicatesJsunit.test.js
浏览文件 @
3c22a5db
...
...
@@ -39,6 +39,7 @@ describe('rdbPredicatesTest', function () {
await
buildAllDataType1
();
await
buildAllDataType2
();
await
buildAllDataType3
();
await
rdbStore
.
executeSql
(
"
CREATE INDEX index_name ON AllDataType (characterValue);
"
,
null
);
})
beforeEach
(
function
()
{
...
...
@@ -2173,48 +2174,88 @@ describe('rdbPredicatesTest', function () {
})
/**
* @tc.name predicates indexedBy test
* @tc.number SUB_DDM_AppDataFWK_JSRDB_Predicates_0220
* @tc.desc predicates indexedBy test
*/
it
(
'
testIndexedBy0001
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
"
************* testIndexedBy0001 start *************
"
);
let
errInfo
=
undefined
try
{
let
predicates
=
await
new
dataRdb
.
RdbPredicates
(
"
AllDataType
"
);
predicates
.
like
(
"
stringValue
"
,
"
ABCDEFGHIJKLMN
"
).
indexedBy
([
"
characterValue
"
]);
let
result
=
await
rdbStore
.
query
(
predicates
);
expect
(
3
).
assertEqual
(
result
.
rowCount
);
}
catch
(
err
)
{
expect
(
err
!=
undefined
).
assertTrue
();
console
.
info
(
TAG
+
"
testIndexedBy0001 err
"
+
err
);
errInfo
=
err
;
}
done
();
console
.
info
(
TAG
+
"
************* testIndexedBy0001 end *************
"
);
})
/**
* @tc.name predicates indexedBy test
* @tc.number SUB_DDM_AppDataFWK_JSRDB_Predicates_0221
* @tc.desc predicates indexedBy test
*/
it
(
'
testIndexedBy0002
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
"
************* testIndexedBy0002 start *************
"
);
let
errInfo
=
undefined
try
{
let
predicates
=
await
new
dataRdb
.
RdbPredicates
(
"
AllDataType
"
);
predicates
.
like
(
"
stringValue
"
,
"
ABCDEFGHIJKLMN
"
).
indexedBy
([
"
characterValueX
"
]);
let
result
=
await
rdbStore
.
query
(
predicates
);
expect
(
3
).
assertEqual
(
result
.
rowCount
);
}
catch
(
err
)
{
expect
(
err
!=
undefined
).
assertTrue
();
console
.
info
(
TAG
+
"
testIndexedBy0002 err
"
+
err
);
errInfo
=
err
;
}
done
();
console
.
info
(
TAG
+
"
************* testIndexedBy0002 end *************
"
);
})
* @tc.name predicates indexedBy test
* @tc.number SUB_DDM_AppDataFWK_JSRDB_Predicates_0220
* @tc.desc predicates indexedBy test
*/
it
(
'
testIndexedBy0001
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
"
************* testIndexedBy0001 start *************
"
);
try
{
let
predicates
=
await
new
dataRdb
.
RdbPredicates
(
"
AllDataType
"
);
predicates
.
like
(
"
stringValue
"
,
"
ABCDEFGHIJKLMN
"
).
indexedBy
([
"
characterValue
"
]);
let
result
=
await
rdbStore
.
query
(
predicates
);
expect
(
result
.
rowCount
==
-
1
).
assertTrue
();
done
();
}
catch
(
err
)
{
expect
(
err
!=
undefined
).
assertTrue
();
console
.
info
(
TAG
+
"
testIndexedBy0001 err
"
+
err
);
done
();
}
console
.
info
(
TAG
+
"
************* testIndexedBy0001 end *************
"
);
})
/**
* @tc.name predicates indexedBy test
* @tc.number SUB_DDM_AppDataFWK_JSRDB_Predicates_0221
* @tc.desc predicates indexedBy test
*/
it
(
'
testIndexedBy0002
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
"
************* testIndexedBy0002 start *************
"
);
try
{
let
predicates
=
await
new
dataRdb
.
RdbPredicates
(
"
AllDataType
"
);
predicates
.
like
(
"
stringValue
"
,
"
ABCDEFGHIJKLMN
"
).
indexedBy
(
"
characterValue
"
);
let
result
=
await
rdbStore
.
query
(
predicates
);
expect
(
result
.
rowCount
==
-
1
).
assertTrue
();
done
();
}
catch
(
err
)
{
expect
(
err
!=
undefined
).
assertTrue
();
console
.
info
(
TAG
+
"
testIndexedBy0002 err
"
+
err
);
done
();
}
console
.
info
(
TAG
+
"
************* testIndexedBy0002 end *************
"
);
})
/**
* @tc.name predicates indexedBy test
* @tc.number SUB_DDM_AppDataFWK_JSRDB_Predicates_0222
* @tc.desc predicates indexedBy test
*/
it
(
'
testIndexedBy0003
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
"
************* testIndexedBy0003 start *************
"
);
try
{
let
predicates
=
await
new
dataRdb
.
RdbPredicates
(
"
AllDataType
"
);
predicates
.
indexedBy
(
"
index_name
"
);
let
result
=
await
rdbStore
.
query
(
predicates
);
expect
(
3
).
assertEqual
(
result
.
rowCount
);
done
();
}
catch
(
err
)
{
expect
(
err
!=
undefined
).
assertFail
();
console
.
info
(
TAG
+
"
testIndexedBy0003 err
"
+
err
);
done
();
}
console
.
info
(
TAG
+
"
************* testIndexedBy0003 end *************
"
);
})
/**
* @tc.name predicates indexedBy test
* @tc.number SUB_DDM_AppDataFWK_JSRDB_Predicates_0223
* @tc.desc predicates indexedBy test
*/
it
(
'
testIndexedBy0004
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
"
************* testIndexedBy0004 start *************
"
);
try
{
let
predicates
=
await
new
dataRdb
.
RdbPredicates
(
"
AllDataType
"
);
predicates
.
like
(
"
stringValue
"
,
"
ABCDEFGHIJKLMN
"
).
indexedBy
(
"
index_name
"
);
let
result
=
await
rdbStore
.
query
(
predicates
);
expect
(
3
).
assertEqual
(
result
.
rowCount
);
done
();
}
catch
(
err
)
{
expect
(
err
!=
undefined
).
assertFail
();
console
.
info
(
TAG
+
"
testIndexedBy0004 err
"
+
err
);
done
();
}
console
.
info
(
TAG
+
"
************* testIndexedBy0004 end *************
"
);
})
console
.
info
(
TAG
+
"
*************Unit Test End*************
"
);
})}
distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RelationalStorePredicatesJsunit.test.js
浏览文件 @
3c22a5db
...
...
@@ -42,6 +42,7 @@ describe('relationalStorePredicatesTest', function () {
await
buildAllDataType1
();
await
buildAllDataType2
();
await
buildAllDataType3
();
await
rdbStore
.
executeSql
(
"
CREATE INDEX index_name ON AllDataType (characterValue);
"
,
null
);
})
beforeEach
(
function
()
{
...
...
@@ -2174,48 +2175,92 @@ describe('relationalStorePredicatesTest', function () {
})
/**
* @tc.name predicates indexedBy test
* @tc.number SUB_DDM_AppDataFWK_JSRelationalStore_Predicates_0220
* @tc.desc predicates indexedBy test
*/
it
(
'
testIndexedBy0001
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
"
************* testIndexedBy0001 start *************
"
);
let
errInfo
=
undefined
try
{
let
predicates
=
await
new
data_Rdb
.
RdbPredicates
(
"
AllDataType
"
);
predicates
.
like
(
"
stringValue
"
,
"
ABCDEFGHIJKLMN
"
).
indexedBy
([
"
characterValue
"
]);
let
result
=
await
rdbStore
.
query
(
predicates
);
expect
(
3
).
assertEqual
(
result
.
rowCount
);
result
.
close
();
}
catch
(
err
){
errInfo
=
err
}
expect
(
errInfo
.
code
).
assertEqual
(
"
401
"
)
done
();
console
.
info
(
TAG
+
"
************* testIndexedBy0001 end *************
"
);
})
/**
* @tc.name predicates indexedBy test
* @tc.number SUB_DDM_AppDataFWK_JSRelationalStore_Predicates_0221
* @tc.desc predicates indexedBy test
*/
it
(
'
testIndexedBy0002
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
"
************* testIndexedBy0002 start *************
"
);
let
errInfo
=
undefined
try
{
let
predicates
=
await
new
data_Rdb
.
RdbPredicates
(
"
AllDataType
"
);
predicates
.
like
(
"
stringValue
"
,
"
ABCDEFGHIJKLMN
"
).
indexedBy
([
"
characterValueX
"
]);
let
result
=
await
rdbStore
.
query
(
predicates
);
expect
(
3
).
assertEqual
(
result
.
rowCount
);
result
.
close
();
}
catch
(
err
){
errInfo
=
err
}
expect
(
errInfo
.
code
).
assertEqual
(
"
401
"
)
done
();
console
.
info
(
TAG
+
"
************* testIndexedBy0002 end *************
"
);
})
* @tc.name predicates indexedBy test
* @tc.number SUB_DDM_AppDataFWK_JSRelationalStore_Predicates_0220
* @tc.desc predicates indexedBy test
*/
it
(
'
testIndexedBy0001
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
"
************* testIndexedBy0001 start *************
"
);
try
{
let
predicates
=
await
new
data_Rdb
.
RdbPredicates
(
"
AllDataType
"
);
predicates
.
like
(
"
stringValue
"
,
"
ABCDEFGHIJKLMN
"
).
indexedBy
([
"
characterValue
"
]);
let
result
=
await
rdbStore
.
query
(
predicates
);
expect
(
result
.
rowCount
==
-
1
).
assertTrue
();
result
.
close
();
done
();
}
catch
(
err
){
expect
(
err
.
code
).
assertEqual
(
"
401
"
);
done
();
}
console
.
info
(
TAG
+
"
************* testIndexedBy0001 end *************
"
);
})
/**
* @tc.name predicates indexedBy test
* @tc.number SUB_DDM_AppDataFWK_JSRelationalStore_Predicates_0221
* @tc.desc predicates indexedBy test
*/
it
(
'
testIndexedBy0002
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
"
************* testIndexedBy0002 start *************
"
);
try
{
let
predicates
=
await
new
data_Rdb
.
RdbPredicates
(
"
AllDataType
"
);
predicates
.
like
(
"
stringValue
"
,
"
ABCDEFGHIJKLMN
"
).
indexedBy
(
"
characterValue
"
);
let
result
=
await
rdbStore
.
query
(
predicates
);
expect
(
result
.
rowCount
==
-
1
).
assertTrue
();
result
.
close
();
done
();
}
catch
(
err
){
expect
(
err
!=
undefined
).
assertFalse
();
done
();
}
console
.
info
(
TAG
+
"
************* testIndexedBy0002 end *************
"
);
})
/**
* @tc.name predicates indexedBy test
* @tc.number SUB_DDM_AppDataFWK_JSRelationalStore_Predicates_0222
* @tc.desc predicates indexedBy test
*/
it
(
'
testIndexedBy0003
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
"
************* testIndexedBy0003 start *************
"
);
try
{
let
predicates
=
await
new
data_Rdb
.
RdbPredicates
(
"
AllDataType
"
);
predicates
.
indexedBy
(
"
index_name
"
);
let
result
=
await
rdbStore
.
query
(
predicates
);
console
.
info
(
TAG
+
"
result.rowCount =
"
+
result
.
rowCount
);
expect
(
3
).
assertEqual
(
result
.
rowCount
);
result
.
close
();
done
();
}
catch
(
err
){
console
.
info
(
TAG
+
"
err =
"
+
err
);
expect
(
err
!=
undefined
).
assertFalse
();
done
();
}
console
.
info
(
TAG
+
"
************* testIndexedBy0003 end *************
"
);
})
/**
* @tc.name predicates indexedBy test
* @tc.number SUB_DDM_AppDataFWK_JSRelationalStore_Predicates_0223
* @tc.desc predicates indexedBy test
*/
it
(
'
testIndexedBy0004
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
"
************* testIndexedBy0004 start *************
"
);
try
{
let
predicates
=
await
new
data_Rdb
.
RdbPredicates
(
"
AllDataType
"
);
predicates
.
like
(
"
stringValue
"
,
"
ABCDEFGHIJKLMN
"
).
indexedBy
(
"
index_name
"
);
let
result
=
await
rdbStore
.
query
(
predicates
);
console
.
info
(
TAG
+
"
result.rowCount =
"
+
result
.
rowCount
);
expect
(
3
).
assertEqual
(
result
.
rowCount
);
result
.
close
();
done
();
}
catch
(
err
){
console
.
info
(
TAG
+
"
err =
"
+
err
);
expect
(
err
!=
undefined
).
assertFalse
();
done
();
}
console
.
info
(
TAG
+
"
************* testIndexedBy0004 end *************
"
);
})
console
.
info
(
TAG
+
"
*************Unit Test End*************
"
);
})}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录