Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
74c034a3
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看板
提交
74c034a3
编写于
11月 30, 2021
作者:
O
openharmony_ci
提交者:
Gitee
11月 30, 2021
浏览文件
操作
浏览文件
下载
差异文件
!1227 distributeddatamgrjstest add enum type test cases
Merge pull request !1227 from wangkun/master
上级
a5bb0bba
724bde25
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
188 addition
and
1 deletion
+188
-1
distributeddatamgr/distributeddatamgrjstest/hap/src/main/js/default/test/List.test.js
...eddatamgrjstest/hap/src/main/js/default/test/List.test.js
+2
-1
distributeddatamgr/distributeddatamgrjstest/hap/src/main/js/default/test/SingleKvStoreEnumJsunit.test.js
.../src/main/js/default/test/SingleKvStoreEnumJsunit.test.js
+186
-0
未找到文件。
distributeddatamgr/distributeddatamgrjstest/hap/src/main/js/default/test/List.test.js
浏览文件 @
74c034a3
...
@@ -14,3 +14,4 @@
...
@@ -14,3 +14,4 @@
*/
*/
require
(
'
./SingleKvStorePromiseJsunit.test.js
'
)
require
(
'
./SingleKvStorePromiseJsunit.test.js
'
)
require
(
'
./SingleKvStoreCallbackJsunit.test.js
'
)
require
(
'
./SingleKvStoreCallbackJsunit.test.js
'
)
require
(
'
./SingleKvStoreEnumJsunit.test.js
'
)
\ No newline at end of file
distributeddatamgr/distributeddatamgrjstest/hap/src/main/js/default/test/SingleKvStoreEnumJsunit.test.js
0 → 100644
浏览文件 @
74c034a3
/*
* Copyright (c) 2021 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
import
factory
from
'
@ohos.data.distributedData
'
;
describe
(
'
KvStoreEnumTest
'
,
function
()
{
it
(
'
enum_usertype_test_same_user_id
'
,
0
,
function
()
{
var
sameUserId
=
factory
.
UserType
.
SAME_USER_ID
;
console
.
info
(
'
sameUserId =
'
+
sameUserId
);
expect
(
sameUserId
==
0
).
assertTrue
()
})
it
(
'
enum_constants_test_max_key_length
'
,
0
,
function
()
{
var
maxKeyLength
=
factory
.
Constants
.
MAX_KEY_LENGTH
;
console
.
info
(
'
maxKeyLength =
'
+
maxKeyLength
);
expect
(
maxKeyLength
==
1024
).
assertTrue
()
})
it
(
'
enum_constants_test_max_value_length
'
,
0
,
function
()
{
var
maxValueLength
=
factory
.
Constants
.
MAX_VALUE_LENGTH
;
console
.
info
(
'
maxValueLength =
'
+
maxValueLength
);
expect
(
maxValueLength
==
4194303
).
assertTrue
()
})
it
(
'
enum_constants_test_max_key_length_device
'
,
0
,
function
()
{
var
maxKeyLengthDevice
=
factory
.
Constants
.
MAX_KEY_LENGTH_DEVICE
;
console
.
info
(
'
maxKeyLengthDevice =
'
+
maxKeyLengthDevice
);
expect
(
maxKeyLengthDevice
==
896
).
assertTrue
()
})
it
(
'
enum_constants_test_max_store_id_length
'
,
0
,
function
()
{
var
maxStoreIdLength
=
factory
.
Constants
.
MAX_STORE_ID_LENGTH
;
console
.
info
(
'
maxStoreIdLength =
'
+
maxStoreIdLength
);
expect
(
maxStoreIdLength
==
128
).
assertTrue
()
})
it
(
'
enum_constants_test_max_query_length
'
,
0
,
function
()
{
var
maxQueryLength
=
factory
.
Constants
.
MAX_QUERY_LENGTH
;
console
.
info
(
'
maxQueryLength =
'
+
maxQueryLength
);
expect
(
maxQueryLength
==
512000
).
assertTrue
()
})
it
(
'
enum_constants_test_max_batch_size
'
,
0
,
function
()
{
var
maxBatchSize
=
factory
.
Constants
.
MAX_BATCH_SIZE
;
console
.
info
(
'
maxBatchSize =
'
+
maxBatchSize
);
expect
(
maxBatchSize
==
128
).
assertTrue
()
})
it
(
'
enum_valuetype_test_string
'
,
0
,
function
()
{
var
string
=
factory
.
ValueType
.
STRING
;
console
.
info
(
'
string =
'
+
string
);
expect
(
string
==
0
).
assertTrue
()
})
it
(
'
enum_valuetype_test_integer
'
,
0
,
function
()
{
var
integer
=
factory
.
ValueType
.
INTEGER
;
console
.
info
(
'
integer =
'
+
integer
);
expect
(
integer
==
1
).
assertTrue
()
})
it
(
'
enum_valuetype_test_float
'
,
0
,
function
()
{
var
float
=
factory
.
ValueType
.
FLOAT
;
console
.
info
(
'
float =
'
+
float
);
expect
(
float
==
2
).
assertTrue
()
})
it
(
'
enum_valuetype_test_byte_array
'
,
0
,
function
()
{
var
byteArray
=
factory
.
ValueType
.
BYTE_ARRAY
;
console
.
info
(
'
byteArray =
'
+
byteArray
);
expect
(
byteArray
==
3
).
assertTrue
()
})
it
(
'
enum_valuetype_test_boolean
'
,
0
,
function
()
{
var
boolean
=
factory
.
ValueType
.
BOOLEAN
;
console
.
info
(
'
boolean =
'
+
boolean
);
expect
(
boolean
==
4
).
assertTrue
()
})
it
(
'
enum_valuetype_test_double
'
,
0
,
function
()
{
var
double
=
factory
.
ValueType
.
DOUBLE
;
console
.
info
(
'
double =
'
+
double
);
expect
(
double
==
5
).
assertTrue
()
})
it
(
'
enum_syncmode_test_pull_only
'
,
0
,
function
()
{
var
pullonly
=
factory
.
SyncMode
.
PULL_ONLY
;
console
.
info
(
'
pullonly =
'
+
pullonly
);
expect
(
pullonly
==
0
).
assertTrue
()
})
it
(
'
enum_syncmode_test_push_only
'
,
0
,
function
()
{
var
pushonly
=
factory
.
SyncMode
.
PUSH_ONLY
;
console
.
info
(
'
pushonly =
'
+
pushonly
);
expect
(
pushonly
==
1
).
assertTrue
()
})
it
(
'
enum_syncmode_test_push_pull
'
,
0
,
function
()
{
var
pushpull
=
factory
.
SyncMode
.
PUSH_PULL
;
console
.
info
(
'
pushpull =
'
+
pushpull
);
expect
(
pushpull
==
2
).
assertTrue
()
})
it
(
'
enum_subscribetype_test_subscribe_type_local
'
,
0
,
function
()
{
var
local
=
factory
.
SubscribeType
.
SUBSCRIBE_TYPE_LOCAL
;
console
.
info
(
'
local =
'
+
local
);
expect
(
local
==
0
).
assertTrue
()
})
it
(
'
enum_subscribetype_test_subscribe_type_remote
'
,
0
,
function
()
{
var
remote
=
factory
.
SubscribeType
.
SUBSCRIBE_TYPE_REMOTE
;
console
.
info
(
'
remote =
'
+
remote
);
expect
(
remote
==
1
).
assertTrue
()
})
it
(
'
enum_subscribetype_test_subscribe_type_all
'
,
0
,
function
()
{
var
all
=
factory
.
SubscribeType
.
SUBSCRIBE_TYPE_ALL
;
console
.
info
(
'
all =
'
+
all
);
expect
(
all
==
2
).
assertTrue
()
})
it
(
'
enum_kvstoretype_test_device_collaboration
'
,
0
,
function
()
{
var
collaboration
=
factory
.
KVStoreType
.
DEVICE_COLLABORATION
;
console
.
info
(
'
collaboration =
'
+
collaboration
);
expect
(
collaboration
==
0
).
assertTrue
()
})
it
(
'
enum_kvstoretype_test_single_version
'
,
0
,
function
()
{
var
single
=
factory
.
KVStoreType
.
SINGLE_VERSION
;
console
.
info
(
'
single =
'
+
single
);
expect
(
single
==
1
).
assertTrue
()
})
it
(
'
enum_kvstoretype_test_multi_version
'
,
0
,
function
()
{
var
multi
=
factory
.
KVStoreType
.
MULTI_VERSION
;
console
.
info
(
'
multi =
'
+
multi
);
expect
(
multi
==
2
).
assertTrue
()
})
it
(
'
enum_securitylevel_test_no_level
'
,
0
,
function
()
{
var
nolevel
=
factory
.
SecurityLevel
.
NO_LEVEL
;
console
.
info
(
'
nolevel =
'
+
nolevel
);
expect
(
nolevel
==
0
).
assertTrue
()
})
it
(
'
enum_securitylevel_test_s0
'
,
0
,
function
()
{
var
s0
=
factory
.
SecurityLevel
.
S0
;
console
.
info
(
'
s0 =
'
+
s0
);
expect
(
s0
==
1
).
assertTrue
()
})
it
(
'
enum_securitylevel_test_s1
'
,
0
,
function
()
{
var
s1
=
factory
.
SecurityLevel
.
S1
;
console
.
info
(
'
s1 =
'
+
s1
);
expect
(
s1
==
2
).
assertTrue
()
})
it
(
'
enum_securitylevel_test_s2
'
,
0
,
function
()
{
var
s2
=
factory
.
SecurityLevel
.
S2
;
console
.
info
(
'
s2 =
'
+
s2
);
expect
(
s2
==
3
).
assertTrue
()
})
it
(
'
enum_securitylevel_test_s3
'
,
0
,
function
()
{
var
s3
=
factory
.
SecurityLevel
.
S3
;
console
.
info
(
'
s3 =
'
+
s3
);
expect
(
s3
==
5
).
assertTrue
()
})
it
(
'
enum_securitylevel_test_s4
'
,
0
,
function
()
{
var
s4
=
factory
.
SecurityLevel
.
S4
;
console
.
info
(
'
s4 =
'
+
s4
);
expect
(
s4
==
6
).
assertTrue
()
})
})
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录