Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
c788e0d3
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看板
未验证
提交
c788e0d3
编写于
12月 27, 2022
作者:
O
openharmony_ci
提交者:
Gitee
12月 27, 2022
浏览文件
操作
浏览文件
下载
差异文件
!6977 【Distributeddatamgr】【master】分布式对象save以及revokeSave用例优化修改
Merge pull request !6977 from wangxiaomeng/master
上级
7d0094d6
acf245cc
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
161 addition
and
85 deletion
+161
-85
distributeddatamgr/dataObjectjstest/hap/src/main/js/test/ObjectStoreJsunit.test.js
...jectjstest/hap/src/main/js/test/ObjectStoreJsunit.test.js
+127
-67
distributeddatamgr/dataObjectjstest/hap/src/main/js/test/ObjectStoreJsunitV9.test.js
...ctjstest/hap/src/main/js/test/ObjectStoreJsunitV9.test.js
+34
-18
未找到文件。
distributeddatamgr/dataObjectjstest/hap/src/main/js/test/ObjectStoreJsunit.test.js
浏览文件 @
c788e0d3
/*
* Copyright (C) 202
1-202
2 Huawei Device Co., Ltd.
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
@@ -336,7 +336,6 @@ export default function objectStoreTest() {
objectTest
.
name
=
"
jack1
"
;
objectTest
.
age
=
19
;
objectTest
.
isVis
=
true
;
expect
(
objectTest
.
name
==
"
jack1
"
).
assertEqual
(
true
);
expect
(
objectTest
.
age
==
19
).
assertEqual
(
true
);
console
.
info
(
TAG
+
"
set data success!
"
);
}
else
{
...
...
@@ -717,74 +716,135 @@ export default function objectStoreTest() {
console
.
log
(
TAG
+
"
************* testPerformance001 end *************
"
);
complexObject
.
setSessionId
(
""
);
})
/**
* @tc.name: testSave001
* @tc.desc: Save object <Promise>
* @tc.number: SUB_DDM_AppDataFWK_Object_Api_Save_001
*/
it
(
'
testSave001
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
"
************* testSave001 start *************
"
);
var
gObject
=
distributedObject
.
createDistributedObject
({
name
:
"
Amy
"
,
age
:
18
,
isVis
:
false
});
gObject
.
setSessionId
(
"
tmpsession01
"
);
let
result
=
await
gObject
.
save
(
"
local
"
);
done
();
expect
(
result
.
sessionId
==
"
tmpsession01
"
).
assertEqual
(
true
);
expect
(
result
.
version
==
gObject
.
__version
).
assertEqual
(
true
);
expect
(
result
.
deviceId
==
"
local
"
).
assertEqual
(
true
);
gObject
.
setSessionId
(
""
);
gObject
.
name
=
undefined
;
gObject
.
age
=
undefined
;
gObject
.
isVis
=
undefined
;
gObject
.
setSessionId
(
"
tmpsession01
"
);
expect
(
gObject
.
name
==
"
Amy
"
).
assertEqual
(
true
);
expect
(
gObject
.
age
==
18
).
assertEqual
(
true
);
expect
(
gObject
.
isVis
==
false
).
assertEqual
(
true
);
done
();
console
.
info
(
TAG
+
"
************* testSave001 end *************
"
);
})
/**
* @tc.name: testSave001
* @tc.desc: Save object <Promise>
* @tc.number: SUB_DDM_AppDataFWK_Object_Api_Save_001
*/
it
(
'
testSave001
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
"
************* testSave001 start *************
"
);
/**
* @tc.name: testSave002
* @tc.desc: Save object
* @tc.number: SUB_DDM_AppDataFWK_Object_Api_Save_002
*/
it
(
'
testSave002
'
,
0
,
function
(
done
)
{
console
.
info
(
TAG
+
"
************* testSave002 start *************
"
);
var
objectTest
=
distributedObject
.
createDistributedObject
({
name
:
"
Eva
"
,
age
:
20
,
isVis
:
false
});
objectTest
.
setSessionId
(
"
tmpsession02
"
);
done
();
console
.
info
(
TAG
+
"
************* testSave002 end *************
"
);
var
gObject
=
distributedObject
.
createDistributedObject
({
name
:
"
Amy
"
,
age
:
18
,
isVis
:
false
});
gObject
.
setSessionId
(
"
tmpsession01
"
);
let
result
=
await
gObject
.
save
(
"
local
"
);
done
();
expect
(
result
.
sessionId
==
"
tmpsession01
"
).
assertEqual
(
true
);
expect
(
result
.
version
==
gObject
.
__version
).
assertEqual
(
true
);
expect
(
result
.
deviceId
==
"
local
"
).
assertEqual
(
true
);
gObject
.
setSessionId
(
""
);
gObject
.
name
=
undefined
;
gObject
.
age
=
undefined
;
gObject
.
isVis
=
undefined
;
gObject
.
setSessionId
(
"
tmpsession01
"
);
expect
(
gObject
.
name
==
"
Amy
"
).
assertEqual
(
true
);
expect
(
gObject
.
age
==
18
).
assertEqual
(
true
);
expect
(
gObject
.
isVis
==
false
).
assertEqual
(
true
);
gObject
.
setSessionId
(
""
);
done
();
console
.
info
(
TAG
+
"
************* testSave001 end *************
"
);
})
/**
* @tc.name: testSave002
* @tc.desc: Save object
* @tc.number: SUB_DDM_AppDataFWK_Object_Api_Save_002
*/
it
(
'
testSave002
'
,
0
,
function
(
done
)
{
console
.
info
(
TAG
+
"
************* testSave002 start *************
"
);
var
gObject
=
distributedObject
.
createDistributedObject
({
name
:
"
Amy
"
,
age
:
18
,
isVis
:
false
});
if
(
gObject
!=
undefined
&&
gObject
!=
null
)
{
gObject
.
setSessionId
(
"
tmpsession02
"
);
console
.
info
(
TAG
+
"
testSave002 joinSession tmpsession02 success:
"
+
gObject
.
__sessionId
);
}
gObject
.
save
(
"
local
"
,
(
result
)
=>
{
console
.
info
(
"
save callback
"
);
expect
(
result
.
sessionId
==
"
tmpsession02
"
).
assertEqual
(
true
);
expect
(
result
.
version
==
gObject
.
__version
).
assertEqual
(
true
);
expect
(
result
.
deviceId
==
"
local
"
).
assertEqual
(
true
);
console
.
info
(
"
save end
"
);
console
.
info
(
"
save success
"
);
gObject
.
setSessionId
(
""
);
gObject
.
name
=
undefined
;
gObject
.
age
=
undefined
;
gObject
.
isVis
=
undefined
;
console
.
info
(
"
save setSessionId
"
);
gObject
.
setSessionId
(
"
tmpsession02
"
);
expect
(
gObject
.
name
==
"
Amy
"
).
assertEqual
(
true
);
expect
(
gObject
.
age
==
18
).
assertEqual
(
true
);
expect
(
gObject
.
isVis
==
false
).
assertEqual
(
true
);
})
/**
* @tc.name: testRevokeSave001
* @tc.desc: Revoke save object <Promise>
* @tc.number: SUB_DDM_AppDataFWK_Object_Api_RevokeSave_001
*/
it
(
'
testRevokeSave001
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
"
************* testRevokeSave001 start *************
"
);
var
gObject
=
distributedObject
.
createDistributedObject
({
name
:
"
Amy
"
,
age
:
18
,
isVis
:
false
});
gObject
.
setSessionId
(
"
tmpsession03
"
);
done
();
console
.
info
(
TAG
+
"
************* testRevokeSave001 end *************
"
);
})
gObject
.
setSessionId
(
""
);
});
done
();
console
.
info
(
TAG
+
"
************* testSave002 end *************
"
);
})
/**
* @tc.name: testRevokeSave001
* @tc.desc: Revoke save object <Promise>
* @tc.number: SUB_DDM_AppDataFWK_Object_Api_RevokeSave_001
*/
it
(
'
testRevokeSave001
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
"
************* testRevokeSave001 start *************
"
);
var
RObject
=
distributedObject
.
createDistributedObject
({
name
:
"
Amy
"
,
age
:
18
,
isVis
:
false
});
RObject
.
setSessionId
(
"
tmpsession03
"
);
expect
(
"
tmpsession03
"
==
RObject
.
__sessionId
).
assertEqual
(
true
);
let
result
=
await
RObject
.
save
(
"
local
"
);
done
();
expect
(
result
.
sessionId
==
"
tmpsession03
"
).
assertEqual
(
true
);
expect
(
result
.
version
==
RObject
.
__version
).
assertEqual
(
true
);
expect
(
result
.
deviceId
==
"
local
"
).
assertEqual
(
true
);
result
=
await
RObject
.
revokeSave
();
RObject
.
setSessionId
(
""
);
RObject
.
name
=
undefined
;
RObject
.
age
=
undefined
;
RObject
.
isVis
=
undefined
;
RObject
.
setSessionId
(
"
tmpsession03
"
);
expect
(
RObject
.
name
==
"
Amy
"
).
assertEqual
(
false
);
expect
(
RObject
.
age
==
18
).
assertEqual
(
false
);
expect
(
RObject
.
isVis
==
false
).
assertEqual
(
false
);
RObject
.
setSessionId
(
""
);
done
();
console
.
info
(
TAG
+
"
************* testRevokeSave001 end *************
"
);
})
/**
* @tc.name: testRevokeSave002
* @tc.desc: Revoke save object <Callback>
* @tc.number: SUB_DDM_AppDataFWK_Object_Api_RevokeSave_002
*/
it
(
'
testRevokeSave002
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
"
************* testRevokeSave002 start *************
"
);
var
gObject
=
distributedObject
.
createDistributedObject
({
name
:
"
Amy
"
,
age
:
18
,
isVis
:
false
});
gObject
.
setSessionId
(
"
tmpsession04
"
);
done
();
console
.
info
(
TAG
+
"
************* testRevokeSave002 end *************
"
);
})
/**
* @tc.name: testRevokeSave002
* @tc.desc: Revoke save object <Callback>
* @tc.number: SUB_DDM_AppDataFWK_Object_Api_RevokeSave_002
*/
it
(
'
testRevokeSave002
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
"
************* testRevokeSave002 start *************
"
);
var
RObject
=
distributedObject
.
createDistributedObject
({
name
:
"
Amy
"
,
age
:
18
,
isVis
:
false
});
RObject
.
setSessionId
(
"
tmpsession04
"
);
expect
(
"
tmpsession04
"
==
RObject
.
__sessionId
).
assertEqual
(
true
);
let
result
=
await
RObject
.
save
(
"
local
"
);
done
();
RObject
.
revokeSave
((
response
)
=>
{
console
.
info
(
TAG
+
"
revokeSave callback
"
);
console
.
info
(
"
revokeSave sessionId:
"
+
response
.
sessionId
);
console
.
info
(
TAG
+
"
revokeSave end
"
);
RObject
.
setSessionId
(
""
);
RObject
.
name
=
undefined
;
RObject
.
age
=
undefined
;
RObject
.
isVis
=
undefined
;
RObject
.
setSessionId
(
"
tmpsession04
"
);
expect
(
RObject
.
name
==
"
Amy
"
).
assertEqual
(
false
);
expect
(
RObject
.
age
==
18
).
assertEqual
(
false
);
expect
(
RObject
.
isVis
==
false
).
assertEqual
(
false
);
RObject
.
setSessionId
(
""
);
});
done
();
console
.
info
(
TAG
+
"
************* testRevokeSave002 end *************
"
);
})
console
.
info
(
TAG
+
"
*************Unit Test End*************
"
);
})
}
\ No newline at end of file
distributeddatamgr/dataObjectjstest/hap/src/main/js/test/ObjectStoreJsunitV9.test.js
浏览文件 @
c788e0d3
...
...
@@ -12,12 +12,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
{
afterAll
,
afterEach
,
beforeAll
,
beforeEach
,
describe
,
expect
,
it
}
from
'
deccjsunit/index
'
;
import
{
afterAll
,
afterEach
,
beforeAll
,
beforeEach
,
describe
,
expect
,
it
}
from
'
@ohos/hypium
'
;
import
distributedObject
from
'
@ohos.data.distributedDataObject
'
;
import
abilityAccessCtrl
from
'
@ohos.abilityAccessCtrl
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
import
bundle
from
'
@ohos.bundle
'
;
var
context
;
let
context
;
const
TAG
=
"
OBJECTSTORE_TEST
"
;
function
changeCallback
(
sessionId
,
changeData
)
{
console
.
info
(
"
changeCallback start
"
);
...
...
@@ -83,7 +83,7 @@ describe('objectStoreTest', function () {
* @tc.number: SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_001
* @tc.type: FUNC
*/
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_001
'
,
0
,
function
()
{
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_001
'
,
0
,
function
(
done
)
{
console
.
log
(
TAG
+
"
************* SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_001 start *************
"
);
var
g_object
;
try
{
...
...
@@ -112,6 +112,7 @@ describe('objectStoreTest', function () {
g_object
.
setSessionId
((
error
,
data
)
=>
{
console
.
info
(
TAG
+
error
+
"
,
"
+
data
);
});
done
();
})
/**
...
...
@@ -120,7 +121,7 @@ describe('objectStoreTest', function () {
* @tc.type: FUNC
* @tc.number: SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_002
*/
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_002
'
,
0
,
function
()
{
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_002
'
,
0
,
function
(
done
)
{
console
.
log
(
TAG
+
"
************* SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_002 start *************
"
);
var
g_object
=
distributedObject
.
create
(
context
,
{
name
:
"
Amy
"
,
age
:
18
,
isVis
:
false
});
expect
(
g_object
==
undefined
).
assertEqual
(
false
);
...
...
@@ -139,6 +140,7 @@ describe('objectStoreTest', function () {
g_object
.
setSessionId
((
error
,
data
)
=>
{
console
.
info
(
TAG
+
error
+
"
,
"
+
data
);
});
done
();
})
/**
...
...
@@ -147,7 +149,7 @@ describe('objectStoreTest', function () {
* @tc.type: FUNC
* @tc.number: SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_003
*/
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_003
'
,
0
,
function
()
{
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_003
'
,
0
,
function
(
done
)
{
console
.
log
(
TAG
+
"
************* SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_003 start *************
"
);
var
g_object
=
distributedObject
.
create
(
context
,
{
name
:
"
Amy
"
,
age
:
18
,
isVis
:
false
});
expect
(
g_object
==
undefined
).
assertEqual
(
false
);
...
...
@@ -163,6 +165,7 @@ describe('objectStoreTest', function () {
g_object
.
setSessionId
((
error
,
data
)
=>
{
console
.
info
(
TAG
+
error
+
"
,
"
+
data
);
});
done
();
})
/**
...
...
@@ -171,7 +174,7 @@ describe('objectStoreTest', function () {
* @tc.type: FUNC
* @tc.number: SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_004
*/
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_004
'
,
0
,
function
()
{
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_004
'
,
0
,
function
(
done
)
{
console
.
log
(
TAG
+
"
************* SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_004 start *************
"
);
var
g_object
=
distributedObject
.
create
(
context
,
{
name
:
"
Amy
"
,
age
:
18
,
isVis
:
false
});
expect
(
g_object
==
undefined
).
assertEqual
(
false
);
...
...
@@ -185,6 +188,7 @@ describe('objectStoreTest', function () {
g_object
.
setSessionId
((
error
,
data
)
=>
{
console
.
info
(
TAG
+
error
+
"
,
"
+
data
);
});
done
();
})
/**
...
...
@@ -193,7 +197,7 @@ describe('objectStoreTest', function () {
* @tc.type: FUNC
* @tc.number: SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_005
*/
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_005
'
,
0
,
function
()
{
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_005
'
,
0
,
function
(
done
)
{
console
.
log
(
TAG
+
"
************* SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_005 start *************
"
);
var
g_object
=
distributedObject
.
create
(
context
,
{
name
:
"
Amy
"
,
age
:
18
,
isVis
:
false
});
expect
(
g_object
==
undefined
).
assertEqual
(
false
);
...
...
@@ -218,6 +222,7 @@ describe('objectStoreTest', function () {
g_object
.
setSessionId
(
""
,
(
error
,
data
)
=>
{
console
.
info
(
TAG
+
error
+
"
,
"
+
data
);
});
done
();
})
...
...
@@ -227,7 +232,7 @@ describe('objectStoreTest', function () {
* @tc.type: FUNC
* @tc.number: SUB_DDM_AppDataFWK_Object_Api9_On_001
*/
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_On_001
'
,
0
,
function
()
{
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_On_001
'
,
0
,
function
(
done
)
{
console
.
log
(
TAG
+
"
************* SUB_DDM_AppDataFWK_Object_Api9_On_001 start *************
"
);
var
g_object
=
distributedObject
.
create
(
context
,
{
name
:
"
Amy
"
,
age
:
18
,
isVis
:
false
});
expect
(
g_object
==
undefined
).
assertEqual
(
false
);
...
...
@@ -263,6 +268,7 @@ describe('objectStoreTest', function () {
g_object
.
setSessionId
(
""
,
(
error
,
data
)
=>
{
console
.
info
(
TAG
+
error
+
"
,
"
+
data
);
});
done
();
})
/**
...
...
@@ -271,7 +277,7 @@ describe('objectStoreTest', function () {
* @tc.type: FUNC
* @tc.number: SUB_DDM_AppDataFWK_Object_Api9_On_002
*/
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_On_002
'
,
0
,
function
()
{
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_On_002
'
,
0
,
function
(
done
)
{
console
.
log
(
TAG
+
"
************* SUB_DDM_AppDataFWK_Object_Api9_On_002 start *************
"
);
var
g_object
=
distributedObject
.
create
(
context
,
{
name
:
"
Amy
"
,
age
:
18
,
isVis
:
false
});
expect
(
g_object
==
undefined
).
assertEqual
(
false
);
...
...
@@ -298,6 +304,7 @@ describe('objectStoreTest', function () {
g_object
.
setSessionId
(
""
,
(
error
,
data
)
=>
{
console
.
info
(
TAG
+
error
+
"
,
"
+
data
);
});
done
();
})
/**
...
...
@@ -306,7 +313,7 @@ describe('objectStoreTest', function () {
* @tc.type: FUNC
* @tc.number: SUB_DDM_AppDataFWK_Object_Api9_On_003
*/
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_On_003
'
,
0
,
function
()
{
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_On_003
'
,
0
,
function
(
done
)
{
console
.
log
(
TAG
+
"
************* SUB_DDM_AppDataFWK_Object_Api9_On_003 start *************
"
);
var
g_object
=
distributedObject
.
create
(
context
,
{
name
:
"
Amy
"
,
age
:
18
,
isVis
:
false
});
expect
(
g_object
==
undefined
).
assertEqual
(
false
);
...
...
@@ -334,6 +341,7 @@ describe('objectStoreTest', function () {
g_object
.
setSessionId
(
""
,
(
error
,
data
)
=>
{
console
.
info
(
TAG
+
error
+
"
,
"
+
data
);
});
done
();
})
/**
...
...
@@ -342,7 +350,7 @@ describe('objectStoreTest', function () {
* @tc.type: FUNC
* @tc.number: SUB_DDM_AppDataFWK_Object_Api9_Off_001
*/
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_Off_001
'
,
0
,
function
()
{
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_Off_001
'
,
0
,
function
(
done
)
{
console
.
log
(
TAG
+
"
************* SUB_DDM_AppDataFWK_Object_Api9_Off_001 start *************
"
);
var
g_object
=
distributedObject
.
create
(
context
,
{
name
:
"
Amy
"
,
age
:
18
,
isVis
:
false
});
expect
(
g_object
==
undefined
).
assertEqual
(
false
);
...
...
@@ -381,6 +389,7 @@ describe('objectStoreTest', function () {
g_object
.
setSessionId
((
error
,
data
)
=>
{
console
.
info
(
TAG
+
error
+
"
,
"
+
data
);
});
done
();
})
/**
...
...
@@ -389,7 +398,7 @@ describe('objectStoreTest', function () {
* @tc.type: FUNC
* @tc.number: SUB_DDM_AppDataFWK_Object_Api9_Off_002
*/
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_Off_002
'
,
0
,
function
()
{
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_Off_002
'
,
0
,
function
(
done
)
{
console
.
log
(
TAG
+
"
************* SUB_DDM_AppDataFWK_Object_Api9_Off_002 start *************
"
);
var
g_object
=
distributedObject
.
create
(
context
,
{
name
:
"
Amy
"
,
age
:
18
,
isVis
:
false
});
expect
(
g_object
==
undefined
).
assertEqual
(
false
);
...
...
@@ -413,6 +422,7 @@ describe('objectStoreTest', function () {
}).
catch
((
error
)
=>
{
console
.
info
(
TAG
+
error
.
code
+
error
.
message
);
});
done
();
})
/**
...
...
@@ -421,7 +431,7 @@ describe('objectStoreTest', function () {
* @tc.type: FUNC
* @tc.number: SUB_DDM_AppDataFWK_Object_Api9_OnStatus_001
*/
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_OnStatus_001
'
,
0
,
function
()
{
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_OnStatus_001
'
,
0
,
function
(
done
)
{
console
.
log
(
TAG
+
"
************* SUB_DDM_AppDataFWK_Object_Api9_OnStatus_001 start *************
"
);
console
.
log
(
TAG
+
"
start watch status
"
);
var
g_object
=
distributedObject
.
create
(
context
,
{
name
:
"
Amy
"
,
age
:
18
,
isVis
:
false
});
...
...
@@ -440,6 +450,7 @@ describe('objectStoreTest', function () {
}).
catch
((
error
)
=>
{
console
.
info
(
TAG
+
error
.
code
+
error
.
message
);
});
done
();
})
/**
...
...
@@ -448,7 +459,7 @@ describe('objectStoreTest', function () {
* @tc.type: FUNC
* @tc.number: SUB_DDM_AppDataFWK_Object_Api9_OnStatus_002
*/
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_OnStatus_002
'
,
0
,
function
()
{
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_OnStatus_002
'
,
0
,
function
(
done
)
{
console
.
log
(
TAG
+
"
************* SUB_DDM_AppDataFWK_Object_Api9_OnStatus_002 start *************
"
);
console
.
log
(
TAG
+
"
start watch status
"
);
var
g_object
=
distributedObject
.
create
(
context
,
{
name
:
"
Amy
"
,
age
:
18
,
isVis
:
false
});
...
...
@@ -465,6 +476,7 @@ describe('objectStoreTest', function () {
}).
catch
((
error
)
=>
{
console
.
info
(
TAG
+
error
.
code
+
error
.
message
);
});
done
();
})
/**
...
...
@@ -473,7 +485,7 @@ describe('objectStoreTest', function () {
* @tc.type: FUNC
* @tc.number: SUB_DDM_AppDataFWK_Object_Api9_Save_001
*/
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_Save_001
'
,
0
,
async
function
()
{
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_Save_001
'
,
0
,
async
function
(
done
)
{
console
.
log
(
TAG
+
"
************* SUB_DDM_AppDataFWK_Object_Api9_Save_001 start *************
"
);
var
g_object
=
distributedObject
.
create
(
context
,
{
name
:
"
Amy
"
,
age
:
18
,
isVis
:
false
});
expect
(
g_object
==
undefined
).
assertEqual
(
false
);
...
...
@@ -511,6 +523,7 @@ describe('objectStoreTest', function () {
}).
catch
((
error
)
=>
{
console
.
info
(
TAG
+
error
.
code
+
error
.
message
);
});
done
();
})
/**
...
...
@@ -519,7 +532,7 @@ describe('objectStoreTest', function () {
* @tc.type: FUNC
* @tc.number: SUB_DDM_AppDataFWK_Object_Api9_Save_002
*/
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_Save_002
'
,
0
,
async
function
()
{
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_Save_002
'
,
0
,
async
function
(
done
)
{
console
.
log
(
TAG
+
"
************* SUB_DDM_AppDataFWK_Object_Api9_Save_002 start *************
"
);
var
g_object
=
distributedObject
.
create
(
context
,
{
name
:
"
Amy
"
,
age
:
18
,
isVis
:
false
});
expect
(
g_object
==
undefined
).
assertEqual
(
false
);
...
...
@@ -559,6 +572,7 @@ describe('objectStoreTest', function () {
}).
catch
((
error
)
=>
{
console
.
info
(
TAG
+
error
.
code
+
error
.
message
);
});
done
();
})
/**
...
...
@@ -567,7 +581,7 @@ describe('objectStoreTest', function () {
* @tc.type: FUNC
* @tc.number: SUB_DDM_AppDataFWK_Object_Api9_RevokeSave_001
*/
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_RevokeSave_001
'
,
0
,
async
function
()
{
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_RevokeSave_001
'
,
0
,
async
function
(
done
)
{
console
.
log
(
TAG
+
"
************* SUB_DDM_AppDataFWK_Object_Api9_RevokeSave_001 start *************
"
);
var
g_object
=
distributedObject
.
create
(
context
,
{
name
:
"
Amy
"
,
age
:
18
,
isVis
:
false
});
expect
(
g_object
==
undefined
).
assertEqual
(
false
);
...
...
@@ -605,6 +619,7 @@ describe('objectStoreTest', function () {
g_object
.
setSessionId
(
""
,
(
error
,
data
)
=>
{
console
.
info
(
TAG
+
error
+
"
,
"
+
data
);
});
done
();
})
/**
...
...
@@ -613,7 +628,7 @@ describe('objectStoreTest', function () {
* @tc.type: FUNC
* @tc.number: SUB_DDM_AppDataFWK_Object_Api9_RevokeSave_002
*/
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_RevokeSave_002
'
,
0
,
async
function
()
{
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_RevokeSave_002
'
,
0
,
async
function
(
done
)
{
console
.
log
(
TAG
+
"
************* SUB_DDM_AppDataFWK_Object_Api9_RevokeSave_002 start *************
"
);
var
g_object
=
distributedObject
.
create
(
context
,
{
name
:
"
Amy
"
,
age
:
18
,
isVis
:
false
});
expect
(
g_object
==
undefined
).
assertEqual
(
false
);
...
...
@@ -642,6 +657,7 @@ describe('objectStoreTest', function () {
g_object
.
setSessionId
(
""
,
(
error
,
data
)
=>
{
console
.
info
(
TAG
+
error
+
"
,
"
+
data
);
});
done
();
})
console
.
log
(
TAG
+
"
*************Unit Test End*************
"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录