提交 e46fd0f7 编写于 作者: Y yangzhouwei

add distributeddatamgr js unit test.

Signed-off-by: Nyangzhouwei <yangzhouwei1@huawei.com>
上级 f11e1701
{
"app": {
"bundleName": "com.example.datamanagertest",
"bundleName": "ohos.acts.distributeddatamgr",
"vendor": "example",
"version": {
"code": 2000000,
"name": "2.0.0"
"code": 1000000,
"name": "1.0.0"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.datamanagertest",
"package": "ohos.acts.distributeddatamgr",
"name": ".MyApplication",
"mainAbility": "com.example.datamanagertest.MainAbility",
"mainAbility": "ohos.acts.distributeddatamgr.MainAbility",
"deviceType": [
"phone"
],
......@@ -33,7 +33,7 @@
]
}
],
"name": "com.example.datamanagertest.MainAbility",
"name": "ohos.acts.distributeddatamgr.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
......
......@@ -25,12 +25,15 @@ const VALUE_TEST_FLOAT_ELEMENT = 4321.12;
const VALUE_TEST_BOOLEAN_ELEMENT = true;
const VALUE_TEST_STRING_ELEMENT = 'value-string-002';
const SINGLE_VERSION = 1;
const SECURITY_LEVEL = 3;
var kvManager = null;
var kvStore = null;
describe('KvStoreTest', function () {
const config = {
bundleName : 'com.example.datamanagertest',
bundleName : 'ohos.acts.distributeddatamgr',
userInfo : {
userId : '0',
userType : 0
......@@ -42,9 +45,9 @@ describe('KvStoreTest', function () {
encrypt : false,
backup : false,
autoSync : true,
kvStoreType : 1,
kvStoreType : SINGLE_VERSION,
schema : '',
securityLevel : 3,
securityLevel : SECURITY_LEVEL,
}
it('testCreateKVManager102', 0, async function (done) {
......@@ -272,7 +275,7 @@ describe('KvStoreTest', function () {
done();
})
it('testOnChange101', 0, async function (done) {
it('testOnChange100', 0, async function (done) {
try {
kvStore.on('dataChange', 0, function (data) {
expect(true).assertEqual(data !=null);
......
......@@ -24,13 +24,15 @@ const VALUE_TEST_INT_ELEMENT = 123;
const VALUE_TEST_FLOAT_ELEMENT = 321.12;
const VALUE_TEST_BOOLEAN_ELEMENT = true;
const VALUE_TEST_STRING_ELEMENT = 'value-string-001';
const SINGLE_VERSION = 1;
const SECURITY_LEVEL = 3;
var kvManager = null;
var kvStore = null;
describe('KvStoreTest', function () {
const config = {
bundleName : 'com.example.datamanagertest',
bundleName : 'ohos.acts.distributeddatamgr',
userInfo : {
userId : '0',
userType : 0
......@@ -42,9 +44,9 @@ describe('KvStoreTest', function () {
encrypt : false,
backup : false,
autoSync : true,
kvStoreType : 1,
kvStoreType : SINGLE_VERSION,
schema : '',
securityLevel : 3,
securityLevel : SECURITY_LEVEL,
}
it('testCreateKVManager001', 0, async function (done) {
......
......@@ -2,7 +2,7 @@
"string": [
{
"name": "app_name",
"value": "MyApplication"
"value": "DistributeddatamgrJsTest"
},
{
"name": "mainability_description",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册