Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
1a89cc13
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看板
未验证
提交
1a89cc13
编写于
4月 12, 2022
作者:
O
openharmony_ci
提交者:
Gitee
4月 12, 2022
浏览文件
操作
浏览文件
下载
差异文件
!2974 修改多hap安装用例,增加检查点,修改不符合用例描述的辅助demo
Merge pull request !2974 from ry/master
上级
4f02be1d
262387a8
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
579 addition
and
864 deletion
+579
-864
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageruninstall/entry/src/main/js/test/ExampleJsunit.test.js
...geruninstall/entry/src/main/js/test/ExampleJsunit.test.js
+109
-105
appexecfwk/bundle_standard/bundlemanager/actsbundlemgrmultipleinstalltest/entry/src/main/js/test/ExampleJsunit.test.js
...einstalltest/entry/src/main/js/test/ExampleJsunit.test.js
+439
-728
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmseighthright/src/main/config.json
...emanager/sceneProject/bmseighthright/src/main/config.json
+1
-1
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmseleventhright/src/main/config.json
...anager/sceneProject/bmseleventhright/src/main/config.json
+2
-2
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsfifthright/src/main/config.json
...lemanager/sceneProject/bmsfifthright/src/main/config.json
+2
-2
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsfirstright/src/main/config.json
...lemanager/sceneProject/bmsfirstright/src/main/config.json
+3
-3
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsfourteenthright/src/main/config.json
...ager/sceneProject/bmsfourteenthright/src/main/config.json
+2
-2
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsfourthright/src/main/config.json
...emanager/sceneProject/bmsfourthright/src/main/config.json
+2
-2
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsninthright/src/main/config.json
...lemanager/sceneProject/bmsninthright/src/main/config.json
+4
-4
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmssecondbackupright/src/main/config.json
...er/sceneProject/bmssecondbackupright/src/main/config.json
+2
-2
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmssecondright/src/main/config.json
...emanager/sceneProject/bmssecondright/src/main/config.json
+2
-2
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmssixteenthright/src/main/config.json
...nager/sceneProject/bmssixteenthright/src/main/config.json
+2
-2
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmssixthright/src/main/config.json
...lemanager/sceneProject/bmssixthright/src/main/config.json
+2
-2
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmstenthright/src/main/config.json
...lemanager/sceneProject/bmstenthright/src/main/config.json
+3
-3
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsthirteenthright/src/main/config.json
...ager/sceneProject/bmsthirteenthright/src/main/config.json
+2
-2
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmstwelfthright/src/main/config.json
...manager/sceneProject/bmstwelfthright/src/main/config.json
+2
-2
未找到文件。
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageruninstall/entry/src/main/js/test/ExampleJsunit.test.js
浏览文件 @
1a89cc13
...
@@ -16,28 +16,28 @@
...
@@ -16,28 +16,28 @@
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
import
demo
from
'
@ohos.bundle
'
import
demo
from
'
@ohos.bundle
'
const
PATH
=
"
/data/
"
const
PATH
=
"
/data/
"
;
const
ERROR
=
"
error.hap
"
const
ERROR
=
"
error.hap
"
;
const
BMSJSTEST1
=
"
bmsJstest1.hap
"
const
BMSJSTEST1
=
"
bmsJstest1.hap
"
;
const
BMSJSTEST2
=
"
bmsJstest2.hap
"
const
BMSJSTEST2
=
"
bmsJstest2.hap
"
;
const
BMSJSTEST3
=
"
bmsJstest3.hap
"
const
BMSJSTEST3
=
"
bmsJstest3.hap
"
;
const
BMSJSTEST4
=
"
bmsJstest4.hap
"
const
BMSJSTEST4
=
"
bmsJstest4.hap
"
;
const
BMSJSTEST5
=
"
bmsJstest5.hap
"
const
BMSJSTEST5
=
"
bmsJstest5.hap
"
;
const
BMSJSTEST6
=
"
bmsJstest6.hap
"
const
BMSJSTEST6
=
"
bmsJstest6.hap
"
;
const
BMSJSTEST8
=
"
bmsJstest8.hap
"
const
BMSJSTEST8
=
"
bmsJstest8.hap
"
;
const
NAME1
=
"
com.example.myapplication1
"
const
NAME1
=
"
com.example.myapplication1
"
;
const
NAME2
=
"
com.example.myapplication2
"
const
NAME2
=
"
com.example.myapplication2
"
;
const
NAME3
=
"
com.example.myapplication4
"
const
NAME3
=
"
com.example.myapplication4
"
;
const
NAME4
=
"
com.example.myapplication5
"
const
NAME4
=
"
com.example.myapplication5
"
;
const
NAME5
=
"
com.example.myapplication6
"
const
NAME5
=
"
com.example.myapplication6
"
;
const
THIRD1
=
"
com.example.third1
"
const
THIRD1
=
"
com.example.third1
"
;
const
LAUNCHER
=
"
com.ohos.launcher
"
const
LAUNCHER
=
"
com.ohos.launcher
"
;
const
SUCCESS
=
"
SUCCESS
"
const
SUCCESS
=
"
SUCCESS
"
;
le
t
installParam
=
{
cons
t
installParam
=
{
userId
:
100
,
userId
:
100
,
installFlag
:
1
,
installFlag
:
1
,
isKeepData
:
false
isKeepData
:
false
}
}
;
describe
(
'
ActsBundleManagerUninstall
'
,
function
()
{
describe
(
'
ActsBundleManagerUninstall
'
,
function
()
{
...
@@ -47,17 +47,17 @@ describe('ActsBundleManagerUninstall', function () {
...
@@ -47,17 +47,17 @@ describe('ActsBundleManagerUninstall', function () {
* @tc.desc Test uninstall interfaces.
* @tc.desc Test uninstall interfaces.
*/
*/
it
(
'
uninstall_0100
'
,
0
,
async
function
(
done
)
{
it
(
'
uninstall_0100
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
()
let
installData
=
await
demo
.
getBundleInstaller
()
;
installData
.
install
([
PATH
+
BMSJSTEST1
],
installParam
,
async
(
err
,
data
)
=>
{
installData
.
install
([
PATH
+
BMSJSTEST1
],
installParam
,
async
(
err
,
data
)
=>
{
checkInstallResult
(
data
)
checkInstallResult
(
err
,
data
);
await
queryInfo
(
NAME1
,
0
)
await
queryInfo
(
NAME1
,
0
)
;
installData
.
uninstall
(
NAME1
,
installParam
,
async
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME1
,
installParam
,
async
(
err
,
data
)
=>
{
checkInstallResult
(
data
)
checkInstallResult
(
err
,
data
);
await
queryInfo
(
NAME1
,
1
)
await
queryInfo
(
NAME1
,
1
)
;
done
()
done
()
;
})
})
;
})
})
;
})
})
;
/**
/**
* @tc.number uninstall_0200
* @tc.number uninstall_0200
...
@@ -65,18 +65,18 @@ describe('ActsBundleManagerUninstall', function () {
...
@@ -65,18 +65,18 @@ describe('ActsBundleManagerUninstall', function () {
* @tc.desc Test uninstall interfaces.
* @tc.desc Test uninstall interfaces.
*/
*/
it
(
'
uninstall_0200
'
,
0
,
async
function
(
done
)
{
it
(
'
uninstall_0200
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
()
let
installData
=
await
demo
.
getBundleInstaller
()
;
installData
.
install
([
PATH
+
BMSJSTEST2
,
PATH
+
BMSJSTEST3
],
installParam
,
async
(
err
,
data
)
=>
{
installData
.
install
([
PATH
+
BMSJSTEST2
,
PATH
+
BMSJSTEST3
],
installParam
,
async
(
err
,
data
)
=>
{
checkInstallResult
(
data
)
checkInstallResult
(
err
,
data
);
let
bundleInfo
=
await
demo
.
getBundleInfo
(
NAME2
,
demo
.
BundleFlag
.
GET_BUNDLE_DEFAULT
);
let
bundleInfo
=
await
demo
.
getBundleInfo
(
NAME2
,
demo
.
BundleFlag
.
GET_BUNDLE_DEFAULT
);
expect
(
bundleInfo
.
appInfo
.
moduleSourceDirs
.
length
).
assertEqual
(
2
)
expect
(
bundleInfo
.
appInfo
.
moduleSourceDirs
.
length
).
assertEqual
(
2
)
;
installData
.
uninstall
(
NAME2
,
installParam
,
async
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME2
,
installParam
,
async
(
err
,
data
)
=>
{
checkInstallResult
(
data
)
checkInstallResult
(
err
,
data
);
await
queryInfo
(
NAME2
,
1
)
await
queryInfo
(
NAME2
,
1
)
;
done
()
done
()
;
})
})
;
})
})
;
})
})
;
/**
/**
* @tc.number uninstall_0300
* @tc.number uninstall_0300
...
@@ -84,33 +84,33 @@ describe('ActsBundleManagerUninstall', function () {
...
@@ -84,33 +84,33 @@ describe('ActsBundleManagerUninstall', function () {
* @tc.desc Test uninstall interfaces.
* @tc.desc Test uninstall interfaces.
*/
*/
it
(
'
uninstall_0300
'
,
0
,
async
function
(
done
)
{
it
(
'
uninstall_0300
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
()
let
installData
=
await
demo
.
getBundleInstaller
()
;
installData
.
install
([
PATH
+
BMSJSTEST4
],
installParam
,
async
(
err
,
data
)
=>
{
installData
.
install
([
PATH
+
BMSJSTEST4
],
installParam
,
async
(
err
,
data
)
=>
{
checkInstallResult
(
data
)
checkInstallResult
(
err
,
data
);
installData
.
install
([
PATH
+
BMSJSTEST5
],
installParam
,
async
(
err
,
data
)
=>
{
installData
.
install
([
PATH
+
BMSJSTEST5
],
installParam
,
async
(
err
,
data
)
=>
{
checkInstallResult
(
data
)
checkInstallResult
(
err
,
data
);
installData
.
install
([
PATH
+
BMSJSTEST6
],
installParam
,
async
(
err
,
data
)
=>
{
installData
.
install
([
PATH
+
BMSJSTEST6
],
installParam
,
async
(
err
,
data
)
=>
{
checkInstallResult
(
data
)
checkInstallResult
(
err
,
data
);
await
queryInfo
(
NAME3
,
0
)
await
queryInfo
(
NAME3
,
0
)
;
await
queryInfo
(
NAME4
,
0
)
await
queryInfo
(
NAME4
,
0
)
;
await
queryInfo
(
NAME5
,
0
)
await
queryInfo
(
NAME5
,
0
)
;
installData
.
uninstall
(
NAME3
,
installParam
,
async
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME3
,
installParam
,
async
(
err
,
data
)
=>
{
checkInstallResult
(
data
)
checkInstallResult
(
err
,
data
);
installData
.
uninstall
(
NAME4
,
installParam
,
async
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME4
,
installParam
,
async
(
err
,
data
)
=>
{
checkInstallResult
(
data
)
checkInstallResult
(
err
,
data
);
installData
.
uninstall
(
NAME5
,
installParam
,
async
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME5
,
installParam
,
async
(
err
,
data
)
=>
{
checkInstallResult
(
data
)
checkInstallResult
(
err
,
data
);
await
queryInfo
(
NAME3
,
1
)
await
queryInfo
(
NAME3
,
1
)
;
await
queryInfo
(
NAME4
,
1
)
await
queryInfo
(
NAME4
,
1
)
;
await
queryInfo
(
NAME5
,
1
)
await
queryInfo
(
NAME5
,
1
)
;
done
()
done
()
;
})
})
;
})
})
;
})
})
;
})
})
;
})
})
;
})
})
;
})
})
;
/**
/**
* @tc.number uninstall_0400
* @tc.number uninstall_0400
...
@@ -120,12 +120,13 @@ describe('ActsBundleManagerUninstall', function () {
...
@@ -120,12 +120,13 @@ describe('ActsBundleManagerUninstall', function () {
it
(
'
uninstall_0400
'
,
0
,
async
function
(
done
)
{
it
(
'
uninstall_0400
'
,
0
,
async
function
(
done
)
{
demo
.
getBundleInstaller
().
then
((
data
)
=>
{
demo
.
getBundleInstaller
().
then
((
data
)
=>
{
data
.
uninstall
(
ERROR
,
installParam
,
(
err
,
data
)
=>
{
data
.
uninstall
(
ERROR
,
installParam
,
(
err
,
data
)
=>
{
expect
(
data
.
status
).
assertEqual
(
demo
.
InstallErrorCode
.
STATUS_UNINSTALL_FAILURE
)
expect
(
err
.
code
).
assertEqual
(
-
1
);
expect
(
data
.
statusMessage
).
assertEqual
(
"
STATUS_UNINSTALL_FAILURE
"
)
expect
(
data
.
status
).
assertEqual
(
demo
.
InstallErrorCode
.
STATUS_UNINSTALL_FAILURE
);
done
()
expect
(
data
.
statusMessage
).
assertEqual
(
"
STATUS_UNINSTALL_FAILURE
"
);
})
done
();
})
});
})
});
});
/**
/**
* @tc.number uninstall_0500
* @tc.number uninstall_0500
...
@@ -135,12 +136,13 @@ describe('ActsBundleManagerUninstall', function () {
...
@@ -135,12 +136,13 @@ describe('ActsBundleManagerUninstall', function () {
it
(
'
uninstall_0500
'
,
0
,
async
function
(
done
)
{
it
(
'
uninstall_0500
'
,
0
,
async
function
(
done
)
{
demo
.
getBundleInstaller
().
then
((
data
)
=>
{
demo
.
getBundleInstaller
().
then
((
data
)
=>
{
data
.
uninstall
(
''
,
installParam
,
(
err
,
data
)
=>
{
data
.
uninstall
(
''
,
installParam
,
(
err
,
data
)
=>
{
expect
(
data
.
status
).
assertEqual
(
demo
.
InstallErrorCode
.
STATUS_UNINSTALL_FAILURE_ABORTED
)
expect
(
err
.
code
).
assertEqual
(
-
1
);
expect
(
data
.
statusMessage
).
assertEqual
(
"
STATUS_UNINSTALL_FAILURE_ABORTED
"
)
expect
(
data
.
status
).
assertEqual
(
demo
.
InstallErrorCode
.
STATUS_UNINSTALL_FAILURE
);
done
()
expect
(
data
.
statusMessage
).
assertEqual
(
"
STATUS_UNINSTALL_FAILURE
"
);
})
done
();
})
});
})
});
});
/**
/**
* @tc.number uninstall_0600
* @tc.number uninstall_0600
...
@@ -150,12 +152,13 @@ describe('ActsBundleManagerUninstall', function () {
...
@@ -150,12 +152,13 @@ describe('ActsBundleManagerUninstall', function () {
it
(
'
uninstall_0600
'
,
0
,
async
function
(
done
)
{
it
(
'
uninstall_0600
'
,
0
,
async
function
(
done
)
{
demo
.
getBundleInstaller
().
then
((
data
)
=>
{
demo
.
getBundleInstaller
().
then
((
data
)
=>
{
data
.
uninstall
(
LAUNCHER
,
installParam
,
(
err
,
data
)
=>
{
data
.
uninstall
(
LAUNCHER
,
installParam
,
(
err
,
data
)
=>
{
expect
(
data
.
status
).
assertEqual
(
demo
.
InstallErrorCode
.
STATUS_UNINSTALL_FAILURE_CONFLICT
)
expect
(
err
.
code
).
assertEqual
(
-
1
);
expect
(
data
.
statusMessage
).
assertEqual
(
"
STATUS_UNINSTALL_FAILURE_CONFLICT
"
)
expect
(
data
.
status
).
assertEqual
(
demo
.
InstallErrorCode
.
STATUS_UNINSTALL_FAILURE
);
done
()
expect
(
data
.
statusMessage
).
assertEqual
(
"
STATUS_UNINSTALL_FAILURE
"
);
})
done
();
})
});
})
});
});
/**
/**
* @tc.number uninstall_0700
* @tc.number uninstall_0700
...
@@ -169,15 +172,15 @@ describe('ActsBundleManagerUninstall', function () {
...
@@ -169,15 +172,15 @@ describe('ActsBundleManagerUninstall', function () {
installFlag
:
1
,
installFlag
:
1
,
isKeepData
:
true
isKeepData
:
true
},
async
(
err
,
data
)
=>
{
},
async
(
err
,
data
)
=>
{
checkInstallResult
(
data
)
checkInstallResult
(
err
,
data
);
await
queryInfo
(
NAME1
,
0
)
await
queryInfo
(
NAME1
,
0
)
;
result
.
uninstall
(
NAME1
,
installParam
,
async
(
err
,
data
)
=>
{
result
.
uninstall
(
NAME1
,
installParam
,
async
(
err
,
data
)
=>
{
checkInstallResult
(
data
)
checkInstallResult
(
err
,
data
);
await
queryInfo
(
NAME1
,
1
)
await
queryInfo
(
NAME1
,
1
)
;
done
()
done
()
;
})
})
;
})
})
;
})
})
;
/**
/**
* @tc.number uninstall_0800
* @tc.number uninstall_0800
...
@@ -187,42 +190,43 @@ describe('ActsBundleManagerUninstall', function () {
...
@@ -187,42 +190,43 @@ describe('ActsBundleManagerUninstall', function () {
it
(
'
uninstall_0800
'
,
0
,
async
function
(
done
)
{
it
(
'
uninstall_0800
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
();
let
installData
=
await
demo
.
getBundleInstaller
();
installData
.
install
([
PATH
+
BMSJSTEST8
],
installParam
,
async
(
err
,
data
)
=>
{
installData
.
install
([
PATH
+
BMSJSTEST8
],
installParam
,
async
(
err
,
data
)
=>
{
checkInstallResult
(
data
)
checkInstallResult
(
err
,
data
);
let
bundleInfo
=
await
demo
.
getBundleInfo
(
'
com.example.third1
'
,
demo
.
BundleFlag
.
GET_BUNDLE_DEFAULT
);
let
bundleInfo
=
await
demo
.
getBundleInfo
(
'
com.example.third1
'
,
demo
.
BundleFlag
.
GET_BUNDLE_DEFAULT
);
expect
(
bundleInfo
.
uid
).
assertLarger
(
10000
);
expect
(
bundleInfo
.
uid
).
assertLarger
(
10000
);
installData
.
uninstall
(
THIRD1
,
installParam
,
async
(
err
,
data
)
=>
{
installData
.
uninstall
(
THIRD1
,
installParam
,
async
(
err
,
data
)
=>
{
checkInstallResult
(
data
)
checkInstallResult
(
err
,
data
);
await
queryInfo
(
'
com.example.third1
'
,
1
)
await
queryInfo
(
'
com.example.third1
'
,
1
)
;
done
()
done
()
;
})
})
;
})
})
;
})
})
;
async
function
queryInfo
(
bundleName
,
assertFlag
){
async
function
queryInfo
(
bundleName
,
assertFlag
){
if
(
!
assertFlag
)
{
if
(
!
assertFlag
)
{
await
demo
.
getBundleInfo
(
bundleName
,
demo
.
BundleFlag
.
GET_BUNDLE_DEFAULT
await
demo
.
getBundleInfo
(
bundleName
,
demo
.
BundleFlag
.
GET_BUNDLE_DEFAULT
).
then
(
datainfo
=>
{
).
then
(
datainfo
=>
{
console
.
info
(
"
getBundleInfo result0
"
+
JSON
.
stringify
(
datainfo
))
console
.
info
(
"
getBundleInfo result0
"
+
JSON
.
stringify
(
datainfo
))
;
expect
(
datainfo
.
name
).
assertEqual
(
bundleName
)
expect
(
datainfo
.
name
).
assertEqual
(
bundleName
)
;
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
console
.
info
(
"
getBundleInfo result0
"
+
JSON
.
stringify
(
datainfo
))
console
.
info
(
"
getBundleInfo result0
"
+
JSON
.
stringify
(
datainfo
))
;
expect
(
err
).
assertFail
()
expect
(
err
).
assertFail
()
;
})
})
;
}
else
{
}
else
{
await
demo
.
getBundleInfo
(
bundleName
,
demo
.
BundleFlag
.
GET_BUNDLE_DEFAULT
await
demo
.
getBundleInfo
(
bundleName
,
demo
.
BundleFlag
.
GET_BUNDLE_DEFAULT
).
then
(
datainfo
=>
{
).
then
(
datainfo
=>
{
console
.
info
(
"
getBundleInfo result1
"
+
JSON
.
stringify
(
datainfo
))
console
.
info
(
"
getBundleInfo result1
"
+
JSON
.
stringify
(
datainfo
))
;
expect
(
datainfo
).
assertFail
()
expect
(
datainfo
).
assertFail
()
;
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
console
.
info
(
"
getBundleInfo result1
"
+
JSON
.
stringify
(
err
))
console
.
info
(
"
getBundleInfo result1
"
+
JSON
.
stringify
(
err
))
;
expect
(
err
).
assertEqual
(
1
)
expect
(
err
).
assertEqual
(
1
)
;
})
})
;
}
}
}
}
function
checkInstallResult
(
result
)
{
function
checkInstallResult
(
err
,
result
)
{
console
.
info
(
"
install uninstall result
"
+
JSON
.
stringify
(
result
))
console
.
info
(
"
install uninstall result
"
+
JSON
.
stringify
(
result
));
expect
(
result
.
status
).
assertEqual
(
demo
.
InstallErrorCode
.
SUCCESS
)
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
result
.
statusMessage
).
assertEqual
(
SUCCESS
)
expect
(
result
.
status
).
assertEqual
(
demo
.
InstallErrorCode
.
SUCCESS
);
expect
(
result
.
statusMessage
).
assertEqual
(
SUCCESS
);
}
}
})
})
\ No newline at end of file
appexecfwk/bundle_standard/bundlemanager/actsbundlemgrmultipleinstalltest/entry/src/main/js/test/ExampleJsunit.test.js
浏览文件 @
1a89cc13
...
@@ -16,932 +16,643 @@
...
@@ -16,932 +16,643 @@
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
import
demo
from
'
@ohos.bundle
'
import
demo
from
'
@ohos.bundle
'
const
PATH
=
"
/data/test/resource/bms/install_bundle/
"
const
PATH
=
"
/data/test/resource/bms/install_bundle/
"
;
const
FIRST_RIGHT
=
"
first_right.hap
"
;
const
FIRST_RIGHT
=
"
first_right.hap
"
const
SECOND_RIGHT
=
"
second_right.hap
"
;
const
SECOND_RIGHT
=
"
second_right.hap
"
const
THIRD_RIGHT
=
"
third_right.hap
"
;
const
THIRD_RIGHT
=
"
third_right.hap
"
const
FOURTH_RIGHT
=
"
fourth_right.hap
"
;
const
FOURTH_RIGHT
=
"
fourth_right.hap
"
const
EIGHTH_RIGHT
=
"
eighth_right.hap
"
;
const
EIGHTH_RIGHT
=
"
eighth_right.hap
"
const
NINTH_RIGHT
=
"
ninth_right.hap
"
;
const
NINTH_RIGHT
=
"
ninth_right.hap
"
const
TENTH_RIGHT
=
"
tenth_right.hap
"
;
const
TENTH_RIGHT
=
"
tenth_right.hap
"
const
ELEVEBTH_RIGHT
=
"
eleventh_right.hap
"
;
const
ELEVEBTH_RIGHT
=
"
eleventh_right.hap
"
const
FIFTH_RIGHT
=
"
fifth_right.hap
"
;
const
FIFTH_RIGHT
=
"
fifth_right.hap
"
const
SECOND_BACKUP_RIGHT
=
"
second_backup_right.hap
"
;
const
SECOND_BACKUP_RIGHT
=
"
second_backup_right.hap
"
const
TWELFTH_RIGHT
=
"
twelfth_right.hap
"
;
const
TWELFTH_RIGHT
=
"
twelfth_right.hap
"
const
SIXTH_RIGHT
=
"
sixth_right.hap
"
;
const
SIXTH_RIGHT
=
"
sixth_right.hap
"
const
THIRTEENTH_RIGHT
=
"
thirteenth_right.hap
"
;
const
THIRTEENTH_RIGHT
=
"
thirteenth_right.hap
"
const
FOURTEENTH_RIGHT
=
"
fourteenth_right.hap
"
;
const
FOURTEENTH_RIGHT
=
"
fourteenth_right.hap
"
const
SIXTEENTH_RIGHT
=
"
sixteenth_right.hap
"
;
const
SIXTEENTH_RIGHT
=
"
sixteenth_right.hap
"
const
NAME
=
"
com.example.l3jsdemo
"
;
const
NAME
=
"
com.example.l3jsdemo
"
const
ERR_CODE
=
-
1
;
const
ERR_CODE
=
-
1
;
const
STATUS_INSTALL_FAILURE_INVALID
=
3
;
const
installParam1
=
{
const
STATUS_INSTALL_FAILURE_CONFLICT
=
4
;
userId
:
100
,
installFlag
:
0
,
const
STATUS_INSTALL_FAILURE_INCOMPATIBLE
=
6
;
isKeepData
:
false
};
const
installParam2
=
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
};
describe
(
'
ActsBundleMgrMultipleInstallTest
'
,
function
()
{
describe
(
'
ActsBundleMgrMultipleInstallTest
'
,
function
()
{
/**
* @tc.number BMS_Multiple_Hap_Install_0100
* @tc.name BUNDLE::install
* @tc.desc Test install interfaces.
*/
it
(
'
BMS_Multiple_Hap_Install_0100
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
();
installData
.
install
([
""
],
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
ERR_CODE
);
expect
(
data
.
status
).
assertEqual
(
STATUS_INSTALL_FAILURE_INVALID
);
console
.
info
(
'
===BMS_Multiple_Hap_Install_0100.Message1===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
data
.
statusMessage
).
assertEqual
(
"
STATUS_INSTALL_FAILURE_INVALID
"
);
done
();
});
})
/**
/**
* @tc.number BMS_Multiple_Hap_Install_0200
* @tc.number BMS_Multiple_Hap_Install_0200
* @tc.name BUNDLE::install
* @tc.name BUNDLE::install
* @tc.desc Test install interfaces.
* @tc.desc Test install interfaces
path err
.
*/
*/
it
(
'
BMS_Multiple_Hap_Install_0200
'
,
0
,
async
function
(
done
)
{
it
(
'
BMS_Multiple_Hap_Install_0200
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
();
let
installData
=
await
demo
.
getBundleInstaller
();
installData
.
install
([
PATH
+
FIRST_RIGHT
,
""
],
{
installData
.
install
([
PATH
+
FIRST_RIGHT
,
""
],
installParam1
,
async
(
err
,
data
)
=>
{
userId
:
100
,
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
STATUS_INSTALL_FAILURE_INVALID
,
installFlag
:
1
,
"
STATUS_INSTALL_FAILURE_INVALID
"
);
isKeepData
:
false
await
queryInfo
(
NAME
,
1
);
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
ERR_CODE
);
expect
(
data
.
status
).
assertEqual
(
STATUS_INSTALL_FAILURE_INVALID
);
console
.
info
(
'
===BMS_Multiple_Hap_Install_0200.Message1===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
data
.
statusMessage
).
assertEqual
(
"
STATUS_INSTALL_FAILURE_INVALID
"
);
done
();
done
();
});
});
})
});
/**
* @tc.number BMS_Multiple_Hap_Install_0300
* @tc.name BUNDLE::install
* @tc.desc Test install interfaces.
*/
it
(
'
BMS_Multiple_Hap_Install_0300
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
();
installData
.
install
([
PATH
+
FIRST_RIGHT
],
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
console
.
info
(
'
===BMS_Multiple_Hap_Install_0300.Message1===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
installData
.
uninstall
(
NAME
,
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data1
)
=>
{
console
.
info
(
'
===BMS_Multiple_Hap_Install_0300.Message3===
'
+
JSON
.
stringify
(
data1
.
statusMessage
));
expect
(
data1
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
})
});
})
/**
/**
* @tc.number BMS_Multiple_Hap_Install_0400
* @tc.number BMS_Multiple_Hap_Install_0400
* @tc.name BUNDLE::install
* @tc.name BUNDLE::install
* @tc.desc Test install interfaces.
* @tc.desc Test install interfaces
two different hap
.
*/
*/
it
(
'
BMS_Multiple_Hap_Install_0400
'
,
0
,
async
function
(
done
)
{
it
(
'
BMS_Multiple_Hap_Install_0400
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
();
let
installData
=
await
demo
.
getBundleInstaller
();
installData
.
install
([
PATH
+
SECOND_RIGHT
,
PATH
+
THIRD_RIGHT
],
{
installData
.
install
([
PATH
+
SECOND_RIGHT
,
PATH
+
THIRD_RIGHT
],
installParam1
,
userId
:
100
,
async
(
err
,
data
)
=>
{
installFlag
:
1
,
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
STATUS_INSTALL_FAILURE_CONFLICT
,
isKeepData
:
false
"
STATUS_INSTALL_FAILURE_CONFLICT
"
);
},
async
(
err
,
data
)
=>
{
await
queryInfo
(
NAME
,
1
);
expect
(
err
.
code
).
assertEqual
(
ERR_CODE
);
done
();
expect
(
data
.
status
).
assertEqual
(
STATUS_INSTALL_FAILURE_CONFLICT
);
});
console
.
info
(
'
===BMS_Multiple_Hap_Install_0400.Message1===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
});
expect
(
data
.
statusMessage
).
assertEqual
(
"
STATUS_INSTALL_FAILURE_CONFLICT
"
);
done
();
});
})
/**
/**
* @tc.number BMS_Multiple_Hap_Install_0500
* @tc.number BMS_Multiple_Hap_Install_0500
* @tc.name BUNDLE::install
* @tc.name BUNDLE::install
* @tc.desc Test install interfaces.
* @tc.desc Test install interfaces
version code different
.
*/
*/
it
(
'
BMS_Multiple_Hap_Install_0500
'
,
0
,
async
function
(
done
)
{
it
(
'
BMS_Multiple_Hap_Install_0500
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
();
let
installData
=
await
demo
.
getBundleInstaller
();
installData
.
install
([
PATH
+
SECOND_RIGHT
,
PATH
+
FOURTH_RIGHT
],
{
installData
.
install
([
PATH
+
FIRST_RIGHT
,
PATH
+
FOURTH_RIGHT
],
installParam1
,
userId
:
100
,
async
(
err
,
data
)
=>
{
installFlag
:
1
,
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
STATUS_INSTALL_FAILURE_CONFLICT
,
isKeepData
:
false
"
STATUS_INSTALL_FAILURE_CONFLICT
"
);
},
async
(
err
,
data
)
=>
{
await
queryInfo
(
NAME
,
1
);
expect
(
err
.
code
).
assertEqual
(
ERR_CODE
);
done
();
expect
(
data
.
status
).
assertEqual
(
STATUS_INSTALL_FAILURE_CONFLICT
);
});
console
.
info
(
'
===BMS_Multiple_Hap_Install_0500.Message1===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
});
expect
(
data
.
statusMessage
).
assertEqual
(
"
STATUS_INSTALL_FAILURE_CONFLICT
"
);
done
();
});
})
/**
/**
* @tc.number BMS_Multiple_Hap_Install_0600
* @tc.number BMS_Multiple_Hap_Install_0600
* @tc.name BUNDLE::install
* @tc.name BUNDLE::install
* @tc.desc Test install interfaces.
* @tc.desc Test install interfaces
version name different
.
*/
*/
it
(
'
BMS_Multiple_Hap_Install_0600
'
,
0
,
async
function
(
done
)
{
it
(
'
BMS_Multiple_Hap_Install_0600
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
();
let
installData
=
await
demo
.
getBundleInstaller
();
installData
.
install
([
PATH
+
FIRST_RIGHT
,
PATH
+
EIGHTH_RIGHT
],
{
installData
.
install
([
PATH
+
FIRST_RIGHT
,
PATH
+
EIGHTH_RIGHT
],
installParam1
,
userId
:
100
,
async
(
err
,
data
)
=>
{
installFlag
:
1
,
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
STATUS_INSTALL_FAILURE_CONFLICT
,
isKeepData
:
false
"
STATUS_INSTALL_FAILURE_CONFLICT
"
);
},
async
(
err
,
data
)
=>
{
await
queryInfo
(
NAME
,
1
);
expect
(
err
.
code
).
assertEqual
(
ERR_CODE
);
done
();
expect
(
data
.
status
).
assertEqual
(
STATUS_INSTALL_FAILURE_CONFLICT
);
});
console
.
info
(
'
===BMS_Multiple_Hap_Install_0600.Message1===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
});
expect
(
data
.
statusMessage
).
assertEqual
(
"
STATUS_INSTALL_FAILURE_CONFLICT
"
);
done
();
});
})
/**
/**
* @tc.number BMS_Multiple_Hap_Install_0700
* @tc.number BMS_Multiple_Hap_Install_0700
* @tc.name BUNDLE::install
* @tc.name BUNDLE::install
* @tc.desc Test install interfaces.
* @tc.desc Test install interfaces
target different
.
*/
*/
it
(
'
BMS_Multiple_Hap_Install_0700
'
,
0
,
async
function
(
done
)
{
it
(
'
BMS_Multiple_Hap_Install_0700
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
();
let
installData
=
await
demo
.
getBundleInstaller
();
installData
.
install
([
PATH
+
FIRST_RIGHT
,
PATH
+
NINTH_RIGHT
],
{
installData
.
install
([
PATH
+
FIRST_RIGHT
,
PATH
+
NINTH_RIGHT
],
installParam1
,
userId
:
100
,
async
(
err
,
data
)
=>
{
installFlag
:
1
,
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
STATUS_INSTALL_FAILURE_CONFLICT
,
isKeepData
:
false
"
STATUS_INSTALL_FAILURE_CONFLICT
"
);
},
async
(
err
,
data
)
=>
{
await
queryInfo
(
NAME
,
1
);
expect
(
err
.
code
).
assertEqual
(
ERR_CODE
);
done
();
expect
(
data
.
status
).
assertEqual
(
STATUS_INSTALL_FAILURE_CONFLICT
);
});
console
.
info
(
'
===BMS_Multiple_Hap_Install_0700.Message1===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
});
expect
(
data
.
statusMessage
).
assertEqual
(
"
STATUS_INSTALL_FAILURE_CONFLICT
"
);
done
();
});
})
/**
/**
* @tc.number BMS_Multiple_Hap_Install_0800
* @tc.number BMS_Multiple_Hap_Install_0800
* @tc.name BUNDLE::install
* @tc.name BUNDLE::install
* @tc.desc Test install interfaces.
* @tc.desc Test install interfaces
compatible different
.
*/
*/
it
(
'
BMS_Multiple_Hap_Install_0800
'
,
0
,
async
function
(
done
)
{
it
(
'
BMS_Multiple_Hap_Install_0800
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
();
let
installData
=
await
demo
.
getBundleInstaller
();
installData
.
install
([
PATH
+
FIRST_RIGHT
,
PATH
+
TENTH_RIGHT
],
{
installData
.
install
([
PATH
+
FIRST_RIGHT
,
PATH
+
TENTH_RIGHT
],
installParam1
,
userId
:
100
,
async
(
err
,
data
)
=>
{
installFlag
:
1
,
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
STATUS_INSTALL_FAILURE_CONFLICT
,
isKeepData
:
false
"
STATUS_INSTALL_FAILURE_CONFLICT
"
);
},
async
(
err
,
data
)
=>
{
await
queryInfo
(
NAME
,
1
);
expect
(
err
.
code
).
assertEqual
(
ERR_CODE
);
expect
(
data
.
status
).
assertEqual
(
STATUS_INSTALL_FAILURE_CONFLICT
);
console
.
info
(
'
===BMS_Multiple_Hap_Install_0800.Message1===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
data
.
statusMessage
).
assertEqual
(
"
STATUS_INSTALL_FAILURE_CONFLICT
"
);
done
();
done
();
});
});
})
})
;
/**
/**
* @tc.number BMS_Multiple_Hap_Install_0900
* @tc.number BMS_Multiple_Hap_Install_0900
* @tc.name BUNDLE::install
* @tc.name BUNDLE::install
* @tc.desc Test install interfaces.
* @tc.desc Test install interfaces
vendor different
.
*/
*/
it
(
'
BMS_Multiple_Hap_Install_0900
'
,
0
,
async
function
(
done
)
{
it
(
'
BMS_Multiple_Hap_Install_0900
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
();
let
installData
=
await
demo
.
getBundleInstaller
();
installData
.
install
([
PATH
+
FIRST_RIGHT
,
PATH
+
ELEVEBTH_RIGHT
],
{
installData
.
install
([
PATH
+
FIRST_RIGHT
,
PATH
+
ELEVEBTH_RIGHT
],
installParam1
,
userId
:
100
,
async
(
err
,
data
)
=>
{
installFlag
:
1
,
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
STATUS_INSTALL_FAILURE_CONFLICT
,
isKeepData
:
false
"
STATUS_INSTALL_FAILURE_CONFLICT
"
);
},
async
(
err
,
data
)
=>
{
await
queryInfo
(
NAME
,
1
);
expect
(
err
.
code
).
assertEqual
(
ERR_CODE
);
expect
(
data
.
status
).
assertEqual
(
STATUS_INSTALL_FAILURE_CONFLICT
);
console
.
info
(
'
===BMS_Multiple_Hap_Install_0900.Message1===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
data
.
statusMessage
).
assertEqual
(
"
STATUS_INSTALL_FAILURE_CONFLICT
"
);
done
();
done
();
});
});
})
})
;
/**
/**
* @tc.number BMS_Multiple_Hap_Install_1000
* @tc.number BMS_Multiple_Hap_Install_1000
* @tc.name BUNDLE::install
* @tc.name BUNDLE::install
* @tc.desc Test install interfaces.
* @tc.desc Test install interfaces
two entry
.
*/
*/
it
(
'
BMS_Multiple_Hap_Install_1000
'
,
0
,
async
function
(
done
)
{
it
(
'
BMS_Multiple_Hap_Install_1000
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
();
let
installData
=
await
demo
.
getBundleInstaller
();
installData
.
install
([
PATH
+
FIRST_RIGHT
,
PATH
+
FIFTH_RIGHT
],
{
installData
.
install
([
PATH
+
FIRST_RIGHT
,
PATH
+
FIFTH_RIGHT
],
installParam1
,
userId
:
100
,
async
(
err
,
data
)
=>
{
installFlag
:
1
,
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
STATUS_INSTALL_FAILURE_INVALID
,
isKeepData
:
false
"
STATUS_INSTALL_FAILURE_INVALID
"
);
},
async
(
err
,
data
)
=>
{
await
queryInfo
(
NAME
,
1
);
expect
(
err
.
code
).
assertEqual
(
ERR_CODE
);
expect
(
data
.
status
).
assertEqual
(
STATUS_INSTALL_FAILURE_INVALID
);
console
.
info
(
'
===BMS_Multiple_Hap_Install_1000.Message1===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
data
.
statusMessage
).
assertEqual
(
"
STATUS_INSTALL_FAILURE_INVALID
"
);
done
();
done
();
});
});
})
})
;
/**
/**
* @tc.number BMS_Multiple_Hap_Install_1100
* @tc.number BMS_Multiple_Hap_Install_1100
* @tc.name BUNDLE::install
* @tc.name BUNDLE::install
* @tc.desc Test install interfaces.
* @tc.desc Test install interfaces
same feature
.
*/
*/
it
(
'
BMS_Multiple_Hap_Install_1100
'
,
0
,
async
function
(
done
)
{
it
(
'
BMS_Multiple_Hap_Install_1100
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
();
let
installData
=
await
demo
.
getBundleInstaller
();
installData
.
install
([
PATH
+
SECOND_RIGHT
,
PATH
+
SECOND_BACKUP_RIGHT
],
{
installData
.
install
([
PATH
+
SECOND_RIGHT
,
PATH
+
SECOND_BACKUP_RIGHT
],
installParam1
,
userId
:
100
,
async
(
err
,
data
)
=>
{
installFlag
:
1
,
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
isKeepData
:
false
await
queryInfo
(
NAME
,
0
);
},
async
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME
,
installParam1
,
async
(
err
,
data1
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
checkResult
(
err
,
data1
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
expect
(
data
.
status
).
assertEqual
(
0
);
await
queryInfo
(
NAME
,
1
);
console
.
info
(
'
===BMS_Multiple_Hap_Install_1100.Message1===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
done
();
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
});
installData
.
uninstall
(
NAME
,
{
});
userId
:
100
,
});
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data1
)
=>
{
console
.
info
(
'
===BMS_Multiple_Hap_Install_1100.Message2===
'
+
JSON
.
stringify
(
data1
.
statusMessage
));
expect
(
data1
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
})
});
})
/**
/**
* @tc.number BMS_Multiple_Hap_Install_1200
* @tc.number BMS_Multiple_Hap_Install_1200
* @tc.name BUNDLE::install
* @tc.name BUNDLE::install
* @tc.desc Test install interfaces.
* @tc.desc Test install interfaces
entry and feature
.
*/
*/
it
(
'
BMS_Multiple_Hap_Install_1200
'
,
0
,
async
function
(
done
)
{
it
(
'
BMS_Multiple_Hap_Install_1200
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
();
let
installData
=
await
demo
.
getBundleInstaller
();
installData
.
install
([
PATH
+
FIRST_RIGHT
,
PATH
+
SECOND_RIGHT
],
{
installData
.
install
([
PATH
+
FIRST_RIGHT
,
PATH
+
SECOND_RIGHT
],
installParam1
,
userId
:
100
,
async
(
err
,
data
)
=>
{
installFlag
:
1
,
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
isKeepData
:
false
await
demo
.
getBundleInfo
(
NAME
,
demo
.
BundleFlag
.
GET_BUNDLE_DEFAULT
).
then
(
datainfo
=>
{
},
async
(
err
,
data
)
=>
{
console
.
info
(
"
getBundleInfo result
"
+
JSON
.
stringify
(
datainfo
))
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
datainfo
.
hapModuleInfos
.
length
).
assertEqual
(
2
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
datainfo
.
hapModuleInfos
[
0
].
moduleName
).
assertEqual
(
"
l2jsdemo
"
);
console
.
info
(
'
===BMS_Multiple_Hap_Install_1200.Message1===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
datainfo
.
hapModuleInfos
[
1
].
moduleName
).
assertEqual
(
"
entry
"
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
}).
catch
(
err
=>
{
installData
.
uninstall
(
NAME
,
{
console
.
info
(
"
getBundleInfo err
"
+
JSON
.
stringify
(
err
));
userId
:
100
,
expect
(
err
).
assertFail
();
installFlag
:
1
,
});
isKeepData
:
false
installData
.
uninstall
(
NAME
,
installParam1
,
async
(
err
,
data1
)
=>
{
},
async
(
err
,
data1
)
=>
{
checkResult
(
err
,
data1
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
console
.
info
(
'
===BMS_Multiple_Hap_Install_1200.Message2===
'
+
JSON
.
stringify
(
data1
.
statusMessage
));
await
queryInfo
(
NAME
,
1
);
expect
(
data1
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
done
();
})
})
;
});
});
})
})
;
/**
/**
* @tc.number BMS_Multiple_Hap_Install_1300
* @tc.number BMS_Multiple_Hap_Install_1300
* @tc.name BUNDLE::install
* @tc.name BUNDLE::install
* @tc.desc Test install interfaces.
* @tc.desc Test install interfaces
two feature
.
*/
*/
it
(
'
BMS_Multiple_Hap_Install_1300
'
,
0
,
async
function
(
done
)
{
it
(
'
BMS_Multiple_Hap_Install_1300
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
();
let
installData
=
await
demo
.
getBundleInstaller
();
installData
.
install
([
PATH
+
SECOND_RIGHT
,
PATH
+
TWELFTH_RIGHT
],
{
installData
.
install
([
PATH
+
SECOND_RIGHT
,
PATH
+
TWELFTH_RIGHT
],
installParam1
,
userId
:
100
,
async
(
err
,
data
)
=>
{
installFlag
:
1
,
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
isKeepData
:
false
await
demo
.
getBundleInfo
(
NAME
,
demo
.
BundleFlag
.
GET_BUNDLE_DEFAULT
).
then
(
datainfo
=>
{
},
async
(
err
,
data
)
=>
{
console
.
info
(
"
getBundleInfo result
"
+
JSON
.
stringify
(
datainfo
))
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
datainfo
.
hapModuleInfos
.
length
).
assertEqual
(
2
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
datainfo
.
hapModuleInfos
[
0
].
moduleName
).
assertEqual
(
"
l1jsdemo
"
);
console
.
info
(
'
===BMS_Multiple_Hap_Install_1300.Message1===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
datainfo
.
hapModuleInfos
[
1
].
moduleName
).
assertEqual
(
"
l2jsdemo
"
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
}).
catch
(
err
=>
{
installData
.
uninstall
(
NAME
,
{
console
.
info
(
"
getBundleInfo err
"
+
JSON
.
stringify
(
err
));
userId
:
100
,
expect
(
err
).
assertFail
();
installFlag
:
1
,
});
isKeepData
:
false
installData
.
uninstall
(
NAME
,
installParam1
,
async
(
err
,
data1
)
=>
{
},
async
(
err
,
data1
)
=>
{
checkResult
(
err
,
data1
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
console
.
info
(
'
===BMS_Multiple_Hap_Install_1300.Message2===
'
+
JSON
.
stringify
(
data1
.
statusMessage
));
await
queryInfo
(
NAME
,
1
);
expect
(
data1
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
done
();
})
})
;
});
});
})
})
;
/**
/**
* @tc.number BMS_Multiple_Hap_Install_1400
* @tc.number BMS_Multiple_Hap_Install_1400
* @tc.name BUNDLE::install
* @tc.name BUNDLE::install
* @tc.desc Test install interfaces.
* @tc.desc Test install interfaces path err.
*/
it
(
'
BMS_Multiple_Hap_Install_1400
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
();
installData
.
install
([
PATH
+
FIRST_RIGHT
,
PATH
+
"
test_right.hap
"
],
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
ERR_CODE
);
expect
(
data
.
status
).
assertEqual
(
STATUS_INSTALL_FAILURE_INVALID
);
console
.
info
(
'
===BMS_Multiple_Hap_Install_1400.Message1===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
data
.
statusMessage
).
assertEqual
(
"
STATUS_INSTALL_FAILURE_INVALID
"
);
done
();
});
})
/**
* @tc.number BMS_Multiple_Hap_Install_1500
* @tc.name BUNDLE::install
* @tc.desc Test install interfaces.
*/
*/
it
(
'
BMS_Multiple_Hap_Install_15
00
'
,
0
,
async
function
(
done
)
{
it
(
'
BMS_Multiple_Hap_Install_14
00
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
();
let
installData
=
await
demo
.
getBundleInstaller
();
installData
.
install
([
PATH
+
FIRST_RIGHT
,
PATH
+
SIXTH_RIGHT
],
{
installData
.
install
([
PATH
+
FIRST_RIGHT
,
PATH
+
"
test_right.hap
"
],
installParam1
,
userId
:
100
,
async
(
err
,
data
)
=>
{
installFlag
:
1
,
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
STATUS_INSTALL_FAILURE_INVALID
,
isKeepData
:
false
"
STATUS_INSTALL_FAILURE_INVALID
"
);
},
async
(
err
,
data
)
=>
{
await
queryInfo
(
NAME
,
1
);
expect
(
err
.
code
).
assertEqual
(
ERR_CODE
);
expect
(
data
.
status
).
assertEqual
(
STATUS_INSTALL_FAILURE_CONFLICT
);
console
.
info
(
'
===BMS_Multiple_Hap_Install_1500.Message1===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
data
.
statusMessage
).
assertEqual
(
"
STATUS_INSTALL_FAILURE_CONFLICT
"
);
done
();
done
();
});
});
})
})
;
/**
/**
* @tc.number BMS_Multiple_Hap_Update_0100
* @tc.number BMS_Multiple_Hap_Update_0100
* @tc.name BUNDLE::install
* @tc.name BUNDLE::install
* @tc.desc Test install interfaces.
* @tc.desc Test install interfaces
entry and feature
.
*/
*/
it
(
'
BMS_Multiple_Hap_Update_0100
'
,
0
,
async
function
(
done
)
{
it
(
'
BMS_Multiple_Hap_Update_0100
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
();
let
installData
=
await
demo
.
getBundleInstaller
();
installData
.
install
([
PATH
+
FIRST_RIGHT
],
{
installData
.
install
([
PATH
+
FIRST_RIGHT
],
installParam1
,
async
(
err
,
data
)
=>
{
userId
:
100
,
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
installFlag
:
1
,
await
queryInfo
(
NAME
,
0
);
isKeepData
:
false
installData
.
install
([
PATH
+
SECOND_RIGHT
],
installParam1
,
async
(
err
,
data
)
=>
{
},
async
(
err
,
data
)
=>
{
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
expect
(
err
.
code
).
assertEqual
(
0
);
await
demo
.
getBundleInfo
(
NAME
,
demo
.
BundleFlag
.
GET_BUNDLE_DEFAULT
).
then
(
datainfo
=>
{
expect
(
data
.
status
).
assertEqual
(
0
);
console
.
info
(
"
getBundleInfo result
"
+
JSON
.
stringify
(
datainfo
));
console
.
info
(
'
===BMS_Multiple_Hap_Update_0100.Message1===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
datainfo
.
hapModuleInfos
.
length
).
assertEqual
(
2
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
expect
(
datainfo
.
hapModuleInfos
[
0
].
moduleName
).
assertEqual
(
"
l2jsdemo
"
);
expect
(
datainfo
.
hapModuleInfos
[
1
].
moduleName
).
assertEqual
(
"
entry
"
);
installData
.
install
([
PATH
+
SECOND_RIGHT
],
{
}).
catch
(
err
=>
{
userId
:
100
,
console
.
info
(
"
getBundleInfo err
"
+
JSON
.
stringify
(
err
));
installFlag
:
1
,
expect
(
err
).
assertFail
();
isKeepData
:
false
});
},
async
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME
,
installParam1
,
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
expect
(
data
.
status
).
assertEqual
(
0
);
await
queryInfo
(
NAME
,
1
);
console
.
info
(
'
===BMS_Multiple_Hap_Update_0100.Message2===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
installData
.
uninstall
(
NAME
,
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
console
.
info
(
'
===BMS_Multiple_Hap_Update_0100.Message3===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
done
();
})
})
;
})
})
;
});
});
})
})
;
/**
/**
* @tc.number BMS_Multiple_Hap_Update_0200
* @tc.number BMS_Multiple_Hap_Update_0200
* @tc.name BUNDLE::install
* @tc.name BUNDLE::install
* @tc.desc Test install interfaces.
* @tc.desc Test install interfaces
high version feature
.
*/
*/
it
(
'
BMS_Multiple_Hap_Update_0200
'
,
0
,
async
function
(
done
)
{
it
(
'
BMS_Multiple_Hap_Update_0200
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
();
let
installData
=
await
demo
.
getBundleInstaller
();
installData
.
install
([
PATH
+
FIRST_RIGHT
],
{
installData
.
install
([
PATH
+
FIRST_RIGHT
],
installParam1
,
async
(
err
,
data
)
=>
{
userId
:
100
,
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
installFlag
:
1
,
await
queryInfo
(
NAME
,
0
);
isKeepData
:
false
installData
.
install
([
PATH
+
SIXTH_RIGHT
],
installParam1
,
async
(
err
,
data
)
=>
{
},
async
(
err
,
data
)
=>
{
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
STATUS_INSTALL_FAILURE_CONFLICT
,
expect
(
err
.
code
).
assertEqual
(
0
);
"
STATUS_INSTALL_FAILURE_CONFLICT
"
);
expect
(
data
.
status
).
assertEqual
(
0
);
installData
.
uninstall
(
NAME
,
installParam1
,
async
(
err
,
data
)
=>
{
console
.
info
(
'
===BMS_Multiple_Hap_Update_0200.Message1===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
await
queryInfo
(
NAME
,
1
);
installData
.
install
([
PATH
+
FOURTH_RIGHT
],
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
ERR_CODE
);
expect
(
data
.
status
).
assertEqual
(
STATUS_INSTALL_FAILURE_CONFLICT
);
console
.
info
(
'
===BMS_Multiple_Hap_Update_0200.Message2===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
data
.
statusMessage
).
assertEqual
(
'
STATUS_INSTALL_FAILURE_CONFLICT
'
);
installData
.
uninstall
(
NAME
,
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
console
.
info
(
'
===BMS_Multiple_Hap_Update_0200.Message3===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
done
();
})
})
;
})
})
;
})
})
;
})
})
;
/**
/**
* @tc.number BMS_Multiple_Hap_Update_0300
* @tc.number BMS_Multiple_Hap_Update_0300
* @tc.name BUNDLE::install
* @tc.name BUNDLE::install
* @tc.desc Test install interfaces.
* @tc.desc Test install interfaces
low version feature
.
*/
*/
it
(
'
BMS_Multiple_Hap_Update_0300
'
,
0
,
async
function
(
done
)
{
it
(
'
BMS_Multiple_Hap_Update_0300
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
();
let
installData
=
await
demo
.
getBundleInstaller
();
installData
.
install
([
PATH
+
FIRST_RIGHT
],
{
installData
.
install
([
PATH
+
FIRST_RIGHT
],
installParam1
,
async
(
err
,
data
)
=>
{
userId
:
100
,
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
installFlag
:
1
,
await
queryInfo
(
NAME
,
0
);
isKeepData
:
false
installData
.
install
([
PATH
+
THIRTEENTH_RIGHT
],
installParam1
,
async
(
err
,
data
)
=>
{
},
async
(
err
,
data
)
=>
{
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
STATUS_INSTALL_FAILURE_INCOMPATIBLE
,
expect
(
err
.
code
).
assertEqual
(
0
);
"
STATUS_INSTALL_FAILURE_INCOMPATIBLE
"
);
expect
(
data
.
status
).
assertEqual
(
0
);
installData
.
uninstall
(
NAME
,
installParam1
,
async
(
err
,
data
)
=>
{
console
.
info
(
'
===BMS_Multiple_Hap_Update_0300.Message1===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
await
queryInfo
(
NAME
,
1
);
installData
.
install
([
PATH
+
THIRTEENTH_RIGHT
],
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
ERR_CODE
);
expect
(
data
.
status
).
assertEqual
(
STATUS_INSTALL_FAILURE_INCOMPATIBLE
);
console
.
info
(
'
===BMS_Multiple_Hap_Update_0300.Message2===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
data
.
statusMessage
).
assertEqual
(
'
STATUS_INSTALL_FAILURE_INCOMPATIBLE
'
);
installData
.
uninstall
(
NAME
,
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
console
.
info
(
'
===BMS_Multiple_Hap_Update_0300.Message3===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
done
();
})
})
;
})
})
;
})
})
;
})
})
;
/**
/**
* @tc.number BMS_Multiple_Hap_Update_0400
* @tc.number BMS_Multiple_Hap_Update_0400
* @tc.name BUNDLE::install
* @tc.name BUNDLE::install
* @tc.desc Test install interfaces.
* @tc.desc Test install interfaces
same entry
.
*/
*/
it
(
'
BMS_Multiple_Hap_Update_0400
'
,
0
,
async
function
(
done
)
{
it
(
'
BMS_Multiple_Hap_Update_0400
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
();
let
installData
=
await
demo
.
getBundleInstaller
();
installData
.
install
([
PATH
+
FIRST_RIGHT
],
{
installData
.
install
([
PATH
+
FIRST_RIGHT
],
installParam1
,
async
(
err
,
data
)
=>
{
userId
:
100
,
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
installFlag
:
1
,
await
queryInfo
(
NAME
,
0
);
isKeepData
:
false
installData
.
install
([
PATH
+
FIRST_RIGHT
],
installParam1
,
async
(
err
,
data
)
=>
{
},
async
(
err
,
data
)
=>
{
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
expect
(
err
.
code
).
assertEqual
(
0
);
await
queryInfo
(
NAME
,
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
installData
.
uninstall
(
NAME
,
installParam1
,
async
(
err
,
data
)
=>
{
console
.
info
(
'
===BMS_Multiple_Hap_Update_0400.Message1===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
await
queryInfo
(
NAME
,
1
);
installData
.
install
([
PATH
+
FIRST_RIGHT
],
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
console
.
info
(
'
===BMS_Multiple_Hap_Update_0400.Message2===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
installData
.
uninstall
(
NAME
,
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
console
.
info
(
'
===BMS_Multiple_Hap_Update_0400.Message3===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
done
();
})
})
;
})
})
;
});
});
})
})
;
/**
/**
* @tc.number BMS_Multiple_Hap_Update_0500
* @tc.number BMS_Multiple_Hap_Update_0500
* @tc.name BUNDLE::install
* @tc.name BUNDLE::install
* @tc.desc Test install interfaces.
* @tc.desc Test install interfaces
entry upgrade
.
*/
*/
it
(
'
BMS_Multiple_Hap_Update_0500
'
,
0
,
async
function
(
done
)
{
it
(
'
BMS_Multiple_Hap_Update_0500
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
();
let
installData
=
await
demo
.
getBundleInstaller
();
installData
.
install
([
PATH
+
FIRST_RIGHT
],
{
installData
.
install
([
PATH
+
FIRST_RIGHT
],
installParam1
,
async
(
err
,
data
)
=>
{
userId
:
100
,
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
installFlag
:
1
,
await
queryInfo
(
NAME
,
0
);
isKeepData
:
false
installData
.
install
([
PATH
+
FOURTEENTH_RIGHT
],
installParam1
,
async
(
err
,
data
)
=>
{
},
async
(
err
,
data
)
=>
{
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
expect
(
err
.
code
).
assertEqual
(
0
);
await
demo
.
getBundleInfo
(
NAME
,
demo
.
BundleFlag
.
GET_BUNDLE_DEFAULT
).
then
(
datainfo
=>
{
expect
(
data
.
status
).
assertEqual
(
0
);
console
.
info
(
"
getBundleInfo result
"
+
JSON
.
stringify
(
datainfo
));
console
.
info
(
'
===BMS_Multiple_Hap_Update_0500.Message1===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
datainfo
.
versionName
).
assertEqual
(
"
3.0.0
"
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
}).
catch
(
err
=>
{
console
.
info
(
"
getBundleInfo err
"
+
JSON
.
stringify
(
err
));
installData
.
install
([
PATH
+
FOURTEENTH_RIGHT
],
{
expect
(
err
).
assertFail
();
userId
:
100
,
});
installFlag
:
1
,
installData
.
uninstall
(
NAME
,
installParam1
,
async
(
err
,
data
)
=>
{
isKeepData
:
false
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
},
async
(
err
,
data
)
=>
{
await
queryInfo
(
NAME
,
1
);
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
console
.
info
(
'
===BMS_Multiple_Hap_Update_0500.Message2===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
installData
.
uninstall
(
NAME
,
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
console
.
info
(
'
===BMS_Multiple_Hap_Update_0500.Message3===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
done
();
})
})
;
})
})
;
});
});
})
})
;
/**
/**
* @tc.number BMS_Multiple_Hap_Update_0600
* @tc.number BMS_Multiple_Hap_Update_0600
* @tc.name BUNDLE::install
* @tc.name BUNDLE::install
* @tc.desc Test install interfaces.
* @tc.desc Test install interfaces
entry of the same version
.
*/
*/
it
(
'
BMS_Multiple_Hap_Update_0600
'
,
0
,
async
function
(
done
)
{
it
(
'
BMS_Multiple_Hap_Update_0600
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
();
let
installData
=
await
demo
.
getBundleInstaller
();
installData
.
install
([
PATH
+
SECOND_RIGHT
],
{
installData
.
install
([
PATH
+
SECOND_RIGHT
],
installParam1
,
async
(
err
,
data
)
=>
{
userId
:
100
,
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
installFlag
:
1
,
await
queryInfo
(
NAME
,
0
);
isKeepData
:
false
installData
.
install
([
PATH
+
FIRST_RIGHT
],
installParam1
,
async
(
err
,
data
)
=>
{
},
async
(
err
,
data
)
=>
{
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
expect
(
err
.
code
).
assertEqual
(
0
);
await
demo
.
getBundleInfo
(
NAME
,
demo
.
BundleFlag
.
GET_BUNDLE_DEFAULT
).
then
(
datainfo
=>
{
expect
(
data
.
status
).
assertEqual
(
0
);
console
.
info
(
"
getBundleInfo result
"
+
JSON
.
stringify
(
datainfo
));
console
.
info
(
'
===BMS_Multiple_Hap_Update_0600.Message1===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
datainfo
.
hapModuleInfos
.
length
).
assertEqual
(
2
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
expect
(
datainfo
.
hapModuleInfos
[
0
].
moduleName
).
assertEqual
(
"
l2jsdemo
"
);
expect
(
datainfo
.
hapModuleInfos
[
1
].
moduleName
).
assertEqual
(
"
entry
"
);
installData
.
install
([
PATH
+
FIRST_RIGHT
],
{
}).
catch
(
err
=>
{
userId
:
100
,
console
.
info
(
"
getBundleInfo err
"
+
JSON
.
stringify
(
err
));
installFlag
:
1
,
expect
(
err
).
assertFail
();
isKeepData
:
false
});
},
async
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME
,
installParam1
,
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
expect
(
data
.
status
).
assertEqual
(
0
);
await
queryInfo
(
NAME
,
1
);
console
.
info
(
'
===BMS_Multiple_Hap_Update_0600.Message2===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
installData
.
uninstall
(
NAME
,
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
console
.
info
(
'
===BMS_Multiple_Hap_Update_0600.Message3===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
done
();
})
})
;
})
})
;
});
});
})
})
;
/**
/**
* @tc.number BMS_Multiple_Hap_Update_0700
* @tc.number BMS_Multiple_Hap_Update_0700
* @tc.name BUNDLE::install
* @tc.name BUNDLE::install
* @tc.desc Test install interfaces.
* @tc.desc Test install interfaces
entry of the high version
.
*/
*/
it
(
'
BMS_Multiple_Hap_Update_0700
'
,
0
,
async
function
(
done
)
{
it
(
'
BMS_Multiple_Hap_Update_0700
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
();
let
installData
=
await
demo
.
getBundleInstaller
();
installData
.
install
([
PATH
+
SECOND_RIGHT
],
{
installData
.
install
([
PATH
+
SECOND_RIGHT
],
installParam1
,
async
(
err
,
data
)
=>
{
userId
:
100
,
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
installFlag
:
1
,
await
queryInfo
(
NAME
,
0
);
isKeepData
:
false
installData
.
install
([
PATH
+
FOURTEENTH_RIGHT
],
installParam1
,
async
(
err
,
data
)
=>
{
},
async
(
err
,
data
)
=>
{
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
expect
(
err
.
code
).
assertEqual
(
0
);
await
demo
.
getBundleInfo
(
NAME
,
demo
.
BundleFlag
.
GET_BUNDLE_DEFAULT
).
then
(
datainfo
=>
{
expect
(
data
.
status
).
assertEqual
(
0
);
console
.
info
(
"
getBundleInfo result
"
+
JSON
.
stringify
(
datainfo
));
console
.
info
(
'
===BMS_Multiple_Hap_Update_0700.Message1===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
datainfo
.
versionName
).
assertEqual
(
"
3.0.0
"
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
expect
(
datainfo
.
hapModuleInfos
[
0
].
moduleName
).
assertEqual
(
"
entry
"
);
}).
catch
(
err
=>
{
installData
.
install
([
PATH
+
FOURTEENTH_RIGHT
],
{
console
.
info
(
"
getBundleInfo err
"
+
JSON
.
stringify
(
err
));
userId
:
100
,
expect
(
err
).
assertFail
();
installFlag
:
1
,
});
isKeepData
:
false
installData
.
uninstall
(
NAME
,
installParam1
,
async
(
err
,
data
)
=>
{
},
async
(
err
,
data
)
=>
{
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
expect
(
err
.
code
).
assertEqual
(
0
);
await
queryInfo
(
NAME
,
1
);
expect
(
data
.
status
).
assertEqual
(
0
);
console
.
info
(
'
===BMS_Multiple_Hap_Update_0700.Message2===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
installData
.
uninstall
(
NAME
,
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
console
.
info
(
'
===BMS_Multiple_Hap_Update_0700.Message3===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
done
();
})
})
;
})
})
;
});
});
})
})
;
/**
/**
* @tc.number BMS_Multiple_Hap_Update_0800
* @tc.number BMS_Multiple_Hap_Update_0800
* @tc.name BUNDLE::install
* @tc.name BUNDLE::install
* @tc.desc Test install interfaces.
* @tc.desc Test install interfaces
same feature
.
*/
*/
it
(
'
BMS_Multiple_Hap_Update_0800
'
,
0
,
async
function
(
done
)
{
it
(
'
BMS_Multiple_Hap_Update_0800
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
();
let
installData
=
await
demo
.
getBundleInstaller
();
installData
.
install
([
PATH
+
SECOND_RIGHT
],
{
installData
.
install
([
PATH
+
SECOND_RIGHT
],
installParam1
,
async
(
err
,
data
)
=>
{
userId
:
100
,
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
installFlag
:
1
,
await
queryInfo
(
NAME
,
0
);
isKeepData
:
false
installData
.
install
([
PATH
+
SECOND_RIGHT
],
installParam1
,
async
(
err
,
data
)
=>
{
},
async
(
err
,
data
)
=>
{
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
expect
(
err
.
code
).
assertEqual
(
0
);
installData
.
uninstall
(
NAME
,
installParam1
,
async
(
err
,
data
)
=>
{
expect
(
data
.
status
).
assertEqual
(
0
);
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
console
.
info
(
'
===BMS_Multiple_Hap_Update_0800.Message1===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
await
queryInfo
(
NAME
,
1
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
installData
.
install
([
PATH
+
SECOND_RIGHT
],
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
console
.
info
(
'
===BMS_Multiple_Hap_Update_0800.Message2===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
installData
.
uninstall
(
NAME
,
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
console
.
info
(
'
===BMS_Multiple_Hap_Update_0800.Message3===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
done
();
})
})
;
})
})
;
});
});
})
})
;
/**
/**
* @tc.number BMS_Multiple_Hap_Update_0900
* @tc.number BMS_Multiple_Hap_Update_0900
* @tc.name BUNDLE::install
* @tc.name BUNDLE::install
* @tc.desc Test install interfaces.
* @tc.desc Test install interfaces
feature of the high version
.
*/
*/
it
(
'
BMS_Multiple_Hap_Update_0900
'
,
0
,
async
function
(
done
)
{
it
(
'
BMS_Multiple_Hap_Update_0900
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
();
let
installData
=
await
demo
.
getBundleInstaller
();
installData
.
install
([
PATH
+
SECOND_RIGHT
],
{
installData
.
install
([
PATH
+
SECOND_RIGHT
],
installParam1
,
async
(
err
,
data
)
=>
{
userId
:
100
,
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
installFlag
:
1
,
await
queryInfo
(
NAME
,
0
);
isKeepData
:
false
installData
.
install
([
PATH
+
SIXTH_RIGHT
],
installParam1
,
async
(
err
,
data
)
=>
{
},
async
(
err
,
data
)
=>
{
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
expect
(
err
.
code
).
assertEqual
(
0
);
await
demo
.
getBundleInfo
(
NAME
,
demo
.
BundleFlag
.
GET_BUNDLE_DEFAULT
).
then
(
datainfo
=>
{
expect
(
data
.
status
).
assertEqual
(
0
);
console
.
info
(
"
getBundleInfo result
"
+
JSON
.
stringify
(
datainfo
));
console
.
info
(
'
===BMS_Multiple_Hap_Update_0900.Message1===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
datainfo
.
versionName
).
assertEqual
(
"
3.0.0
"
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
}).
catch
(
err
=>
{
console
.
info
(
"
getBundleInfo err
"
+
JSON
.
stringify
(
err
));
installData
.
install
([
PATH
+
FOURTH_RIGHT
],
{
expect
(
err
).
assertFail
();
userId
:
100
,
});
installFlag
:
1
,
installData
.
uninstall
(
NAME
,
installParam1
,
async
(
err
,
data
)
=>
{
isKeepData
:
false
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
},
async
(
err
,
data
)
=>
{
await
queryInfo
(
NAME
,
1
);
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
console
.
info
(
'
===BMS_Multiple_Hap_Update_0900.Message2===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
installData
.
uninstall
(
NAME
,
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
console
.
info
(
'
===BMS_Multiple_Hap_Update_0900.Message3===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
done
();
})
})
;
})
})
;
});
});
})
})
;
/**
/**
* @tc.number BMS_Multiple_Hap_Update_1000
* @tc.number BMS_Multiple_Hap_Update_1000
* @tc.name BUNDLE::install
* @tc.name BUNDLE::install
* @tc.desc Test install interfaces.
* @tc.desc Test install interfaces
feature of the lower version
.
*/
*/
it
(
'
BMS_Multiple_Hap_Update_1000
'
,
0
,
async
function
(
done
)
{
it
(
'
BMS_Multiple_Hap_Update_1000
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
();
let
installData
=
await
demo
.
getBundleInstaller
();
installData
.
install
([
PATH
+
SECOND_RIGHT
],
{
installData
.
install
([
PATH
+
SECOND_RIGHT
],
installParam1
,
async
(
err
,
data
)
=>
{
userId
:
100
,
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
installFlag
:
1
,
await
queryInfo
(
NAME
,
0
);
isKeepData
:
false
installData
.
install
([
PATH
+
THIRTEENTH_RIGHT
],
installParam1
,
async
(
err
,
data
)
=>
{
},
async
(
err
,
data
)
=>
{
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
STATUS_INSTALL_FAILURE_INCOMPATIBLE
,
expect
(
err
.
code
).
assertEqual
(
0
);
"
STATUS_INSTALL_FAILURE_INCOMPATIBLE
"
);
expect
(
data
.
status
).
assertEqual
(
0
);
installData
.
uninstall
(
NAME
,
installParam1
,
async
(
err
,
data
)
=>
{
console
.
info
(
'
===BMS_Multiple_Hap_Update_1000.Message1===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
await
queryInfo
(
NAME
,
1
);
installData
.
install
([
PATH
+
THIRTEENTH_RIGHT
],
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
ERR_CODE
);
expect
(
data
.
status
).
assertEqual
(
STATUS_INSTALL_FAILURE_INCOMPATIBLE
);
console
.
info
(
'
===BMS_Multiple_Hap_Update_1000.Message2===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
data
.
statusMessage
).
assertEqual
(
'
STATUS_INSTALL_FAILURE_INCOMPATIBLE
'
);
installData
.
uninstall
(
NAME
,
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
console
.
info
(
'
===BMS_Multiple_Hap_Update_1000.Message3===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
done
();
})
})
;
})
})
;
})
})
;
})
})
;
/**
/**
* @tc.number BMS_Multiple_Hap_Update_1100
* @tc.number BMS_Multiple_Hap_Update_1100
* @tc.name BUNDLE::install
* @tc.name BUNDLE::install
* @tc.desc Test install interfaces.
* @tc.desc Test install interfaces
install other feature
.
*/
*/
it
(
'
BMS_Multiple_Hap_Update_1100
'
,
0
,
async
function
(
done
)
{
it
(
'
BMS_Multiple_Hap_Update_1100
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
();
let
installData
=
await
demo
.
getBundleInstaller
();
installData
.
install
([
PATH
+
SECOND_RIGHT
],
{
installData
.
install
([
PATH
+
SECOND_RIGHT
],
installParam1
,
async
(
err
,
data
)
=>
{
userId
:
100
,
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
installFlag
:
1
,
await
queryInfo
(
NAME
,
0
);
isKeepData
:
false
installData
.
install
([
PATH
+
TWELFTH_RIGHT
],
installParam1
,
async
(
err
,
data
)
=>
{
},
async
(
err
,
data
)
=>
{
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
expect
(
err
.
code
).
assertEqual
(
0
);
await
demo
.
getBundleInfo
(
NAME
,
demo
.
BundleFlag
.
GET_BUNDLE_DEFAULT
).
then
(
datainfo
=>
{
expect
(
data
.
status
).
assertEqual
(
0
);
console
.
info
(
"
getBundleInfo result
"
+
JSON
.
stringify
(
datainfo
));
console
.
info
(
'
===BMS_Multiple_Hap_Update_1100.Message1===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
datainfo
.
hapModuleInfos
.
length
).
assertEqual
(
2
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
expect
(
datainfo
.
hapModuleInfos
[
0
].
moduleName
).
assertEqual
(
"
l1jsdemo
"
);
expect
(
datainfo
.
hapModuleInfos
[
1
].
moduleName
).
assertEqual
(
"
l2jsdemo
"
);
installData
.
install
([
PATH
+
TWELFTH_RIGHT
],
{
}).
catch
(
err
=>
{
userId
:
100
,
console
.
info
(
"
getBundleInfo err
"
+
JSON
.
stringify
(
err
));
installFlag
:
1
,
expect
(
err
).
assertFail
();
isKeepData
:
false
});
},
async
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME
,
installParam1
,
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
expect
(
data
.
status
).
assertEqual
(
0
);
await
queryInfo
(
NAME
,
1
);
console
.
info
(
'
===BMS_Multiple_Hap_Update_1100.Message2===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
installData
.
uninstall
(
NAME
,
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
console
.
info
(
'
===BMS_Multiple_Hap_Update_1100.Message3===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
done
();
})
})
;
})
})
;
});
});
})
})
;
/**
/**
* @tc.number BMS_Multiple_Hap_Update_1200
* @tc.number BMS_Multiple_Hap_Update_1200
* @tc.name BUNDLE::install
* @tc.name BUNDLE::install
* @tc.desc Test install interfaces.
* @tc.desc Test install interfaces
install other high version feature
.
*/
*/
it
(
'
BMS_Multiple_Hap_Update_1200
'
,
0
,
async
function
(
done
)
{
it
(
'
BMS_Multiple_Hap_Update_1200
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
();
let
installData
=
await
demo
.
getBundleInstaller
();
installData
.
install
([
PATH
+
SECOND_RIGHT
],
{
installData
.
install
([
PATH
+
SECOND_RIGHT
],
installParam1
,
async
(
err
,
data
)
=>
{
userId
:
100
,
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
installFlag
:
1
,
await
queryInfo
(
NAME
,
0
);
isKeepData
:
false
installData
.
install
([
PATH
+
SIXTEENTH_RIGHT
],
installParam1
,
async
(
err
,
data
)
=>
{
},
async
(
err
,
data
)
=>
{
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
expect
(
err
.
code
).
assertEqual
(
0
);
await
demo
.
getBundleInfo
(
NAME
,
demo
.
BundleFlag
.
GET_BUNDLE_DEFAULT
).
then
(
datainfo
=>
{
expect
(
data
.
status
).
assertEqual
(
0
);
console
.
info
(
"
getBundleInfo result
"
+
JSON
.
stringify
(
datainfo
));
console
.
info
(
'
===BMS_Multiple_Hap_Update_1200.Message1===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
datainfo
.
versionName
).
assertEqual
(
"
3.0.0
"
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
expect
(
datainfo
.
hapModuleInfos
[
0
].
moduleName
).
assertEqual
(
"
l1jsdemo
"
);
}).
catch
(
err
=>
{
installData
.
install
([
PATH
+
SIXTEENTH_RIGHT
],
{
console
.
info
(
"
getBundleInfo err
"
+
JSON
.
stringify
(
err
));
userId
:
100
,
expect
(
err
).
assertFail
();
installFlag
:
1
,
});
isKeepData
:
false
installData
.
uninstall
(
NAME
,
installParam1
,
async
(
err
,
data
)
=>
{
},
async
(
err
,
data
)
=>
{
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
expect
(
err
.
code
).
assertEqual
(
0
);
await
queryInfo
(
NAME
,
1
);
expect
(
data
.
status
).
assertEqual
(
0
);
console
.
info
(
'
===BMS_Multiple_Hap_Update_1200.Message2===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
installData
.
uninstall
(
NAME
,
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
console
.
info
(
'
===BMS_Multiple_Hap_Update_1200.Message3===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
done
();
})
})
;
})
})
;
});
});
})
})
;
/**
/**
* @tc.number BMS_Multiple_Hap_Update_1300
* @tc.number BMS_Multiple_Hap_Update_1300
* @tc.name BUNDLE::install
* @tc.name BUNDLE::install
* @tc.desc Test install interfaces.
* @tc.desc Test install interfaces
install other low version feature
.
*/
*/
it
(
'
BMS_Multiple_Hap_Update_1300
'
,
0
,
async
function
(
done
)
{
it
(
'
BMS_Multiple_Hap_Update_1300
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
();
let
installData
=
await
demo
.
getBundleInstaller
();
installData
.
install
([
PATH
+
SECOND_RIGHT
],
{
installData
.
install
([
PATH
+
SECOND_RIGHT
],
installParam1
,
async
(
err
,
data
)
=>
{
userId
:
100
,
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
installFlag
:
1
,
await
queryInfo
(
NAME
,
0
);
isKeepData
:
false
installData
.
install
([
PATH
+
THIRTEENTH_RIGHT
],
installParam1
,
async
(
err
,
data
)
=>
{
},
async
(
err
,
data
)
=>
{
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
STATUS_INSTALL_FAILURE_INCOMPATIBLE
,
expect
(
err
.
code
).
assertEqual
(
0
);
"
STATUS_INSTALL_FAILURE_INCOMPATIBLE
"
);
expect
(
data
.
status
).
assertEqual
(
0
);
installData
.
uninstall
(
NAME
,
installParam1
,
async
(
err
,
data
)
=>
{
console
.
info
(
'
===BMS_Multiple_Hap_Update_1300.Message1===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
await
queryInfo
(
NAME
,
1
);
installData
.
install
([
PATH
+
THIRTEENTH_RIGHT
],
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
ERR_CODE
);
expect
(
data
.
status
).
assertEqual
(
STATUS_INSTALL_FAILURE_INCOMPATIBLE
);
console
.
info
(
'
===BMS_Multiple_Hap_Update_1300.Message2===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
data
.
statusMessage
).
assertEqual
(
'
STATUS_INSTALL_FAILURE_INCOMPATIBLE
'
);
installData
.
uninstall
(
NAME
,
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
console
.
info
(
'
===BMS_Multiple_Hap_Update_1300.Message3===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
done
();
})
});
})
});
})
})
/**
* @tc.number BMS_Multiple_Hap_Update_1400
* @tc.name BUNDLE::install
* @tc.desc Test install interfaces.
*/
it
(
'
BMS_Multiple_Hap_Update_1400
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
();
installData
.
install
([
PATH
+
FIRST_RIGHT
,
PATH
+
SECOND_RIGHT
],
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
console
.
info
(
'
===BMS_Multiple_Hap_Update_1400.Message1===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
installData
.
uninstall
(
NAME
,
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data1
)
=>
{
console
.
info
(
'
===BMS_Multiple_Hap_Update_1400.Message2===
'
+
JSON
.
stringify
(
data1
.
statusMessage
));
expect
(
data1
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
})
});
});
})
})
;
/**
/**
* @tc.number BMS_Multiple_Hap_Update_1500
* @tc.number BMS_Multiple_Hap_Update_1500
* @tc.name BUNDLE::install
* @tc.name BUNDLE::install
* @tc.desc Test install interfaces.
* @tc.desc Test install interfaces.
*/
*/
it
(
'
BMS_Multiple_Hap_Update_1500
'
,
0
,
async
function
(
done
)
{
it
(
'
BMS_Multiple_Hap_Update_1500
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
();
let
installData
=
await
demo
.
getBundleInstaller
();
installData
.
install
([
PATH
+
FIRST_RIGHT
,
PATH
+
SECOND_RIGHT
],
{
installData
.
install
([
PATH
+
FIRST_RIGHT
,
PATH
+
SECOND_RIGHT
],
installParam1
,
async
(
err
,
data
)
=>
{
userId
:
100
,
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
installFlag
:
0
,
await
queryInfo
(
NAME
,
0
);
isKeepData
:
false
installData
.
install
([
PATH
+
FIRST_RIGHT
,
PATH
+
SECOND_RIGHT
],
installParam2
,
async
(
err
,
data
)
=>
{
},
async
(
err
,
data
)
=>
{
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
expect
(
err
.
code
).
assertEqual
(
0
);
await
queryInfo
(
NAME
,
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
installData
.
uninstall
(
NAME
,
installParam1
,
async
(
err
,
data
)
=>
{
console
.
info
(
'
===BMS_Multiple_Hap_Update_1500.Message1===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
checkResult
(
err
,
data
,
demo
.
InstallErrorCode
.
SUCCESS
,
"
SUCCESS
"
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
await
queryInfo
(
NAME
,
1
);
installData
.
install
([
PATH
+
FIRST_RIGHT
,
PATH
+
SECOND_RIGHT
],
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
console
.
info
(
'
===BMS_Multiple_Hap_Update_1500.Message2===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
installData
.
uninstall
(
NAME
,
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
console
.
info
(
'
===BMS_Multiple_Hap_Update_1500.Message3===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
done
();
})
})
;
})
})
;
});
});
})
});
function
checkResult
(
error
,
data
,
status
,
statusMessage
)
{
if
(
!
status
)
{
expect
(
error
.
code
).
assertEqual
(
status
);
expect
(
data
.
status
).
assertEqual
(
status
);
expect
(
data
.
statusMessage
).
assertEqual
(
statusMessage
);
console
.
info
(
'
===install uninstall result===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
}
else
{
expect
(
error
.
code
).
assertEqual
(
ERR_CODE
);
expect
(
data
.
status
).
assertEqual
(
status
);
expect
(
data
.
statusMessage
).
assertEqual
(
statusMessage
);
console
.
info
(
'
===install uninstall result===
'
+
JSON
.
stringify
(
data
.
statusMessage
));
}
}
async
function
queryInfo
(
bundleName
,
assertFlag
){
if
(
!
assertFlag
)
{
await
demo
.
getBundleInfo
(
bundleName
,
demo
.
BundleFlag
.
GET_BUNDLE_DEFAULT
).
then
(
datainfo
=>
{
console
.
info
(
"
getBundleInfo result0
"
+
JSON
.
stringify
(
datainfo
));
expect
(
datainfo
.
name
).
assertEqual
(
bundleName
);
}).
catch
(
err
=>
{
console
.
info
(
"
getBundleInfo result0
"
+
JSON
.
stringify
(
datainfo
));
expect
(
err
).
assertFail
();
});
}
else
{
await
demo
.
getBundleInfo
(
bundleName
,
demo
.
BundleFlag
.
GET_BUNDLE_DEFAULT
)
.
then
(
datainfo
=>
{
console
.
info
(
"
getBundleInfo result1
"
+
JSON
.
stringify
(
datainfo
));
expect
(
datainfo
).
assertFail
();
}).
catch
(
err
=>
{
console
.
info
(
"
getBundleInfo result1
"
+
JSON
.
stringify
(
err
));
expect
(
err
).
assertEqual
(
1
);
});
}
}
})
})
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmseighthright/src/main/config.json
浏览文件 @
1a89cc13
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
"bundleName"
:
"com.example.l3jsdemo"
,
"bundleName"
:
"com.example.l3jsdemo"
,
"label"
:
"$string:app_name"
,
"label"
:
"$string:app_name"
,
"version"
:
{
"version"
:
{
"code"
:
1
000000
,
"code"
:
2
000000
,
"name"
:
"1.0.1"
"name"
:
"1.0.1"
}
}
},
},
...
...
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmseleventhright/src/main/config.json
浏览文件 @
1a89cc13
...
@@ -12,8 +12,8 @@
...
@@ -12,8 +12,8 @@
"bundleName"
:
"com.example.l3jsdemo"
,
"bundleName"
:
"com.example.l3jsdemo"
,
"label"
:
"$string:app_name"
,
"label"
:
"$string:app_name"
,
"version"
:
{
"version"
:
{
"code"
:
1
000000
,
"code"
:
2
000000
,
"name"
:
"
1
.0.0"
"name"
:
"
2
.0.0"
}
}
},
},
"deviceConfig"
:
{
"deviceConfig"
:
{
...
...
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsfifthright/src/main/config.json
浏览文件 @
1a89cc13
...
@@ -8,8 +8,8 @@
...
@@ -8,8 +8,8 @@
"vendor"
:
"example"
,
"vendor"
:
"example"
,
"bundleName"
:
"com.example.l3jsdemo"
,
"bundleName"
:
"com.example.l3jsdemo"
,
"version"
:
{
"version"
:
{
"code"
:
1
000000
,
"code"
:
2
000000
,
"name"
:
"
1
.0.0"
"name"
:
"
2
.0.0"
}
}
},
},
"deviceConfig"
:
{
"deviceConfig"
:
{
...
...
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsfirstright/src/main/config.json
浏览文件 @
1a89cc13
...
@@ -8,8 +8,8 @@
...
@@ -8,8 +8,8 @@
"vendor"
:
"example"
,
"vendor"
:
"example"
,
"bundleName"
:
"com.example.l3jsdemo"
,
"bundleName"
:
"com.example.l3jsdemo"
,
"version"
:
{
"version"
:
{
"code"
:
1
000000
,
"code"
:
2
000000
,
"name"
:
"
1
.0.0"
"name"
:
"
2
.0.0"
}
}
},
},
"deviceConfig"
:
{
"deviceConfig"
:
{
...
@@ -48,7 +48,7 @@
...
@@ -48,7 +48,7 @@
"mainAbility"
:
"com.example.l3jsdemo.MainAbility"
,
"mainAbility"
:
"com.example.l3jsdemo.MainAbility"
,
"distro"
:
{
"distro"
:
{
"moduleType"
:
"entry"
,
"moduleType"
:
"entry"
,
"installationFree"
:
tru
e
,
"installationFree"
:
fals
e
,
"deliveryWithInstall"
:
true
,
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
"moduleName"
:
"entry"
},
},
...
...
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsfourteenthright/src/main/config.json
浏览文件 @
1a89cc13
...
@@ -8,8 +8,8 @@
...
@@ -8,8 +8,8 @@
"vendor"
:
"example"
,
"vendor"
:
"example"
,
"bundleName"
:
"com.example.l3jsdemo"
,
"bundleName"
:
"com.example.l3jsdemo"
,
"version"
:
{
"version"
:
{
"code"
:
1000001
,
"code"
:
3000000
,
"name"
:
"
1
.0.0"
"name"
:
"
3
.0.0"
}
}
},
},
"deviceConfig"
:
{
"deviceConfig"
:
{
...
...
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsfourthright/src/main/config.json
浏览文件 @
1a89cc13
...
@@ -12,8 +12,8 @@
...
@@ -12,8 +12,8 @@
"bundleName"
:
"com.example.l3jsdemo"
,
"bundleName"
:
"com.example.l3jsdemo"
,
"label"
:
"$string:app_name"
,
"label"
:
"$string:app_name"
,
"version"
:
{
"version"
:
{
"code"
:
1000001
,
"code"
:
3000000
,
"name"
:
"
1
.0.0"
"name"
:
"
2
.0.0"
}
}
},
},
"deviceConfig"
:
{
"deviceConfig"
:
{
...
...
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsninthright/src/main/config.json
浏览文件 @
1a89cc13
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
"iconId"
:
33554436
,
"iconId"
:
33554436
,
"apiVersion"
:
{
"apiVersion"
:
{
"compatible"
:
4
,
"compatible"
:
4
,
"releaseType"
:
"
Beta1
"
,
"releaseType"
:
"
Release
"
,
"target"
:
6
"target"
:
6
},
},
"labelId"
:
33554432
,
"labelId"
:
33554432
,
...
@@ -12,8 +12,8 @@
...
@@ -12,8 +12,8 @@
"bundleName"
:
"com.example.l3jsdemo"
,
"bundleName"
:
"com.example.l3jsdemo"
,
"label"
:
"$string:app_name"
,
"label"
:
"$string:app_name"
,
"version"
:
{
"version"
:
{
"code"
:
1
000000
,
"code"
:
2
000000
,
"name"
:
"
1
.0.0"
"name"
:
"
2
.0.0"
}
}
},
},
"deviceConfig"
:
{
"deviceConfig"
:
{
...
@@ -43,7 +43,7 @@
...
@@ -43,7 +43,7 @@
"mainAbility"
:
"com.example.l2jsdemo.MainAbility"
,
"mainAbility"
:
"com.example.l2jsdemo.MainAbility"
,
"distro"
:
{
"distro"
:
{
"moduleType"
:
"feature"
,
"moduleType"
:
"feature"
,
"installationFree"
:
fals
e
,
"installationFree"
:
tru
e
,
"deliveryWithInstall"
:
true
,
"deliveryWithInstall"
:
true
,
"moduleName"
:
"l2jsdemo"
"moduleName"
:
"l2jsdemo"
},
},
...
...
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmssecondbackupright/src/main/config.json
浏览文件 @
1a89cc13
...
@@ -12,8 +12,8 @@
...
@@ -12,8 +12,8 @@
"bundleName"
:
"com.example.l3jsdemo"
,
"bundleName"
:
"com.example.l3jsdemo"
,
"label"
:
"$string:app_name"
,
"label"
:
"$string:app_name"
,
"version"
:
{
"version"
:
{
"code"
:
1
000000
,
"code"
:
2
000000
,
"name"
:
"
1
.0.0"
"name"
:
"
2
.0.0"
}
}
},
},
"deviceConfig"
:
{
"deviceConfig"
:
{
...
...
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmssecondright/src/main/config.json
浏览文件 @
1a89cc13
...
@@ -12,8 +12,8 @@
...
@@ -12,8 +12,8 @@
"bundleName"
:
"com.example.l3jsdemo"
,
"bundleName"
:
"com.example.l3jsdemo"
,
"label"
:
"$string:app_name"
,
"label"
:
"$string:app_name"
,
"version"
:
{
"version"
:
{
"code"
:
1
000000
,
"code"
:
2
000000
,
"name"
:
"
1
.0.0"
"name"
:
"
2
.0.0"
}
}
},
},
"deviceConfig"
:
{
"deviceConfig"
:
{
...
...
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmssixteenthright/src/main/config.json
浏览文件 @
1a89cc13
...
@@ -12,8 +12,8 @@
...
@@ -12,8 +12,8 @@
"bundleName"
:
"com.example.l3jsdemo"
,
"bundleName"
:
"com.example.l3jsdemo"
,
"label"
:
"$string:app_name"
,
"label"
:
"$string:app_name"
,
"version"
:
{
"version"
:
{
"code"
:
1000001
,
"code"
:
3000000
,
"name"
:
"
1
.0.0"
"name"
:
"
3
.0.0"
}
}
},
},
"deviceConfig"
:
{
"deviceConfig"
:
{
...
...
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmssixthright/src/main/config.json
浏览文件 @
1a89cc13
...
@@ -12,8 +12,8 @@
...
@@ -12,8 +12,8 @@
"bundleName"
:
"com.example.l3jsdemo"
,
"bundleName"
:
"com.example.l3jsdemo"
,
"label"
:
"$string:app_name"
,
"label"
:
"$string:app_name"
,
"version"
:
{
"version"
:
{
"code"
:
1000001
,
"code"
:
3000000
,
"name"
:
"
1
.0.0"
"name"
:
"
3
.0.0"
}
}
},
},
"deviceConfig"
:
{
"deviceConfig"
:
{
...
...
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmstenthright/src/main/config.json
浏览文件 @
1a89cc13
...
@@ -12,8 +12,8 @@
...
@@ -12,8 +12,8 @@
"bundleName"
:
"com.example.l3jsdemo"
,
"bundleName"
:
"com.example.l3jsdemo"
,
"label"
:
"$string:app_name"
,
"label"
:
"$string:app_name"
,
"version"
:
{
"version"
:
{
"code"
:
1
000000
,
"code"
:
2
000000
,
"name"
:
"
1
.0.0"
"name"
:
"
2
.0.0"
}
}
},
},
"deviceConfig"
:
{
"deviceConfig"
:
{
...
@@ -43,7 +43,7 @@
...
@@ -43,7 +43,7 @@
"mainAbility"
:
"com.example.l2jsdemo.MainAbility"
,
"mainAbility"
:
"com.example.l2jsdemo.MainAbility"
,
"distro"
:
{
"distro"
:
{
"moduleType"
:
"feature"
,
"moduleType"
:
"feature"
,
"installationFree"
:
fals
e
,
"installationFree"
:
tru
e
,
"deliveryWithInstall"
:
true
,
"deliveryWithInstall"
:
true
,
"moduleName"
:
"l2jsdemo"
"moduleName"
:
"l2jsdemo"
},
},
...
...
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsthirteenthright/src/main/config.json
浏览文件 @
1a89cc13
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
"bundleName"
:
"com.example.l3jsdemo"
,
"bundleName"
:
"com.example.l3jsdemo"
,
"label"
:
"$string:app_name"
,
"label"
:
"$string:app_name"
,
"version"
:
{
"version"
:
{
"code"
:
999999
,
"code"
:
1000000
,
"name"
:
"1.0.0"
"name"
:
"1.0.0"
}
}
},
},
...
@@ -43,7 +43,7 @@
...
@@ -43,7 +43,7 @@
"mainAbility"
:
"com.example.l1jsdemo.MainAbility"
,
"mainAbility"
:
"com.example.l1jsdemo.MainAbility"
,
"distro"
:
{
"distro"
:
{
"moduleType"
:
"feature"
,
"moduleType"
:
"feature"
,
"installationFree"
:
fals
e
,
"installationFree"
:
tru
e
,
"deliveryWithInstall"
:
true
,
"deliveryWithInstall"
:
true
,
"moduleName"
:
"l1jsdemo"
"moduleName"
:
"l1jsdemo"
},
},
...
...
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmstwelfthright/src/main/config.json
浏览文件 @
1a89cc13
...
@@ -12,8 +12,8 @@
...
@@ -12,8 +12,8 @@
"bundleName"
:
"com.example.l3jsdemo"
,
"bundleName"
:
"com.example.l3jsdemo"
,
"label"
:
"$string:app_name"
,
"label"
:
"$string:app_name"
,
"version"
:
{
"version"
:
{
"code"
:
1
000000
,
"code"
:
2
000000
,
"name"
:
"
1
.0.0"
"name"
:
"
2
.0.0"
}
}
},
},
"deviceConfig"
:
{
"deviceConfig"
:
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录