Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
3f6d31d4
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,发现更多精彩内容 >>
未验证
提交
3f6d31d4
编写于
8月 26, 2022
作者:
O
openharmony_ci
提交者:
Gitee
8月 26, 2022
浏览文件
操作
浏览文件
下载
差异文件
!5221 【Distributeddatamgr】【master】解决用例失败问题
Merge pull request !5221 from 梁梁/master
上级
9ed29473
faf8ad7e
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
200 addition
and
72 deletion
+200
-72
distributeddatamgr/preferencesjstest/hap/src/main/js/test/PreferencesCallBackJsunit.test.js
...st/hap/src/main/js/test/PreferencesCallBackJsunit.test.js
+24
-24
distributeddatamgr/preferencesjstest/hap/src/main/js/test/PreferencesHelperJsunit.test.js
...test/hap/src/main/js/test/PreferencesHelperJsunit.test.js
+7
-7
distributeddatamgr/preferencesjstest/hap/src/main/js/test/PreferencesPromiseJsunit.test.js
...est/hap/src/main/js/test/PreferencesPromiseJsunit.test.js
+20
-20
distributeddatamgr/relationalStorejstest/hap/src/main/js/test/RdbStoreResultSetJsunit.test.js
...test/hap/src/main/js/test/RdbStoreResultSetJsunit.test.js
+128
-4
distributeddatamgr/relationalStorejstest/hap/src/main/js/test/RdbstoreInsertJsunit.test.js
...ejstest/hap/src/main/js/test/RdbstoreInsertJsunit.test.js
+21
-17
未找到文件。
distributeddatamgr/preferencesjstest/hap/src/main/js/test/PreferencesCallBackJsunit.test.js
浏览文件 @
3f6d31d4
...
...
@@ -44,7 +44,7 @@ describe('preferencesCallBackTest', function () {
/**
* @tc.name clear callback interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences
_CallBack_0010
* @tc.number SUB_DDM_
Preferences_Clear
_CallBack_0010
* @tc.desc clear callback interface test
*/
it
(
'
testPreferencesClear0012
'
,
0
,
async
function
(
done
)
{
...
...
@@ -59,7 +59,7 @@ describe('preferencesCallBackTest', function () {
/**
* @tc.name has string callback interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreference
s_CallBack_0020
* @tc.number SUB_DDM_
Preferences_Ha
s_CallBack_0020
* @tc.desc has string callback interface test
*/
it
(
'
testPreferencesHasKey0032
'
,
0
,
async
function
(
done
)
{
...
...
@@ -72,7 +72,7 @@ describe('preferencesCallBackTest', function () {
/**
* @tc.name has int callback interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_CallBack_01
30
* @tc.number SUB_DDM_
Preferences_Has_CallBack_00
30
* @tc.desc has int callback interface test
*/
it
(
'
testPreferencesHasKey0033
'
,
0
,
async
function
(
done
)
{
...
...
@@ -85,7 +85,7 @@ describe('preferencesCallBackTest', function () {
/**
* @tc.name has float callback interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_CallBack_01
40
* @tc.number SUB_DDM_
Preferences_Has_CallBack_00
40
* @tc.desc has float callback interface test
*/
it
(
'
testPreferencesHasKey0034
'
,
0
,
async
function
(
done
)
{
...
...
@@ -98,7 +98,7 @@ describe('preferencesCallBackTest', function () {
/**
* @tc.name has long callback interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_CallBack_01
50
* @tc.number SUB_DDM_
Preferences_Has_CallBack_00
50
* @tc.desc has long callback interface test
*/
it
(
'
testPreferencesHasKey0035
'
,
0
,
async
function
(
done
)
{
...
...
@@ -111,7 +111,7 @@ describe('preferencesCallBackTest', function () {
/**
* @tc.name has boolean callback interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_CallBack_01
60
* @tc.number SUB_DDM_
Preferences_Has_CallBack_00
60
* @tc.desc has boolean callback interface test
*/
it
(
'
testPreferencesHasKey0036
'
,
0
,
async
function
(
done
)
{
...
...
@@ -124,7 +124,7 @@ describe('preferencesCallBackTest', function () {
/**
* @tc.name get defaultValue callback interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_CallBack_003
0
* @tc.number SUB_DDM_
Preferences_Get_CallBack_007
0
* @tc.desc get defaultValue callback interface test
*/
it
(
'
testPreferencesGetDefValue0062
'
,
0
,
async
function
(
done
)
{
...
...
@@ -137,7 +137,7 @@ describe('preferencesCallBackTest', function () {
/**
* @tc.name get float callback interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_CallBack_004
0
* @tc.number SUB_DDM_
Preferences_Get_CallBack_008
0
* @tc.desc get float callback interface test
*/
it
(
'
testPreferencesGetFloat0072
'
,
0
,
async
function
(
done
)
{
...
...
@@ -151,7 +151,7 @@ describe('preferencesCallBackTest', function () {
/**
* @tc.name get int callback interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_CallBack_005
0
* @tc.number SUB_DDM_
Preferences_Get_CallBack_009
0
* @tc.desc get int callback interface test
*/
it
(
'
testPreferencesGetInt0082
'
,
0
,
async
function
(
done
)
{
...
...
@@ -165,7 +165,7 @@ describe('preferencesCallBackTest', function () {
/**
* @tc.name get long callback interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_CallBack_006
0
* @tc.number SUB_DDM_
Preferences_Get_CallBack_010
0
* @tc.desc get long callback interface test
*/
it
(
'
testPreferencesGetLong0092
'
,
0
,
async
function
(
done
)
{
...
...
@@ -181,7 +181,7 @@ describe('preferencesCallBackTest', function () {
/**
* @tc.name get String callback interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_CallBack_007
0
* @tc.number SUB_DDM_
Preferences_Get_CallBack_011
0
* @tc.desc get String callback interface test
*/
it
(
'
testPreferencesGetString102
'
,
0
,
async
function
(
done
)
{
...
...
@@ -196,7 +196,7 @@ describe('preferencesCallBackTest', function () {
/**
* @tc.name put boolean callback interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_CallBack_008
0
* @tc.number SUB_DDM_
Preferences_Put_CallBack_012
0
* @tc.desc put boolean callback interface test
*/
it
(
'
testPreferencesPutBoolean0122
'
,
0
,
async
function
(
done
)
{
...
...
@@ -213,7 +213,7 @@ describe('preferencesCallBackTest', function () {
/**
* @tc.name put float callback interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_CallBack_009
0
* @tc.number SUB_DDM_
Preferences_Put_CallBack_013
0
* @tc.desc put float callback interface test
*/
it
(
'
testPreferencesPutFloat0132
'
,
0
,
async
function
(
done
)
{
...
...
@@ -230,7 +230,7 @@ describe('preferencesCallBackTest', function () {
/**
* @tc.name put int callback interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_CallBack_010
0
* @tc.number SUB_DDM_
Preferences_Put_CallBack_014
0
* @tc.desc put int callback interface test
*/
it
(
'
testPreferencesPutInt0142
'
,
0
,
async
function
(
done
)
{
...
...
@@ -247,7 +247,7 @@ describe('preferencesCallBackTest', function () {
/**
* @tc.name put long callback interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_CallBack_011
0
* @tc.number SUB_DDM_
Preferences_Put_CallBack_015
0
* @tc.desc put long callback interface test
*/
it
(
'
testPreferencesPutLong0152
'
,
0
,
async
function
(
done
)
{
...
...
@@ -265,7 +265,7 @@ describe('preferencesCallBackTest', function () {
/**
* @tc.name put String callback interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_CallBack_012
0
* @tc.number SUB_DDM_
Preferences_Put_CallBack_016
0
* @tc.desc put String callback interface test
*/
it
(
'
testPreferencesPutString0162
'
,
0
,
async
function
(
done
)
{
...
...
@@ -282,7 +282,7 @@ describe('preferencesCallBackTest', function () {
/**
* @tc.name clear、put、get、flush String callback interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_CallBack_012
0
* @tc.number SUB_DDM_
Preferences_Flush_CallBack_017
0
* @tc.desc flush String callback interface test
*/
it
(
'
testPreferencesCallback0172
'
,
0
,
function
(
done
)
{
...
...
@@ -320,7 +320,7 @@ describe('preferencesCallBackTest', function () {
/**
* @tc.name put StringArray callback interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_CallBack_0001
* @tc.number SUB_DDM_
Preferences_Put_CallBack_0180
* @tc.desc put String callback interface test
*/
it
(
'
testPreferencesPutStringArray0001
'
,
0
,
async
function
(
done
)
{
...
...
@@ -338,7 +338,7 @@ describe('preferencesCallBackTest', function () {
/**
* @tc.name put NumberArray callback interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_CallBack_0002
* @tc.number SUB_DDM_
Preferences_Put_CallBack_0190
* @tc.desc put String callback interface test
*/
it
(
'
testPreferencesPutNumArray0001
'
,
0
,
async
function
(
done
)
{
...
...
@@ -356,7 +356,7 @@ describe('preferencesCallBackTest', function () {
/**
* @tc.name put BoolArray callback interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_CallBack_0003
* @tc.number SUB_DDM_
Preferences_Put_CallBack_0200
* @tc.desc put String callback interface test
*/
it
(
'
testPreferencesPutBoolArray0001
'
,
0
,
async
function
(
done
)
{
...
...
@@ -374,7 +374,7 @@ describe('preferencesCallBackTest', function () {
/**
* @tc.name getAll callback interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_CallBack_0004
* @tc.number SUB_DDM_
Preferences_GetAll_CallBack_0210
* @tc.desc getAll callback interface test
*/
it
(
'
testPreferencesGetAll0001
'
,
0
,
async
function
(
done
)
{
...
...
@@ -416,7 +416,7 @@ describe('preferencesCallBackTest', function () {
/**
* @tc.name getPreferences callback interface test
* @tc.number SUB_DDM_
AppDataFWK_GetPreferencesTest_CallBack_0001
* @tc.number SUB_DDM_
Preferences_GetPreferencesTest_CallBack_0220
* @tc.desc getPreferences callback interface test
*/
it
(
'
testPreferencesGetPreferences0001
'
,
0
,
async
function
(
done
)
{
...
...
@@ -435,7 +435,7 @@ describe('preferencesCallBackTest', function () {
/**
* @tc.name deletePreferences callback interface test
* @tc.number SUB_DDM_
AppDataFWK_DeletePreferencesTest_CallBack_0001
* @tc.number SUB_DDM_
Preferences_DeletePreferencesTest_CallBack_0230
* @tc.desc deletePreferences callback interface test
*/
it
(
'
testPreferencesDeletePreferences0001
'
,
0
,
async
function
(
done
)
{
...
...
@@ -463,7 +463,7 @@ describe('preferencesCallBackTest', function () {
/**
* @tc.name removePreferencesFromCache interface test
* @tc.number SUB_DDM_
AppDataFWK_RemovePreferencesFromCache_CallBack_0001
* @tc.number SUB_DDM_
Preferences_RemovePreferencesFromCache_CallBack_0240
* @tc.desc removePreferencesFromCache interface test
*/
it
(
'
testRemovePreferencesFromCache0001
'
,
0
,
async
function
(
done
)
{
...
...
distributeddatamgr/preferencesjstest/hap/src/main/js/test/PreferencesHelperJsunit.test.js
浏览文件 @
3f6d31d4
...
...
@@ -36,7 +36,7 @@ describe('preferencesHelperTest', function () {
/**
* @tc.name getPreferencesSync interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_Preferences
_0010
* @tc.number SUB_DDM_
Preferences_GetPreferences_Helper
_0010
* @tc.desc getPreferencesSync interface test
*/
it
(
'
testGetPreferencesHelper001
'
,
0
,
async
function
()
{
...
...
@@ -49,7 +49,7 @@ describe('preferencesHelperTest', function () {
/**
* @tc.name getPreferences interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_Preferences
_0020
* @tc.number SUB_DDM_
Preferences_GetPreferences_Helper
_0020
* @tc.desc getPreferences interface test
*/
it
(
'
testGetPreferencesHelper002
'
,
0
,
async
function
(
done
)
{
...
...
@@ -68,7 +68,7 @@ describe('preferencesHelperTest', function () {
/**
* @tc.name removePreferencesFromCache interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_Preferences
_0030
* @tc.number SUB_DDM_
Preferences_GetPreferences_Helper
_0030
* @tc.desc removePreferencesFromCache interface test
*/
it
(
'
testRemovePreferencesFromCache001
'
,
0
,
async
function
(
done
)
{
...
...
@@ -85,7 +85,7 @@ describe('preferencesHelperTest', function () {
/**
* @tc.name deletePreferences interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_Preferences_006
0
* @tc.number SUB_DDM_
Preferences_GetPreferences_Helper_004
0
* @tc.desc deletePreferences interface test
*/
it
(
'
testDeletePreferencesHelper002
'
,
0
,
async
function
(
done
)
{
...
...
@@ -102,7 +102,7 @@ describe('preferencesHelperTest', function () {
/**
* @tc.name put interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_014
0
* @tc.number SUB_DDM_
Preferences_Put_Helper_005
0
* @tc.desc put interface test
*/
it
(
'
testPreferencesRegisterObserver001
'
,
0
,
async
function
()
{
...
...
@@ -117,7 +117,7 @@ describe('preferencesHelperTest', function () {
/**
* @tc.name repeat on interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_015
0
* @tc.number SUB_DDM_
Preferences_On_Helper_006
0
* @tc.desc repeat on interface test
*/
it
(
'
testPreferencesRegisterObserver002
'
,
0
,
async
function
()
{
...
...
@@ -133,7 +133,7 @@ describe('preferencesHelperTest', function () {
/**
* @tc.name off interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_016
0
* @tc.number SUB_DDM_
Preferences_Off_Helper_007
0
* @tc.desc off interface test
*/
it
(
'
testPreferencesUnRegisterObserver001
'
,
0
,
async
function
()
{
...
...
distributeddatamgr/preferencesjstest/hap/src/main/js/test/PreferencesPromiseJsunit.test.js
浏览文件 @
3f6d31d4
...
...
@@ -43,7 +43,7 @@ describe('preferencesPromiseTest', function () {
/**
* @tc.name put StringArray promise interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_Preferences_0131
* @tc.number SUB_DDM_
Preferences_Put_Promise_0010
* @tc.desc put StringArray promise interface test
*/
it
(
'
testPreferencesPutStringArray0131
'
,
0
,
async
function
(
done
)
{
...
...
@@ -67,7 +67,7 @@ describe('preferencesPromiseTest', function () {
/**
* @tc.name put NumberArray promise interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_Preferences_0132
* @tc.number SUB_DDM_
Preferences_Put_Promise_0020
* @tc.desc put NumberArray promise interface test
*/
it
(
'
testPreferencesPutNumberArray0132
'
,
0
,
async
function
(
done
)
{
...
...
@@ -90,7 +90,7 @@ describe('preferencesPromiseTest', function () {
/**
* @tc.name put BoolArray promise interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_Preferences_0133
* @tc.number SUB_DDM_
Preferences_Put_Promise_0030
* @tc.desc put BoolArray promise interface test
*/
it
(
'
testPreferencesPutBoolArray0133
'
,
0
,
async
function
(
done
)
{
...
...
@@ -113,7 +113,7 @@ describe('preferencesPromiseTest', function () {
/**
* @tc.name getAll promise interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_Preferences_0133
* @tc.number SUB_DDM_
Preferences_GetAll_Promise_0040
* @tc.desc getAll promise interface test
*/
it
(
'
testPreferencesGetAll0001
'
,
0
,
async
function
(
done
)
{
...
...
@@ -159,7 +159,7 @@ describe('preferencesPromiseTest', function () {
/**
* @tc.name clear promise interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_Promise_001
0
* @tc.number SUB_DDM_
Preferences_Clear_Promise_005
0
* @tc.desc clear promise interface test
*/
it
(
'
testPreferencesClear0011
'
,
0
,
async
function
(
done
)
{
...
...
@@ -178,7 +178,7 @@ describe('preferencesPromiseTest', function () {
/**
* @tc.name has string interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_Preferences_002
0
* @tc.number SUB_DDM_
Preferences_Has_Promise_006
0
* @tc.desc has string interface test
*/
it
(
'
testPreferencesHasKey0031
'
,
0
,
async
function
(
done
)
{
...
...
@@ -195,7 +195,7 @@ describe('preferencesPromiseTest', function () {
/**
* @tc.name has int interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_Preferences_014
0
* @tc.number SUB_DDM_
Preferences_Has_Promise_007
0
* @tc.desc has int interface test
*/
it
(
'
testPreferencesHasKey0032
'
,
0
,
async
function
(
done
)
{
...
...
@@ -212,7 +212,7 @@ describe('preferencesPromiseTest', function () {
/**
* @tc.name has float interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_Preferences_015
0
* @tc.number SUB_DDM_
Preferences_Put_Promise_008
0
* @tc.desc has float interface test
*/
it
(
'
testPreferencesHasKey0033
'
,
0
,
async
function
(
done
)
{
...
...
@@ -229,7 +229,7 @@ describe('preferencesPromiseTest', function () {
/**
* @tc.name has boolean interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_Preferences_016
0
* @tc.number SUB_DDM_
Preferences_Has_Promise_009
0
* @tc.desc has boolean interface test
*/
it
(
'
testPreferencesHasKey0034
'
,
0
,
async
function
(
done
)
{
...
...
@@ -246,7 +246,7 @@ describe('preferencesPromiseTest', function () {
/**
* @tc.name has long interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_Preferences_017
0
* @tc.number SUB_DDM_
Preferences_Put_Promise_010
0
* @tc.desc has long interface test
*/
it
(
'
testPreferencesHasKey0035
'
,
0
,
async
function
(
done
)
{
...
...
@@ -263,7 +263,7 @@ describe('preferencesPromiseTest', function () {
/**
* @tc.name get string promise interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_Preferences_003
0
* @tc.number SUB_DDM_
Preferences_Get_Promise_011
0
* @tc.desc get string promise interface test
*/
it
(
'
testPreferencesGetDefValue0061
'
,
0
,
async
function
(
done
)
{
...
...
@@ -280,7 +280,7 @@ describe('preferencesPromiseTest', function () {
/**
* @tc.name get float promise interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_Preferences_004
0
* @tc.number SUB_DDM_
Preferences_Get_Promise_012
0
* @tc.desc get float promise interface test
*/
it
(
'
testPreferencesGetFloat0071
'
,
0
,
async
function
(
done
)
{
...
...
@@ -298,7 +298,7 @@ describe('preferencesPromiseTest', function () {
/**
* @tc.name get int promise interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_Preferences_005
0
* @tc.number SUB_DDM_
Preferences_Put_Promise_013
0
* @tc.desc get int promise interface test
*/
it
(
'
testPreferencesGetInt0081
'
,
0
,
async
function
(
done
)
{
...
...
@@ -316,7 +316,7 @@ describe('preferencesPromiseTest', function () {
/**
* @tc.name get long promise interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_Preferences_006
0
* @tc.number SUB_DDM_
Preferences_Put_Promise_014
0
* @tc.desc get long promise interface test
*/
it
(
'
testPreferencesGetLong0091
'
,
0
,
async
function
(
done
)
{
...
...
@@ -334,7 +334,7 @@ describe('preferencesPromiseTest', function () {
/**
* @tc.name get String promise interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_Preferences_007
0
* @tc.number SUB_DDM_
Preferences_Get_Promise_015
0
* @tc.desc get String promise interface test
*/
it
(
'
tesPreferencesGetString101
'
,
0
,
async
function
(
done
)
{
...
...
@@ -353,7 +353,7 @@ describe('preferencesPromiseTest', function () {
/**
* @tc.name put boolean promise interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_Preferences_009
0
* @tc.number SUB_DDM_
Preferences_Put_Promise_016
0
* @tc.desc put boolean promise interface test
*/
it
(
'
testPreferencesPutBoolean0121
'
,
0
,
async
function
(
done
)
{
...
...
@@ -373,7 +373,7 @@ describe('preferencesPromiseTest', function () {
/**
* @tc.name put float promise interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_Preferences_010
0
* @tc.number SUB_DDM_
Preferences_Put_Promise_017
0
* @tc.desc put float promise interface test
*/
it
(
'
testPreferencesPutFloat0131
'
,
0
,
async
function
(
done
)
{
...
...
@@ -393,7 +393,7 @@ describe('preferencesPromiseTest', function () {
/**
* @tc.name put int promise interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_Preferences_011
0
* @tc.number SUB_DDM_
Preferences_Put_Promise_018
0
* @tc.desc put int promise interface test
*/
it
(
'
testPreferencesPutInt0141
'
,
0
,
async
function
(
done
)
{
...
...
@@ -413,7 +413,7 @@ describe('preferencesPromiseTest', function () {
/**
* @tc.name put long promise interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_Preferences_012
0
* @tc.number SUB_DDM_
Preferences_Put_Promise_019
0
* @tc.desc put long promise interface test
*/
it
(
'
testPreferencesPutLong0151
'
,
0
,
async
function
(
done
)
{
...
...
@@ -433,7 +433,7 @@ describe('preferencesPromiseTest', function () {
/**
* @tc.name put String promise interface test
* @tc.number SUB_DDM_
AppDataFWK_JSPreferences_Preferences_013
0
* @tc.number SUB_DDM_
Preferences_Put_Promise_020
0
* @tc.desc put String promise interface test
*/
it
(
'
testPreferencesPutString0161
'
,
0
,
async
function
(
done
)
{
...
...
distributeddatamgr/relationalStorejstest/hap/src/main/js/test/RdbStoreResultSetJsunit.test.js
浏览文件 @
3f6d31d4
...
...
@@ -24,6 +24,41 @@ const STORE_CONFIG = {
const
COLOUNM_NAMES
=
[
"
id
"
,
"
data1
"
,
"
data2
"
,
"
data3
"
,
"
data4
"
];
var
rdbStore
=
undefined
;
function
createUint8Array
(
length
)
{
let
i
=
0
let
index
=
0
let
temp
=
null
let
u8
=
new
Uint8Array
(
length
)
length
=
typeof
(
length
)
===
'
undefined
'
?
9
:
length
for
(
i
=
1
;
i
<=
length
;
i
++
)
{
u8
[
i
-
1
]
=
i
}
for
(
i
=
1
;
i
<=
length
;
i
++
)
{
index
=
parseInt
(
Math
.
random
()
*
(
length
-
i
))
+
i
if
(
index
!=
i
)
{
temp
=
u8
[
i
-
1
]
u8
[
i
-
1
]
=
u8
[
index
-
1
]
u8
[
index
-
1
]
=
temp
}
}
return
u8
;
}
async
function
createBigData
(
size
)
{
await
rdbStore
.
executeSql
(
"
DELETE FROM test
"
);
let
u8
=
createUint8Array
(
32768
);
let
valueBucketArray
=
new
Array
();
for
(
let
i
=
0
;
i
<
size
;
i
++
)
{
valueBucketArray
.
push
({
"
data1
"
:
"
test
"
+
i
,
"
data2
"
:
18
,
"
data3
"
:
100.5
,
"
data4
"
:
u8
,
});
}
await
rdbStore
.
batchInsert
(
"
test
"
,
valueBucketArray
);
}
export
default
function
rdbResultSetTest
()
{
describe
(
'
rdbResultSetTest
'
,
function
()
{
beforeAll
(
async
function
()
{
...
...
@@ -214,20 +249,21 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet isStarted normal test
*/
it
(
'
testIsStarted0003
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
'
************* testIsStarted0003 start *************
'
);
let
predicates
=
await
new
dataRdb
.
RdbPredicates
(
'
test
'
)
console
.
info
(
TAG
+
"
************* testIsStarted0003 start *************
"
);
let
predicates
=
await
new
dataRdb
.
RdbPredicates
(
"
test
"
)
let
resultSet
=
await
rdbStore
.
query
(
predicates
)
try
{
expect
(
false
).
assertEqual
(
resultSet
.
isStarted
)
expect
(
true
).
assertEqual
(
resultSet
.
goToNextRow
())
expect
(
true
).
assertEqual
(
resultSet
.
isStarted
)
expect
(
false
).
assertEqual
(
resultSet
.
goToPreviousRow
())
expect
(
fals
e
).
assertEqual
(
resultSet
.
isStarted
)
expect
(
tru
e
).
assertEqual
(
resultSet
.
isStarted
)
}
catch
(
e
)
{
expect
(
null
).
assertFail
();
}
resultSet
=
null
done
();
console
.
info
(
TAG
+
'
************* testIsStarted0003 end *************
'
);
console
.
info
(
TAG
+
"
************* testIsStarted0003 end *************
"
);
})
/**
...
...
@@ -1768,6 +1804,94 @@ describe('rdbResultSetTest', function () {
console
.
info
(
TAG
+
'
************* testcolumnNames0001 end *************
'
);
}
})
/**
* @tc.name big resultSet data test
* @tc.number SUB_DDM_AppDataFWK_JSRDB_ResultSet_0250
* @tc.desc big resultSet data test
*/
it
(
'
testBigData0001
'
,
0
,
async
function
(
done
)
{
console
.
log
(
TAG
+
"
************* testBigData0001 start *************
"
);
{
await
createBigData
(
500
);
let
resultSet
=
await
rdbStore
.
querySql
(
"
SELECT * FROM test
"
);
let
count
=
resultSet
.
rowCount
;
expect
(
500
).
assertEqual
(
count
);
resultSet
.
goToFirstRow
();
let
i
=
0
;
while
(
resultSet
.
isEnded
==
false
)
{
expect
(
"
test
"
+
i
++
).
assertEqual
(
resultSet
.
getString
(
1
))
resultSet
.
goToNextRow
();
}
resultSet
.
close
()
expect
(
true
).
assertEqual
(
resultSet
.
isClosed
)
resultSet
=
null
;
done
();
console
.
log
(
TAG
+
"
************* testBigData0001 end *************
"
);
}
})
/**
* @tc.name big resultSet data test
* @tc.number SUB_DDM_AppDataFWK_JSRDB_ResultSet_0251
* @tc.desc big resultSet data test
*/
it
(
'
testBigData0002
'
,
0
,
async
function
(
done
)
{
console
.
log
(
TAG
+
"
************* testBigData0002 start *************
"
);
{
await
createBigData
(
500
);
let
resultSet
=
await
rdbStore
.
querySql
(
"
SELECT * FROM test
"
);
let
count
=
resultSet
.
rowCount
;
expect
(
500
).
assertEqual
(
count
);
resultSet
.
goToLastRow
();
let
i
=
resultSet
.
rowCount
;
while
(
i
>=
1
)
{
expect
(
"
test
"
+
--
i
).
assertEqual
(
resultSet
.
getString
(
1
))
resultSet
.
goToPreviousRow
();
}
resultSet
.
close
()
expect
(
true
).
assertEqual
(
resultSet
.
isClosed
)
resultSet
=
null
;
done
();
console
.
log
(
TAG
+
"
************* testBigData0002 end *************
"
);
}
})
/**
* @tc.name big resultSet data test
* @tc.number SUB_DDM_AppDataFWK_JSRDB_ResultSet_0252
* @tc.desc big resultSet data test
*/
it
(
'
testBigData0003
'
,
0
,
async
function
(
done
)
{
console
.
log
(
TAG
+
"
************* testBigData0003 start *************
"
);
{
await
createBigData
(
1
);
let
resultSet
=
await
rdbStore
.
querySql
(
"
SELECT * FROM test
"
);
let
count
=
resultSet
.
rowCount
;
expect
(
1
).
assertEqual
(
count
);
resultSet
.
goToFirstRow
();
expect
(
true
).
assertEqual
(
resultSet
.
isStarted
);
expect
(
"
test0
"
).
assertEqual
(
resultSet
.
getString
(
1
))
let
rows
=
[
1
,
2
,
-
1
,
-
2
];
for
(
const
i
of
rows
)
{
resultSet
.
goToRow
(
i
);
expect
(
true
).
assertEqual
(
resultSet
.
isStarted
);
expect
(
""
).
assertEqual
(
resultSet
.
getString
(
1
))
}
resultSet
.
close
()
expect
(
true
).
assertEqual
(
resultSet
.
isClosed
)
resultSet
=
null
;
done
();
console
.
log
(
TAG
+
"
************* testBigData0003 end *************
"
);
}
})
console
.
info
(
TAG
+
'
*************Unit Test End*************
'
);
})
...
...
distributeddatamgr/relationalStorejstest/hap/src/main/js/test/RdbstoreInsertJsunit.test.js
浏览文件 @
3f6d31d4
...
...
@@ -25,6 +25,7 @@ const STORE_CONFIG = {
}
var
rdbStore
=
undefined
;
var
resultSet
=
undefined
;
function
sleep
(
ms
)
{
return
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
ms
));
...
...
@@ -320,7 +321,7 @@ describe('rdbstoreInsertTest', function () {
})
let
predicates
=
new
dataRdb
.
RdbPredicates
(
"
test2
"
);
predicates
.
equalTo
(
"
name
"
,
"
lisi
"
)
resultSet
=
await
rdbStore
.
query
(
predicates
)
let
resultSet
=
await
rdbStore
.
query
(
predicates
)
try
{
console
.
info
(
TAG
+
"
resultSet query done
"
);
expect
(
true
).
assertEqual
(
resultSet
.
goToFirstRow
())
...
...
@@ -334,11 +335,11 @@ describe('rdbstoreInsertTest', function () {
expect
(
"
lisi
"
).
assertEqual
(
name
)
expect
(
23
).
assertEqual
(
age
)
expect
(
200
).
assertEqual
(
salary
)
await
rdb
s
tore
.
delete
(
predicates
).
then
((
number
)
=>
{
await
rdb
S
tore
.
delete
(
predicates
).
then
((
number
)
=>
{
expect
(
1
).
assertEqual
(
number
)
}).
then
(
async
()
=>
{
resultSet
=
await
rdbStore
.
query
(
predicates
).
catch
((
err
)
=>
{
expect
(
true
).
assertTrue
();
expect
(
err
!=
null
).
assertTrue
();
})
})
}
catch
(
e
)
{
...
...
@@ -393,6 +394,7 @@ describe('rdbstoreInsertTest', function () {
const
name
=
resultSet
.
getString
(
resultSet
.
getColumnIndex
(
"
name
"
))
const
age
=
resultSet
.
getLong
(
resultSet
.
getColumnIndex
(
"
age
"
))
const
salary
=
resultSet
.
getDouble
(
resultSet
.
getColumnIndex
(
"
salary
"
))
const
blobType
=
resultSet
.
getBlob
(
resultSet
.
getColumnIndex
(
"
blobType
"
))
console
.
info
(
TAG
+
"
id=
"
+
id
+
"
, name=
"
+
name
+
"
, age=
"
+
age
+
"
, salary=
"
+
salary
+
"
, blobType=
"
+
blobType
);
expect
(
1
).
assertEqual
(
id
);
expect
(
"
zhangsan
"
).
assertEqual
(
name
)
...
...
@@ -414,6 +416,7 @@ describe('rdbstoreInsertTest', function () {
const
name
=
resultSet
.
getString
(
resultSet
.
getColumnIndex
(
"
name
"
))
const
age
=
resultSet
.
getLong
(
resultSet
.
getColumnIndex
(
"
age
"
))
const
salary
=
resultSet
.
getDouble
(
resultSet
.
getColumnIndex
(
"
salary
"
))
const
blobType
=
resultSet
.
getBlob
(
resultSet
.
getColumnIndex
(
"
blobType
"
))
console
.
info
(
TAG
+
"
id=
"
+
id
+
"
, name=
"
+
name
+
"
, age=
"
+
age
+
"
, salary=
"
+
salary
+
"
, blobType=
"
+
blobType
);
expect
(
2
).
assertEqual
(
id
);
expect
(
"
lisi
"
).
assertEqual
(
name
)
...
...
@@ -425,7 +428,7 @@ describe('rdbstoreInsertTest', function () {
"
salary
"
:
500
,
"
blobType
"
:
u8
,
}
await
rdb
s
tore
.
insert
(
"
test3
"
,
valueBucket4
)
await
rdb
S
tore
.
insert
(
"
test3
"
,
valueBucket4
)
predicates
=
new
dataRdb
.
RdbPredicates
(
"
test3
"
);
predicates
.
equalTo
(
"
name
"
,
"
zhangmaowen
"
)
resultSet
=
await
rdbStore
.
query
(
predicates
)
...
...
@@ -488,6 +491,7 @@ describe('rdbstoreInsertTest', function () {
const
name
=
resultSet
.
getString
(
resultSet
.
getColumnIndex
(
"
name
"
))
const
age
=
resultSet
.
getLong
(
resultSet
.
getColumnIndex
(
"
age
"
))
const
salary
=
resultSet
.
getDouble
(
resultSet
.
getColumnIndex
(
"
salary
"
))
const
blobType
=
resultSet
.
getBlob
(
resultSet
.
getColumnIndex
(
"
blobType
"
))
console
.
info
(
TAG
+
"
id=
"
+
id
+
"
, name=
"
+
name
+
"
, age=
"
+
age
+
"
, salary=
"
+
salary
+
"
, blobType=
"
+
blobType
);
expect
(
56
).
assertEqual
(
id
);
expect
(
"
zhangsan55
"
).
assertEqual
(
name
)
...
...
@@ -594,11 +598,11 @@ describe('rdbstoreInsertTest', function () {
const
valueBuckets
=
[
valueBucket1
,
valueBucket2
,
valueBucket3
]
try
{
await
rdbStore
.
batchInsert
(
"
test6
"
,
"
valueBuckets
"
).
catch
((
err
)
=>
{
expect
(
true
).
assertTrue
();
expect
(
err
!=
null
).
assertTrue
();
})
}
catch
(
err
){
console
.
info
(
TAG
+
"
Batch insert data error:
"
+
err
)
expect
(
true
).
assertTrue
();
expect
(
err
!=
null
).
assertTrue
();
}
done
()
console
.
info
(
TAG
+
"
************* testRdbStorebatchInsertPromise0006 end *************
"
);
...
...
@@ -614,11 +618,11 @@ describe('rdbstoreInsertTest', function () {
await
rdbStore
.
executeSql
(
CREATE_TABLE_NAME
+
"
7
"
+
CREATE_TABLE
)
try
{
await
rdbStore
.
batchInsert
(
"
test7
"
).
catch
((
err
)
=>
{
expect
(
true
).
assertTrue
();
expect
(
err
!=
null
).
assertTrue
();
})
}
catch
(
err
){
console
.
info
(
TAG
+
"
Batch insert data error:
"
+
err
)
expect
(
true
).
assertTrue
();
expect
(
err
!=
null
).
assertTrue
();
}
done
()
console
.
info
(
TAG
+
"
************* testRdbStorebatchInsertPromise0007 end *************
"
);
...
...
@@ -748,7 +752,7 @@ describe('rdbstoreInsertTest', function () {
expect
(
3
).
assertEqual
(
data
)
let
predicates
=
new
dataRdb
.
RdbPredicates
(
"
testCallback2
"
);
predicates
.
equalTo
(
"
name
"
,
"
lisi
"
)
resultSet
=
await
rdbStore
.
query
(
predicates
)
let
resultSet
=
await
rdbStore
.
query
(
predicates
)
try
{
console
.
info
(
TAG
+
"
resultSet query done
"
);
expect
(
true
).
assertEqual
(
resultSet
.
goToFirstRow
())
...
...
@@ -762,11 +766,11 @@ describe('rdbstoreInsertTest', function () {
expect
(
"
lisi
"
).
assertEqual
(
name
)
expect
(
23
).
assertEqual
(
age
)
expect
(
200
).
assertEqual
(
salary
)
await
rdb
s
tore
.
delete
(
predicates
).
then
((
number
)
=>
{
await
rdb
S
tore
.
delete
(
predicates
).
then
((
number
)
=>
{
expect
(
1
).
assertEqual
(
number
)
}).
then
(
async
()
=>
{
resultSet
=
await
rdbStore
.
query
(
predicates
).
catch
((
err
)
=>
{
expect
(
true
).
assertTrue
();
expect
(
err
!=
null
).
assertTrue
();
})
})
}
catch
(
e
)
{
...
...
@@ -856,7 +860,7 @@ describe('rdbstoreInsertTest', function () {
"
salary
"
:
500
,
"
blobType
"
:
u8
,
}
await
rdb
s
tore
.
insert
(
"
testCallback3
"
,
valueBucket4
)
await
rdb
S
tore
.
insert
(
"
testCallback3
"
,
valueBucket4
)
predicates
=
new
dataRdb
.
RdbPredicates
(
"
testCallback3
"
);
predicates
.
equalTo
(
"
name
"
,
"
zhangmaowen
"
)
resultSet
=
await
rdbStore
.
query
(
predicates
)
...
...
@@ -1034,14 +1038,14 @@ describe('rdbstoreInsertTest', function () {
try
{
await
rdbStore
.
batchInsert
(
"
testCallback6
"
,
"
valueBuckets
"
,
(
err
,
data
)
=>
{
if
(
err
!=
null
){
expect
(
true
).
assertTrue
()
expect
(
err
!=
null
).
assertTrue
()
}
else
{
expect
(
false
).
assertTrue
()
}
})
}
catch
(
err
){
console
.
info
(
TAG
+
"
Batch insert data error:
"
+
err
)
expect
(
true
).
assertTrue
();
expect
(
err
!=
null
).
assertTrue
();
}
})
...
...
@@ -1059,15 +1063,15 @@ describe('rdbstoreInsertTest', function () {
console
.
info
(
TAG
+
"
************* testRdbStorebatchInsertCallback0007 start *************
"
);
try
{
await
rdbStore
.
executeSql
(
CREATE_TABLE_NAME
+
"
Callback7
"
+
CREATE_TABLE
).
then
(
async
()
=>
{
await
rdb
s
tore
.
batchInsert
(
"
testCallback7
"
,
(
err
,
data
)
=>
{
await
rdb
S
tore
.
batchInsert
(
"
testCallback7
"
,
(
err
,
data
)
=>
{
if
(
err
!=
null
){
expect
(
true
).
assertTrue
();
expect
(
err
!=
null
).
assertTrue
();
}
})
})
}
catch
(
err
){
console
.
info
(
TAG
+
"
Batch insert data error:
"
+
err
)
expect
(
true
).
assertTrue
();
expect
(
err
!=
null
).
assertTrue
();
}
done
()
console
.
info
(
TAG
+
"
************* testRdbStorebatchInsertCallback0007 end *************
"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录