Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
100f46ba
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看板
未验证
提交
100f46ba
编写于
2月 02, 2023
作者:
O
openharmony_ci
提交者:
Gitee
2月 02, 2023
浏览文件
操作
浏览文件
下载
差异文件
!7342 【Distributeddatamgr】【master】master用例修改
Merge pull request !7342 from yanglifeng/master
上级
5d7b32cf
59f99d90
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
48 addition
and
217 deletion
+48
-217
distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbStoreResultSetJsunit.test.js
...test/hap/src/main/js/test/RdbStoreResultSetJsunit.test.js
+10
-15
distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RelationalStoreJsunit.test.js
...Jstest/hap/src/main/js/test/RelationalStoreJsunit.test.js
+38
-202
未找到文件。
distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbStoreResultSetJsunit.test.js
浏览文件 @
100f46ba
...
...
@@ -1651,20 +1651,15 @@ describe('rdbResultSetTest', function () {
*/
it
(
'
testGetColumnIndex0004
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
'
************* testGetColumnIndex0004 start *************
'
);
let
errInfo
=
undefined
;
{
let
predicates
=
await
new
dataRdb
.
RdbPredicates
(
'
test
'
)
let
resultSet
=
await
rdbStore
.
query
(
predicates
)
try
{
let
resultSetresult
=
resultSet
.
getColumnIndex
(
''
)
expect
(
-
1
).
assertEqual
(
resultSetresult
)
}
catch
(
err
){
errInfo
=
err
}
expect
(
errInfo
.
code
).
assertEqual
(
"
401
"
)
expect
(
-
1
).
assertEqual
(
resultSet
.
getColumnIndex
(
''
))
resultSet
=
null
;
done
();
console
.
info
(
TAG
+
'
************* testGetColumnIndex0004 end *************
'
);
}
})
/**
...
...
distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RelationalStoreJsunit.test.js
浏览文件 @
100f46ba
...
...
@@ -249,232 +249,68 @@ describe('relationalStoreTest', function () {
})
/**
* @tc.number SUB_DDM_RelationalStore_
OpenStatus
_0010
* @tc.name Get relational store
status
test
* @tc.desc relational
OpenStatus
* @tc.number SUB_DDM_RelationalStore_
Version
_0010
* @tc.name Get relational store
version
test
* @tc.desc relational
version
*/
it
(
'
SUB_DDM_RelationalStore_OpenStatus_0010
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
"
************* SUB_DDM_RelationalStore_OpenStatus_0010 start *************
"
);
data_Rdb
.
getRdbStore
(
context
,
STORE_CONFIG
,
async
(
err
,
store
)
=>
{
if
(
err
)
{
expect
(
null
).
assertFail
();
}
expect
(
store
.
openStatus
==
data_Rdb
.
OpenStatus
.
ON_CREATE
).
assertTrue
();
data_Rdb
.
getRdbStore
(
context
,
STORE_CONFIG
,
async
(
err
,
store
)
=>
{
if
(
err
)
{
expect
(
null
).
assertFail
();
}
expect
(
store
.
openStatus
==
data_Rdb
.
OpenStatus
.
ON_OPEN
).
assertTrue
();
await
data_Rdb
.
deleteRdbStore
(
context
,
STORE_CONFIG
.
name
);
done
();
})
})
console
.
info
(
TAG
+
"
************* SUB_DDM_RelationalStore_OpenStatus_0010 end *************
"
);
})
it
(
'
SUB_DDM_RelationalStore_Version_0010
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
"
************* SUB_DDM_RelationalStore_Version_0010 start *************
"
);
let
store
=
await
data_Rdb
.
getRdbStore
(
context
,
STORE_CONFIG
);
/**
* @tc.number SUB_DDM_RelationalStore_OpenStatus_0020
* @tc.name Get relational store status test
* @tc.desc relational OpenStatus
*/
it
(
'
SUB_DDM_RelationalStore_OpenStatus_0020
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
"
************* SUB_DDM_RelationalStore_OpenStatus_0020 start *************
"
);
try
{
let
rdbStore
=
await
data_Rdb
.
getRdbStore
(
context
,
STORE_CONFIG
);
expect
(
rdbStore
.
openStatus
==
data_Rdb
.
OpenStatus
.
ON_CREATE
).
assertTrue
();
await
rdbStore
.
executeSql
(
CREATE_TABLE_TEST
);
rdbStore
=
await
data_Rdb
.
getRdbStore
(
context
,
STORE_CONFIG
);
expect
(
rdbStore
.
openStatus
==
data_Rdb
.
OpenStatus
.
ON_OPEN
).
assertTrue
();
await
data_Rdb
.
deleteRdbStore
(
context
,
STORE_CONFIG
.
name
);
done
();
}
catch
(
e
)
{
console
.
log
(
"
catch err: failed, err: code=
"
+
e
.
code
+
"
message=
"
+
e
.
message
);
store
.
version
=
5
expect
(
5
).
assertEqual
(
store
.
version
);
}
catch
(
err
)
{
console
.
info
(
"
SUB_DDM_RelationalStore_Version_0010 failed: err: code=
"
+
err
.
code
+
"
message=
"
+
err
.
message
);
expect
(
null
).
assertFail
();
done
();
console
.
info
(
TAG
+
"
************* SUB_DDM_RelationalStore_OpenStatus_0020 end *************
"
);
}
})
/**
* @tc.number SUB_DDM_RelationalStore_OpenStatus_0030
* @tc.name Get relational store status test
* @tc.desc relational OpenStatus
*/
it
(
'
SUB_DDM_RelationalStore_OpenStatus_0030
'
,
0
,
async
function
(
done
){
console
.
info
(
TAG
+
"
************* SUB_DDM_RelationalStore_OpenStatus_0030 start *************
"
);
await
data_Rdb
.
getRdbStore
(
contextApplication
,
STORE_CONFIG
,
async
function
(
err
,
rdbStore
){
try
{
if
(
err
)
{
console
.
info
(
"
Get SUB_DDM_RelationalStore_OpenStatus_0030 failed, err:
"
+
err
);
expect
().
assertFail
();
return
;
}
expect
(
rdbStore
.
openStatus
==
data_Rdb
.
OpenStatus
.
ON_CREATE
).
assertTrue
();
store
.
version
=
2147483647
expect
(
2147483647
).
assertEqual
(
store
.
version
);
}
catch
(
err
)
{
console
.
log
(
"
SUB_DDM_RelationalStore_OpenStatus_0030 status is
"
+
rdbStore
.
OpenStatus
);
console
.
info
(
"
SUB_DDM_RelationalStore_Version_0010 failed: err: code=
"
+
err
.
code
+
"
message=
"
+
err
.
message
);
expect
(
null
).
assertFail
();
}
console
.
log
(
"
Get SUB_DDM_RelationalStore_OpenStatus_0030 successfully.
"
);
})
await
data_Rdb
.
deleteRdbStore
(
context
,
STORE_CONFIG
.
name
);
done
();
console
.
log
(
"
Get SUB_DDM_RelationalStore_OpenStatus_0030 successfully end.
"
);
await
sleep
(
1000
);
})
/**
* @tc.number SUB_DDM_RelationalStore_OpenStatus_0040
* @tc.name Get relational store status test
* @tc.desc relational OpenStatus
*/
it
(
'
SUB_DDM_RelationalStore_OpenStatus_0040
'
,
0
,
async
function
(
done
){
console
.
info
(
TAG
+
"
************* SUB_DDM_RelationalStore_OpenStatus_0040 start *************
"
);
await
data_Rdb
.
getRdbStore
(
contextApplication
,
STORE_CONFIG
,
async
function
(
err
,
rdbStore
){
try
{
if
(
err
)
{
console
.
info
(
"
Get SUB_DDM_RelationalStore_OpenStatus_0040 failed, err:
"
+
err
);
return
;
}
expect
(
rdbStore
.
openStatus
==
data_Rdb
.
OpenStatus
.
ON_CREATE
).
assertTrue
();
}
catch
(
err
)
{
console
.
log
(
"
SUB_DDM_RelationalStore_OpenStatus_0040 status1 is
"
+
rdbStore
.
OpenStatus
);
}
});
await
sleep
(
1000
);
await
data_Rdb
.
getRdbStore
(
contextApplication
,
STORE_CONFIG
,
async
function
(
err
,
rdbStore
){
try
{
if
(
err
)
{
console
.
info
(
"
Get SUB_DDM_RelationalStore_OpenStatus_0040 failed, err:
"
+
err
);
expect
().
assertFail
();
return
;
}
expect
(
rdbStore
.
openStatus
==
data_Rdb
.
OpenStatus
.
ON_OPEN
).
assertTrue
();
}
catch
(
err
)
{
console
.
log
(
"
SUB_DDM_RelationalStore_OpenStatus_0040 status is
"
+
rdbStore
.
OpenStatus
);
}
});
await
data_Rdb
.
deleteRdbStore
(
context
,
STORE_CONFIG
.
name
);
done
();
console
.
log
(
"
Get SUB_DDM_RelationalStore_OpenStatus_0040 successfully end.
"
);
console
.
info
(
TAG
+
"
************* SUB_DDM_RelationalStore_Version_0010 end *************
"
);
})
/**
* @tc.number SUB_DDM_RelationalStore_
OpenStatus_005
0
* @tc.name Get relational store
status
test
* @tc.desc relational
OpenStatus
* @tc.number SUB_DDM_RelationalStore_
Version_002
0
* @tc.name Get relational store
version
test
* @tc.desc relational
version
*/
it
(
'
SUB_DDM_RelationalStore_OpenStatus_0050
'
,
0
,
async
function
(
done
){
console
.
info
(
TAG
+
"
************* SUB_DDM_RelationalStore_OpenStatus_0050 start *************
"
);
try
{
let
promise
=
null
;
promise
=
await
data_Rdb
.
getRdbStore
(
context
,
STORE_CONFIG
);
promise
=
null
;
promise
=
await
data_Rdb
.
getRdbStore
(
context
,
STORE_CONFIG
);
console
.
info
(
"
Get SUB_DDM_RelationalStore_OpenStatus_0050 promise.openStatus:
"
+
promise
.
openStatus
);
console
.
info
(
"
Get SUB_DDM_RelationalStore_OpenStatus_0050 data_Rdb.OpenStatus.ON_OPEN:
"
+
data_Rdb
.
OpenStatus
.
ON_OPEN
);
expect
(
promise
.
openStatus
).
assertEqual
(
data_Rdb
.
OpenStatus
.
ON_OPEN
);
await
data_Rdb
.
deleteRdbStore
(
context
,
STORE_CONFIG
.
name
);
}
catch
(
err
)
{
console
.
info
(
TAG
+
"
Get rdbstore fail catch err:
"
+
err
);
expect
(
null
).
assertFail
();
}
done
();
console
.
log
(
"
Get SUB_DDM_RelationalStore_OpenStatus_0050 successfully end.
"
);
})
it
(
'
SUB_DDM_RelationalStore_Version_0020
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
"
************* SUB_DDM_RelationalStore_Version_0020 start *************
"
);
let
store
=
await
data_Rdb
.
getRdbStore
(
context
,
STORE_CONFIG
);
/**
* @tc.number SUB_DDM_RelationalStore_OpenStatus_0060
* @tc.name Get relational store status test
* @tc.desc relational OpenStatus
*/
it
(
'
SUB_DDM_RelationalStore_OpenStatus_0060
'
,
0
,
async
function
(
done
){
console
.
info
(
TAG
+
"
************* SUB_DDM_RelationalStore_OpenStatus_0060 start *************
"
);
let
STORE_CONFIG1
=
{
name
:
"
rdbnumber.db
"
,
securityLevel
:
data_Rdb
.
SecurityLevel
.
S1
};
try
{
let
promise
=
null
;
promise
=
await
data_Rdb
.
getRdbStore
(
context
,
STORE_CONFIG
);
console
.
info
(
"
Get SUB_DDM_RelationalStore_OpenStatus_0060 STORE_CONFIG promise.openStatus:
"
+
promise
.
openStatus
);
expect
(
promise
.
openStatus
).
assertEqual
(
data_Rdb
.
OpenStatus
.
ON_CREATE
);
promise
=
await
data_Rdb
.
getRdbStore
(
context
,
STORE_CONFIG1
);
console
.
info
(
"
Get SUB_DDM_RelationalStore_OpenStatus_0060 STORE_CONFIG1 promise.openStatus:
"
+
promise
.
openStatus
);
expect
(
promise
.
openStatus
).
assertEqual
(
data_Rdb
.
OpenStatus
.
ON_CREATE
);
store
.
version
=
-
2147483648
;
}
catch
(
err
)
{
console
.
info
(
TAG
+
"
Get SUB_DDM_RelationalStore_OpenStatus_0060 fail catch err:
"
+
err
);
expect
(
null
).
assertFail
(
);
console
.
info
(
"
SUB_DDM_RelationalStore_Version_0020 failed1: err: code=
"
+
err
.
code
+
"
message=
"
+
err
.
message
);
expect
(
"
401
"
).
assertEqual
(
err
.
code
);
}
await
data_Rdb
.
deleteRdbStore
(
context
,
STORE_CONFIG
.
name
);
await
data_Rdb
.
deleteRdbStore
(
context
,
STORE_CONFIG1
.
name
);
done
();
console
.
log
(
"
Get SUB_DDM_RelationalStore_OpenStatus_0060 successfully end.
"
);
})
/**
* @tc.number SUB_DDM_RelationalStore_OpenStatus_0070
* @tc.name Get relational store status test
* @tc.desc relational OpenStatus
*/
it
(
'
SUB_DDM_RelationalStore_OpenStatus_0070
'
,
0
,
async
function
(
done
){
console
.
info
(
TAG
+
"
************* SUB_DDM_RelationalStore_OpenStatus_0070 start *************
"
);
let
STORE_CONFIG1
=
{
name
:
"
rdbnumber.db
"
,
securityLevel
:
data_Rdb
.
SecurityLevel
.
S1
};
try
{
let
promise
=
null
;
promise
=
await
data_Rdb
.
getRdbStore
(
context
,
STORE_CONFIG
);
console
.
info
(
"
Get SUB_DDM_RelationalStore_OpenStatus_0070 STORE_CONFIG promise.openStatus:
"
+
promise
.
openStatus
);
expect
(
promise
.
openStatus
).
assertEqual
(
data_Rdb
.
OpenStatus
.
ON_CREATE
);
let
rdbResult
=
await
data_Rdb
.
getRdbStore
(
context
,
STORE_CONFIG1
);
console
.
info
(
"
Get SUB_DDM_RelationalStore_OpenStatus_0070 STORE_CONFIG1 rdbResult.openStatus:
"
+
rdbResult
.
openStatus
);
expect
(
rdbResult
.
openStatus
).
assertEqual
(
data_Rdb
.
OpenStatus
.
ON_CREATE
);
store
.
version
=
2147483647000
;
}
catch
(
err
)
{
console
.
info
(
TAG
+
"
Get SUB_DDM_RelationalStore_OpenStatus_0070 fail catch err:
"
+
err
);
expect
(
null
).
assertFail
(
);
console
.
info
(
"
SUB_DDM_RelationalStore_Version_0020 failed2: err: code=
"
+
err
.
code
+
"
message=
"
+
err
.
message
);
expect
(
"
401
"
).
assertEqual
(
err
.
code
);
}
await
data_Rdb
.
deleteRdbStore
(
context
,
STORE_CONFIG
.
name
);
await
data_Rdb
.
deleteRdbStore
(
context
,
STORE_CONFIG1
.
name
);
done
();
console
.
log
(
"
Get SUB_DDM_RelationalStore_OpenStatus_0070 successfully end.
"
);
})
/**
* @tc.number SUB_DDM_RelationalStore_OpenStatus_0080
* @tc.name Get relational store status test
* @tc.desc relational OpenStatus
*/
it
(
'
SUB_DDM_RelationalStore_OpenStatus_0080
'
,
0
,
async
function
(
done
){
console
.
info
(
TAG
+
"
************* SUB_DDM_RelationalStore_OpenStatus_0050 start *************
"
);
let
STORE_CONFIG1
=
{
name
:
"
rdbnumber.db
"
,
securityLevel
:
data_Rdb
.
SecurityLevel
.
S1
};
try
{
let
promise
=
null
;
promise
=
await
data_Rdb
.
getRdbStore
(
context
,
STORE_CONFIG
);
console
.
info
(
"
Get SUB_DDM_RelationalStore_OpenStatus_0080 STORE_CONFIG promise.openStatus:
"
+
promise
.
openStatus
);
expect
(
promise
.
openStatus
).
assertEqual
(
data_Rdb
.
OpenStatus
.
ON_CREATE
);
let
rdbResult
=
await
data_Rdb
.
getRdbStore
(
context
,
STORE_CONFIG1
);
console
.
info
(
"
Get SUB_DDM_RelationalStore_OpenStatus_0080 STORE_CONFIG1 rdbResult.openStatus:
"
+
rdbResult
.
openStatus
);
expect
(
rdbResult
.
openStatus
).
assertEqual
(
data_Rdb
.
OpenStatus
.
ON_CREATE
);
promise
=
null
;
promise
=
await
data_Rdb
.
getRdbStore
(
context
,
STORE_CONFIG
);
console
.
info
(
"
Get SUB_DDM_RelationalStore_OpenStatus_0080 STORE_CONFIG promise.openStatus:
"
+
promise
.
openStatus
);
expect
(
promise
.
openStatus
).
assertEqual
(
data_Rdb
.
OpenStatus
.
ON_OPEN
);
rdbResult
=
null
;
rdbResult
=
await
data_Rdb
.
getRdbStore
(
context
,
STORE_CONFIG1
);
console
.
info
(
"
Get SUB_DDM_RelationalStore_OpenStatus_0080 STORE_CONFIG1 rdbResult.openStatus:
"
+
rdbResult
.
openStatus
);
expect
(
rdbResult
.
openStatus
).
assertEqual
(
data_Rdb
.
OpenStatus
.
ON_OPEN
);
store
.
version
=
0
;
}
catch
(
err
)
{
console
.
info
(
TAG
+
"
Get SUB_DDM_RelationalStore_OpenStatus_0080 fail catch err:
"
+
err
);
expect
(
null
).
assertFail
(
);
console
.
info
(
"
SUB_DDM_RelationalStore_Version_0020 failed3: err: code=
"
+
err
.
code
+
"
message=
"
+
err
.
message
);
expect
(
"
401
"
).
assertEqual
(
err
.
code
);
}
await
data_Rdb
.
deleteRdbStore
(
context
,
STORE_CONFIG
.
name
);
await
data_Rdb
.
deleteRdbStore
(
context
,
STORE_CONFIG1
.
name
);
done
();
console
.
log
(
"
Get SUB_DDM_RelationalStore_OpenStatus_0080 successfully end.
"
);
console
.
info
(
TAG
+
"
************* SUB_DDM_RelationalStore_Version_0020 end *************
"
);
})
console
.
info
(
TAG
+
"
*************Unit Test End*************
"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录