提交 e46fd0f7 编写于 作者: Y yangzhouwei

add distributeddatamgr js unit test.

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