Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
cbae5c74
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cbae5c74
编写于
4月 26, 2022
作者:
I
inter515
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增hasInstalled用例
Signed-off-by:
N
inter515
<
ry.renyi@huawei.com
>
上级
8cd0954c
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
90 addition
and
56 deletion
+90
-56
appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/test/ActsBmsHapModuleTest.test.js
...etest/entry/src/main/js/test/ActsBmsHapModuleTest.test.js
+29
-32
appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/test/ActsBmsHasInstalldTest.test.js
...est/entry/src/main/js/test/ActsBmsHasInstalldTest.test.js
+44
-0
appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/src/main/js/test/ActsBmsMetaDataTest.test.js
...tatest/entry/src/main/js/test/ActsBmsMetaDataTest.test.js
+0
-6
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/MainAbility/test/GetAbilityLabelJsUnit.test.ets
.../main/ets/MainAbility/test/GetAbilityLabelJsUnit.test.ets
+0
-1
appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/test/ExampleJsunit.test.js
...emanagertest/entry/src/main/js/test/ExampleJsunit.test.js
+17
-17
未找到文件。
appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/test/ActsBmsHapModuleTest.test.js
浏览文件 @
cbae5c74
...
...
@@ -99,37 +99,35 @@ describe('ActsBmsHapModuleTest', function () {
* @tc.desc: get the module information of the hap without mainAbility
*/
it
(
'
bms_getHapModuleInfo_0300
'
,
0
,
async
function
(
done
)
{
await
bundle
.
getBundleInfo
(
BUNDLE_NAME2
,
bundle
.
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
)
.
then
(
async
(
result
)
=>
{
bundle
.
getBundleInfo
(
BUNDLE_NAME2
,
bundle
.
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
,(
err
,
data
)
=>
{
expect
(
JSON
.
stringify
(
result
)).
assertEqual
(
JSON
.
stringify
(
data
));
});
expect
(
result
.
hapModuleInfos
.
length
).
assertEqual
(
1
);
if
(
result
.
hapModuleInfos
.
length
>
0
)
{
let
hapModuleInfo
=
result
.
hapModuleInfos
[
0
];
expect
(
hapModuleInfo
.
name
).
assertEqual
(
BUNDLE_NAME2
);
expect
(
hapModuleInfo
.
moduleName
).
assertEqual
(
'
entry
'
);
expect
(
hapModuleInfo
.
description
).
assertEqual
(
''
);
expect
(
hapModuleInfo
.
descriptionId
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
iconPath
).
assertEqual
(
"
$media:icon
"
);
expect
(
hapModuleInfo
.
icon
).
assertEqual
(
''
);
expect
(
hapModuleInfo
.
label
).
assertEqual
(
'
$string:app_name
'
);
expect
(
hapModuleInfo
.
labelId
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
iconId
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
backgroundImg
).
assertEqual
(
""
);
expect
(
hapModuleInfo
.
supportedModes
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
reqCapabilities
.
length
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
deviceTypes
[
0
]).
assertEqual
(
'
phone
'
);
expect
(
hapModuleInfo
.
mainAbilityName
).
assertEqual
(
""
);
expect
(
hapModuleInfo
.
mainElementName
).
assertEqual
(
""
);
expect
(
hapModuleInfo
.
abilityInfo
.
length
).
assertLarger
(
0
);
expect
(
hapModuleInfo
.
colorMode
).
assertEqual
(
-
1
);
expect
(
hapModuleInfo
.
extensionAbilityInfo
.
length
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
metadata
.
length
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
installationFree
).
assertEqual
(
false
);
done
();
}
});
let
result
=
await
bundle
.
getBundleInfo
(
BUNDLE_NAME2
,
bundle
.
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
);
bundle
.
getBundleInfo
(
BUNDLE_NAME2
,
bundle
.
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
,
(
err
,
data
)
=>
{
expect
(
JSON
.
stringify
(
result
)).
assertEqual
(
JSON
.
stringify
(
data
));
expect
(
result
.
hapModuleInfos
.
length
).
assertEqual
(
1
);
if
(
result
.
hapModuleInfos
.
length
>
0
)
{
let
hapModuleInfo
=
result
.
hapModuleInfos
[
0
];
expect
(
hapModuleInfo
.
name
).
assertEqual
(
BUNDLE_NAME2
);
expect
(
hapModuleInfo
.
moduleName
).
assertEqual
(
'
entry
'
);
expect
(
hapModuleInfo
.
description
).
assertEqual
(
''
);
expect
(
hapModuleInfo
.
descriptionId
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
iconPath
).
assertEqual
(
"
$media:icon
"
);
expect
(
hapModuleInfo
.
icon
).
assertEqual
(
''
);
expect
(
hapModuleInfo
.
label
).
assertEqual
(
'
$string:app_name
'
);
expect
(
hapModuleInfo
.
labelId
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
iconId
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
backgroundImg
).
assertEqual
(
""
);
expect
(
hapModuleInfo
.
supportedModes
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
reqCapabilities
.
length
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
deviceTypes
[
0
]).
assertEqual
(
'
phone
'
);
expect
(
hapModuleInfo
.
mainAbilityName
).
assertEqual
(
""
);
expect
(
hapModuleInfo
.
mainElementName
).
assertEqual
(
""
);
expect
(
hapModuleInfo
.
abilityInfo
.
length
).
assertLarger
(
0
);
expect
(
hapModuleInfo
.
colorMode
).
assertEqual
(
-
1
);
expect
(
hapModuleInfo
.
extensionAbilityInfo
.
length
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
metadata
.
length
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
installationFree
).
assertEqual
(
false
);
done
();
}
});
});
/*
...
...
@@ -224,5 +222,4 @@ describe('ActsBmsHapModuleTest', function () {
expect
(
info
.
metadata
.
length
).
assertEqual
(
0
);
expect
(
info
.
installationFree
).
assertEqual
(
false
);
}
})
\ No newline at end of file
appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/test/ActsBmsHasInstalldTest.test.js
浏览文件 @
cbae5c74
...
...
@@ -118,4 +118,48 @@ describe('ActsBmsHasInstalldTest', function () {
}
});
});
/*
* @tc.number: hasInstalled_0500
* @tc.name: test hasInstalled bundleName is number
* @tc.desc: test hasInstalled bundleName is number without function fail
* @tc.level 3
*/
it
(
'
hasInstalled_0500
'
,
0
,
async
function
(
done
)
{
pkg
.
hasInstalled
({
bundleName
:
NUM_TWO
,
success
:
function
success
(
data
)
{
console
.
info
(
'
hasInstalled success
'
+
JSON
.
stringify
(
data
));
expect
(
error
).
assertFail
();
done
();
},
complete
:
function
complete
()
{
console
.
info
(
'
hasInstalled complete
'
);
done
();
}
})
});
/*
* @tc.number: hasInstalled_0600
* @tc.name: test hasInstalled bundleName is number
* @tc.desc: test hasInstalled bundleName is number without function complete
* @tc.level 3
*/
it
(
'
hasInstalled_0600
'
,
0
,
async
function
(
done
)
{
pkg
.
hasInstalled
({
bundleName
:
NUM_TWO
,
success
:
function
success
(
data
)
{
console
.
info
(
'
hasInstalled success
'
+
JSON
.
stringify
(
data
));
expect
(
error
).
assertFail
();
done
();
},
fail
:
function
fail
(
data
,
code
)
{
console
.
info
(
'
hasInstalled fail
'
);
expect
(
data
).
assertEqual
(
"
value is not an available number
"
);
expect
(
code
).
assertEqual
(
202
);
done
();
}
})
});
})
\ No newline at end of file
appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/src/main/js/test/ActsBmsMetaDataTest.test.js
浏览文件 @
cbae5c74
...
...
@@ -142,10 +142,4 @@ describe('ActsBmsMetaDataTest', function () {
});
});
function
checkInstallOrUninstall
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
}
})
\ No newline at end of file
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/MainAbility/test/GetAbilityLabelJsUnit.test.ets
浏览文件 @
cbae5c74
...
...
@@ -166,7 +166,6 @@ export default function getAbilityLabelJsUnit() {
done();
});
/*
* @tc.number: context_getAbilityLabel_test_0700
* @tc.name: getAbilityLabel : Gets the specified ability label
...
...
appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/test/ExampleJsunit.test.js
浏览文件 @
cbae5c74
...
...
@@ -198,7 +198,7 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test getApplicationInfos interfaces with one hap.
*/
it
(
'
getApplicationInfos_0100
'
,
0
,
async
function
(
done
)
{
let
datainfo
=
await
demo
.
getAllApplicationInfo
(
8
,
USERID
);
let
datainfo
=
await
demo
.
getAllApplicationInfo
(
demo
.
BundleFlag
.
GET_APPLICATION_INFO_WITH_PERMISSION
,
USERID
);
checkgetApplicationInfos
(
datainfo
);
done
();
})
...
...
@@ -231,7 +231,7 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test getApplicationInfos interfaces with one hap.
*/
it
(
'
getApplicationInfos_0600
'
,
0
,
async
function
(
done
)
{
await
demo
.
getAllApplicationInfo
(
8
,
USERID
,
(
error
,
datainfo
)
=>
{
await
demo
.
getAllApplicationInfo
(
demo
.
BundleFlag
.
GET_APPLICATION_INFO_WITH_PERMISSION
,
USERID
,
(
error
,
datainfo
)
=>
{
expect
(
datainfo
.
length
).
assertLarger
(
0
);
for
(
let
i
=
0
;
i
<
datainfo
.
length
;
i
++
)
{
expect
(
datainfo
[
i
].
name
.
length
).
assertLarger
(
0
);
...
...
@@ -254,7 +254,7 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test getBundleInfos interfaces with one hap.
*/
it
(
'
getBundleInfos_0100
'
,
0
,
async
function
(
done
)
{
let
data
=
await
demo
.
getAllBundleInfo
(
0
);
let
data
=
await
demo
.
getAllBundleInfo
(
demo
.
BundleFlag
.
GET_BUNDLE_DEFAULT
);
expect
(
typeof
data
).
assertEqual
(
OBJECT
);
expect
(
data
.
length
).
assertLarger
(
0
);
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
...
...
@@ -319,7 +319,7 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test getBundleInfos interfaces with one hap.
*/
it
(
'
getBundleInfos_0600
'
,
0
,
async
function
(
done
)
{
await
demo
.
getAllBundleInfo
(
0
,
(
error
,
data
)
=>
{
await
demo
.
getAllBundleInfo
(
demo
.
BundleFlag
.
GET_BUNDLE_DEFAULT
,
(
error
,
data
)
=>
{
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
console
.
info
(
'
dataInfos=============
'
+
i
);
for
(
const
item
in
data
[
i
])
{
...
...
@@ -481,7 +481,7 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test getApplicationInfos interfaces with two haps.
*/
it
(
'
getApplicationInfos_0200
'
,
0
,
async
function
(
done
)
{
let
datainfo
=
await
demo
.
getAllApplicationInfo
(
8
,
USERID
);
let
datainfo
=
await
demo
.
getAllApplicationInfo
(
demo
.
BundleFlag
.
GET_APPLICATION_INFO_WITH_PERMISSION
,
USERID
);
console
.
info
(
"
==========ActsBmsGetInfosSecondScene is ==========
"
+
JSON
.
stringify
(
datainfo
));
checkgetApplicationInfos
(
datainfo
);
done
();
...
...
@@ -493,7 +493,7 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test getApplicationInfos interfaces with two haps and different param.
*/
it
(
'
getApplicationInfos_0400
'
,
0
,
async
function
(
done
)
{
let
datainfo
=
await
demo
.
getAllApplicationInfo
(
0
,
USERID
);
let
datainfo
=
await
demo
.
getAllApplicationInfo
(
demo
.
BundleFlag
.
GET_BUNDLE_DEFAULT
,
USERID
);
expect
(
datainfo
.
length
).
assertLarger
(
0
);
checkgetApplicationInfos
(
datainfo
);
done
();
...
...
@@ -505,7 +505,7 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test getApplicationInfos interfaces with two haps.
*/
it
(
'
getApplicationInfos_0700
'
,
0
,
async
function
(
done
)
{
await
demo
.
getAllApplicationInfo
(
8
,
USERID
,
(
error
,
datainfo
)
=>
{
await
demo
.
getAllApplicationInfo
(
demo
.
BundleFlag
.
GET_APPLICATION_INFO_WITH_PERMISSION
,
USERID
,
(
error
,
datainfo
)
=>
{
for
(
let
i
=
0
;
i
<
datainfo
.
length
;
i
++
)
{
expect
(
datainfo
[
i
].
name
.
length
).
assertLarger
(
0
);
if
(
datainfo
[
i
].
name
==
NAME1
||
datainfo
[
i
].
name
==
NAME2
...
...
@@ -533,7 +533,7 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test getApplicationInfos interfaces with three haps.
*/
it
(
'
getApplicationInfos_0800
'
,
0
,
async
function
(
done
)
{
await
demo
.
getAllApplicationInfo
(
0
,
USERID
,
(
error
,
datainfo
)
=>
{
await
demo
.
getAllApplicationInfo
(
demo
.
BundleFlag
.
GET_BUNDLE_DEFAULT
,
USERID
,
(
error
,
datainfo
)
=>
{
for
(
let
i
=
0
;
i
<
datainfo
.
length
;
i
++
)
{
expect
(
datainfo
[
i
].
name
.
length
).
assertLarger
(
0
);
if
(
datainfo
[
i
].
name
==
NAME1
||
datainfo
[
i
].
name
==
NAME2
...
...
@@ -561,7 +561,7 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test getApplicationInfos interfaces with two haps and different param.
*/
it
(
'
getApplicationInfos_0900
'
,
0
,
async
function
(
done
)
{
await
demo
.
getAllApplicationInfo
(
0
,
USERID
,
(
error
,
datainfo
)
=>
{
await
demo
.
getAllApplicationInfo
(
demo
.
BundleFlag
.
GET_BUNDLE_DEFAULT
,
USERID
,
(
error
,
datainfo
)
=>
{
for
(
let
i
=
0
;
i
<
datainfo
.
length
;
i
++
)
{
expect
(
datainfo
[
i
].
name
.
length
).
assertLarger
(
0
);
if
(
datainfo
[
i
].
name
==
NAME1
||
datainfo
[
i
].
name
==
NAME2
...
...
@@ -589,7 +589,7 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test getBundleInfos interfaces with two haps.
*/
it
(
'
getBundleInfos_0200
'
,
0
,
async
function
(
done
)
{
let
data
=
await
demo
.
getAllBundleInfo
(
0
);
let
data
=
await
demo
.
getAllBundleInfo
(
demo
.
BundleFlag
.
GET_BUNDLE_DEFAULT
);
expect
(
typeof
data
).
assertEqual
(
OBJECT
);
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
expect
(
data
[
i
].
name
.
length
).
assertLarger
(
0
);
...
...
@@ -612,7 +612,7 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test getBundleInfos interfaces with two haps and different param.
*/
it
(
'
getBundleInfos_0400
'
,
0
,
async
function
(
done
)
{
let
data
=
await
demo
.
getAllBundleInfo
(
1
);
let
data
=
await
demo
.
getAllBundleInfo
(
demo
.
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
);
expect
(
typeof
data
).
assertEqual
(
OBJECT
);
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
expect
(
data
[
i
].
name
.
length
).
assertLarger
(
0
);
...
...
@@ -671,7 +671,7 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test getBundleInfos interfaces with two haps.
*/
it
(
'
getBundleInfos_0700
'
,
0
,
async
function
(
done
)
{
await
demo
.
getAllBundleInfo
(
0
,
(
error
,
data
)
=>
{
await
demo
.
getAllBundleInfo
(
demo
.
BundleFlag
.
GET_BUNDLE_DEFAULT
,
(
error
,
data
)
=>
{
expect
(
typeof
data
).
assertEqual
(
OBJECT
);
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
expect
(
data
[
i
].
name
.
length
).
assertLarger
(
0
);
...
...
@@ -695,7 +695,7 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test getBundleInfos interfaces with two haps and different param.
*/
it
(
'
getBundleInfos_0900
'
,
0
,
async
function
(
done
)
{
await
demo
.
getAllBundleInfo
(
1
,
(
error
,
data
)
=>
{
await
demo
.
getAllBundleInfo
(
demo
.
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
,
(
error
,
data
)
=>
{
expect
(
typeof
data
).
assertEqual
(
OBJECT
);
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
expect
(
data
[
i
].
name
.
length
).
assertLarger
(
0
);
...
...
@@ -751,7 +751,7 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test getBundleInfos interfaces with three haps.
*/
it
(
'
getBundleInfos_0300
'
,
0
,
async
function
(
done
)
{
let
data
=
await
demo
.
getAllBundleInfo
(
0
);
let
data
=
await
demo
.
getAllBundleInfo
(
demo
.
BundleFlag
.
GET_BUNDLE_DEFAULT
);
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
expect
(
data
[
i
].
name
.
length
).
assertLarger
(
0
);
expect
(
data
[
i
].
appInfo
.
name
.
length
).
assertLarger
(
0
);
...
...
@@ -773,7 +773,7 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test getBundleInfos interfaces with three haps and different param.
*/
it
(
'
getBundleInfos_0500
'
,
0
,
async
function
(
done
)
{
let
data
=
await
demo
.
getAllBundleInfo
(
1
);
let
data
=
await
demo
.
getAllBundleInfo
(
demo
.
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
);
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
expect
(
data
[
i
].
name
.
length
).
assertLarger
(
0
);
expect
(
data
[
i
].
appInfo
.
name
.
length
).
assertLarger
(
0
);
...
...
@@ -795,7 +795,7 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test getBundleInfos interfaces with three haps.
*/
it
(
'
getBundleInfos_0800
'
,
0
,
async
function
(
done
)
{
await
demo
.
getAllBundleInfo
(
0
,
(
error
,
data
)
=>
{
await
demo
.
getAllBundleInfo
(
demo
.
BundleFlag
.
GET_BUNDLE_DEFAULT
,
(
error
,
data
)
=>
{
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
expect
(
data
[
i
].
name
.
length
).
assertLarger
(
0
);
expect
(
data
[
i
].
appInfo
.
name
.
length
).
assertLarger
(
0
);
...
...
@@ -1151,7 +1151,7 @@ describe('ActsBundleManagerTest', function () {
{
"
bundleName
"
:
"
wrong name
"
,
"
abilityName
"
:
"
com.example.myapplication1.MainAbility
"
},
0
,
USERID
).
then
(
datainfo
=>
{
},
demo
.
BundleFlag
.
GET_BUNDLE_DEFAULT
,
USERID
).
then
(
datainfo
=>
{
console
.
info
(
"
queryAbilityByWant_0400 dataInfo : ===========
"
+
datainfo
);
expect
(
datainfo
).
assertFail
();
}).
catch
(
err
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录