Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
9bca7c1a
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
大约 1 年 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9bca7c1a
编写于
9月 03, 2022
作者:
I
inter515
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增用例+用例名称整改
Signed-off-by:
N
inter515
<
ry.renyi@huawei.com
>
上级
1a9f665d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
358 addition
and
273 deletion
+358
-273
bundlemanager/bundle_standard/bundlemanager/actsbmsjstest/src/main/js/test/ActsBmsHasInstalldTest.test.js
...bmsjstest/src/main/js/test/ActsBmsHasInstalldTest.test.js
+128
-43
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/test/GetProfileByAbility.test.ets
...test/entry/src/main/ets/test/GetProfileByAbility.test.ets
+114
-114
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/test/GetProfileByExtensionAbility.test.ets
...y/src/main/ets/test/GetProfileByExtensionAbility.test.ets
+115
-115
bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsscenesix/src/main/config.json
...ndlemanager/sceneProject/bmsscenesix/src/main/config.json
+1
-1
未找到文件。
bundlemanager/bundle_standard/bundlemanager/actsbmsjstest/src/main/js/test/ActsBmsHasInstalldTest.test.js
浏览文件 @
9bca7c1a
...
...
@@ -23,12 +23,12 @@ const ERR_MERSSAGE = 'value is not an available number';
export
default
function
ActsBmsHasInstalldTest
()
{
describe
(
'
ActsBmsHasInstalldTest
'
,
function
()
{
/*
*
* @tc.number
hasInstalled_0100
* @tc.name
Package::h
asInstalled
/*
* @tc.number
SUB_BMS_HAP_STATUS_0001
* @tc.name
testH
asInstalled
* @tc.desc Test hasInstalled interface.
*/
it
(
'
hasInstalled_0100
'
,
0
,
async
function
(
done
)
{
it
(
'
testHasInstalled
'
,
0
,
async
function
(
done
)
{
let
flag
=
0
;
pkg
.
hasInstalled
({
bundleName
:
'
com.example.third2
'
,
...
...
@@ -49,54 +49,73 @@ describe('ActsBmsHasInstalldTest', function () {
});
});
/*
*
* @tc.number
hasInstalled_0200
* @tc.name
Package::hasInstalled
* @tc.desc Test hasInstalled interface.
/*
* @tc.number
SUB_BMS_HAP_STATUS_0002
* @tc.name
testHasInstalledNoSuccess
* @tc.desc Test hasInstalled interface
without success function
.
*/
it
(
'
hasInstalled_0200
'
,
0
,
async
function
(
done
)
{
let
flag
=
0
;
it
(
'
testHasInstalledNoSuccess
'
,
0
,
async
function
(
done
)
{
pkg
.
hasInstalled
({
bundleName
:
'
wrongName
'
,
success
:
function
success
(
data
)
{
console
.
info
(
'
hasInstalled success function in
'
);
flag
+=
1
;
expect
(
data
.
result
).
assertFalse
();
},
bundleName
:
'
com.example.third2
'
,
fail
:
function
fail
(
data
,
code
)
{
console
.
info
(
'
hasInstalled fail function in
'
);
expect
().
assertFail
();
},
complete
:
function
complete
()
{
console
.
info
(
'
hasInstalled complete function in
'
);
expect
(
flag
).
assertEqual
(
1
);
done
();
}
});
});
/*
*
* @tc.number
hasInstalled_0300
* @tc.name
Package::hasInstalled
* @tc.desc Test hasInstalled
interface
.
/*
* @tc.number
SUB_BMS_HAP_STATUS_0003
* @tc.name
testHasInstalledNoFailComplete
* @tc.desc Test hasInstalled
without fail function and complete function
.
*/
it
(
'
hasInstalled_0300
'
,
0
,
async
function
(
done
)
{
it
(
'
testHasInstalledNoFailComplete
'
,
0
,
async
function
(
done
)
{
pkg
.
hasInstalled
({
bundleName
:
'
wrongName
'
,
bundleName
:
'
com.example.third2
'
,
success
:
function
success
(
data
)
{
console
.
info
(
'
hasInstalled success function in
'
);
expect
(
data
.
result
).
assertTrue
();
done
();
}
});
});
/*
* @tc.number SUB_BMS_HAP_STATUS_0004
* @tc.name hasInstalledHapNotExist
* @tc.desc Test hasInstalled when hap not exist.
*/
it
(
'
hasInstalledHapNotExist
'
,
0
,
async
function
(
done
)
{
let
flag
=
0
;
pkg
.
hasInstalled
({
bundleName
:
'
wrongName
'
,
success
:
function
success
(
data
)
{
console
.
info
(
'
hasInstalled success function in
'
+
JSON
.
stringify
(
data
));
flag
+=
1
;
expect
(
data
.
result
).
assertFalse
();
},
fail
:
function
fail
(
data
,
code
)
{
console
.
info
(
'
hasInstalled fail function in
'
);
expect
().
assertFail
();
},
complete
:
function
complete
()
{
console
.
info
(
'
hasInstalled complete function in
'
);
expect
(
flag
).
assertEqual
(
1
);
done
();
}
});
});
/*
*
* @tc.number
hasInstalled_0400
* @tc.name
Package::hasInstalled
* @tc.desc Test hasInstalled
interface
.
/*
* @tc.number
SUB_BMS_HAP_STATUS_0007
* @tc.name
testHasInstalledNumberParam
* @tc.desc Test hasInstalled
when bundleName is number
.
*/
it
(
'
hasInstalled_0400
'
,
0
,
async
function
(
done
)
{
it
(
'
testHasInstalledNumberParam
'
,
0
,
async
function
(
done
)
{
let
flag
=
0
;
pkg
.
hasInstalled
({
bundleName
:
NUM_TWO
,
...
...
@@ -111,41 +130,97 @@ describe('ActsBmsHasInstalldTest', function () {
expect
(
code
).
assertEqual
(
ERR_CODE
);
},
complete
:
function
complete
()
{
flag
+=
3
;
console
.
info
(
'
hasInstalled complete function in
'
);
expect
(
flag
).
assertEqual
(
5
)
expect
(
flag
).
assertEqual
(
2
)
done
();
}
});
});
/*
* @tc.number: hasInstalled_0500
* @tc.name: test hasInstalled bundleName is number
* @tc.desc: test hasInstalled bundleName is number without function fail
* @tc.level 3
*/
it
(
'
hasInstalled_0500
'
,
0
,
async
function
(
done
)
{
* @tc.number SUB_BMS_HAP_STATUS_0008
* @tc.name testHasInstalledFailNotExist
* @tc.desc Test hasInstalled without function fail.
*/
it
(
'
testHasInstalledFailNotExist
'
,
0
,
async
function
(
done
)
{
pkg
.
hasInstalled
({
bundleName
:
NUM_TWO
,
success
:
function
success
(
data
)
{
console
.
info
(
'
hasInstalled success
'
+
JSON
.
stringify
(
data
)
);
expect
(
error
).
assertFail
();
console
.
info
(
'
hasInstalled success
function in
'
);
expect
().
assertFail
();
},
complete
:
function
complete
()
{
console
.
info
(
'
hasInstalled complete
'
);
console
.
info
(
'
hasInstalled complete
function in
'
);
done
();
}
})
});
});
/*
* @tc.number SUB_BMS_HAP_STATUS_0009
* @tc.name testHasInstalledCompleteNotExit
* @tc.desc Test hasInstalled without function complete.
*/
it
(
'
testHasInstalledCompleteNotExit
'
,
0
,
async
function
(
done
)
{
pkg
.
hasInstalled
({
bundleName
:
undefined
,
success
:
function
success
(
data
)
{
console
.
info
(
'
hasInstalled success function in
'
);
expect
().
assertFail
();
done
();
},
fail
:
function
fail
(
data
,
code
)
{
console
.
info
(
'
hasInstalled fail function in
'
);
expect
(
data
).
assertEqual
(
ERR_MERSSAGE
);
expect
(
code
).
assertEqual
(
ERR_CODE
);
done
();
}
});
});
/*
* @tc.number SUB_BMS_HAP_STATUS_0010
* @tc.name testHasInstalledReturnNotExist
* @tc.desc Test hasInstalled without function fail and function complete.
*/
it
(
'
testHasInstalledReturnNotExist
'
,
0
,
async
function
(
done
)
{
let
status
=
"
normal
"
;
pkg
.
hasInstalled
({
bundleName
:
NUM_TWO
,
success
:
function
success
(
data
)
{
status
=
"
success
"
;
console
.
info
(
'
hasInstalled success function in
'
);
expect
().
assertFail
();
}
});
await
sleep
(
500
);
expect
(
status
).
assertEqual
(
"
normal
"
);
done
();
});
/*
* @tc.number SUB_BMS_HAP_STATUS_0013
* @tc.name testHasInstalledNoFailCompleteBundleNotExist
* @tc.desc Test hasInstalled interface without function fail and function complete bundleName not exiet
*/
it
(
'
testHasInstalledNoFailCompleteBundleNotExist
'
,
0
,
async
function
(
done
)
{
pkg
.
hasInstalled
({
bundleName
:
'
wrongName
'
,
success
:
function
success
(
data
)
{
console
.
info
(
'
hasInstalled success function in
'
);
expect
(
data
.
result
).
assertFalse
();
done
();
}
});
});
/*
* @tc.number:
hasInstalled_0600
* @tc.name: test
hasInstalled bundleName is number
* @tc.number:
SUB_BMS_HAP_STATUS_0014
* @tc.name: test
HasInstalledInvalidParamCompleteNotExit
* @tc.desc: test hasInstalled bundleName is number without function complete
* @tc.level 3
*/
it
(
'
hasInstalled_0600
'
,
0
,
async
function
(
done
)
{
it
(
'
testHasInstalledInvalidParamCompleteNotExit
'
,
0
,
async
function
(
done
)
{
pkg
.
hasInstalled
({
bundleName
:
NUM_TWO
,
success
:
function
success
(
data
)
{
...
...
@@ -161,4 +236,14 @@ describe('ActsBmsHasInstalldTest', function () {
}
})
});
async
function
sleep
(
time
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
resolve
()
},
time
)
}).
then
(()
=>
{
console
.
info
(
`sleep
${
time
}
over...`
)
})
}
})}
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/test/GetProfileByAbility.test.ets
浏览文件 @
9bca7c1a
...
...
@@ -32,54 +32,54 @@ const PROFILE_JSON_STRING = "{\"src\":[\"MainAbility/pages/index/index\",\"MainA
export default function getProfileByAbility() {
describe('getProfileByAbility', function () {
/*
* @tc.number:
getProfileByAbility_0400
* @tc.name: getProfileByAbility
: The profile is obtained by specified ability
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_0021
* @tc.name: getProfileByAbility
InvalidModulePro
* @tc.desc: Check the invalid moduleName (by promise)
* @tc.level 0
*/
it('getProfileByAbility
_0400
', 0, async function (done) {
it('getProfileByAbility
InvalidModulePro
', 0, async function (done) {
await bundle.getProfileByAbility(MODULE_NAME_TEST, ABILITY_NAME, METADATA_NAME).then(data => {
console.info("getProfileByAbility
_0400
success" + JSON.stringify(data))
console.info("getProfileByAbility
InvalidModulePro
success" + JSON.stringify(data))
expect(data).assertFail()
done()
}).catch(err => {
console.info("getProfileByAbility
_0400
failed" + JSON.stringify(err))
console.info("getProfileByAbility
InvalidModulePro
failed" + JSON.stringify(err))
expect(err).assertEqual(1)
done()
})
})
/*
* @tc.number:
getProfileByAbility_0500
* @tc.name: getProfileByAbility
: The profile is obtained by specified ability
* @tc.desc: Check the
invalid
moduleName (by promise)
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_0031
* @tc.name: getProfileByAbility
EmptyModulePro
* @tc.desc: Check the
empty
moduleName (by promise)
* @tc.level 0
*/
it('getProfileByAbility
_0500
', 0, async function (done) {
it('getProfileByAbility
EmptyModulePro
', 0, async function (done) {
await bundle.getProfileByAbility('', ABILITY_NAME, METADATA_NAME).then(data => {
console.info("getProfileByAbility
_0500
success" + JSON.stringify(data))
console.info("getProfileByAbility
EmptyModulePro
success" + JSON.stringify(data))
expect(data).assertFail()
done()
}).catch(err => {
console.info("getProfileByAbility
_0500
failed" + JSON.stringify(err))
console.info("getProfileByAbility
EmptyModulePro
failed" + JSON.stringify(err))
expect(err).assertEqual(1)
done()
})
})
/*
* @tc.number:
getProfileByAbility_0600
* @tc.name: getProfileByAbility
: The profile is obtained by specified ability
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_0028
* @tc.name: getProfileByAbility
InvalidModuleCall
* @tc.desc: Check the invalid moduleName (by callback)
* @tc.level 0
*/
it('getProfileByAbility
_0600
', 0, async function (done) {
it('getProfileByAbility
InvalidModuleCall
', 0, async function (done) {
bundle.getProfileByAbility(MODULE_NAME_TEST, ABILITY_NAME, METADATA_NAME, (err, data) => {
if (err) {
console.error('[getProfileByAbility
_0600
]Operation failed. Cause: ' + JSON.stringify(err));
console.error('[getProfileByAbility
InvalidModuleCall
]Operation failed. Cause: ' + JSON.stringify(err));
expect(err).assertEqual(1);
}
console.info('[getProfileByAbility
_0600
] getApplicationInfo callback data is: ' + JSON.stringify(data));
console.info('[getProfileByAbility
InvalidModuleCall
] getApplicationInfo callback data is: ' + JSON.stringify(data));
expect(typeof data).assertEqual("string");
expect(data).assertEqual("GetProfile failed");
done();
...
...
@@ -87,18 +87,18 @@ export default function getProfileByAbility() {
})
/*
* @tc.number:
getProfileByAbility_0700
* @tc.name: getProfileByAbility
: The profile is obtained by specified ability
* @tc.desc: Check the
invalid
moduleName (by callback)
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_0037
* @tc.name: getProfileByAbility
EmptyModuleCall
* @tc.desc: Check the
empty
moduleName (by callback)
* @tc.level 0
*/
it('getProfileByAbility
_0700
', 0, async function (done) {
it('getProfileByAbility
EmptyModuleCall
', 0, async function (done) {
bundle.getProfileByAbility('', ABILITY_NAME, METADATA_NAME, (err, data) => {
if (err) {
console.error('[getProfileByAbility
_0700
]Operation failed. Cause: ' + JSON.stringify(err));
console.error('[getProfileByAbility
EmptyModuleCall
]Operation failed. Cause: ' + JSON.stringify(err));
expect(err).assertEqual(1);
}
console.info('[getProfileByAbility
_0700
] getApplicationInfo callback data is: ' + JSON.stringify(data));
console.info('[getProfileByAbility
EmptyModuleCall
] getApplicationInfo callback data is: ' + JSON.stringify(data));
expect(typeof data).assertEqual("string");
expect(data).assertEqual("GetProfile failed");
done();
...
...
@@ -106,54 +106,54 @@ export default function getProfileByAbility() {
})
/*
* @tc.number:
getProfileByAbility_0800
* @tc.name: getProfileByAbility
: The profile is obtained by specified ability
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_0013
* @tc.name: getProfileByAbility
InvalidAbilityPro
* @tc.desc: Check the invalid abilityName (by promise)
* @tc.level 0
*/
it('getProfileByAbility
_0800
', 0, async function (done) {
it('getProfileByAbility
InvalidAbilityPro
', 0, async function (done) {
await bundle.getProfileByAbility(MODULE_NAME, ABILITY_NAME_TEST, METADATA_NAME).then(data => {
console.info("getProfileByAbility
_0800
success" + JSON.stringify(data))
console.info("getProfileByAbility
InvalidAbilityPro
success" + JSON.stringify(data))
expect(data).assertFail()
done()
}).catch(err => {
console.info("getProfileByAbility
_0800
failed" + JSON.stringify(err))
console.info("getProfileByAbility
InvalidAbilityPro
failed" + JSON.stringify(err))
expect(err).assertEqual(1)
done()
})
})
/*
* @tc.number:
getProfileByAbility_0900
* @tc.name: getProfileByAbility
: The profile is obtained by specified ability
* @tc.desc: Check the
invalid
abilityName (by promise)
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_0032
* @tc.name: getProfileByAbility
EmptyAbilityPro
* @tc.desc: Check the
empty
abilityName (by promise)
* @tc.level 0
*/
it('getProfileByAbility
_0900
', 0, async function (done) {
it('getProfileByAbility
EmptyAbilityPro
', 0, async function (done) {
await bundle.getProfileByAbility(MODULE_NAME, '', METADATA_NAME).then(data => {
console.info("getProfileByAbility
_0900
success" + JSON.stringify(data))
console.info("getProfileByAbility
EmptyAbilityPro
success" + JSON.stringify(data))
expect(data).assertFail()
done()
}).catch(err => {
console.info("getProfileByAbility
_0900
failed" + JSON.stringify(err))
console.info("getProfileByAbility
EmptyAbilityPro
failed" + JSON.stringify(err))
expect(err).assertEqual(1)
done()
})
})
/*
* @tc.number:
getProfileByAbility_1000
* @tc.name: getProfileByAbility
: The profile is obtained by specified ability
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_0023
* @tc.name: getProfileByAbility
InvalidAbilityCall
* @tc.desc: Check the invalid abilityName (by callback)
* @tc.level 0
*/
it('getProfileByAbility
_1000
', 0, async function (done) {
it('getProfileByAbility
InvalidAbilityCall
', 0, async function (done) {
bundle.getProfileByAbility(MODULE_NAME, ABILITY_NAME_TEST, METADATA_NAME, (err, data) => {
if (err) {
console.error('[getProfileByAbility
_1000
]Operation failed. Cause: ' + JSON.stringify(err));
console.error('[getProfileByAbility
InvalidAbilityCall
]Operation failed. Cause: ' + JSON.stringify(err));
expect(err).assertEqual(1);
}
console.info('[getProfileByAbility
_1000
] getApplicationInfo callback data is: ' + JSON.stringify(data));
console.info('[getProfileByAbility
InvalidAbilityCall
] getApplicationInfo callback data is: ' + JSON.stringify(data));
expect(typeof data).assertEqual("string");
expect(data).assertEqual("GetProfile failed");
done();
...
...
@@ -161,18 +161,18 @@ export default function getProfileByAbility() {
})
/*
* @tc.number:
getProfileByAbility_1100
* @tc.name: getProfileByAbility
: The profile is obtained by specified ability
* @tc.desc: Check the
invalid
abilityName (by callback)
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_0038
* @tc.name: getProfileByAbility
EmptyAbilityCall
* @tc.desc: Check the
empty
abilityName (by callback)
* @tc.level 0
*/
it('getProfileByAbility
_1100
', 0, async function (done) {
it('getProfileByAbility
EmptyAbilityCall
', 0, async function (done) {
bundle.getProfileByAbility(MODULE_NAME, '', METADATA_NAME, (err, data) => {
if (err) {
console.error('[getProfileByAbility
_1100
]Operation failed. Cause: ' + JSON.stringify(err));
console.error('[getProfileByAbility
EmptyAbilityCall
]Operation failed. Cause: ' + JSON.stringify(err));
expect(err).assertEqual(1);
}
console.info('[getProfileByAbility
_1100
] getApplicationInfo callback data is: ' + JSON.stringify(data));
console.info('[getProfileByAbility
EmptyAbilityCall
] getApplicationInfo callback data is: ' + JSON.stringify(data));
expect(typeof data).assertEqual("string");
expect(data).assertEqual("GetProfile failed");
done();
...
...
@@ -180,18 +180,18 @@ export default function getProfileByAbility() {
})
/*
* @tc.number:
getProfileByAbility_1200
* @tc.name: getProfileByAbility
: The profile is obtained by specified ability
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_0025
* @tc.name: getProfileByAbility
Callback
* @tc.desc: Check the valid metadataName (by callback)
* @tc.level 0
*/
it('getProfileByAbility
_1200
', 0, async function (done) {
it('getProfileByAbility
Callback
', 0, async function (done) {
bundle.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME, (err, data) => {
if (err) {
console.error('[getProfileByAbility
_1200
]Operation failed. Cause: ' + JSON.stringify(err));
console.error('[getProfileByAbility
Callback
]Operation failed. Cause: ' + JSON.stringify(err));
expect(err).assertEqual(1);
}
console.info('[getProfileByAbility
_1200
] getApplicationInfo callback data is: ' + JSON.stringify(data));
console.info('[getProfileByAbility
Callback
] getApplicationInfo callback data is: ' + JSON.stringify(data));
expect(Array.isArray(data)).assertTrue();
expect(typeof data[0]).assertEqual("string");
expect(data[0]).assertEqual(PROFILE_JSON_STRING);
...
...
@@ -200,18 +200,18 @@ export default function getProfileByAbility() {
})
/*
* @tc.number:
getProfileByAbility_1300
* @tc.name: getProfileByAbility
: The profile is obtained by specified ability
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_0027
* @tc.name: getProfileByAbility
InvalidMetaDataCall
* @tc.desc: Check the invalid metadataName (by callback)
* @tc.level 0
*/
it('getProfileByAbility
_1300
', 0, async function (done) {
it('getProfileByAbility
InvalidMetaDataCall
', 0, async function (done) {
bundle.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME_TEST, (err, data) => {
if (err) {
console.error('[getProfileByAbility
_1300
]Operation failed. Cause: ' + JSON.stringify(err));
console.error('[getProfileByAbility
InvalidMetaDataCall
]Operation failed. Cause: ' + JSON.stringify(err));
expect(err).assertEqual(1);
}
console.info('[getProfileByAbility
_1300
] getApplicationInfo callback data is: ' + JSON.stringify(data));
console.info('[getProfileByAbility
InvalidMetaDataCall
] getApplicationInfo callback data is: ' + JSON.stringify(data));
expect(typeof data).assertEqual("string");
expect(data).assertEqual("GetProfile failed");
done();
...
...
@@ -219,18 +219,18 @@ export default function getProfileByAbility() {
})
/*
* @tc.number:
getProfileByAbility_1400
* @tc.name: getProfileByAbility
: The profile is obtained by specified ability
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_0039
* @tc.name: getProfileByAbility
EmptyMetaDataCall
* @tc.desc: Check the empty metadataName (by callback)
* @tc.level 0
*/
it('getProfileByAbility
_1400
', 0, async function (done) {
it('getProfileByAbility
EmptyMetaDataCall
', 0, async function (done) {
bundle.getProfileByAbility(MODULE_NAME, ABILITY_NAME, '', (err, data) => {
if (err) {
console.error('[getProfileByAbility
_1400
]Operation failed. Cause: ' + JSON.stringify(err));
console.error('[getProfileByAbility
EmptyMetaDataCall
]Operation failed. Cause: ' + JSON.stringify(err));
expect(err).assertEqual(1);
}
console.info('[getProfileByAbility
_1400
] getApplicationInfo callback data is: ' + JSON.stringify(data));
console.info('[getProfileByAbility
EmptyMetaDataCall
] getApplicationInfo callback data is: ' + JSON.stringify(data));
expect(Array.isArray(data)).assertTrue();
expect(typeof data[0]).assertEqual("string");
expect(data[0]).assertEqual(PROFILE_JSON_STRING);
...
...
@@ -241,52 +241,52 @@ export default function getProfileByAbility() {
})
/*
* @tc.number:
getProfileByAbility_1500
* @tc.name: getProfileByAbility
: The profile is obtained by specified ability
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_0003
* @tc.name: getProfileByAbility
Promise
* @tc.desc: Check the valid metadataName (by promise)
* @tc.level 0
*/
it('getProfileByAbility
_1500
', 0, async function (done) {
it('getProfileByAbility
Promise
', 0, async function (done) {
await bundle.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME).then(data => {
console.info('[getProfileByAbility
_1500
] getApplicationInfo callback data is: ' + JSON.stringify(data));
console.info('[getProfileByAbility
Promise
] getApplicationInfo callback data is: ' + JSON.stringify(data));
expect(Array.isArray(data)).assertTrue();
expect(typeof data[0]).assertEqual("string");
expect(data[0]).assertEqual(PROFILE_JSON_STRING);
done();
}).catch(err => {
console.error('[getProfileByAbility
_1500
]Operation failed. Cause: ' + JSON.stringify(err));
console.error('[getProfileByAbility
Promise
]Operation failed. Cause: ' + JSON.stringify(err));
expect(err).assertEqual(1);
done();
})
})
/*
* @tc.number:
getProfileByAbility_1600
* @tc.name: getProfileByAbility
: The profile is obtained by specified ability
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_0016
* @tc.name: getProfileByAbility
InvalidMetaDataPro
* @tc.desc: Check the invalid metadataName (by promise)
* @tc.level 0
*/
it('getProfileByAbility
_1600
', 0, async function (done) {
it('getProfileByAbility
InvalidMetaDataPro
', 0, async function (done) {
await bundle.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME_TEST).then(data => {
console.info('[getProfileByAbility
_1600
] getApplicationInfo callback data is: ' + JSON.stringify(data));
console.info('[getProfileByAbility
InvalidMetaDataPro
] getApplicationInfo callback data is: ' + JSON.stringify(data));
expect(data).assertFail()
done()
}).catch(err => {
console.error('[getProfileByAbility
_1600
]Operation failed. Cause: ' + JSON.stringify(err));
console.error('[getProfileByAbility
InvalidMetaDataPro
]Operation failed. Cause: ' + JSON.stringify(err));
expect(err).assertEqual(1);
done();
})
})
/*
* @tc.number:
getProfileByAbility_1700
* @tc.name: getProfileByAbility
: The profile is obtained by specified ability
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_0033
* @tc.name: getProfileByAbility
EmptyMetaDataPro
* @tc.desc: Check the empty metadataName (by promise)
* @tc.level 0
*/
it('getProfileByAbility
_1700
', 0, async function (done) {
it('getProfileByAbility
EmptyMetaDataPro
', 0, async function (done) {
await bundle.getProfileByAbility(MODULE_NAME, ABILITY_NAME, '').then(data => {
console.info('[getProfileByAbility
_1700
] getApplicationInfo callback data is: ' + JSON.stringify(data));
console.info('[getProfileByAbility
EmptyMetaDataPro
] getApplicationInfo callback data is: ' + JSON.stringify(data));
expect(Array.isArray(data)).assertTrue();
expect(typeof data[0]).assertEqual("string");
expect(data[0]).assertEqual(PROFILE_JSON_STRING);
...
...
@@ -294,21 +294,21 @@ export default function getProfileByAbility() {
expect(data[1]).assertEqual(PROFILE_JSON_STRING);
done();
}).catch(err => {
console.error('[getProfileByAbility
_1700
]Operation failed. Cause: ' + JSON.stringify(err));
console.error('[getProfileByAbility
EmptyMetaDataPro
]Operation failed. Cause: ' + JSON.stringify(err));
expect(err).assertEqual(1);
done();
})
})
/*
* @tc.number:
getProfileByAbility_180
0
* @tc.name: getProfileByAbility
: The profile is obtained by specified ability
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_001
0
* @tc.name: getProfileByAbility
NoMetaDataPro
* @tc.desc: without metadataName (by promise)
* @tc.level 0
*/
it('getProfileByAbility
_1800
', 0, async function (done) {
it('getProfileByAbility
NoMetaDataPro
', 0, async function (done) {
await bundle.getProfileByAbility(MODULE_NAME, ABILITY_NAME).then(data => {
console.info('[getProfileByAbility
_1800
] getApplicationInfo callback data is: ' + JSON.stringify(data));
console.info('[getProfileByAbility
NoMetaDataPro
] getApplicationInfo callback data is: ' + JSON.stringify(data));
expect(Array.isArray(data)).assertTrue();
expect(typeof data[0]).assertEqual("string");
expect(data[0]).assertEqual(PROFILE_JSON_STRING);
...
...
@@ -316,61 +316,61 @@ export default function getProfileByAbility() {
expect(data[1]).assertEqual(PROFILE_JSON_STRING);
done();
}).catch(err => {
console.error('[getProfileByAbility
_1800
]Operation failed. Cause: ' + JSON.stringify(err));
console.error('[getProfileByAbility
NoMetaDataPro
]Operation failed. Cause: ' + JSON.stringify(err));
expect(err).assertEqual(1);
done();
})
})
/*
* @tc.number:
getProfileByAbility_1900
* @tc.name: getProfileByAbility
: The profile is obtained by specified ability
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_0049
* @tc.name: getProfileByAbility
NoProfilePro
* @tc.desc: no profile configured under the ability (by promise)
* @tc.level 0
*/
it('getProfileByAbility
_1900
', 0, async function (done) {
it('getProfileByAbility
NoProfilePro
', 0, async function (done) {
await bundle.getProfileByAbility(MODULE_NAME, ABILITY_NAME1).then(data => {
console.info('[getProfileByAbility
_1900
] getApplicationInfo callback data is: ' + JSON.stringify(data));
console.info('[getProfileByAbility
NoProfilePro
] getApplicationInfo callback data is: ' + JSON.stringify(data));
expect(data).assertFail()
done();
}).catch(err => {
console.error('[getProfileByAbility
_1900
]Operation failed. Cause: ' + JSON.stringify(err));
console.error('[getProfileByAbility
NoProfilePro
]Operation failed. Cause: ' + JSON.stringify(err));
expect(err).assertEqual(1);
done();
})
})
/*
* @tc.number:
getProfileByAbility_2000
* @tc.name: getProfileByAbility
: The profile is obtained by specified ability
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_0043
* @tc.name: getProfileByAbility
NotPrefixPro
* @tc.desc: resource has no prefix '$profile:' (by promise)
* @tc.level 0
*/
it('getProfileByAbility
_2000
', 0, async function (done) {
it('getProfileByAbility
NotPrefixPro
', 0, async function (done) {
await bundle.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME2).then(data => {
console.info('[getProfileByAbility
_2000
] getApplicationInfo callback data is: ' + JSON.stringify(data));
console.info('[getProfileByAbility
NotPrefixPro
] getApplicationInfo callback data is: ' + JSON.stringify(data));
expect(data).assertFail()
done();
}).catch(err => {
console.error('[getProfileByAbility
_2000
]Operation failed. Cause: ' + JSON.stringify(err));
console.error('[getProfileByAbility
NotPrefixPro
]Operation failed. Cause: ' + JSON.stringify(err));
expect(err).assertEqual(1);
done();
})
})
/*
* @tc.number:
getProfileByAbility_2100
* @tc.name: getProfileByAbility
: The profile is obtained by specified ability
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_0042
* @tc.name: getProfileByAbility
NotPrefixCall
* @tc.desc: resource has no prefix '$profile:' (by callback)
* @tc.level 0
*/
it('getProfileByAbility
_2100
', 0, async function (done) {
it('getProfileByAbility
NotPrefixCall
', 0, async function (done) {
bundle.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME2, (err, data) => {
if (err) {
console.error('[getProfileByAbility
_2100
]Operation failed. Cause: ' + JSON.stringify(err));
console.error('[getProfileByAbility
NotPrefixCall
]Operation failed. Cause: ' + JSON.stringify(err));
expect(err).assertEqual(1);
}
console.info('[getProfileByAbility
_2100
] getApplicationInfo callback data is: ' + JSON.stringify(data));
console.info('[getProfileByAbility
NotPrefixCall
] getApplicationInfo callback data is: ' + JSON.stringify(data));
expect(typeof data).assertEqual("string");
expect(data).assertEqual("GetProfile failed");
done();
...
...
@@ -378,37 +378,37 @@ export default function getProfileByAbility() {
})
/*
* @tc.number:
getProfileByAbility_2200
* @tc.name: getProfileByAbility
: The profile is obtained by specified ability
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_0019
* @tc.name: getProfileByAbility
NotSuffixPro
* @tc.desc: profile is .txt suffix (by promise)
* @tc.level 0
*/
it('getProfileByAbility
_2200
', 0, async function (done) {
it('getProfileByAbility
NotSuffixPro
', 0, async function (done) {
await bundle.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME3).then(data => {
console.info('[getProfileByAbility
_2200
] getApplicationInfo callback data is: ' + JSON.stringify(data));
console.info('[getProfileByAbility
NotSuffixPro
] getApplicationInfo callback data is: ' + JSON.stringify(data));
expect(Array.isArray(data)).assertTrue();
expect(typeof data[0]).assertEqual("string");
done();
}).catch(err => {
console.error('[getProfileByAbility
_2200
]Operation failed. Cause: ' + JSON.stringify(err));
console.error('[getProfileByAbility
NotSuffixPro
]Operation failed. Cause: ' + JSON.stringify(err));
expect().assertFail();
done();
})
})
/*
* @tc.number:
getProfileByAbility_2300
* @tc.name: getProfileByAbility
: The profile is obtained by specified ability
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_0041
* @tc.name: getProfileByAbility
NotSuffixCall
* @tc.desc: profile is .txt suffix (by callback)
* @tc.level 0
*/
it('getProfileByAbility
_2300
', 0, async function (done) {
it('getProfileByAbility
NotSuffixCall
', 0, async function (done) {
bundle.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME3, (err, data) => {
if (err) {
console.error('[getProfileByAbility
_2300
]Operation failed. Cause: ' + JSON.stringify(err));
console.error('[getProfileByAbility
NotSuffixCall
]Operation failed. Cause: ' + JSON.stringify(err));
expect().assertFail();
}
console.info('[getProfileByAbility
_2300
] getApplicationInfo callback data is: ' + JSON.stringify(data));
console.info('[getProfileByAbility
NotSuffixCall
] getApplicationInfo callback data is: ' + JSON.stringify(data));
expect(Array.isArray(data)).assertTrue();
expect(typeof data[0]).assertEqual("string");
done();
...
...
@@ -416,34 +416,34 @@ export default function getProfileByAbility() {
})
/*
* @tc.number:
getProfileByAbility_240
0
* @tc.name: getProfileByAbility
: The profile is obtained by specified ability
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_002
0
* @tc.name: getProfileByAbility
NoJsonPro
* @tc.desc: profile is invalid json format (by promise)
* @tc.level 0
*/
it('getProfileByAbility
_2400
', 0, async function (done) {
it('getProfileByAbility
NoJsonPro
', 0, async function (done) {
await bundle.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME4).then(data => {
console.info('[getProfileByAbility
_2400
] data is: ' + JSON.stringify(data));
console.info('[getProfileByAbility
NoJsonPro
] data is: ' + JSON.stringify(data));
expect().assertFail();
done();
}).catch(err => {
console.error('[getProfileByAbility
_2400
] Operation failed. Cause: ' + JSON.stringify(err));
console.error('[getProfileByAbility
NoJsonPro
] Operation failed. Cause: ' + JSON.stringify(err));
expect(err).assertEqual(1);
done();
})
})
/*
* @tc.number:
getProfileByAbility_2500
* @tc.name: getProfileByAbility
: The profile is obtained by specified ability
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_0047
* @tc.name: getProfileByAbility
NoJsonCall
* @tc.desc: profile is invalid json format (by callback)
* @tc.level 0
*/
it('getProfileByAbility
_2500
', 0, async function (done) {
it('getProfileByAbility
NoJsonCall
', 0, async function (done) {
bundle.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME4, (err, data) => {
console.info('[getProfileByAbility
_2500
] err: ' + JSON.stringify(err));
console.info('[getProfileByAbility
NoJsonCall
] err: ' + JSON.stringify(err));
expect(err).assertEqual(1);
console.info('[getProfileByAbility
_2500
] data is: ' + JSON.stringify(data));
console.info('[getProfileByAbility
NoJsonCall
] data is: ' + JSON.stringify(data));
expect(typeof data).assertEqual("string");
expect(data).assertEqual("GetProfile failed");
done();
...
...
bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/test/GetProfileByExtensionAbility.test.ets
浏览文件 @
9bca7c1a
...
...
@@ -32,54 +32,54 @@ const PROFILE_JSON_STRING = "{\"src\":[\"MainAbility/pages/index/index\",\"MainA
export default function getProfileByExtensionAbility() {
describe('getProfileByExtensionAbility', function () {
/*
* @tc.number:
getProfileByExtensionAbility_0400
* @tc.name: getProfileByExtension
Ability : The profile is obtained by specified ability
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_0011
* @tc.name: getProfileByExtension
InvalidModulePro
* @tc.desc: Check the invalid moduleName (by promise)
* @tc.level 0
*/
it('getProfileByExtension
Ability_0400
', 0, async function (done) {
it('getProfileByExtension
InvalidModulePro
', 0, async function (done) {
await bundle.getProfileByExtensionAbility(MODULE_NAME_TEST, ABILITY_NAME, METADATA_NAME).then(data => {
console.info("getProfileByExtension
Ability_0400
success" + JSON.stringify(data))
console.info("getProfileByExtension
InvalidModulePro
success" + JSON.stringify(data))
expect(data).assertFail()
done()
}).catch(err => {
console.info("getProfileByExtension
Ability_0400
failed" + JSON.stringify(err))
console.info("getProfileByExtension
InvalidModulePro
failed" + JSON.stringify(err))
expect(err).assertEqual(1)
done()
})
})
/*
* @tc.number:
getProfileByExtensionAbility_0500
* @tc.name: getProfileByExtension
Ability : The profile is obtained by specified ability
* @tc.desc: Check the
invalid
moduleName (by promise)
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_0015
* @tc.name: getProfileByExtension
EmptyModulePro
* @tc.desc: Check the
Empty
moduleName (by promise)
* @tc.level 0
*/
it('getProfileByExtension
Ability_0500
', 0, async function (done) {
it('getProfileByExtension
EmptyModulePro
', 0, async function (done) {
await bundle.getProfileByExtensionAbility('', ABILITY_NAME, METADATA_NAME).then(data => {
console.info("getProfileByExtension
Ability_0500
success" + JSON.stringify(data))
console.info("getProfileByExtension
EmptyModulePro
success" + JSON.stringify(data))
expect(data).assertFail()
done()
}).catch(err => {
console.info("getProfileByExtension
Ability_0500
failed" + JSON.stringify(err))
console.info("getProfileByExtension
EmptyModulePro
failed" + JSON.stringify(err))
expect(err).assertEqual(1)
done()
})
})
/*
* @tc.number:
getProfileByExtensionAbility_0600
* @tc.name: getProfileByExtension
Ability : The profile is obtained by specified ability
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_0017
* @tc.name: getProfileByExtension
EmptyModuleCall
* @tc.desc: Check the invalid moduleName (by callback)
* @tc.level 0
*/
it('getProfileByExtension
Ability_0600
', 0, async function (done) {
it('getProfileByExtension
EmptyModuleCall
', 0, async function (done) {
bundle.getProfileByExtensionAbility(MODULE_NAME_TEST, ABILITY_NAME, METADATA_NAME, (err, data) => {
if (err) {
console.error('[getProfileByExtension
Ability_0600
]Operation failed. Cause: ' + JSON.stringify(err));
console.error('[getProfileByExtension
EmptyModuleCall
]Operation failed. Cause: ' + JSON.stringify(err));
expect(err).assertEqual(1);
}
console.info('[getProfileByExtension
Ability_0600
] getApplicationInfo callback data is: ' + JSON.stringify(data));
console.info('[getProfileByExtension
EmptyModuleCall
] getApplicationInfo callback data is: ' + JSON.stringify(data));
expect(typeof data).assertEqual("string");
expect(data).assertEqual("GetProfile failed");
done();
...
...
@@ -87,18 +87,18 @@ export default function getProfileByExtensionAbility() {
})
/*
* @tc.number:
getProfileByExtensionAbility_0700
* @tc.name: getProfileByExtension
Ability : The profile is obtained by specified ability
* @tc.desc: Check the
invalid
moduleName (by callback)
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_0034
* @tc.name: getProfileByExtension
EmptyModuleCall
* @tc.desc: Check the
Empty
moduleName (by callback)
* @tc.level 0
*/
it('getProfileByExtension
Ability_0700
', 0, async function (done) {
it('getProfileByExtension
EmptyModuleCall
', 0, async function (done) {
bundle.getProfileByExtensionAbility('', ABILITY_NAME, METADATA_NAME, (err, data) => {
if (err) {
console.error('[getProfileByExtension
Ability_0700
]Operation failed. Cause: ' + JSON.stringify(err));
console.error('[getProfileByExtension
EmptyModuleCall
]Operation failed. Cause: ' + JSON.stringify(err));
expect(err).assertEqual(1);
}
console.info('[getProfileByExtension
Ability_0700
] getApplicationInfo callback data is: ' + JSON.stringify(data));
console.info('[getProfileByExtension
EmptyModuleCall
] getApplicationInfo callback data is: ' + JSON.stringify(data));
expect(typeof data).assertEqual("string");
expect(data).assertEqual("GetProfile failed");
done();
...
...
@@ -106,54 +106,54 @@ export default function getProfileByExtensionAbility() {
})
/*
* @tc.number:
getProfileByExtensionAbility_0800
* @tc.name: getProfileByExtension
Ability : The profile is obtained by specified ability
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_0012
* @tc.name: getProfileByExtension
InvalidAbilityPro
* @tc.desc: Check the invalid abilityName (by promise)
* @tc.level 0
*/
it('getProfileByExtension
Ability_0800
', 0, async function (done) {
it('getProfileByExtension
InvalidAbilityPro
', 0, async function (done) {
await bundle.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME_TEST, METADATA_NAME).then(data => {
console.info("getProfileByExtension
Ability_0800
success" + JSON.stringify(data))
console.info("getProfileByExtension
InvalidAbilityPro
success" + JSON.stringify(data))
expect(data).assertFail()
done()
}).catch(err => {
console.info("getProfileByExtension
Ability_0800
failed" + JSON.stringify(err))
console.info("getProfileByExtension
InvalidAbilityPro
failed" + JSON.stringify(err))
expect(err).assertEqual(1)
done()
})
})
/*
* @tc.number:
getProfileByExtensionAbility_0900
* @tc.name: getProfileByExtension
Ability : The profile is obtained by specified ability
* @tc.desc: Check the
invalid
abilityName (by promise)
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_0029
* @tc.name: getProfileByExtension
EmptyAbilityPro
* @tc.desc: Check the
Empty
abilityName (by promise)
* @tc.level 0
*/
it('getProfileByExtension
Ability_0900
', 0, async function (done) {
it('getProfileByExtension
EmptyAbilityPro
', 0, async function (done) {
await bundle.getProfileByExtensionAbility(MODULE_NAME, '', METADATA_NAME).then(data => {
console.info("getProfileByExtension
Ability_0900
success" + JSON.stringify(data))
console.info("getProfileByExtension
EmptyAbilityPro
success" + JSON.stringify(data))
expect(data).assertFail()
done()
}).catch(err => {
console.info("getProfileByExtension
Ability_0900
failed" + JSON.stringify(err))
console.info("getProfileByExtension
EmptyAbilityPro
failed" + JSON.stringify(err))
expect(err).assertEqual(1)
done()
})
})
/*
* @tc.number:
getProfileByExtensionAbility_1000
* @tc.name: getProfileByExtension
Ability : The profile is obtained by specified ability
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_0022
* @tc.name: getProfileByExtension
InvalidAbilityCall
* @tc.desc: Check the invalid abilityName (by callback)
* @tc.level 0
*/
it('getProfileByExtension
Ability_1000
', 0, async function (done) {
it('getProfileByExtension
InvalidAbilityCall
', 0, async function (done) {
bundle.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME_TEST, METADATA_NAME, (err, data) => {
if (err) {
console.error('[getProfileByExtension
Ability_1000
]Operation failed. Cause: ' + JSON.stringify(err));
console.error('[getProfileByExtension
InvalidAbilityCall
]Operation failed. Cause: ' + JSON.stringify(err));
expect(err).assertEqual(1);
}
console.info('[getProfileByExtension
Ability_1000
] getApplicationInfo callback data is: ' + JSON.stringify(data));
console.info('[getProfileByExtension
InvalidAbilityCall
] getApplicationInfo callback data is: ' + JSON.stringify(data));
expect(typeof data).assertEqual("string");
expect(data).assertEqual("GetProfile failed");
done();
...
...
@@ -161,18 +161,18 @@ export default function getProfileByExtensionAbility() {
})
/*
* @tc.number:
getProfileByExtensionAbility_1100
* @tc.name: getProfileByExtension
Ability : The profile is obtained by specified ability
* @tc.desc: Check the
invalid
abilityName (by callback)
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_0035
* @tc.name: getProfileByExtension
EmptyAbilityCall
* @tc.desc: Check the
Empty
abilityName (by callback)
* @tc.level 0
*/
it('getProfileByExtension
Ability_1100
', 0, async function (done) {
it('getProfileByExtension
EmptyAbilityCall
', 0, async function (done) {
bundle.getProfileByExtensionAbility(MODULE_NAME, '', METADATA_NAME, (err, data) => {
if (err) {
console.error('[getProfileByExtension
Ability_1100
]Operation failed. Cause: ' + JSON.stringify(err));
console.error('[getProfileByExtension
EmptyAbilityCall
]Operation failed. Cause: ' + JSON.stringify(err));
expect(err).assertEqual(1);
}
console.info('[getProfileByExtension
Ability_1100
] getApplicationInfo callback data is: ' + JSON.stringify(data));
console.info('[getProfileByExtension
EmptyAbilityCall
] getApplicationInfo callback data is: ' + JSON.stringify(data));
expect(typeof data).assertEqual("string");
expect(data).assertEqual("GetProfile failed");
done();
...
...
@@ -180,18 +180,18 @@ export default function getProfileByExtensionAbility() {
})
/*
* @tc.number:
getProfileByExtensionAbility_1200
* @tc.name: getProfileByExtensionAbility
: The profile is obtained by specified ability
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_0024
* @tc.name: getProfileByExtensionAbility
Callback
* @tc.desc: Check the valid metadataName (by callback)
* @tc.level 0
*/
it('getProfileByExtensionAbility
_1200
', 0, async function (done) {
it('getProfileByExtensionAbility
Callback
', 0, async function (done) {
bundle.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME, (err, data) => {
if (err) {
console.error('[getProfileByExtensionAbility
_1200
]Operation failed. Cause: ' + JSON.stringify(err));
console.error('[getProfileByExtensionAbility
Callback
]Operation failed. Cause: ' + JSON.stringify(err));
expect(err).assertEqual(1);
}
console.info('[getProfileByExtensionAbility
_1200
] getApplicationInfo callback data is: ' + JSON.stringify(data));
console.info('[getProfileByExtensionAbility
Callback
] getApplicationInfo callback data is: ' + JSON.stringify(data));
expect(Array.isArray(data)).assertTrue();
expect(typeof data[0]).assertEqual("string");
expect(data[0]).assertEqual(PROFILE_JSON_STRING);
...
...
@@ -200,18 +200,18 @@ export default function getProfileByExtensionAbility() {
})
/*
* @tc.number:
getProfileByExtensionAbility_1300
* @tc.name: getProfileByExtension
Ability : The profile is obtained by specified ability
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_0026
* @tc.name: getProfileByExtension
InvalidMetaDataCall
* @tc.desc: Check the invalid metadataName (by callback)
* @tc.level 0
*/
it('getProfileByExtension
Ability_1300
', 0, async function (done) {
it('getProfileByExtension
InvalidMetaDataCall
', 0, async function (done) {
bundle.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME_TEST, (err, data) => {
if (err) {
console.error('[getProfileByExtension
Ability_1300
]Operation failed. Cause: ' + JSON.stringify(err));
console.error('[getProfileByExtension
InvalidMetaDataCall
]Operation failed. Cause: ' + JSON.stringify(err));
expect(err).assertEqual(1);
}
console.info('[getProfileByExtension
Ability_1300
] getApplicationInfo callback data is: ' + JSON.stringify(data));
console.info('[getProfileByExtension
InvalidMetaDataCall
] getApplicationInfo callback data is: ' + JSON.stringify(data));
expect(typeof data).assertEqual("string");
expect(data).assertEqual("GetProfile failed");
done();
...
...
@@ -219,18 +219,18 @@ export default function getProfileByExtensionAbility() {
})
/*
* @tc.number:
getProfileByExtensionAbility_1400
* @tc.name: getProfileByExtension
Ability : The profile is obtained by specified ability
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_0036
* @tc.name: getProfileByExtension
EmptyMetaDataCall
* @tc.desc: Check the empty metadataName (by callback)
* @tc.level 0
*/
it('getProfileByExtension
Ability_1400
', 0, async function (done) {
it('getProfileByExtension
EmptyMetaDataCall
', 0, async function (done) {
bundle.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, '', (err, data) => {
if (err) {
console.error('[getProfileByExtension
Ability_1400
]Operation failed. Cause: ' + JSON.stringify(err));
console.error('[getProfileByExtension
EmptyMetaDataCall
]Operation failed. Cause: ' + JSON.stringify(err));
expect(err).assertEqual(1);
}
console.info('[getProfileByExtension
Ability_1400
] getApplicationInfo callback data is: ' + JSON.stringify(data));
console.info('[getProfileByExtension
EmptyMetaDataCall
] getApplicationInfo callback data is: ' + JSON.stringify(data));
expect(Array.isArray(data)).assertTrue();
expect(typeof data[0]).assertEqual("string");
expect(data[0]).assertEqual(PROFILE_JSON_STRING);
...
...
@@ -241,52 +241,52 @@ export default function getProfileByExtensionAbility() {
})
/*
* @tc.number:
getProfileByExtensionAbility_1500
* @tc.name: getProfileByExtensionAbility
: The profile is obtained by specified ability
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_0002
* @tc.name: getProfileByExtensionAbility
Promise
* @tc.desc: Check the valid metadataName (by promise)
* @tc.level 0
*/
it('getProfileByExtensionAbility
_1500
', 0, async function (done) {
it('getProfileByExtensionAbility
Promise
', 0, async function (done) {
await bundle.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME).then(data => {
console.info('[getProfileByExtensionAbility
_1500
] getApplicationInfo callback data is: ' + JSON.stringify(data));
console.info('[getProfileByExtensionAbility
Promise
] getApplicationInfo callback data is: ' + JSON.stringify(data));
expect(Array.isArray(data)).assertTrue();
expect(typeof data[0]).assertEqual("string");
expect(data[0]).assertEqual(PROFILE_JSON_STRING);
done();
}).catch(err => {
console.error('[getProfileByExtensionAbility
_1500
]Operation failed. Cause: ' + JSON.stringify(err));
console.error('[getProfileByExtensionAbility
Promise
]Operation failed. Cause: ' + JSON.stringify(err));
expect(err).assertEqual(1);
done();
})
})
/*
* @tc.number:
getProfileByExtensionAbility_1600
* @tc.name: getProfileByExtension
Ability : The profile is obtained by specified ability
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_0004
* @tc.name: getProfileByExtension
InvalidMetaDataPro
* @tc.desc: Check the invalid metadataName (by promise)
* @tc.level 0
*/
it('getProfileByExtension
Ability_1600
', 0, async function (done) {
it('getProfileByExtension
InvalidMetaDataPro
', 0, async function (done) {
await bundle.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME_TEST).then(data => {
console.info('[getProfileByExtension
Ability_1600
] getApplicationInfo callback data is: ' + JSON.stringify(data));
console.info('[getProfileByExtension
InvalidMetaDataPro
] getApplicationInfo callback data is: ' + JSON.stringify(data));
expect(data).assertFail()
done()
}).catch(err => {
console.error('[getProfileByExtension
Ability_1600
]Operation failed. Cause: ' + JSON.stringify(err));
console.error('[getProfileByExtension
InvalidMetaDataPro
]Operation failed. Cause: ' + JSON.stringify(err));
expect(err).assertEqual(1);
done();
})
})
/*
* @tc.number:
getProfileByExtensionAbility_170
0
* @tc.name: getProfileByExtension
Ability : The profile is obtained by specified ability
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_003
0
* @tc.name: getProfileByExtension
EmptyMetaDataPro
* @tc.desc: Check the empty metadataName (by promise)
* @tc.level 0
*/
it('getProfileByExtension
Ability_1700
', 0, async function (done) {
it('getProfileByExtension
EmptyMetaDataPro
', 0, async function (done) {
await bundle.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, '').then(data => {
console.info('[getProfileByExtension
Ability_1700
] getApplicationInfo callback data is: ' + JSON.stringify(data));
console.info('[getProfileByExtension
EmptyMetaDataPro
] getApplicationInfo callback data is: ' + JSON.stringify(data));
expect(Array.isArray(data)).assertTrue();
expect(typeof data[0]).assertEqual("string");
expect(data[0]).assertEqual(PROFILE_JSON_STRING);
...
...
@@ -294,21 +294,21 @@ export default function getProfileByExtensionAbility() {
expect(data[1]).assertEqual(PROFILE_JSON_STRING);
done();
}).catch(err => {
console.error('[getProfileByExtension
Ability_1700
]Operation failed. Cause: ' + JSON.stringify(err));
console.error('[getProfileByExtension
EmptyMetaDataPro
]Operation failed. Cause: ' + JSON.stringify(err));
expect(err).assertEqual(1);
done();
})
})
/*
* @tc.number:
getProfileByExtensionAbility_1800
* @tc.name: getProfileByExtensionAbility
: The profile is obtained by specified ability
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_0009
* @tc.name: getProfileByExtensionAbility
NoMetaDataPro
* @tc.desc: without metadataName (by promise)
* @tc.level 0
*/
it('getProfileByExtensionAbility
_1800
', 0, async function (done) {
it('getProfileByExtensionAbility
NoMetaDataPro
', 0, async function (done) {
await bundle.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME).then(data => {
console.info('[getProfileByExtensionAbility
_1800
] getApplicationInfo callback data is: ' + JSON.stringify(data));
console.info('[getProfileByExtensionAbility
NoMetaDataPro
] getApplicationInfo callback data is: ' + JSON.stringify(data));
expect(Array.isArray(data)).assertTrue();
expect(typeof data[0]).assertEqual("string");
expect(data[0]).assertEqual(PROFILE_JSON_STRING);
...
...
@@ -316,61 +316,61 @@ export default function getProfileByExtensionAbility() {
expect(data[1]).assertEqual(PROFILE_JSON_STRING);
done();
}).catch(err => {
console.error('[getProfileByExtensionAbility
_1800
]Operation failed. Cause: ' + JSON.stringify(err));
console.error('[getProfileByExtensionAbility
NoMetaDataPro
]Operation failed. Cause: ' + JSON.stringify(err));
expect(err).assertEqual(1);
done();
})
})
/*
* @tc.number:
getProfileByExtensionAbility_1900
* @tc.name: getProfileByExtensionAbility
: The profile is obtained by specified ability
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_0048
* @tc.name: getProfileByExtensionAbility
NoProfilePro
* @tc.desc: no profile configured under the ability (by promise)
* @tc.level 0
*/
it('getProfileByExtensionAbility
_1900
', 0, async function (done) {
it('getProfileByExtensionAbility
NoProfilePro
', 0, async function (done) {
await bundle.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME1).then(data => {
console.info('[getProfileByExtensionAbility
_1900
] getApplicationInfo callback data is: ' + JSON.stringify(data));
console.info('[getProfileByExtensionAbility
NoProfilePro
] getApplicationInfo callback data is: ' + JSON.stringify(data));
expect(data).assertFail()
done();
}).catch(err => {
console.error('[getProfileByExtensionAbility
_1900
]Operation failed. Cause: ' + JSON.stringify(err));
console.error('[getProfileByExtensionAbility
NoProfilePro
]Operation failed. Cause: ' + JSON.stringify(err));
expect(err).assertEqual(1);
done();
})
})
/*
* @tc.number:
getProfileByExtensionAbility_2000
* @tc.name: getProfileByExtension
Ability : The profile is obtained by specified ability
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_0045
* @tc.name: getProfileByExtension
NotPrefixPro
* @tc.desc: resource has no prefix '$profile:' (by promise)
* @tc.level 0
*/
it('getProfileByExtension
Ability_2000
', 0, async function (done) {
it('getProfileByExtension
NotPrefixPro
', 0, async function (done) {
await bundle.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME2).then(data => {
console.info('[getProfileByExtension
Ability_2000
] getApplicationInfo callback data is: ' + JSON.stringify(data));
console.info('[getProfileByExtension
NotPrefixPro
] getApplicationInfo callback data is: ' + JSON.stringify(data));
expect(data).assertFail()
done();
}).catch(err => {
console.error('[getProfileByExtension
Ability_2000
]Operation failed. Cause: ' + JSON.stringify(err));
console.error('[getProfileByExtension
NotPrefixPro
]Operation failed. Cause: ' + JSON.stringify(err));
expect(err).assertEqual(1);
done();
})
})
/*
* @tc.number:
getProfileByExtensionAbility_2100
* @tc.name: getProfileByExtension
Ability : The profile is obtained by specified ability
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_0044
* @tc.name: getProfileByExtension
NotPrefixCall
* @tc.desc: resource has no prefix '$profile:' (by callback)
* @tc.level 0
*/
it('getProfileByExtension
Ability_2100
', 0, async function (done) {
it('getProfileByExtension
NotPrefixCall
', 0, async function (done) {
bundle.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME2, (err, data) => {
if (err) {
console.error('[getProfileByExtension
Ability_2100
]Operation failed. Cause: ' + JSON.stringify(err));
console.error('[getProfileByExtension
NotPrefixCall
]Operation failed. Cause: ' + JSON.stringify(err));
expect(err).assertEqual(1);
}
console.info('[getProfileByExtension
Ability_2100
] getApplicationInfo callback data is: ' + JSON.stringify(data));
console.info('[getProfileByExtension
NotPrefixCall
] getApplicationInfo callback data is: ' + JSON.stringify(data));
expect(typeof data).assertEqual("string");
expect(data).assertEqual("GetProfile failed");
done();
...
...
@@ -378,37 +378,37 @@ export default function getProfileByExtensionAbility() {
})
/*
* @tc.number:
getProfileByExtensionAbility_2200
* @tc.name: getProfileByExtension
Ability : The profile is obtained by specified ability
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_0007
* @tc.name: getProfileByExtension
NotSuffixPro
* @tc.desc: profile is .txt suffix (by promise)
* @tc.level 0
*/
it('getProfileByExtension
Ability_2200
', 0, async function (done) {
it('getProfileByExtension
NotSuffixPro
', 0, async function (done) {
await bundle.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME3).then(data => {
console.info('[getProfileByExtension
Ability_2200
] getApplicationInfo callback data is: ' + JSON.stringify(data));
console.info('[getProfileByExtension
NotSuffixPro
] getApplicationInfo callback data is: ' + JSON.stringify(data));
expect(Array.isArray(data)).assertTrue();
expect(typeof data[0]).assertEqual("string");
done();
}).catch(err => {
console.error('[getProfileByExtension
Ability_2200
]Operation failed. Cause: ' + JSON.stringify(err));
console.error('[getProfileByExtension
NotSuffixPro
]Operation failed. Cause: ' + JSON.stringify(err));
expect().assertFail();
done();
})
})
/*
* @tc.number:
getProfileByExtensionAbility_230
0
* @tc.name: getProfileByExtension
Ability : The profile is obtained by specified ability
* @tc.desc: profile is
invalid json format
(by callback)
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_004
0
* @tc.name: getProfileByExtension
NotSuffixCall
* @tc.desc: profile is
.txt suffix
(by callback)
* @tc.level 0
*/
it('getProfileByExtension
Ability_2300
', 0, async function (done) {
it('getProfileByExtension
NotSuffixCall
', 0, async function (done) {
bundle.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME3, (err, data) => {
if (err) {
console.error('[getProfileByExtension
Ability_2300
]Operation failed. Cause: ' + JSON.stringify(err));
console.error('[getProfileByExtension
NotSuffixCall
]Operation failed. Cause: ' + JSON.stringify(err));
expect().assertFail();
}
console.info('[getProfileByExtension
Ability_2300
] getApplicationInfo callback data is: ' + JSON.stringify(data));
console.info('[getProfileByExtension
NotSuffixCall
] getApplicationInfo callback data is: ' + JSON.stringify(data));
expect(Array.isArray(data)).assertTrue();
expect(typeof data[0]).assertEqual("string");
done();
...
...
@@ -416,34 +416,34 @@ export default function getProfileByExtensionAbility() {
})
/*
* @tc.number:
getProfileByExtensionAbility_2400
* @tc.name: getProfileByExtension
Ability : The profile is obtained by specified ability
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_0008
* @tc.name: getProfileByExtension
NoJsonPro
* @tc.desc: profile is invalid json format (by promise)
* @tc.level 0
*/
it('getProfileByExtension
Ability_2400
', 0, async function (done) {
it('getProfileByExtension
NoJsonPro
', 0, async function (done) {
await bundle.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME4).then(data => {
console.info('[getProfileByExtension
Ability_2400
] data is: ' + JSON.stringify(data));
console.info('[getProfileByExtension
NoJsonPro
] data is: ' + JSON.stringify(data));
expect().assertFail();
done();
}).catch(err => {
console.error('[getProfileByExtension
Ability_2400
] Operation failed. Cause: ' + JSON.stringify(err));
console.error('[getProfileByExtension
NoJsonPro
] Operation failed. Cause: ' + JSON.stringify(err));
expect(err).assertEqual(1);
done();
})
})
/*
* @tc.number:
getProfileByExtensionAbility_2500
* @tc.name: getProfileByExtension
Ability : The profile is obtained by specified ability
* @tc.number:
SUB_BMS_APPINFO_QUERYMETAFILE_0046
* @tc.name: getProfileByExtension
NoJsonCall
* @tc.desc: profile is invalid json format (by callback)
* @tc.level 0
*/
it('getProfileByExtension
Ability_2500
', 0, async function (done) {
it('getProfileByExtension
NoJsonCall
', 0, async function (done) {
bundle.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME4, (err, data) => {
console.info('[getProfileByExtension
Ability_2500
] err: ' + JSON.stringify(err));
console.info('[getProfileByExtension
NoJsonCall
] err: ' + JSON.stringify(err));
expect(err).assertEqual(1);
console.info('[getProfileByExtension
Ability_2500
] data is: ' + JSON.stringify(data));
console.info('[getProfileByExtension
NoJsonCall
] data is: ' + JSON.stringify(data));
expect(typeof data).assertEqual("string");
expect(data).assertEqual("GetProfile failed");
done();
...
...
bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsscenesix/src/main/config.json
浏览文件 @
9bca7c1a
...
...
@@ -44,7 +44,7 @@
"type"
:
"page"
,
"isVisible"
:
"true"
,
"launchType"
:
"standard"
,
"orientation"
:
"follow
r
ecent"
,
"orientation"
:
"follow
R
ecent"
,
"language"
:
"C++"
}
],
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录