Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
65f7cc95
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看板
未验证
提交
65f7cc95
编写于
1月 26, 2022
作者:
O
openharmony_ci
提交者:
Gitee
1月 26, 2022
浏览文件
操作
浏览文件
下载
差异文件
!1718 Bms test update cover userId
Merge pull request !1718 from ry/master_0125_bmscode
上级
835595c9
ba6c42d6
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
282 addition
and
67 deletion
+282
-67
appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/test/ExampleJsunit.test.js
...emanagertest/entry/src/main/js/test/ExampleJsunit.test.js
+282
-67
未找到文件。
appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/test/ExampleJsunit.test.js
浏览文件 @
65f7cc95
...
...
@@ -476,7 +476,6 @@ describe('ActsBundleManagerTest', function () {
for
(
var
j
=
0
;
j
<
datainfo
.
moduleInfos
;
j
++
)
{
expect
(
datainfo
.
moduleInfos
[
j
].
moduleName
).
assertEqual
(
"
entry
"
)
expect
(
datainfo
.
moduleInfos
[
j
].
moduleSourceDir
.
length
).
assertLarger
(
0
)
}
}).
catch
(
err
=>
{
console
.
info
(
"
getApplicationInfo fail:
"
+
JSON
.
stringify
(
err
))
...
...
@@ -1010,7 +1009,7 @@ describe('ActsBundleManagerTest', function () {
it
(
'
getBundleArchiveInfo_0900
'
,
0
,
async
function
(
done
)
{
await
demo
.
getBundleArchiveInfo
(
PATH
+
ERROR
,
1
,
OnReceiveEvent
)
function
OnReceiveEvent
(
err
,
datainfo
)
{
if
(
err
)
{
if
(
err
)
{
console
.
info
(
"
getBundleArchiveInfo error
"
+
JSON
.
stringify
(
err
));
expect
(
err
).
assertEqual
(
1
);
done
();
...
...
@@ -1030,7 +1029,7 @@ describe('ActsBundleManagerTest', function () {
it
(
'
getBundleArchiveInfo_1000
'
,
0
,
async
function
(
done
)
{
await
demo
.
getBundleArchiveInfo
(
'
'
,
1
,
OnReceiveEvent
)
function
OnReceiveEvent
(
err
,
datainfo
)
{
if
(
err
)
{
if
(
err
)
{
console
.
info
(
"
getBundleArchiveInfo error
"
+
JSON
.
stringify
(
err
));
expect
(
err
).
assertEqual
(
1
);
done
();
...
...
@@ -1983,7 +1982,7 @@ describe('ActsBundleManagerTest', function () {
it
(
'
getBundleInfo_0900
'
,
0
,
async
function
(
done
)
{
await
demo
.
getBundleInfo
(
'
error
'
,
demo
.
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
,
OnReceiveEvent
)
function
OnReceiveEvent
(
err
,
datainfo
)
{
if
(
err
){
if
(
err
)
{
console
.
info
(
"
getBundleInfo err
"
+
JSON
.
stringify
(
err
));
expect
(
err
).
assertEqual
(
1
);
done
();
...
...
@@ -2043,7 +2042,7 @@ describe('ActsBundleManagerTest', function () {
await
demo
.
getBundleInfo
(
'
'
,
demo
.
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
,
OnReceiveEvent
)
function
OnReceiveEvent
(
err
,
datainfo
)
{
if
(
err
){
if
(
err
)
{
console
.
info
(
"
getBundleInfo err
"
+
JSON
.
stringify
(
err
));
expect
(
err
).
assertEqual
(
1
);
done
();
...
...
@@ -2062,7 +2061,7 @@ describe('ActsBundleManagerTest', function () {
*/
it
(
'
getApplicationInfo_0500
'
,
0
,
async
function
(
done
)
{
demo
.
getApplicationInfo
(
''
,
demo
.
BundleFlag
.
GET_APPLICATION_INFO_WITH_PERMISSION
,
0
,
(
error
,
datainfo
)
=>
{
if
(
error
){
if
(
error
)
{
console
.
info
(
"
getApplicationInfo err
"
+
JSON
.
stringify
(
error
));
expect
(
error
).
assertEqual
(
1
);
done
();
...
...
@@ -2098,7 +2097,7 @@ describe('ActsBundleManagerTest', function () {
*/
it
(
'
getApplicationInfo_1000
'
,
0
,
async
function
(
done
)
{
demo
.
getApplicationInfo
(
''
,
demo
.
BundleFlag
.
GET_APPLICATION_INFO_WITH_PERMISSION
,
0
,
(
error
,
datainfo
)
=>
{
if
(
error
){
if
(
error
)
{
console
.
info
(
"
getApplicationInfo fail
"
+
JSON
.
stringify
(
error
));
expect
(
error
).
assertEqual
(
1
);
done
();
...
...
@@ -2132,7 +2131,7 @@ describe('ActsBundleManagerTest', function () {
{
"
bundleName
"
:
"
com.example.myapplication1
"
,
"
abilityName
"
:
"
com.example.myapplication1.MainAbility
"
,
},
demo
.
BundleFlag
.
GET_ABILITY_INFO_WITH_APPLICATION
|
demo
.
BundleFlag
.
GET_ABILITY_INFO_WITH_PERMISSION
,
0
).
then
(
data
=>
{
},
demo
.
BundleFlag
.
GET_ABILITY_INFO_WITH_APPLICATION
|
demo
.
BundleFlag
.
GET_ABILITY_INFO_WITH_PERMISSION
,
0
).
then
(
data
=>
{
expect
(
data
.
length
).
assertLarger
(
0
);
for
(
let
i
=
0
,
len
=
data
.
length
;
i
<
len
;
i
++
)
{
var
datainfo
=
data
[
i
];
...
...
@@ -2373,6 +2372,222 @@ describe('ActsBundleManagerTest', function () {
})
/**
* @tc.number getBundleInfo_1400
* @tc.name BUNDLEMGR::getBundleInfo
* @tc.desc Test getBundleInfo interface with current userId(by promise).
*/
it
(
'
getBundleInfo_1400
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
()
installData
.
install
([
PATH
+
BMSJSTEST1
],
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
getInfo
();
});
async
function
getInfo
()
{
var
bundleOptions
=
{
userId
:
0
,
networkId
:
""
};
var
dataInfo
=
await
demo
.
getBundleInfo
(
NAME1
,
demo
.
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
,
bundleOptions
);
expect
(
dataInfo
.
name
).
assertEqual
(
NAME1
)
expect
(
dataInfo
.
vendor
).
assertEqual
(
"
example
"
)
expect
(
dataInfo
.
versionCode
).
assertEqual
(
VERSIONCODE1
)
expect
(
dataInfo
.
versionName
).
assertLarger
(
0
)
expect
(
dataInfo
.
entryModuleName
).
assertEqual
(
"
entry
"
)
expect
(
dataInfo
.
appInfo
.
name
).
assertEqual
(
NAME1
)
expect
(
dataInfo
.
appInfo
.
description
).
assertEqual
(
"
$string:mainability_description
"
)
expect
(
dataInfo
.
appInfo
.
descriptionId
>=
0
).
assertTrue
()
expect
(
dataInfo
.
appInfo
.
icon
).
assertEqual
(
"
$media:icon
"
)
expect
(
dataInfo
.
appInfo
.
iconId
>=
0
).
assertTrue
()
expect
(
dataInfo
.
appInfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
expect
(
dataInfo
.
appInfo
.
labelId
>=
0
).
assertTrue
()
expect
(
dataInfo
.
appInfo
.
systemApp
).
assertEqual
(
true
)
expect
(
dataInfo
.
appInfo
.
supportedModes
).
assertEqual
(
0
)
expect
(
dataInfo
.
updateTime
).
assertLarger
(
0
)
expect
(
dataInfo
.
reqPermissions
.
length
).
assertEqual
(
0
)
expect
(
dataInfo
.
reqPermissionDetails
.
length
).
assertEqual
(
0
)
expect
(
dataInfo
.
compatibleVersion
).
assertEqual
(
5
)
expect
(
dataInfo
.
targetVersion
).
assertEqual
(
5
)
expect
(
dataInfo
.
isCompressNativeLibs
).
assertEqual
(
false
)
for
(
var
s
=
0
;
s
<
dataInfo
.
hapModuleInfo
;
s
++
)
{
expect
(
dataInfo
.
moduleInfos
[
s
].
name
).
assertEqual
(
"
com.example.myapplication1
"
)
expect
(
dataInfo
.
moduleInfos
[
s
].
moduleName
).
assertEqual
(
"
entry
"
)
}
expect
(
dataInfo
.
entryModuleName
).
assertEqual
(
"
entry
"
)
expect
(
dataInfo
.
isSilentInstallation
.
length
).
assertEqual
(
0
)
expect
(
dataInfo
.
minCompatibleVersionCode
).
assertEqual
(
0
)
expect
(
dataInfo
.
entryInstallationFree
).
assertEqual
(
false
)
for
(
var
j
=
0
;
j
<
dataInfo
.
appInfo
.
moduleInfos
;
j
++
)
{
expect
(
dataInfo
.
appInfo
.
moduleInfos
[
j
].
moduleName
).
assertEqual
(
"
entry
"
)
expect
(
dataInfo
.
appInfo
.
moduleInfos
[
j
].
moduleSourceDir
).
assertEqual
(
DIR1
)
}
expect
(
dataInfo
.
appInfo
.
enabled
).
assertEqual
(
true
);
installData
.
uninstall
(
NAME1
,
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
}
})
/**
* @tc.number getBundleInfo_1500
* @tc.name BUNDLE::getBundleInfo
* @tc.desc Test getBundleInfo interface with current userId(by callback).
*/
it
(
'
getBundleInfo_1500
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
()
installData
.
install
([
PATH
+
BMSJSTEST1
],
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
getInfo
();
});
async
function
getInfo
()
{
var
bundleOptions
=
{
userId
:
0
,
networkId
:
""
};
demo
.
getBundleInfo
(
NAME1
,
demo
.
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
,
bundleOptions
,
(
err
,
dataInfo
)
=>
{
expect
(
dataInfo
.
name
).
assertEqual
(
NAME1
)
expect
(
dataInfo
.
vendor
).
assertEqual
(
"
example
"
)
expect
(
dataInfo
.
versionCode
).
assertEqual
(
VERSIONCODE1
)
expect
(
dataInfo
.
versionName
).
assertLarger
(
0
)
expect
(
dataInfo
.
entryModuleName
).
assertEqual
(
"
entry
"
)
expect
(
dataInfo
.
appInfo
.
name
).
assertEqual
(
NAME1
)
expect
(
dataInfo
.
appInfo
.
description
).
assertEqual
(
"
$string:mainability_description
"
)
expect
(
dataInfo
.
appInfo
.
descriptionId
>=
0
).
assertTrue
()
expect
(
dataInfo
.
appInfo
.
icon
).
assertEqual
(
"
$media:icon
"
)
expect
(
dataInfo
.
appInfo
.
iconId
>=
0
).
assertTrue
()
expect
(
dataInfo
.
appInfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
expect
(
dataInfo
.
appInfo
.
labelId
>=
0
).
assertTrue
()
expect
(
dataInfo
.
appInfo
.
systemApp
).
assertEqual
(
true
)
expect
(
dataInfo
.
appInfo
.
supportedModes
).
assertEqual
(
0
)
expect
(
dataInfo
.
updateTime
).
assertLarger
(
0
)
expect
(
dataInfo
.
reqPermissions
.
length
).
assertEqual
(
0
)
expect
(
dataInfo
.
reqPermissionDetails
.
length
).
assertEqual
(
0
)
expect
(
dataInfo
.
compatibleVersion
).
assertEqual
(
5
)
expect
(
dataInfo
.
targetVersion
).
assertEqual
(
5
)
expect
(
dataInfo
.
isCompressNativeLibs
).
assertEqual
(
false
)
for
(
var
s
=
0
;
s
<
dataInfo
.
hapModuleInfo
;
s
++
)
{
expect
(
dataInfo
.
moduleInfos
[
s
].
name
).
assertEqual
(
"
com.example.myapplication1
"
)
expect
(
dataInfo
.
moduleInfos
[
s
].
moduleName
).
assertEqual
(
"
entry
"
)
}
expect
(
dataInfo
.
entryModuleName
).
assertEqual
(
"
entry
"
)
expect
(
dataInfo
.
isSilentInstallation
.
length
).
assertEqual
(
0
)
expect
(
dataInfo
.
minCompatibleVersionCode
).
assertEqual
(
0
)
expect
(
dataInfo
.
entryInstallationFree
).
assertEqual
(
false
)
for
(
var
j
=
0
;
j
<
dataInfo
.
appInfo
.
moduleInfos
;
j
++
)
{
expect
(
dataInfo
.
appInfo
.
moduleInfos
[
j
].
moduleName
).
assertEqual
(
"
entry
"
)
expect
(
dataInfo
.
appInfo
.
moduleInfos
[
j
].
moduleSourceDir
).
assertEqual
(
DIR1
)
}
expect
(
dataInfo
.
appInfo
.
enabled
).
assertEqual
(
true
);
installData
.
uninstall
(
NAME1
,
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
});
}
})
/**
* @tc.number getBundleInfo_1600
* @tc.name BUNDLEMGR::getBundleInfo
* @tc.desc Test getBundleInfo interface with other userId(by promise).
*/
it
(
'
getBundleInfo_1600
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
()
installData
.
install
([
PATH
+
BMSJSTEST1
],
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
getInfo
();
});
async
function
getInfo
()
{
demo
.
getBundleInfo
(
NAME1
,
demo
.
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
,
{
userId
:
1
,
networkId
:
""
}).
then
(
data
=>
{
expect
().
assertFail
();
}).
catch
(
err
=>
{
expect
(
err
).
assertEqual
(
1
);
installData
.
uninstall
(
NAME1
,
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
});
}
})
/**
* @tc.number getBundleInfo_1700
* @tc.name BUNDLE::getBundleInfo
* @tc.desc Test getBundleInfo interface with other userId(by callback).
*/
it
(
'
getBundleInfo_1700
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
()
installData
.
install
([
PATH
+
BMSJSTEST1
],
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
getInfo
();
});
async
function
getInfo
()
{
demo
.
getBundleInfo
(
NAME1
,
demo
.
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
,
{
userId
:
1
,
networkId
:
""
},
(
err
,
dataInfo
)
=>
{
expect
(
err
).
assertEqual
(
1
);
expect
(
dataInfo
).
assertEqual
(
undefined
);
installData
.
uninstall
(
NAME1
,
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
});
}
})
/**
* @tc.number queryAbilityByWant_1000
* @tc.name BUNDLE::queryAbilityByWant
...
...
@@ -2403,7 +2618,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST1
],
installParam
,
async
(
err
,
data
)
=>
{
expect
(
data
.
statusMessage
).
assertEqual
(
"
SUCCESS
"
)
var
datainfo
=
await
demo
.
getBundleInfo
(
NAME1
,
demo
.
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
);
console
.
info
(
"
getBundleInfo result
"
+
JSON
.
stringify
(
datainfo
))
console
.
info
(
"
getBundleInfo result
"
+
JSON
.
stringify
(
datainfo
))
expect
(
datainfo
.
name
).
assertEqual
(
NAME1
);
installData
.
uninstall
(
NAME1
,
installParam
,
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录