Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
cd8580dc
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看板
未验证
提交
cd8580dc
编写于
2月 21, 2023
作者:
O
openharmony_ci
提交者:
Gitee
2月 21, 2023
浏览文件
操作
浏览文件
下载
差异文件
!7648 【Distributeddatamgr】【master】master用例修改
Merge pull request !7648 from yanglifeng/monthly_20221018
上级
80ed8906
746b88b0
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
130 addition
and
157 deletion
+130
-157
distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/List.test.js
...onalStoretest/RdbJstest/hap/src/main/js/test/List.test.js
+1
-1
distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbStoreDistributedJsunit.test.js
...st/hap/src/main/js/test/RdbStoreDistributedJsunit.test.js
+1
-29
distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbStoreResultSetJsunit.test.js
...test/hap/src/main/js/test/RdbStoreResultSetJsunit.test.js
+4
-4
distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreDeleteJsunit.test.js
...bJstest/hap/src/main/js/test/RdbstoreDeleteJsunit.test.js
+1
-1
distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreInsertJsunit.test.js
...bJstest/hap/src/main/js/test/RdbstoreInsertJsunit.test.js
+1
-1
distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstorePredicatesComplexFiledJsunit.test.js
...main/js/test/RdbstorePredicatesComplexFiledJsunit.test.js
+2
-2
distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreQuery.test.js
...test/RdbJstest/hap/src/main/js/test/RdbstoreQuery.test.js
+2
-2
distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreRdbstoreJsunit.test.js
...stest/hap/src/main/js/test/RdbstoreRdbstoreJsunit.test.js
+1
-1
distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreStoreExcuteSqlJsunit.test.js
...hap/src/main/js/test/RdbstoreStoreExcuteSqlJsunit.test.js
+1
-1
distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreTransactionJsunit.test.js
...st/hap/src/main/js/test/RdbstoreTransactionJsunit.test.js
+1
-1
distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreUpdateJsunit.test.js
...bJstest/hap/src/main/js/test/RdbstoreUpdateJsunit.test.js
+1
-1
distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/List.test.ets
...ionalStoreStagetest/entry/src/main/ets/test/List.test.ets
+7
-6
distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/relationalStoreDistributedEtsunit.test.ets
.../main/ets/test/relationalStoreDistributedEtsunit.test.ets
+6
-6
distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/relationalStoreEtsunit.test.ets
...t/entry/src/main/ets/test/relationalStoreEtsunit.test.ets
+76
-76
distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/relationalStoreTestResultsetEtsunit.test.ets
...ain/ets/test/relationalStoreTestResultsetEtsunit.test.ets
+20
-20
distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/module.json
...etest/relationalStoreStagetest/entry/src/main/module.json
+5
-5
未找到文件。
distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/List.test.js
浏览文件 @
cd8580dc
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021
-2023
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
...
...
distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbStoreDistributedJsunit.test.js
浏览文件 @
cd8580dc
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2021
-2023
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
...
...
@@ -309,34 +309,6 @@ describe('rdbStoreDistributedTest', function () {
done
();
console
.
info
(
TAG
+
"
************* testRdbStoreDistributed0011 end *************
"
);
})
/**
* @tc.name sync test
* @tc.number SUB_DDM_AppDataFWK_JSRDB_Distributed_syncV9_0100
* @tc.desc sync test
*/
it
(
'
SUB_DDM_AppDataFWK_JSRDB_Distributed_syncV9_0100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
"
************* SUB_DDM_AppDataFWK_JSRDB_Distributed_syncV9_0100 start *************
"
);
let
config
=
{
name
:
"
secure.db
"
,
securityLevel
:
dataRdb
.
SecurityLevel
.
S1
}
await
dataRdb
.
getRdbStoreV9
(
context
,
config
,
1
).
then
(
async
(
store
)
=>
{
let
predicates
=
new
dataRdb
.
RdbPredicatesV9
(
"
employee
"
)
predicates
=
predicates
.
inDevices
(
"
12345678abcd
"
);
try
{
store
.
sync
(
dataRdb
.
SyncMode
.
SYNC_MODE_PUSH
,
predicates
);
}
catch
(
err
)
{
expect
(
null
).
assertFail
();
}
}).
catch
((
err
)
=>
{
expect
(
null
).
assertFail
();
})
await
dataRdb
.
deleteRdbStore
(
context
,
"
secure.db
"
);
done
();
console
.
info
(
TAG
+
"
************* SUB_DDM_AppDataFWK_JSRDB_Distributed_syncV9_0100 end *************
"
);
})
/**
* @tc.name sync Callback test
...
...
distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbStoreResultSetJsunit.test.js
浏览文件 @
cd8580dc
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2021
-2023
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
...
...
@@ -1652,9 +1652,9 @@ describe('rdbResultSetTest', function () {
it
(
'
testGetColumnIndex0004
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
'
************* testGetColumnIndex0004 start *************
'
);
{
let
predicates
=
await
new
dataRdb
.
RdbPredicates
(
'
test
'
)
;
let
resultSet
=
await
rdbStore
.
query
(
predicates
)
;
expect
(
-
1
).
assertEqual
(
resultSet
.
getColumnIndex
(
''
))
;
let
predicates
=
await
new
dataRdb
.
RdbPredicates
(
'
test
'
)
let
resultSet
=
await
rdbStore
.
query
(
predicates
)
expect
(
-
1
).
assertEqual
(
resultSet
.
getColumnIndex
(
''
))
resultSet
=
null
;
done
();
...
...
distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreDeleteJsunit.test.js
浏览文件 @
cd8580dc
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2021
-2023
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
...
...
distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreInsertJsunit.test.js
浏览文件 @
cd8580dc
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2021
-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
...
...
distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstorePredicatesComplexFiledJsunit.test.js
浏览文件 @
cd8580dc
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Copyright (C) 2022
-2023
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
...
...
@@ -12,7 +12,7 @@
* 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
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
import
dataRdb
from
'
@ohos.data.rdb
'
;
const
TAG
=
"
[RDB_JSKITS_TEST]
"
...
...
distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreQuery.test.js
浏览文件 @
cd8580dc
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2021
-2023
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
...
...
@@ -23,7 +23,7 @@ const CREATE_TABLE_TEST = "CREATE TABLE IF NOT EXISTS test (" + "id INTEGER PRIM
const
STORE_CONFIG
=
{
name
:
"
Query.db
"
,
}
const
TEST_BUNDLE_NAME
=
"
ohos.acts.r
elationalStore
jstest
"
const
TEST_BUNDLE_NAME
=
"
ohos.acts.r
db
jstest
"
var
kvManager
=
null
var
kvStore
=
null
...
...
distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreRdbstoreJsunit.test.js
浏览文件 @
cd8580dc
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2021
-2023
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
...
...
distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreStoreExcuteSqlJsunit.test.js
浏览文件 @
cd8580dc
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2021
-2023
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
...
...
distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreTransactionJsunit.test.js
浏览文件 @
cd8580dc
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2021
-2023
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
...
...
distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreUpdateJsunit.test.js
浏览文件 @
cd8580dc
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2021
-2023
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
...
...
distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/List.test.ets
浏览文件 @
cd8580dc
...
...
@@ -12,11 +12,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import rdbStoreV9Test from './RdbstoreRdbstoreV9.test.ets'
import rdbStoreDistributedTest from './RdbstoreDistributedEtsunit.test.ets'
import rdbResultSetTest from './RdbstoreResultsetV9Etsunit.test.ets'
import relationalStoreDistributedTest from './relationalStoreDistributedEtsunit.test.ets'
import relationalStoreTest from './relationalStoreEtsunit.test.ets'
import relationalStoreResultSetTest from './relationalStoreTestResultsetEtsunit.test.ets'
export default function testsuite() {
r
db
StoreDistributedTest(globalThis.abilityContext)
r
dbStoreV9Test(globalThis.abilityContext);
r
db
ResultSetTest(globalThis.abilityContext)
r
elational
StoreDistributedTest(globalThis.abilityContext)
r
elationalStoreTest(globalThis.abilityContext)
r
elationalStore
ResultSetTest(globalThis.abilityContext)
}
distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/
Rdbs
toreDistributedEtsunit.test.ets
→
distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/
relationalS
toreDistributedEtsunit.test.ets
浏览文件 @
cd8580dc
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Copyright (C) 2022
-2023
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
...
...
@@ -15,7 +15,7 @@
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium'
import dataRdb from '@ohos.data.r
db
';
import dataRdb from '@ohos.data.r
elationalStore
';
const TAG = "[RDB_JSKITS_TEST_Distributed]"
const STORE_NAME = "distributed_rdb.db"
...
...
@@ -27,20 +27,20 @@ const config = {
}
const CREATE_TABLE_TEST = "CREATE TABLE IF NOT EXISTS test (" + "id INTEGER PRIMARY KEY AUTOINCREMENT, "
+ "name TEXT NOT NULL, " + "age INTEGER, " + "salary REAL, " + "blobType BLOB)"
export default function r
db
StoreDistributedTest(context) {
describe('r
db
StoreDistributedTest', function () {
export default function r
elational
StoreDistributedTest(context) {
describe('r
elational
StoreDistributedTest', function () {
beforeAll(async function () {
console.info(TAG + 'beforeAll')
})
beforeEach(async function () {
rdbStore = await dataRdb.getRdbStore
V9(context, config, 1
);
rdbStore = await dataRdb.getRdbStore
(context, config
);
await rdbStore.executeSql(CREATE_TABLE_TEST, null)
console.info(TAG + 'beforeEach')
})
afterEach(async function () {
await dataRdb.deleteRdbStore
V9
(context, STORE_NAME);
await dataRdb.deleteRdbStore(context, STORE_NAME);
console.info(TAG + 'afterEach')
})
...
...
distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/
RdbstoreRdbstoreV9
.test.ets
→
distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/
relationalStoreEtsunit
.test.ets
浏览文件 @
cd8580dc
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Copyright (C) 2022
-2023
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
...
...
@@ -14,7 +14,7 @@
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium'
import dataRdb from '@ohos.data.r
db
';
import dataRdb from '@ohos.data.r
elationalStore
';
const TAG = "[RDB_JSKITS_TEST]"
const CREATE_TABLE_TEST = "CREATE TABLE IF NOT EXISTS test (" + "id INTEGER PRIMARY KEY AUTOINCREMENT, " + "name TEXT NOT NULL, " + "age INTEGER, " + "salary REAL, " + "blobType BLOB)";
...
...
@@ -23,8 +23,8 @@ function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
export default function r
dbStoreV9
Test(context){
describe('r
dbStoreV9
Test', function () {
export default function r
elationalStore
Test(context){
describe('r
elationalStore
Test', function () {
beforeAll(async function () {
console.info(TAG + 'beforeAll')
})
...
...
@@ -44,18 +44,18 @@ describe('rdbStoreV9Test', function () {
console.log(TAG + "*************Unit Test Begin*************");
/**
* @tc.name rdb store getRdbStore
V9
with securityLevel S1
* @tc.number SUB_DDM_RELATIONALETS_GETRDBSTORE
V9
_PROMISE_0100
* @tc.desc rdb store getRdbStore
V9
with securityLevel S1
* @tc.name rdb store getRdbStore with securityLevel S1
* @tc.number SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0100
* @tc.desc rdb store getRdbStore with securityLevel S1
* @tc.require: I5PIL6
*/
it('SUB_DDM_RELATIONALETS_GETRDBSTORE
V9
_PROMISE_0100', 0, async function (done) {
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE
V9
_PROMISE_0100 start *************");
it('SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0100', 0, async function (done) {
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0100 start *************");
let config = {
name: "secure.db",
securityLevel: dataRdb.SecurityLevel.S1
}
let storePromise = dataRdb.getRdbStore
V9(context, config, 1
);
let storePromise = dataRdb.getRdbStore
(context, config
);
storePromise.then(async (store) => {
try {
await store.executeSql(CREATE_TABLE_TEST);
...
...
@@ -69,22 +69,22 @@ describe('rdbStoreV9Test', function () {
storePromise = null
await dataRdb.deleteRdbStore(context,"secure.db");
done();
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE
V9
_PROMISE_0100 end *************");
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0100 end *************");
})
/**
* @tc.name rdb store getRdbStore
V9
with securityLevel S2
* @tc.number SUB_DDM_RELATIONALETS_GETRDBSTORE
V9
_PROMISE_0200
* @tc.desc rdb store getRdbStore
V9
with securityLevel S2
* @tc.name rdb store getRdbStore with securityLevel S2
* @tc.number SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0200
* @tc.desc rdb store getRdbStore with securityLevel S2
* @tc.require: I5PIL6
*/
it('SUB_DDM_RELATIONALETS_GETRDBSTORE
V9
_PROMISE_0200', 0, async function (done) {
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE
V9
_PROMISE_0200 start *************");
it('SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0200', 0, async function (done) {
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0200 start *************");
let config = {
name: "secure.db",
securityLevel: dataRdb.SecurityLevel.S2
}
let storePromise = dataRdb.getRdbStore
V9(context, config, 1
);
let storePromise = dataRdb.getRdbStore
(context, config
);
storePromise.then(async (store) => {
try {
await store.executeSql(CREATE_TABLE_TEST);
...
...
@@ -98,22 +98,22 @@ describe('rdbStoreV9Test', function () {
storePromise = null
await dataRdb.deleteRdbStore(context,"secure.db");
done();
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE
V9
_PROMISE_0200 end *************");
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0200 end *************");
})
/**
* @tc.name rdb store getRdbStore
V9
with securityLevel S3
* @tc.number SUB_DDM_RELATIONALETS_GETRDBSTORE
V9
_PROMISE_0300
* @tc.desc rdb store getRdbStore
V9
with securityLevel S3
* @tc.name rdb store getRdbStore with securityLevel S3
* @tc.number SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0300
* @tc.desc rdb store getRdbStore with securityLevel S3
* @tc.require: I5PIL6
*/
it('SUB_DDM_RELATIONALETS_GETRDBSTORE
V9
_PROMISE_0300', 0, async function (done) {
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE
V9
_PROMISE_0300 start *************");
it('SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0300', 0, async function (done) {
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0300 start *************");
let config = {
name: "secure.db",
securityLevel: dataRdb.SecurityLevel.S3
}
let storePromise = dataRdb.getRdbStore
V9(context, config, 1
);
let storePromise = dataRdb.getRdbStore
(context, config
);
storePromise.then(async (store) => {
try {
await store.executeSql(CREATE_TABLE_TEST);
...
...
@@ -127,22 +127,22 @@ describe('rdbStoreV9Test', function () {
storePromise = null
await dataRdb.deleteRdbStore(context,"secure.db");
done();
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE
V9
_PROMISE_0300 end *************");
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0300 end *************");
})
/**
* @tc.name rdb store getRdbStore
V9
with securityLevel S4
* @tc.number SUB_DDM_RELATIONALETS_GETRDBSTORE
V9
_PROMISE_0400
* @tc.desc rdb store getRdbStore
V9
with securityLevel S4
* @tc.name rdb store getRdbStore with securityLevel S4
* @tc.number SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0400
* @tc.desc rdb store getRdbStore with securityLevel S4
* @tc.require: I5PIL6
*/
it('SUB_DDM_RELATIONALETS_GETRDBSTORE
V9
_PROMISE_0400', 0, async function (done) {
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE
V9
_PROMISE_0400 start *************");
it('SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0400', 0, async function (done) {
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0400 start *************");
let config = {
name: "secure.db",
securityLevel: dataRdb.SecurityLevel.S4
}
let storePromise = dataRdb.getRdbStore
V9(context, config, 1
);
let storePromise = dataRdb.getRdbStore
(context, config
);
storePromise.then(async (store) => {
try {
await store.executeSql(CREATE_TABLE_TEST);
...
...
@@ -156,22 +156,22 @@ describe('rdbStoreV9Test', function () {
storePromise = null
await dataRdb.deleteRdbStore(context,"secure.db");
done();
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE
V9
_PROMISE_0400 end *************");
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0400 end *************");
})
/**
* @tc.name rdb store getRdbStore
V9
with securityLevel S1
* @tc.number SUB_DDM_RELATIONALETS_GETRDBSTORE
V9
_CALLBACK_0100
* @tc.desc rdb store getRdbStore
V9
with securityLevel S1
* @tc.name rdb store getRdbStore with securityLevel S1
* @tc.number SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0100
* @tc.desc rdb store getRdbStore with securityLevel S1
* @tc.require: I5PIL6
*/
it('SUB_DDM_RELATIONALETS_GETRDBSTORE
V9
_CALLBACK_0100', 0, async function (done) {
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE
V9
_CALLBACK_0100 start *************");
it('SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0100', 0, async function (done) {
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0100 start *************");
let config = {
name: "secure.db",
securityLevel: dataRdb.SecurityLevel.S1
}
dataRdb.getRdbStore
V9(context, config, 1
, async (err,data) => {
dataRdb.getRdbStore
(context, config
, async (err,data) => {
if(err != null){
console.info(TAG + "get rdb store error" + err.message)
expect(null).assertFail();
...
...
@@ -181,24 +181,24 @@ describe('rdbStoreV9Test', function () {
dataRdb.deleteRdbStore(context,"secure.db").then(()=>{
console.info(TAG + "Delete rdbstore success")
done();
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE
V9
_CALLBACK_0100 end *************");
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0100 end *************");
})
});
})
/**
* @tc.name rdb store getRdbStore
V9
with securityLevel S2
* @tc.number SUB_DDM_RELATIONALETS_GETRDBSTORE
V9
_CALLBACK_0200
* @tc.desc rdb store getRdbStore
V9
with securityLevel S2
* @tc.name rdb store getRdbStore with securityLevel S2
* @tc.number SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0200
* @tc.desc rdb store getRdbStore with securityLevel S2
* @tc.require: I5PIL6
*/
it('SUB_DDM_RELATIONALETS_GETRDBSTORE
V9
_CALLBACK_0200', 0, async function (done) {
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE
V9
_CALLBACK_0200 start *************");
it('SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0200', 0, async function (done) {
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0200 start *************");
let config = {
name: "secure.db",
securityLevel: dataRdb.SecurityLevel.S2
}
dataRdb.getRdbStore
V9(context, config, 1
,async (err,data) => {
dataRdb.getRdbStore
(context, config
,async (err,data) => {
if(err != null){
console.info(TAG + "get rdb store error")
expect(null).assertFail();
...
...
@@ -207,24 +207,24 @@ describe('rdbStoreV9Test', function () {
}
dataRdb.deleteRdbStore(context, "secure.db").then(() => {
done();
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE
V9
_CALLBACK_0200 end *************");
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0200 end *************");
})
});
})
/**
* @tc.name rdb store getRdbStore
V9
with securityLevel S3
* @tc.number SUB_DDM_RELATIONALETS_GETRDBSTORE
V9
_CALLBACK_0300
* @tc.desc rdb store getRdbStore
V9
with securityLevel S3
* @tc.name rdb store getRdbStore with securityLevel S3
* @tc.number SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0300
* @tc.desc rdb store getRdbStore with securityLevel S3
* @tc.require: I5PIL6
*/
it('SUB_DDM_RELATIONALETS_GETRDBSTORE
V9
_CALLBACK_0300', 0, async function (done) {
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE
V9
_CALLBACK_0300 start *************");
it('SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0300', 0, async function (done) {
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0300 start *************");
let config = {
name: "secure.db",
securityLevel: dataRdb.SecurityLevel.S3
}
dataRdb.getRdbStore
V9(context, config, 1
,async (err,data) => {
dataRdb.getRdbStore
(context, config
,async (err,data) => {
if(err != null){
console.info(TAG + "get rdb store error")
expect(null).assertFail();
...
...
@@ -233,24 +233,24 @@ describe('rdbStoreV9Test', function () {
}
dataRdb.deleteRdbStore(context, "secure.db").then(() => {
done();
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE
V9
_CALLBACK_0300 end *************");
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0300 end *************");
})
});
})
/**
* @tc.name rdb store getRdbStore
V9
with securityLevel S4
* @tc.number SUB_DDM_RELATIONALETS_GETRDBSTORE
V9
_CALLBACK_0400
* @tc.desc rdb store getRdbStore
V9
with securityLevel S4
* @tc.name rdb store getRdbStore with securityLevel S4
* @tc.number SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0400
* @tc.desc rdb store getRdbStore with securityLevel S4
* @tc.require: I5PIL6
*/
it('SUB_DDM_RELATIONALETS_GETRDBSTORE
V9
_CALLBACK_0400', 0, async function (done) {
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE
V9
_CALLBACK_0400 start *************");
it('SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0400', 0, async function (done) {
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0400 start *************");
let config = {
name: "secure.db",
securityLevel: dataRdb.SecurityLevel.S4
}
dataRdb.getRdbStore
V9(context, config, 1
,async (err,data) => {
dataRdb.getRdbStore
(context, config
,async (err,data) => {
if(err != null){
console.info(TAG + "get rdb store error")
expect(null).assertFail();
...
...
@@ -259,53 +259,53 @@ describe('rdbStoreV9Test', function () {
}
dataRdb.deleteRdbStore(context,"secure.db").then(() => {
done();
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE
V9
_CALLBACK_0400 end *************");
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0400 end *************");
})
});
})
/**
* @tc.name rdb store deleteRdbStore
V9
* @tc.number SUB_DDM_RELATIONALETS_DELETERDBSTORE
V9
_PROMISE_0100
* @tc.desc rdb store deleteRdbStore
V9
* @tc.name rdb store deleteRdbStore
* @tc.number SUB_DDM_RELATIONALETS_DELETERDBSTORE_PROMISE_0100
* @tc.desc rdb store deleteRdbStore
* @tc.require: I5PIL6
*/
it('SUB_DDM_RELATIONALETS_DELETERDBSTORE
V9
_PROMISE_0100', 0, async function (done) {
console.log(TAG + "************* SUB_DDM_RELATIONALETS_DELETERDBSTORE
V9
_PROMISE_0100 start *************");
it('SUB_DDM_RELATIONALETS_DELETERDBSTORE_PROMISE_0100', 0, async function (done) {
console.log(TAG + "************* SUB_DDM_RELATIONALETS_DELETERDBSTORE_PROMISE_0100 start *************");
let config = {
name: "secure.db",
securityLevel: dataRdb.SecurityLevel.S4
}
let deleteResult = false
await dataRdb.getRdbStore
V9(context, config, 1
).then(async (store) => {
await dataRdb.getRdbStore
(context, config
).then(async (store) => {
console.info(TAG + "create table success")
})
await dataRdb.deleteRdbStore
V9
(context,"secure.db").then(() => {
await dataRdb.deleteRdbStore(context,"secure.db").then(() => {
deleteResult = true
console.info(`${TAG} delete rdb store success,result is ${deleteResult}`)
});
expect(deleteResult).assertTrue();
done();
console.log(TAG + "************* SUB_DDM_RELATIONALETS_DELETERDBSTORE
V9
_PROMISE_0100 end *************");
console.log(TAG + "************* SUB_DDM_RELATIONALETS_DELETERDBSTORE_PROMISE_0100 end *************");
})
/**
* @tc.name rdb store deleteRdbStore
V9
* @tc.number SUB_DDM_RELATIONALETS_DELETERDBSTORE
V9
_CALLBACK_0100
* @tc.desc rdb store deleteRdbStore
V9
* @tc.name rdb store deleteRdbStore
* @tc.number SUB_DDM_RELATIONALETS_DELETERDBSTORE_CALLBACK_0100
* @tc.desc rdb store deleteRdbStore
* @tc.require: I5PIL6
*/
it('SUB_DDM_RELATIONALETS_DELETERDBSTORE
V9
_CALLBACK_0100', 0, async function (done) {
console.log(TAG + "************* SUB_DDM_RELATIONALETS_DELETERDBSTORE
V9
_CALLBACK_0100 start *************");
it('SUB_DDM_RELATIONALETS_DELETERDBSTORE_CALLBACK_0100', 0, async function (done) {
console.log(TAG + "************* SUB_DDM_RELATIONALETS_DELETERDBSTORE_CALLBACK_0100 start *************");
let config = {
name: "secure.db",
securityLevel: dataRdb.SecurityLevel.S1
}
let deleteResult = false
await dataRdb.getRdbStore
V9(context, config, 1
).then(async (store) => {
await dataRdb.getRdbStore
(context, config
).then(async (store) => {
console.info(TAG + "create rdb store success")
})
dataRdb.deleteRdbStore
V9
(context,"secure.db", (err, data) => {
dataRdb.deleteRdbStore(context,"secure.db", (err, data) => {
if(err == undefined){
deleteResult = true
console.info(`${TAG} delete rdb store success,result is ${deleteResult}`)
...
...
@@ -315,7 +315,7 @@ describe('rdbStoreV9Test', function () {
await sleep(1000)
expect(deleteResult).assertTrue();
done();
console.log(TAG + "************* SUB_DDM_RELATIONALETS_DELETERDBSTORE
V9
_CALLBACK_0100 end *************");
console.log(TAG + "************* SUB_DDM_RELATIONALETS_DELETERDBSTORE_CALLBACK_0100 end *************");
})
console.log(TAG + "*************Unit Test End*************");
})
...
...
distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/
RdbstoreResultsetV9
Etsunit.test.ets
→
distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/
relationalStoreTestResultset
Etsunit.test.ets
浏览文件 @
cd8580dc
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Copyright (C) 2022
-2023
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
...
...
@@ -13,7 +13,7 @@
* limitations under the License.
*/
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'@ohos/hypium'
import
dataRdb
from
'@ohos.data.r
db
'
import
dataRdb
from
'@ohos.data.r
elationalStore
'
const
TAG
=
'[RDB_JSKITS_TEST]'
const
CREATE_TABLE_TEST
=
'CREATE TABLE IF NOT EXISTS test ('
+
'id INTEGER PRIMARY KEY AUTOINCREMENT, '
+
'data1 text,'
+
'data2 long, '
+
'data3 double,'
+
'data4 blob)'
;
...
...
@@ -25,11 +25,11 @@ const STORE_CONFIG = {
const
COLOUNM_NAMES
=
[
"id"
,
"data1"
,
"data2"
,
"data3"
,
"data4"
];
var
rdbStore
=
undefined
;
export
default
function
r
dbResultSetTestV9
(
context
)
{
describe
(
'r
dbResultSetTestV9
'
,
function
()
{
export
default
function
r
elationalStoreResultSetTest
(
context
)
{
describe
(
'r
elationalStoreResultSetTest
'
,
function
()
{
beforeAll
(
async
function
()
{
console
.
info
(
TAG
+
'beforeAll'
)
rdbStore
=
await
dataRdb
.
getRdbStore
V9
(
context
,
STORE_CONFIG
,
1
);
rdbStore
=
await
dataRdb
.
getRdbStore
(
context
,
STORE_CONFIG
);
await
rdbStore
.
executeSql
(
CREATE_TABLE_TEST
,
null
);
await
createTest
();
})
...
...
@@ -45,7 +45,7 @@ describe('rdbResultSetTestV9', function () {
afterAll
(
async
function
()
{
console
.
info
(
TAG
+
'afterAll'
)
rdbStore
=
null
await
dataRdb
.
deleteRdbStore
V9
(
context
,
'Resultset.db'
);
await
dataRdb
.
deleteRdbStore
(
context
,
'Resultset.db'
);
})
//插入数据
async
function
createTest
()
{
...
...
@@ -84,32 +84,32 @@ describe('rdbResultSetTestV9', function () {
}
/**
* @tc.name resultSet
V9
getBlob normal test
* @tc.number SUB_DDM_RELATIONALETS_RESULTSET
V9
_0010
* @tc.desc resultSet
V9
getBlob normal test
* @tc.name resultSet getBlob normal test
* @tc.number SUB_DDM_RELATIONALETS_RESULTSET_0010
* @tc.desc resultSet getBlob normal test
*/
it
(
'SUB_DDM_RELATIONALETS_RESULTSET
V9
_0010'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
'************* SUB_DDM_RELATIONALETS_RESULTSET
V9
_0010 start *************'
);
let
predicates
=
await
new
dataRdb
.
RdbPredicates
V9
(
'test'
)
let
resultSet
V9
=
await
rdbStore
.
query
(
predicates
)
it
(
'SUB_DDM_RELATIONALETS_RESULTSET_0010'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
'************* SUB_DDM_RELATIONALETS_RESULTSET_0010 start *************'
);
let
predicates
=
await
new
dataRdb
.
RdbPredicates
(
'test'
)
let
resultSet
=
await
rdbStore
.
query
(
predicates
)
try
{
{
expect
(
true
)
.
assertEqual
(
resultSet
V9
.
goToFirstRow
())
const
id
=
resultSet
V9
.
getLong
(
resultSetV9
.
getColumnIndex
(
'id'
))
const
data4
=
resultSet
V9
.
getBlob
(
resultSetV9
.
getColumnIndex
(
'data4'
))
expect
(
true
)
.
assertEqual
(
resultSet
.
goToFirstRow
())
const
id
=
resultSet
.
getLong
(
resultSet
.
getColumnIndex
(
'id'
))
const
data4
=
resultSet
.
getBlob
(
resultSet
.
getColumnIndex
(
'data4'
))
console
.
info
(
TAG
+
'id='
+
id
+
', data4='
+
data4
);
expect
(
1
)
.
assertEqual
(
data4
[
0
]);
expect
(
2
)
.
assertEqual
(
data4
[
1
]);
expect
(
3
)
.
assertEqual
(
data4
[
2
]);
}
resultSet
V9
.
close
();
expect
(
true
)
.
assertEqual
(
resultSet
V9
.
isClosed
)
resultSet
.
close
();
expect
(
true
)
.
assertEqual
(
resultSet
.
isClosed
)
}
catch
(
e
)
{
expect
(
null
)
.
assertFail
();
}
resultSet
V9
=
null
resultSet
=
null
done
();
console
.
info
(
TAG
+
'************* SUB_DDM_RELATIONALETS_RESULTSET
V9
_0010 end *************'
);
console
.
info
(
TAG
+
'************* SUB_DDM_RELATIONALETS_RESULTSET_0010 end *************'
);
})
console
.
info
(
TAG
+
'*************Unit Test End*************'
);
})
...
...
distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/module.json
浏览文件 @
cd8580dc
...
...
@@ -17,11 +17,11 @@
"pages"
:
"$profile:main_pages"
,
"uiSyntax"
:
"ets"
,
"metadata"
:
[
{
"name"
:
"ArkTSPartialUpdate"
,
"value"
:
"false"
}
],
{
"name"
:
"ArkTSPartialUpdate"
,
"value"
:
"false"
}
],
"abilities"
:
[
{
"name"
:
"ohos.acts.RelationalStoreStage.MainAbility"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录