Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
cc1014cd
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看板
未验证
提交
cc1014cd
编写于
5月 27, 2022
作者:
O
openharmony_ci
提交者:
Gitee
5月 27, 2022
浏览文件
操作
浏览文件
下载
差异文件
!3329 【Distributeddatamgr】【master】新增用例
Merge pull request !3329 from 梁梁/master
上级
d549162f
23361902
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
130 addition
and
8 deletion
+130
-8
distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbStoreResultSetJsunit.test.js
.../src/main/js/default/test/RdbStoreResultSetJsunit.test.js
+23
-1
distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/StorageCallBackJsunit.test.js
...ap/src/main/js/default/test/StorageCallBackJsunit.test.js
+17
-2
distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/StoragePromiseJsunit.test.js
...hap/src/main/js/default/test/StoragePromiseJsunit.test.js
+90
-5
未找到文件。
distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbStoreResultSetJsunit.test.js
浏览文件 @
cc1014cd
...
...
@@ -21,6 +21,7 @@ const CREATE_TABLE_TEST = 'CREATE TABLE IF NOT EXISTS test (' + 'id INTEGER PRIM
const
STORE_CONFIG
=
{
name
:
'
Resultset.db
'
,
}
const
COLOUNM_NAMES
=
[
"
id
"
,
"
data1
"
,
"
data2
"
,
"
data3
"
,
"
data4
"
];
var
rdbStore
=
undefined
;
describe
(
'
rdbResultSetTest
'
,
function
()
{
...
...
@@ -1746,5 +1747,26 @@ describe('rdbResultSetTest', function () {
}
})
/**
* @tc.name resultSet columnNames test
* @tc.number SUB_DDM_AppDataFWK_JSRDB_ResultSet_0240
* @tc.desc resultSet columnNames test
*/
it
(
'
testcolumnNames0001
'
,
0
,
async
function
(
done
)
{
console
.
log
(
TAG
+
'
************* testcolumnNames0001 start *************
'
);
{
let
predicates
=
await
new
dataRdb
.
RdbPredicates
(
'
test
'
)
let
resultSet
=
await
rdbStore
.
query
(
predicates
)
if
(
COLOUNM_NAMES
==
resultSet
.
columnNames
){
expect
(
1
).
assertEqual
(
0
);
}
else
{
expect
(
0
).
assertEqual
(
0
);
}
resultSet
=
null
;
done
();
console
.
log
(
TAG
+
'
************* testcolumnNames0001 end *************
'
);
}
})
console
.
log
(
TAG
+
'
*************Unit Test End*************
'
);
})
\ No newline at end of file
})
distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/StorageCallBackJsunit.test.js
浏览文件 @
cc1014cd
...
...
@@ -276,7 +276,7 @@ describe('storageTest', function () {
/**
* @tc.name clear、put、get、flush String callback interface test
* @tc.number SUB_DDM_AppDataFWK_JSPreferences_CallBack_01
20
* @tc.number SUB_DDM_AppDataFWK_JSPreferences_CallBack_01
72
* @tc.desc flush String callback interface test
*/
it
(
'
testCallback0172
'
,
0
,
function
(
done
)
{
...
...
@@ -317,4 +317,19 @@ describe('storageTest', function () {
});
});
})
})
\ No newline at end of file
/**
* @tc.name delete callback interface test
* @tc.number SUB_DDM_AppDataFWK_JSPreferences_Storage_0180
* @tc.desc delete callback interface test
*/
it
(
'
testDelete0182
'
,
0
,
async
function
(
done
)
{
mPref
.
putSync
(
KEY_TEST_STRING_ELEMENT
,
"
abc
"
);
expect
(
"
abc
"
).
assertEqual
(
mPref
.
getSync
(
KEY_TEST_STRING_ELEMENT
,
"
default
"
));
mPref
.
delete
(
KEY_TEST_STRING_ELEMENT
,(
err
,
ret
)
=>
{
expect
(
"
default
"
).
assertEqual
(
mPref
.
getSync
(
KEY_TEST_STRING_ELEMENT
,
"
default
"
))
});
done
();
})
})
distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/StoragePromiseJsunit.test.js
浏览文件 @
cc1014cd
...
...
@@ -24,14 +24,24 @@ const KEY_TEST_STRING_ELEMENT = 'key_test_string';
var
mPref
;
describe
(
'
storageTest
'
,
function
()
{
beforeAll
(
function
()
{
beforeAll
(
async
function
()
{
console
.
info
(
'
beforeAll
'
)
mPref
=
storage
.
getStorageSync
(
PATH
);
const
promise
=
storage
.
getStorage
(
PATH
);
promise
.
then
((
Storage
)
=>
{
mPref
=
Storage
;
});
await
promise
;
done
();
})
afterAll
(
function
(
)
{
afterAll
(
async
function
(
done
)
{
console
.
info
(
'
afterAll
'
)
storage
.
deleteStorageSync
(
PATH
);
const
promise
=
storage
.
deleteStorage
(
PATH
);
promise
.
then
(()
=>
{
console
.
log
(
'
Delete Storage finish
'
);
});
await
promise
;
done
();
})
/**
...
...
@@ -364,4 +374,79 @@ describe('storageTest', function () {
await
promise
;
done
();
})
})
\ No newline at end of file
/**
* @tc.name Maximum length of key test
* @tc.number SUB_DDM_AppDataFWK_JSPreferences_Storage_0200
* @tc.desc Maximum length of key test
*/
it
(
'
testMaxLengthofKety0200
'
,
0
,
async
function
(
done
){
mPref
.
clearSync
();
const
promise
=
mPref
.
put
(
MAX_KEY_LENGTH
,
"
value1
"
)
promise
.
then
((
ret
)
=>
{
expect
(
"
value1
"
).
assertEqual
(
mPref
.
getSync
(
MAX_KEY_LENGTH
,
"
defaultvalue
"
))
}).
catch
((
err
)
=>
{
expect
(
null
).
assertFail
();
})
await
promise
;
done
();
})
/**
* @tc.name Maximum length of value test
* @tc.number SUB_DDM_AppDataFWK_JSPreferences_Storage_0210
* @tc.desc Maximum length of value test
*/
it
(
'
testMaxLengthofValue0210
'
,
0
,
async
function
(
done
)
{
mPref
.
clearSync
();
mPref
.
putSync
(
"
test
"
,
"
abc
"
);
const
promise
=
mPref
.
put
(
"
test
"
,
MAX_VALUE_LENGTH
);
promise
.
then
((
ret
)
=>
{
expect
(
MAX_VALUE_LENGTH
).
assertEqual
(
mPref
.
getSync
(
"
test
"
,
"
defaultvalue
"
));
}).
catch
((
err
)
=>
{
expect
(
null
).
assertFail
();
});
await
promise
;
done
();
})
/**
* @tc.name Maximum length of value test
* @tc.number SUB_DDM_AppDataFWK_JSPreferences_Storage_0220
* @tc.desc Maximum length of value test
*/
it
(
'
testMaxLengthofValue0220
'
,
0
,
async
function
(
done
)
{
mPref
.
clearSync
();
mPref
.
putSync
(
"
test
"
,
MAX_VALUE_LENGTH
)
const
promise
=
mPref
.
put
(
"
test
"
,
"
y
"
.
repeat
(
8192
));
promise
.
then
((
ret
)
=>
{
expect
(
MAX_VALUE_LENGTH
).
assertEqual
(
mPref
.
getSync
(
"
test
"
,
"
defaultvalue
"
));
}).
catch
((
err
)
=>
{
expect
(
null
).
assertFail
();
});
await
promise
;
done
();
})
/**
* @tc.name delete promise interface test
* @tc.number SUB_DDM_AppDataFWK_JSPreferences_Storage_0230
* @tc.desc delete promise interface test
*/
it
(
'
testDelete0230
'
,
0
,
async
function
(
done
)
{
mPref
.
putSync
(
KEY_TEST_STRING_ELEMENT
,
"
abc
"
);
expect
(
"
abc
"
).
assertEqual
(
mPref
.
getSync
(
KEY_TEST_STRING_ELEMENT
,
"
default
"
));
const
promise
=
mPref
.
delete
(
KEY_TEST_STRING_ELEMENT
);
promise
.
then
((
ret
)
=>
{
expect
(
"
default
"
).
assertEqual
(
mPref
.
getSync
(
KEY_TEST_STRING_ELEMENT
,
"
default
"
));
}).
catch
((
err
)
=>
{
expect
(
''
).
assertFail
();
});
await
promise
;
done
();
})
})
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录