Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
47713768
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看板
提交
47713768
编写于
11月 18, 2022
作者:
C
chengxingzhen
1
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
xts用例优化
Signed-off-by:
N
chengxingzhen
<
chengxingzhen@huawei.com
>
上级
b360ddb6
变更
13
展开全部
隐藏空白更改
内联
并排
Showing
13 changed file
with
576 addition
and
89 deletion
+576
-89
ability/ability_runtime/aacommand/AACommand07/entry/src/main/module.json
..._runtime/aacommand/AACommand07/entry/src/main/module.json
+2
-2
ability/ability_runtime/aacommand/AACommandPrintOneTest/entry/src/main/ets/MainAbility/MainAbility.ts
...rintOneTest/entry/src/main/ets/MainAbility/MainAbility.ts
+16
-25
ability/ability_runtime/aacommand/AACommandPrintOneTest/entry/src/main/module.json
...acommand/AACommandPrintOneTest/entry/src/main/module.json
+6
-0
ability/ability_runtime/aacommand/AACommandPrintSync/entry/src/main/ets/test/AACommandPrint.test.ets
...PrintSync/entry/src/main/ets/test/AACommandPrint.test.ets
+7
-10
ability/ability_runtime/aacommand/AACommandPrintSync/entry/src/main/ets/test/List.test.ets
.../AACommandPrintSync/entry/src/main/ets/test/List.test.ets
+1
-1
ability/ability_runtime/aacommand/AACommandPrintSyncTest/entry/src/main/ets/MainAbility/MainAbility.ts
...intSyncTest/entry/src/main/ets/MainAbility/MainAbility.ts
+5
-10
ability/ability_runtime/aacommand/AACommandPrintSyncTest/entry/src/main/module.json
...command/AACommandPrintSyncTest/entry/src/main/module.json
+6
-0
ability/ability_runtime/aacommand/AACommandRelyHap/entry/src/main/ets/test/AACommand.test.ets
...CommandRelyHap/entry/src/main/ets/test/AACommand.test.ets
+280
-0
ability/ability_runtime/aacommand/AACommandRelyHap/entry/src/main/ets/test/AACommandPrintOne.test.ets
...elyHap/entry/src/main/ets/test/AACommandPrintOne.test.ets
+215
-0
ability/ability_runtime/aacommand/AACommandRelyHap/entry/src/main/ets/test/List.test.ets
...nd/AACommandRelyHap/entry/src/main/ets/test/List.test.ets
+4
-2
ability/ability_runtime/aacommand/AACommandpackage/entry/src/main/ets/test/Ability.test.ets
...AACommandpackage/entry/src/main/ets/test/Ability.test.ets
+1
-1
ability/ability_runtime/aacommand/AACommandtest/entry/src/main/ets/MainAbility/MainAbility.ts
...Commandtest/entry/src/main/ets/MainAbility/MainAbility.ts
+27
-38
ability/ability_runtime/aacommand/AACommandtest/entry/src/main/module.json
...untime/aacommand/AACommandtest/entry/src/main/module.json
+6
-0
未找到文件。
ability/ability_runtime/aacommand/AACommand07/entry/src/main/module.json
浏览文件 @
47713768
...
@@ -6,8 +6,8 @@
...
@@ -6,8 +6,8 @@
"description"
:
"$string:entry_test_desc"
,
"description"
:
"$string:entry_test_desc"
,
"mainElement"
:
"MainAbility"
,
"mainElement"
:
"MainAbility"
,
"deviceTypes"
:
[
"deviceTypes"
:
[
"default"
,
"default"
,
"tablet"
"tablet"
],
],
"deliveryWithInstall"
:
true
,
"deliveryWithInstall"
:
true
,
"installationFree"
:
false
,
"installationFree"
:
false
,
...
...
ability/ability_runtime/aacommand/AACommandPrintOneTest/entry/src/main/ets/MainAbility/MainAbility.ts
浏览文件 @
47713768
...
@@ -44,7 +44,7 @@ export default class MainAbility extends Ability {
...
@@ -44,7 +44,7 @@ export default class MainAbility extends Ability {
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
cmd
=
'
aa test -b com.example.aacommandrelyhap -m entry_test -s class A
CTS_AACommand_01_3
#ACTS_AACo
'
+
cmd
=
'
aa test -b com.example.aacommandrelyhap -m entry_test -s class A
ACommandPrintOneTest
#ACTS_AACo
'
+
'
mmand_print_01_0100 -s unittest OpenHarmonyTestRunner
'
'
mmand_print_01_0100 -s unittest OpenHarmonyTestRunner
'
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
log
(
'
ACTS_AACommand_print_01_0100 - executeShellCommand: start
'
)
console
.
log
(
'
ACTS_AACommand_print_01_0100 - executeShellCommand: start
'
)
...
@@ -52,13 +52,12 @@ export default class MainAbility extends Ability {
...
@@ -52,13 +52,12 @@ export default class MainAbility extends Ability {
console
.
log
(
'
ACTS_AACommand_print_01_0100 stdResult =
'
+
data
.
stdResult
)
console
.
log
(
'
ACTS_AACommand_print_01_0100 stdResult =
'
+
data
.
stdResult
)
globalThis
.
stdResult3
=
data
.
stdResult
;
globalThis
.
stdResult3
=
data
.
stdResult
;
console
.
log
(
'
ACTS_AACommand_print_01_0100 - executeShellCommand: end
'
)
console
.
log
(
'
ACTS_AACommand_print_01_0100 - executeShellCommand: end
'
)
await
startAbilityTest
(
'
ACTS_AACommand_print_01_0100
'
,
this
.
context
);
await
startAbilityTest
(
'
ACTS_AACommand_print_01_0100
'
,
this
.
context
);
})
})
await
sleep
(
4
000
)
await
sleep
(
3
000
)
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap -s class A
CTS_AACommand_01_3
#ACTS_AAComm
'
+
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap -s class A
ACommandPrintOneTest
#ACTS_AAComm
'
+
'
and_print_01_0200 -s unittest OpenHarmonyTestRunner
'
'
and_print_01_0200 -s unittest OpenHarmonyTestRunner
'
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
log
(
'
ACTS_AACommand_print_01_0200 - executeShellCommand: start
'
)
console
.
log
(
'
ACTS_AACommand_print_01_0200 - executeShellCommand: start
'
)
...
@@ -66,13 +65,12 @@ export default class MainAbility extends Ability {
...
@@ -66,13 +65,12 @@ export default class MainAbility extends Ability {
console
.
log
(
'
ACTS_AACommand_print_01_0200 stdResult =
'
+
data
.
stdResult
)
console
.
log
(
'
ACTS_AACommand_print_01_0200 stdResult =
'
+
data
.
stdResult
)
globalThis
.
stdResult4
=
data
.
stdResult
;
globalThis
.
stdResult4
=
data
.
stdResult
;
console
.
log
(
'
ACTS_AACommand_print_01_0200 - executeShellCommand: end
'
)
console
.
log
(
'
ACTS_AACommand_print_01_0200 - executeShellCommand: end
'
)
await
startAbilityTest
(
'
ACTS_AACommand_print_01_0200
'
,
this
.
context
);
await
startAbilityTest
(
'
ACTS_AACommand_print_01_0200
'
,
this
.
context
);
})
})
await
sleep
(
4
000
)
await
sleep
(
3
000
)
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap -s class A
CTS_AACommand_01_3
#ACTS_
'
+
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap -s class A
ACommandPrintOneTest
#ACTS_
'
+
'
AACommand_print_01_0300 -s unittest OpenHarmonyTestRunner
'
'
AACommand_print_01_0300 -s unittest OpenHarmonyTestRunner
'
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
log
(
'
ACTS_AACommand_print_01_0300 - executeShellCommand: start
'
)
console
.
log
(
'
ACTS_AACommand_print_01_0300 - executeShellCommand: start
'
)
...
@@ -80,13 +78,12 @@ export default class MainAbility extends Ability {
...
@@ -80,13 +78,12 @@ export default class MainAbility extends Ability {
console
.
log
(
'
ACTS_AACommand_print_01_0300 stdResult =
'
+
data
.
stdResult
)
console
.
log
(
'
ACTS_AACommand_print_01_0300 stdResult =
'
+
data
.
stdResult
)
globalThis
.
stdResult5
=
data
.
stdResult
;
globalThis
.
stdResult5
=
data
.
stdResult
;
console
.
log
(
'
ACTS_AACommand_print_01_0300 - executeShellCommand: end
'
)
console
.
log
(
'
ACTS_AACommand_print_01_0300 - executeShellCommand: end
'
)
await
startAbilityTest
(
'
ACTS_AACommand_print_01_0300
'
,
this
.
context
);
await
startAbilityTest
(
'
ACTS_AACommand_print_01_0300
'
,
this
.
context
);
})
})
await
sleep
(
4
000
)
await
sleep
(
3
000
)
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap -s class A
CTS_AACommand_01_3
#ACTS_AAComma
'
+
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap -s class A
ACommandPrintOneTest
#ACTS_AAComma
'
+
'
nd_print_01_0400 -s unittest OpenHarmonyTestRunner
'
'
nd_print_01_0400 -s unittest OpenHarmonyTestRunner
'
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
log
(
'
ACTS_AACommand_print_01_0400 - executeShellCommand: start
'
)
console
.
log
(
'
ACTS_AACommand_print_01_0400 - executeShellCommand: start
'
)
...
@@ -94,13 +91,12 @@ export default class MainAbility extends Ability {
...
@@ -94,13 +91,12 @@ export default class MainAbility extends Ability {
console
.
log
(
'
ACTS_AACommand_print_01_0400 stdResult =
'
+
data
.
stdResult
)
console
.
log
(
'
ACTS_AACommand_print_01_0400 stdResult =
'
+
data
.
stdResult
)
globalThis
.
stdResult6
=
data
.
stdResult
;
globalThis
.
stdResult6
=
data
.
stdResult
;
console
.
log
(
'
ACTS_AACommand_print_01_0400 - executeShellCommand: end
'
)
console
.
log
(
'
ACTS_AACommand_print_01_0400 - executeShellCommand: end
'
)
await
startAbilityTest
(
'
ACTS_AACommand_print_01_0400
'
,
this
.
context
);
await
startAbilityTest
(
'
ACTS_AACommand_print_01_0400
'
,
this
.
context
);
})
})
await
sleep
(
4
000
)
await
sleep
(
3
000
)
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap -s class A
CTS_AACommand_01_3
#ACTS_AAComm
'
+
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap -s class A
ACommandPrintOneTest
#ACTS_AAComm
'
+
'
and_print_01_0500 -s unittest OpenHarmonyTestRunner
'
'
and_print_01_0500 -s unittest OpenHarmonyTestRunner
'
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
log
(
'
ACTS_AACommand_print_01_0500 - executeShellCommand: start
'
)
console
.
log
(
'
ACTS_AACommand_print_01_0500 - executeShellCommand: start
'
)
...
@@ -108,13 +104,12 @@ export default class MainAbility extends Ability {
...
@@ -108,13 +104,12 @@ export default class MainAbility extends Ability {
console
.
log
(
'
ACTS_AACommand_print_01_0500 stdResult =
'
+
data
.
stdResult
)
console
.
log
(
'
ACTS_AACommand_print_01_0500 stdResult =
'
+
data
.
stdResult
)
globalThis
.
stdResult7
=
data
.
stdResult
;
globalThis
.
stdResult7
=
data
.
stdResult
;
console
.
log
(
'
ACTS_AACommand_print_01_0500 - executeShellCommand: end
'
)
console
.
log
(
'
ACTS_AACommand_print_01_0500 - executeShellCommand: end
'
)
await
startAbilityTest
(
'
ACTS_AACommand_print_01_0500
'
,
this
.
context
);
await
startAbilityTest
(
'
ACTS_AACommand_print_01_0500
'
,
this
.
context
);
})
})
await
sleep
(
4
000
)
await
sleep
(
3
000
)
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap -s class A
CTS_AACommand_01_3
#ACTS_AA
'
+
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap -s class A
ACommandPrintOneTest
#ACTS_AA
'
+
'
Command_print_01_0600 -s unittest OpenHarmonyTestRunner
'
'
Command_print_01_0600 -s unittest OpenHarmonyTestRunner
'
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
log
(
'
ACTS_AACommand_print_01_0600 - executeShellCommand: start
'
)
console
.
log
(
'
ACTS_AACommand_print_01_0600 - executeShellCommand: start
'
)
...
@@ -122,42 +117,38 @@ export default class MainAbility extends Ability {
...
@@ -122,42 +117,38 @@ export default class MainAbility extends Ability {
console
.
log
(
'
ACTS_AACommand_print_01_0600 stdResult =
'
+
data
.
stdResult
)
console
.
log
(
'
ACTS_AACommand_print_01_0600 stdResult =
'
+
data
.
stdResult
)
globalThis
.
stdResult8
=
data
.
stdResult
;
globalThis
.
stdResult8
=
data
.
stdResult
;
console
.
log
(
'
ACTS_AACommand_print_01_0600 - executeShellCommand: end
'
)
console
.
log
(
'
ACTS_AACommand_print_01_0600 - executeShellCommand: end
'
)
await
startAbilityTest
(
'
ACTS_AACommand_print_01_0600
'
,
this
.
context
);
await
startAbilityTest
(
'
ACTS_AACommand_print_01_0600
'
,
this
.
context
);
})
})
await
sleep
(
4
000
)
await
sleep
(
3
000
)
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap -s class
'
+
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap -s class
'
+
'
A
CTS_AACommand_01_3
#ACTS_AACommand_print_01_0700 -s unittest OpenHarmonyTestRunner
'
'
A
ACommandPrintOneTest
#ACTS_AACommand_print_01_0700 -s unittest OpenHarmonyTestRunner
'
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
log
(
'
ACTS_AACommand_print_01_0700 - executeShellCommand: start
'
)
console
.
log
(
'
ACTS_AACommand_print_01_0700 - executeShellCommand: start
'
)
console
.
log
(
'
ACTS_AACommand_print_01_0700 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_print_01_0700 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_print_01_0700 stdResult =
'
+
data
.
stdResult
)
console
.
log
(
'
ACTS_AACommand_print_01_0700 stdResult =
'
+
data
.
stdResult
)
globalThis
.
stdResult9
=
data
.
stdResult
;
globalThis
.
stdResult9
=
data
.
stdResult
;
console
.
log
(
'
ACTS_AACommand_print_01_0700 - executeShellCommand: end
'
)
console
.
log
(
'
ACTS_AACommand_print_01_0700 - executeShellCommand: end
'
)
await
startAbilityTest
(
'
ACTS_AACommand_print_01_0700
'
,
this
.
context
);
await
startAbilityTest
(
'
ACTS_AACommand_print_01_0700
'
,
this
.
context
);
})
})
await
sleep
(
4
000
)
await
sleep
(
3
000
)
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap -s
'
+
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap -s
'
+
'
class A
CTS_AACommand_01_3
#ACTS_AACommand_print_01_0800 -s unittest OpenHarmonyTestRunner
'
'
class A
ACommandPrintOneTest
#ACTS_AACommand_print_01_0800 -s unittest OpenHarmonyTestRunner
'
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
log
(
'
ACTS_AACommand_print_01_0800 - executeShellCommand: start
'
)
console
.
log
(
'
ACTS_AACommand_print_01_0800 - executeShellCommand: start
'
)
console
.
log
(
'
ACTS_AACommand_print_01_0800 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_print_01_0800 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_print_01_0800 stdResult =
'
+
data
.
stdResult
)
console
.
log
(
'
ACTS_AACommand_print_01_0800 stdResult =
'
+
data
.
stdResult
)
globalThis
.
stdResult10
=
data
.
stdResult
;
globalThis
.
stdResult10
=
data
.
stdResult
;
console
.
log
(
'
ACTS_AACommand_print_01_0800 - executeShellCommand: end
'
)
console
.
log
(
'
ACTS_AACommand_print_01_0800 - executeShellCommand: end
'
)
await
startAbilityTest
(
'
ACTS_AACommand_print_01_0800
'
,
this
.
context
);
await
startAbilityTest
(
'
ACTS_AACommand_print_01_0800
'
,
this
.
context
);
})
})
setTimeout
(()
=>
{
setTimeout
(()
=>
{
Hypium
.
hypiumTest
(
abilityDelegator
,
abilityDelegatorArguments
,
testsuite
)
Hypium
.
hypiumTest
(
abilityDelegator
,
abilityDelegatorArguments
,
testsuite
)
},
6000
)
},
5000
)
}
}
onDestroy
()
{
onDestroy
()
{
...
...
ability/ability_runtime/aacommand/AACommandPrintOneTest/entry/src/main/module.json
浏览文件 @
47713768
...
@@ -33,6 +33,12 @@
...
@@ -33,6 +33,12 @@
}
}
]
]
}
}
],
"requestPermissions"
:
[
{
"name"
:
"ohos.permission.START_ABILITIES_FROM_BACKGROUND"
,
"reason"
:
"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
}
]
]
}
}
}
}
\ No newline at end of file
ability/ability_runtime/aacommand/AACommandPrintSync/entry/src/main/ets/test/A
bility
.test.ets
→
ability/ability_runtime/aacommand/AACommandPrintSync/entry/src/main/ets/test/A
ACommandPrint
.test.ets
浏览文件 @
47713768
...
@@ -13,13 +13,10 @@
...
@@ -13,13 +13,10 @@
* limitations under the License.
* limitations under the License.
*/
*/
import { describe,
beforeAll, beforeEach, afterEach, afterAll, it, expec
t } from '@ohos/hypium'
import { describe,
i
t } from '@ohos/hypium'
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
export default function abilityTest() {
export default function abilityTest() {
describe('A
CTS_AACommand_01_3
', function () {
describe('A
ACommandPrintTest
', function () {
/**
/**
* @tc.number: ACTS_AACommand_printSync_01_0100
* @tc.number: ACTS_AACommand_printSync_01_0100
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid,
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid,
...
@@ -27,7 +24,8 @@ export default function abilityTest() {
...
@@ -27,7 +24,8 @@ export default function abilityTest() {
* @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through
* @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through
* the test command.
* the test command.
*/
*/
it('ACTS_AACommand_printSync_01_0100', 0, async function (done) {
it('ACTS_AACommand_printSync_01_0100', 0, async function (done) {
done()
console.log("ACTS_AACommand_printSync_01_0100 start ====> " )
console.log("ACTS_AACommand_printSync_01_0100 start ====> " )
var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
globalThis.abilityDelegator.printSync(msg);
globalThis.abilityDelegator.printSync(msg);
...
@@ -37,7 +35,6 @@ export default function abilityTest() {
...
@@ -37,7 +35,6 @@ export default function abilityTest() {
console.log("ACTS_AACommand_printSync_01_0100 finishTest test end ========> callback " )
console.log("ACTS_AACommand_printSync_01_0100 finishTest test end ========> callback " )
console.log("ACTS_AACommand_printSync_01_0100 finishTest test end " +
console.log("ACTS_AACommand_printSync_01_0100 finishTest test end " +
"========> callback data: "+JSON.stringify(data))
"========> callback data: "+JSON.stringify(data))
done()
})
})
})
})
...
@@ -49,6 +46,7 @@ export default function abilityTest() {
...
@@ -49,6 +46,7 @@ export default function abilityTest() {
* the test command.
* the test command.
*/
*/
it('ACTS_AACommand_printSync_01_0200', 0, async function (done) {
it('ACTS_AACommand_printSync_01_0200', 0, async function (done) {
done()
var msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
var msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'aaaaaaaaaa' +
'aaaaaaaaaa' +
'1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
...
@@ -65,7 +63,6 @@ export default function abilityTest() {
...
@@ -65,7 +63,6 @@ export default function abilityTest() {
var finishmsg = 'ACTS_AACommand_printSync_01_0200 end'
var finishmsg = 'ACTS_AACommand_printSync_01_0200 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{
globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{
console.log("ACTS_AACommand_printSync_01_0200 print test end ========> callback " )
console.log("ACTS_AACommand_printSync_01_0200 print test end ========> callback " )
done()
})
})
})
})
...
@@ -77,6 +74,7 @@ export default function abilityTest() {
...
@@ -77,6 +74,7 @@ export default function abilityTest() {
* the test command.
* the test command.
*/
*/
it('ACTS_AACommand_printSync_01_0300', 0, async function (done) {
it('ACTS_AACommand_printSync_01_0300', 0, async function (done) {
done()
var msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
var msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'aaaaaaaaaa' +
'aaaaaaaaaa' +
'1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
...
@@ -94,7 +92,6 @@ export default function abilityTest() {
...
@@ -94,7 +92,6 @@ export default function abilityTest() {
var finishmsg = 'ACTS_AACommand_printSync_01_0300 end'
var finishmsg = 'ACTS_AACommand_printSync_01_0300 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{
globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{
console.log("ACTS_AACommand_printSync_01_0300 print test end ========> callback " )
console.log("ACTS_AACommand_printSync_01_0300 print test end ========> callback " )
done()
})
})
})
})
...
@@ -106,12 +103,12 @@ export default function abilityTest() {
...
@@ -106,12 +103,12 @@ export default function abilityTest() {
* the test command.
* the test command.
*/
*/
it('ACTS_AACommand_printSync_01_0400', 0, async function (done) {
it('ACTS_AACommand_printSync_01_0400', 0, async function (done) {
done()
globalThis.abilityDelegator.printSync(null);
globalThis.abilityDelegator.printSync(null);
console.log("ACTS_AACommand_printSync_01_0300 printSync end ====> " )
console.log("ACTS_AACommand_printSync_01_0300 printSync end ====> " )
var finishmsg = 'ACTS_AACommand_printSync_01_0400 end'
var finishmsg = 'ACTS_AACommand_printSync_01_0400 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{
globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{
console.log("ACTS_AACommand_printSync_01_0400 print test end ========> callback " )
console.log("ACTS_AACommand_printSync_01_0400 print test end ========> callback " )
done()
})
})
})
})
})
})
...
...
ability/ability_runtime/aacommand/AACommandPrintSync/entry/src/main/ets/test/List.test.ets
浏览文件 @
47713768
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
import abilityTest from './A
bility
.test'
import abilityTest from './A
ACommandPrint
.test'
export default function testsuite() {
export default function testsuite() {
abilityTest()
abilityTest()
...
...
ability/ability_runtime/aacommand/AACommandPrintSyncTest/entry/src/main/ets/MainAbility/MainAbility.ts
浏览文件 @
47713768
...
@@ -45,59 +45,54 @@ export default class MainAbility extends Ability {
...
@@ -45,59 +45,54 @@ export default class MainAbility extends Ability {
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
cmd
=
'
aa test -b com.example.aacommandprintsync -m entry_test -s class
'
+
cmd
=
'
aa test -b com.example.aacommandprintsync -m entry_test -s class
'
+
'
A
CTS_AACommand_01_3
#ACTS_AACommand_printSync_01_0100 -s unittest OpenHarmonyTestRunner
'
'
A
ACommandPrintTest
#ACTS_AACommand_printSync_01_0100 -s unittest OpenHarmonyTestRunner
'
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
log
(
'
ACTS_AACommand_printSync_01_0100 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_printSync_01_0100 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_printSync_01_0100 stdResult =
'
+
data
.
stdResult
)
console
.
log
(
'
ACTS_AACommand_printSync_01_0100 stdResult =
'
+
data
.
stdResult
)
globalThis
.
stdResult1
=
data
.
stdResult
;
globalThis
.
stdResult1
=
data
.
stdResult
;
console
.
log
(
'
ACTS_AACommand_printSync_01_0100 - executeShellCommand: end
'
)
console
.
log
(
'
ACTS_AACommand_printSync_01_0100 - executeShellCommand: end
'
)
await
startAbilityTest
(
'
ACTS_AACommand_printSync_01_0100
'
,
this
.
context
);
await
startAbilityTest
(
'
ACTS_AACommand_printSync_01_0100
'
,
this
.
context
);
})
})
await
sleep
(
3000
)
await
sleep
(
3000
)
cmd
=
'
aa test -m entry_test -b com.example.aacommandprintsync -s class
'
+
cmd
=
'
aa test -m entry_test -b com.example.aacommandprintsync -s class
'
+
'
A
CTS_AACommand_01_3
#ACTS_AACommand_printSync_01_0200 -s unittest OpenHarmonyTestRunner
'
'
A
ACommandPrintTest
#ACTS_AACommand_printSync_01_0200 -s unittest OpenHarmonyTestRunner
'
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
log
(
'
ACTS_AACommand_printSync_01_0200 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_printSync_01_0200 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_printSync_01_0200 stdResult =
'
+
data
.
stdResult
)
console
.
log
(
'
ACTS_AACommand_printSync_01_0200 stdResult =
'
+
data
.
stdResult
)
globalThis
.
stdResult2
=
data
.
stdResult
;
globalThis
.
stdResult2
=
data
.
stdResult
;
console
.
log
(
'
ACTS_AACommand_printSync_01_0200 - executeShellCommand: end
'
)
console
.
log
(
'
ACTS_AACommand_printSync_01_0200 - executeShellCommand: end
'
)
await
startAbilityTest
(
'
ACTS_AACommand_printSync_01_0200
'
,
this
.
context
);
await
startAbilityTest
(
'
ACTS_AACommand_printSync_01_0200
'
,
this
.
context
);
})
})
await
sleep
(
3000
)
await
sleep
(
3000
)
cmd
=
'
aa test -m entry_test -b com.example.aacommandprintsync -s class
'
+
cmd
=
'
aa test -m entry_test -b com.example.aacommandprintsync -s class
'
+
'
A
CTS_AACommand_01_3
#ACTS_AACommand_printSync_01_0300 -s unittest OpenHarmonyTestRunner
'
'
A
ACommandPrintTest
#ACTS_AACommand_printSync_01_0300 -s unittest OpenHarmonyTestRunner
'
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
log
(
'
ACTS_AACommand_printSync_01_0300 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_printSync_01_0300 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_printSync_01_0300 stdResult =
'
+
data
.
stdResult
)
console
.
log
(
'
ACTS_AACommand_printSync_01_0300 stdResult =
'
+
data
.
stdResult
)
globalThis
.
stdResult3
=
data
.
stdResult
;
globalThis
.
stdResult3
=
data
.
stdResult
;
console
.
log
(
'
ACTS_AACommand_printSync_01_0300 - executeShellCommand: end
'
)
console
.
log
(
'
ACTS_AACommand_printSync_01_0300 - executeShellCommand: end
'
)
await
startAbilityTest
(
'
ACTS_AACommand_printSync_01_0300
'
,
this
.
context
);
await
startAbilityTest
(
'
ACTS_AACommand_printSync_01_0300
'
,
this
.
context
);
})
})
await
sleep
(
3000
)
await
sleep
(
3000
)
cmd
=
'
aa test -m entry_test -b com.example.aacommandprintsync -s class
'
+
cmd
=
'
aa test -m entry_test -b com.example.aacommandprintsync -s class
'
+
'
A
CTS_AACommand_01_3
#ACTS_AACommand_printSync_01_0400 -s unittest OpenHarmonyTestRunner
'
'
A
ACommandPrintTest
#ACTS_AACommand_printSync_01_0400 -s unittest OpenHarmonyTestRunner
'
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
log
(
'
ACTS_AACommand_printSync_01_0400 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_printSync_01_0400 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_printSync_01_0400 stdResult =
'
+
data
.
stdResult
)
console
.
log
(
'
ACTS_AACommand_printSync_01_0400 stdResult =
'
+
data
.
stdResult
)
globalThis
.
stdResult4
=
data
.
stdResult
;
globalThis
.
stdResult4
=
data
.
stdResult
;
console
.
log
(
'
ACTS_AACommand_printSync_01_0400 - executeShellCommand: end
'
)
console
.
log
(
'
ACTS_AACommand_printSync_01_0400 - executeShellCommand: end
'
)
await
startAbilityTest
(
'
ACTS_AACommand_printSync_01_0400
'
,
this
.
context
);
await
startAbilityTest
(
'
ACTS_AACommand_printSync_01_0400
'
,
this
.
context
);
})
})
setTimeout
(()
=>
{
setTimeout
(()
=>
{
Hypium
.
hypiumTest
(
abilityDelegator
,
abilityDelegatorArguments
,
testsuite
)
Hypium
.
hypiumTest
(
abilityDelegator
,
abilityDelegatorArguments
,
testsuite
)
},
6000
)
},
5000
)
}
}
onDestroy
()
{
onDestroy
()
{
...
...
ability/ability_runtime/aacommand/AACommandPrintSyncTest/entry/src/main/module.json
浏览文件 @
47713768
...
@@ -33,6 +33,12 @@
...
@@ -33,6 +33,12 @@
}
}
]
]
}
}
],
"requestPermissions"
:
[
{
"name"
:
"ohos.permission.START_ABILITIES_FROM_BACKGROUND"
,
"reason"
:
"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
}
]
]
}
}
}
}
\ No newline at end of file
ability/ability_runtime/aacommand/AACommandRelyHap/entry/src/main/ets/test/A
bility
.test.ets
→
ability/ability_runtime/aacommand/AACommandRelyHap/entry/src/main/ets/test/A
ACommand
.test.ets
浏览文件 @
47713768
此差异已折叠。
点击以展开。
ability/ability_runtime/aacommand/AACommandRelyHap/entry/src/main/ets/test/AACommandPrintOne.test.ets
0 → 100644
浏览文件 @
47713768
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, it } from '@ohos/hypium'
export default function abilityTest() {
describe('AACommandPrintOneTest', function () {
/**
* @tc.number: ACTS_AACommand_print_01_0100
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is
* called in AsyncCallback mode. The print information includes Chinese, special characters, etc.
* @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through
* the test command.
*/
it('ACTS_AACommand_print_01_0100', 0, async function (done) {
console.log("ACTS_AACommand_print_01_0100 start ====> " )
done()
var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
globalThis.abilityDelegator.print(msg,(err,data)=>{
console.log("ACTS_AACommand_print_01_0100 print test end ========> callback " )
console.log("ACTS_AACommand_print_01_0100 print test end ========> callback err: "+JSON.stringify(err) )
console.log("ACTS_AACommand_print_01_0100 print test end ========> callback data: "+JSON.stringify(data))
})
var finishmsg = 'ACTS_AACommand_print_01_0100 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then((data)=>{
console.log("ACTS_AACommand_print_01_0100 finishTest test end ========> callback " )
console.log("ACTS_AACommand_print_01_0100 finishTest test end ========> callback data: "+JSON.stringify(data))
})
})
/**
* @tc.number: ACTS_AACommand_print_01_0200
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is
* called in AsyncCallback mode. The length of the print message is 1000 characters.
* @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through
* the test command.
*/
it('ACTS_AACommand_print_01_0200', 0, async function (done) {
done()
var msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'aaaaaaaaaa' +
'1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'3aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'4aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'5aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'6aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae'
globalThis.abilityDelegator.print(msg,()=>{
console.log("print test end ========> callback " )
})
var finishmsg = 'ACTS_AACommand_print_01_0200 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{
console.log("ACTS_AACommand_print_01_0200 print test end ========> callback " )
})
})
/**
* @tc.number: ACTS_AACommand_print_01_0300
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is
* called in AsyncCallback mode. The length of the print message is greater than 1000 characters.
* @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through
* the test command.
*/
it('ACTS_AACommand_print_01_0300', 0, async function (done) {
done()
var msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'3aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'4aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'5aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'6aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae' +
'fffffffffff'
globalThis.abilityDelegator.print(msg,()=>{
console.log("print test end ========> callback " )
})
var finishmsg = 'ACTS_AACommand_print_01_0300 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{
console.log("ACTS_AACommand_print_01_0300 print test end ========> callback " )
})
})
/**
* @tc.number: ACTS_AACommand_print_01_0400
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is
* called in AsyncCallback mode. print information is null.
* @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through
* the test command.
*/
it('ACTS_AACommand_print_01_0400', 0, async function (done) {
done()
globalThis.abilityDelegator.print(null,()=>{
console.log("print test end ========> callback " )
})
var finishmsg = 'ACTS_AACommand_print_01_0400 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{
console.log("ACTS_AACommand_print_01_0400 print test end ========> callback " )
})
})
/**
* @tc.number: ACTS_AACommand_print_01_0500
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is
* called in Promise mode. The print information includes Chinese, special characters, etc.
* @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through
* the test command.
*/
it('ACTS_AACommand_print_01_0500', 0, async function (done) {
done()
var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
globalThis.abilityDelegator.print(msg).then(()=>{
console.log("ACTS_AACommand_print_01_0500 print test end ========> callback " )
})
var finishmsg = 'ACTS_AACommand_print_01_0500 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{
console.log("ACTS_AACommand_print_01_0500 print test end ========> callback " )
})
})
/**
* @tc.number: ACTS_AACommand_print_01_0600
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is
* called in Promise mode. The length of the print message is 1000 characters.
* @tc.desc: Verify that the test framework can be started normally and the logs can be output normally
* through the test command.
*/
it('ACTS_AACommand_print_01_0600', 0, async function (done) {
done()
var msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'3aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'4aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'5aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'6aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae'
globalThis.abilityDelegator.print(msg).then(()=>{
console.log("ACTS_AACommand_print_01_0600 print test end ========> callback " )
})
var finishmsg = 'ACTS_AACommand_print_01_0600 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{
console.log("ACTS_AACommand_print_01_0600 2 print test end ========> callback " )
})
})
/**
* @tc.number: ACTS_AACommand_print_01_0700
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is
* called in Promise mode. The length of the print message is greater than 1000 characters.
* @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through
* the test command.
*/
it('ACTS_AACommand_print_01_0700', 0, async function (done) {
done()
var msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'3aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'4aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'5aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'6aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae' +
'fffffffffff'
globalThis.abilityDelegator.print(msg).then(()=>{
console.log("ACTS_AACommand_print_01_0700 print test end ========> callback " )
})
var finishmsg = 'ACTS_AACommand_print_01_0700 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{
console.log("ACTS_AACommand_print_01_0700 2 print test end ========> callback " )
})
})
/**
* @tc.number: ACTS_AACommand_print_01_0800
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is
* called in Promise mode. print information is null.
* @tc.desc: Verify that the test framework can be started normally and the logs can be output normally
* through the test command.
*/
it('ACTS_AACommand_print_01_0800', 0, async function (done) {
done()
globalThis.abilityDelegator.print("").then(()=>{
console.log("ACTS_AACommand_print_01_0800 print test end ========> callback " )
})
var finishmsg = 'ACTS_AACommand_print_01_0800 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{
console.log("ACTS_AACommand_print_01_0800 2 print test end ========> callback " )
})
})
})
};
ability/ability_runtime/aacommand/AACommandRelyHap/entry/src/main/ets/test/List.test.ets
浏览文件 @
47713768
...
@@ -13,8 +13,10 @@
...
@@ -13,8 +13,10 @@
* limitations under the License.
* limitations under the License.
*/
*/
import abilityTest from './Ability.test'
import aaCommandTest from './AACommand.test'
import aaCommandPrintOneTest from './AACommandPrintOne.test'
export default function testsuite() {
export default function testsuite() {
abilityTest()
aaCommandTest()
aaCommandPrintOneTest()
}
}
\ No newline at end of file
ability/ability_runtime/aacommand/AACommandpackage/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
47713768
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
import { describe,
beforeAll, beforeEach, afterEach, afterAll,
it, expect } from '@ohos/hypium'
import { describe, it, expect } from '@ohos/hypium'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
export default function abilityTest() {
export default function abilityTest() {
describe('ACTS_AACommand_01_3', function () {
describe('ACTS_AACommand_01_3', function () {
...
...
ability/ability_runtime/aacommand/AACommandtest/entry/src/main/ets/MainAbility/MainAbility.ts
浏览文件 @
47713768
...
@@ -46,20 +46,19 @@ export default class MainAbility extends Ability {
...
@@ -46,20 +46,19 @@ export default class MainAbility extends Ability {
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap -s
'
+
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap -s
'
+
'
class A
CTS_AACommand_01_3
#ACTS_AACommand_finish_01_0700 -s unittest OpenHarmonyTestRunner
'
'
class A
ACommandTest
#ACTS_AACommand_finish_01_0700 -s unittest OpenHarmonyTestRunner
'
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
log
(
'
ACTS_AACommand_finish_01_0700 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_finish_01_0700 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_finish_01_0700 stdResult =
'
+
data
.
stdResult
)
console
.
log
(
'
ACTS_AACommand_finish_01_0700 stdResult =
'
+
data
.
stdResult
)
globalThis
.
stdResult1
=
data
.
stdResult
;
globalThis
.
stdResult1
=
data
.
stdResult
;
console
.
log
(
'
ACTS_AACommand_finish_01_0700 - executeShellCommand: end
'
)
console
.
log
(
'
ACTS_AACommand_finish_01_0700 - executeShellCommand: end
'
)
await
startAbilityTest
(
'
ACTS_AACommand_finish_01_0700
'
,
this
.
context
);
await
startAbilityTest
(
'
ACTS_AACommand_finish_01_0700
'
,
this
.
context
);
})
})
await
sleep
(
4000
)
await
sleep
(
4000
)
cmd
=
'
aa dump -a
'
cmd
=
'
aa dump -a
'
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
info
(
'
ACTS_AACommand_finish_01_0700 : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
ACTS_AACommand_finish_01_0700 : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
ACTS_AACommand_finish_01_0700 : data :
'
+
JSON
.
stringify
(
data
));
console
.
info
(
'
ACTS_AACommand_finish_01_0700 : data :
'
+
JSON
.
stringify
(
data
));
globalThis
.
stdResult2
=
data
[
"
stdResult
"
];
globalThis
.
stdResult2
=
data
[
"
stdResult
"
];
...
@@ -69,21 +68,20 @@ export default class MainAbility extends Ability {
...
@@ -69,21 +68,20 @@ export default class MainAbility extends Ability {
await
sleep
(
2000
)
await
sleep
(
2000
)
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap -s class
'
+
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap -s class
'
+
'
A
CTS_AACommand_01_3
#ACTS_AACommand_finish_01_0400 -s unittest OpenHarmonyTestRunner
'
'
A
ACommandTest
#ACTS_AACommand_finish_01_0400 -s unittest OpenHarmonyTestRunner
'
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
log
(
'
ACTS_AACommand_finish_01_0400 - executeShellCommand: start
'
)
console
.
log
(
'
ACTS_AACommand_finish_01_0400 - executeShellCommand: start
'
)
console
.
log
(
'
ACTS_AACommand_finish_01_0400 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_finish_01_0400 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_finish_01_0400 stdResult =
'
+
data
.
stdResult
)
console
.
log
(
'
ACTS_AACommand_finish_01_0400 stdResult =
'
+
data
.
stdResult
)
globalThis
.
stdResult11
=
data
.
stdResult
;
globalThis
.
stdResult11
=
data
.
stdResult
;
console
.
log
(
'
ACTS_AACommand_finish_01_0400 - executeShellCommand: end
'
)
console
.
log
(
'
ACTS_AACommand_finish_01_0400 - executeShellCommand: end
'
)
await
startAbilityTest
(
'
ACTS_AACommand_finish_01_0400
'
,
this
.
context
);
await
startAbilityTest
(
'
ACTS_AACommand_finish_01_0400
'
,
this
.
context
);
})
})
await
sleep
(
4000
)
await
sleep
(
4000
)
cmd
=
'
aa dump -a
'
cmd
=
'
aa dump -a
'
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
info
(
'
ACTS_AACommand_finish_01_0700 : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
ACTS_AACommand_finish_01_0700 : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
ACTS_AACommand_finish_01_0700 : data :
'
+
JSON
.
stringify
(
data
));
console
.
info
(
'
ACTS_AACommand_finish_01_0700 : data :
'
+
JSON
.
stringify
(
data
));
globalThis
.
stdResult12
=
data
[
"
stdResult
"
];
globalThis
.
stdResult12
=
data
[
"
stdResult
"
];
...
@@ -93,21 +91,20 @@ export default class MainAbility extends Ability {
...
@@ -93,21 +91,20 @@ export default class MainAbility extends Ability {
await
sleep
(
2000
)
await
sleep
(
2000
)
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap -s
'
+
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap -s
'
+
'
class A
CTS_AACommand_01_3
#ACTS_AACommand_finish_01_0100 -s unittest OpenHarmonyTestRunner
'
'
class A
ACommandTest
#ACTS_AACommand_finish_01_0100 -s unittest OpenHarmonyTestRunner
'
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
log
(
'
ACTS_AACommand_finish_01_0100 - executeShellCommand: start
'
)
console
.
log
(
'
ACTS_AACommand_finish_01_0100 - executeShellCommand: start
'
)
console
.
log
(
'
ACTS_AACommand_finish_01_0100 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_finish_01_0100 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_finish_01_0100 stdResult =
'
+
data
.
stdResult
)
console
.
log
(
'
ACTS_AACommand_finish_01_0100 stdResult =
'
+
data
.
stdResult
)
globalThis
.
stdResult13
=
data
.
stdResult
;
globalThis
.
stdResult13
=
data
.
stdResult
;
console
.
log
(
'
ACTS_AACommand_finish_01_0100 - executeShellCommand: end
'
)
console
.
log
(
'
ACTS_AACommand_finish_01_0100 - executeShellCommand: end
'
)
await
startAbilityTest
(
'
ACTS_AACommand_finish_01_0100
'
,
this
.
context
);
await
startAbilityTest
(
'
ACTS_AACommand_finish_01_0100
'
,
this
.
context
);
})
})
await
sleep
(
4000
)
await
sleep
(
4000
)
cmd
=
'
aa dump -a
'
cmd
=
'
aa dump -a
'
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
info
(
'
ACTS_AACommand_finish_01_0700 : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
ACTS_AACommand_finish_01_0700 : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
ACTS_AACommand_finish_01_0700 : data :
'
+
JSON
.
stringify
(
data
));
console
.
info
(
'
ACTS_AACommand_finish_01_0700 : data :
'
+
JSON
.
stringify
(
data
));
globalThis
.
stdResult14
=
data
[
"
stdResult
"
];
globalThis
.
stdResult14
=
data
[
"
stdResult
"
];
...
@@ -117,21 +114,20 @@ export default class MainAbility extends Ability {
...
@@ -117,21 +114,20 @@ export default class MainAbility extends Ability {
await
sleep
(
2000
)
await
sleep
(
2000
)
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap -s class
'
+
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap -s class
'
+
'
A
CTS_AACommand_01_3
#ACTS_AACommand_finish_01_0500 -s unittest OpenHarmonyTestRunner
'
'
A
ACommandTest
#ACTS_AACommand_finish_01_0500 -s unittest OpenHarmonyTestRunner
'
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
log
(
'
ACTS_AACommand_finish_01_0500 - executeShellCommand: start
'
)
console
.
log
(
'
ACTS_AACommand_finish_01_0500 - executeShellCommand: start
'
)
console
.
log
(
'
ACTS_AACommand_finish_01_0500 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_finish_01_0500 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_finish_01_0500 stdResult =
'
+
data
.
stdResult
)
console
.
log
(
'
ACTS_AACommand_finish_01_0500 stdResult =
'
+
data
.
stdResult
)
globalThis
.
stdResult15
=
data
.
stdResult
;
globalThis
.
stdResult15
=
data
.
stdResult
;
console
.
log
(
'
ACTS_AACommand_finish_01_0500 - executeShellCommand: end
'
)
console
.
log
(
'
ACTS_AACommand_finish_01_0500 - executeShellCommand: end
'
)
await
startAbilityTest
(
'
ACTS_AACommand_finish_01_0500
'
,
this
.
context
);
await
startAbilityTest
(
'
ACTS_AACommand_finish_01_0500
'
,
this
.
context
);
})
})
await
sleep
(
4000
)
await
sleep
(
4000
)
cmd
=
'
aa dump -a
'
cmd
=
'
aa dump -a
'
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
info
(
'
ACTS_AACommand_finish_01_0500 : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
ACTS_AACommand_finish_01_0500 : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
ACTS_AACommand_finish_01_0500 : data :
'
+
JSON
.
stringify
(
data
));
console
.
info
(
'
ACTS_AACommand_finish_01_0500 : data :
'
+
JSON
.
stringify
(
data
));
globalThis
.
stdResult16
=
data
[
"
stdResult
"
];
globalThis
.
stdResult16
=
data
[
"
stdResult
"
];
...
@@ -141,21 +137,20 @@ export default class MainAbility extends Ability {
...
@@ -141,21 +137,20 @@ export default class MainAbility extends Ability {
await
sleep
(
2000
)
await
sleep
(
2000
)
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap -s
'
+
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap -s
'
+
'
class A
CTS_AACommand_01_3
#ACTS_AACommand_finish_01_0600 -s unittest OpenHarmonyTestRunner
'
'
class A
ACommandTest
#ACTS_AACommand_finish_01_0600 -s unittest OpenHarmonyTestRunner
'
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
log
(
'
ACTS_AACommand_finish_01_0600 - executeShellCommand: start
'
)
console
.
log
(
'
ACTS_AACommand_finish_01_0600 - executeShellCommand: start
'
)
console
.
log
(
'
ACTS_AACommand_finish_01_0600 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_finish_01_0600 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_finish_01_0600 stdResult =
'
+
data
.
stdResult
)
console
.
log
(
'
ACTS_AACommand_finish_01_0600 stdResult =
'
+
data
.
stdResult
)
globalThis
.
stdResult17
=
data
.
stdResult
;
globalThis
.
stdResult17
=
data
.
stdResult
;
console
.
log
(
'
ACTS_AACommand_finish_01_0600 - executeShellCommand: end
'
)
console
.
log
(
'
ACTS_AACommand_finish_01_0600 - executeShellCommand: end
'
)
await
startAbilityTest
(
'
ACTS_AACommand_finish_01_0600
'
,
this
.
context
);
await
startAbilityTest
(
'
ACTS_AACommand_finish_01_0600
'
,
this
.
context
);
})
})
await
sleep
(
4000
)
await
sleep
(
4000
)
cmd
=
'
aa dump -a
'
cmd
=
'
aa dump -a
'
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
info
(
'
ACTS_AACommand_finish_01_0600 : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
ACTS_AACommand_finish_01_0600 : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
ACTS_AACommand_finish_01_0600 : data :
'
+
JSON
.
stringify
(
data
));
console
.
info
(
'
ACTS_AACommand_finish_01_0600 : data :
'
+
JSON
.
stringify
(
data
));
globalThis
.
stdResult18
=
data
[
"
stdResult
"
];
globalThis
.
stdResult18
=
data
[
"
stdResult
"
];
...
@@ -165,21 +160,20 @@ export default class MainAbility extends Ability {
...
@@ -165,21 +160,20 @@ export default class MainAbility extends Ability {
await
sleep
(
2000
)
await
sleep
(
2000
)
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap -s
'
+
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap -s
'
+
'
class A
CTS_AACommand_01_3
#ACTS_AACommand_finish_01_0900 -s unittest OpenHarmonyTestRunner
'
'
class A
ACommandTest
#ACTS_AACommand_finish_01_0900 -s unittest OpenHarmonyTestRunner
'
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
log
(
'
ACTS_AACommand_finish_01_0900 - executeShellCommand: start
'
)
console
.
log
(
'
ACTS_AACommand_finish_01_0900 - executeShellCommand: start
'
)
console
.
log
(
'
ACTS_AACommand_finish_01_0900 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_finish_01_0900 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_finish_01_0900 stdResult =
'
+
data
.
stdResult
)
console
.
log
(
'
ACTS_AACommand_finish_01_0900 stdResult =
'
+
data
.
stdResult
)
globalThis
.
stdResult19
=
data
.
stdResult
;
globalThis
.
stdResult19
=
data
.
stdResult
;
console
.
log
(
'
ACTS_AACommand_finish_01_0900 - executeShellCommand: end
'
)
console
.
log
(
'
ACTS_AACommand_finish_01_0900 - executeShellCommand: end
'
)
await
startAbilityTest
(
'
ACTS_AACommand_finish_01_0900
'
,
this
.
context
);
await
startAbilityTest
(
'
ACTS_AACommand_finish_01_0900
'
,
this
.
context
);
})
})
await
sleep
(
4000
)
await
sleep
(
4000
)
cmd
=
'
aa dump -a
'
cmd
=
'
aa dump -a
'
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
info
(
'
ACTS_AACommand_finish_01_0900 : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
ACTS_AACommand_finish_01_0900 : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
ACTS_AACommand_finish_01_0900 : data :
'
+
JSON
.
stringify
(
data
));
console
.
info
(
'
ACTS_AACommand_finish_01_0900 : data :
'
+
JSON
.
stringify
(
data
));
globalThis
.
stdResult20
=
data
[
"
stdResult
"
];
globalThis
.
stdResult20
=
data
[
"
stdResult
"
];
...
@@ -189,21 +183,20 @@ export default class MainAbility extends Ability {
...
@@ -189,21 +183,20 @@ export default class MainAbility extends Ability {
await
sleep
(
2000
)
await
sleep
(
2000
)
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap
'
+
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap
'
+
'
-s class A
CTS_AACommand_01_3
#ACTS_AACommand_finish_01_1300 -s unittest OpenHarmonyTestRunner
'
'
-s class A
ACommandTest
#ACTS_AACommand_finish_01_1300 -s unittest OpenHarmonyTestRunner
'
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
log
(
'
ACTS_AACommand_finish_01_1300 - executeShellCommand: start
'
)
console
.
log
(
'
ACTS_AACommand_finish_01_1300 - executeShellCommand: start
'
)
console
.
log
(
'
ACTS_AACommand_finish_01_1300 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_finish_01_1300 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_finish_01_1300 stdResult =
'
+
data
.
stdResult
)
console
.
log
(
'
ACTS_AACommand_finish_01_1300 stdResult =
'
+
data
.
stdResult
)
globalThis
.
stdResult23
=
data
.
stdResult
;
globalThis
.
stdResult23
=
data
.
stdResult
;
console
.
log
(
'
ACTS_AACommand_finish_01_1300 - executeShellCommand: end
'
)
console
.
log
(
'
ACTS_AACommand_finish_01_1300 - executeShellCommand: end
'
)
await
startAbilityTest
(
'
ACTS_AACommand_finish_01_1300
'
,
this
.
context
);
await
startAbilityTest
(
'
ACTS_AACommand_finish_01_1300
'
,
this
.
context
);
})
})
await
sleep
(
4000
)
await
sleep
(
4000
)
cmd
=
'
aa dump -a
'
cmd
=
'
aa dump -a
'
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
info
(
'
ACTS_AACommand_finish_01_1300 : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
ACTS_AACommand_finish_01_1300 : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
ACTS_AACommand_finish_01_1300 : data :
'
+
JSON
.
stringify
(
data
));
console
.
info
(
'
ACTS_AACommand_finish_01_1300 : data :
'
+
JSON
.
stringify
(
data
));
globalThis
.
stdResult24
=
data
[
"
stdResult
"
];
globalThis
.
stdResult24
=
data
[
"
stdResult
"
];
...
@@ -213,21 +206,20 @@ export default class MainAbility extends Ability {
...
@@ -213,21 +206,20 @@ export default class MainAbility extends Ability {
await
sleep
(
2000
)
await
sleep
(
2000
)
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap
'
+
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap
'
+
'
-s class A
CTS_AACommand_01_3
#ACTS_AACommand_finish_01_1400 -s unittest OpenHarmonyTestRunner
'
'
-s class A
ACommandTest
#ACTS_AACommand_finish_01_1400 -s unittest OpenHarmonyTestRunner
'
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
log
(
'
ACTS_AACommand_finish_01_1400 - executeShellCommand: start
'
)
console
.
log
(
'
ACTS_AACommand_finish_01_1400 - executeShellCommand: start
'
)
console
.
log
(
'
ACTS_AACommand_finish_01_1400 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_finish_01_1400 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_finish_01_1400 stdResult =
'
+
data
.
stdResult
)
console
.
log
(
'
ACTS_AACommand_finish_01_1400 stdResult =
'
+
data
.
stdResult
)
globalThis
.
stdResult25
=
data
.
stdResult
;
globalThis
.
stdResult25
=
data
.
stdResult
;
console
.
log
(
'
ACTS_AACommand_finish_01_1400 - executeShellCommand: end
'
)
console
.
log
(
'
ACTS_AACommand_finish_01_1400 - executeShellCommand: end
'
)
await
startAbilityTest
(
'
ACTS_AACommand_finish_01_1400
'
,
this
.
context
);
await
startAbilityTest
(
'
ACTS_AACommand_finish_01_1400
'
,
this
.
context
);
})
})
await
sleep
(
4000
)
await
sleep
(
4000
)
cmd
=
'
aa dump -a
'
cmd
=
'
aa dump -a
'
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
info
(
'
ACTS_AACommand_finish_01_1400 : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
ACTS_AACommand_finish_01_1400 : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
ACTS_AACommand_finish_01_1400 : data :
'
+
JSON
.
stringify
(
data
));
console
.
info
(
'
ACTS_AACommand_finish_01_1400 : data :
'
+
JSON
.
stringify
(
data
));
globalThis
.
stdResult26
=
data
[
"
stdResult
"
];
globalThis
.
stdResult26
=
data
[
"
stdResult
"
];
...
@@ -237,21 +229,20 @@ export default class MainAbility extends Ability {
...
@@ -237,21 +229,20 @@ export default class MainAbility extends Ability {
await
sleep
(
2000
)
await
sleep
(
2000
)
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap
'
+
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap
'
+
'
-s class A
CTS_AACommand_01_3
#ACTS_AACommand_finish_01_1500 -s unittest OpenHarmonyTestRunner
'
'
-s class A
ACommandTest
#ACTS_AACommand_finish_01_1500 -s unittest OpenHarmonyTestRunner
'
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
log
(
'
ACTS_AACommand_finish_01_1500 - executeShellCommand: start
'
)
console
.
log
(
'
ACTS_AACommand_finish_01_1500 - executeShellCommand: start
'
)
console
.
log
(
'
ACTS_AACommand_finish_01_1500 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_finish_01_1500 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_finish_01_1500 stdResult =
'
+
data
.
stdResult
)
console
.
log
(
'
ACTS_AACommand_finish_01_1500 stdResult =
'
+
data
.
stdResult
)
globalThis
.
stdResult27
=
data
.
stdResult
;
globalThis
.
stdResult27
=
data
.
stdResult
;
console
.
log
(
'
ACTS_AACommand_finish_01_1500 - executeShellCommand: end
'
)
console
.
log
(
'
ACTS_AACommand_finish_01_1500 - executeShellCommand: end
'
)
await
startAbilityTest
(
'
ACTS_AACommand_finish_01_1500
'
,
this
.
context
);
await
startAbilityTest
(
'
ACTS_AACommand_finish_01_1500
'
,
this
.
context
);
})
})
await
sleep
(
4000
)
await
sleep
(
4000
)
cmd
=
'
aa dump -a
'
cmd
=
'
aa dump -a
'
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
info
(
'
ACTS_AACommand_finish_01_1500 : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
ACTS_AACommand_finish_01_1500 : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
ACTS_AACommand_finish_01_1500 : data :
'
+
JSON
.
stringify
(
data
));
console
.
info
(
'
ACTS_AACommand_finish_01_1500 : data :
'
+
JSON
.
stringify
(
data
));
globalThis
.
stdResult28
=
data
[
"
stdResult
"
];
globalThis
.
stdResult28
=
data
[
"
stdResult
"
];
...
@@ -261,43 +252,41 @@ export default class MainAbility extends Ability {
...
@@ -261,43 +252,41 @@ export default class MainAbility extends Ability {
await
sleep
(
2000
)
await
sleep
(
2000
)
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap
'
+
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap
'
+
'
-s class A
CTS_AACommand_01_3
#ACTS_AACommand_finish_01_0300 -s unittest OpenHarmonyTestRunner
'
'
-s class A
ACommandTest
#ACTS_AACommand_finish_01_0300 -s unittest OpenHarmonyTestRunner
'
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
log
(
'
ACTS_AACommand_finish_01_0300 - executeShellCommand: start
'
)
console
.
log
(
'
ACTS_AACommand_finish_01_0300 - executeShellCommand: start
'
)
console
.
log
(
'
ACTS_AACommand_finish_01_0300 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_finish_01_0300 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_finish_01_0300 stdResult =
'
+
data
.
stdResult
)
console
.
log
(
'
ACTS_AACommand_finish_01_0300 stdResult =
'
+
data
.
stdResult
)
console
.
log
(
'
ACTS_AACommand_finish_01_0300 - executeShellCommand: end
'
)
console
.
log
(
'
ACTS_AACommand_finish_01_0300 - executeShellCommand: end
'
)
await
startAbilityTest
(
'
ACTS_AACommand_finish_01_0300
'
,
this
.
context
);
await
startAbilityTest
(
'
ACTS_AACommand_finish_01_0300
'
,
this
.
context
);
})
})
await
sleep
(
3
000
)
await
sleep
(
2
000
)
cmd
=
'
aa dump -a
'
cmd
=
'
aa dump -a
'
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
info
(
'
ACTS_AACommand_finish_01_0300 : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
ACTS_AACommand_finish_01_0300 : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
ACTS_AACommand_finish_01_0300 : data :
'
+
JSON
.
stringify
(
data
));
console
.
info
(
'
ACTS_AACommand_finish_01_0300 : data :
'
+
JSON
.
stringify
(
data
));
globalThis
.
stdResult30
=
data
[
"
stdResult
"
];
globalThis
.
stdResult30
=
data
[
"
stdResult
"
];
console
.
info
(
'
ACTS_AACommand_finish_01_0300 end
'
);
console
.
info
(
'
ACTS_AACommand_finish_01_0300 end
'
);
})
})
await
sleep
(
2
000
)
await
sleep
(
4
000
)
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap
'
+
cmd
=
'
aa test -m entry_test -b com.example.aacommandrelyhap
'
+
'
-s class A
CTS_AACommand_01_3
#ACTS_AACommand_finish_01_1600 -s unittest OpenHarmonyTestRunner
'
'
-s class A
ACommandTest
#ACTS_AACommand_finish_01_1600 -s unittest OpenHarmonyTestRunner
'
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
log
(
'
ACTS_AACommand_finish_01_1600 - executeShellCommand: start
'
)
console
.
log
(
'
ACTS_AACommand_finish_01_1600 - executeShellCommand: start
'
)
console
.
log
(
'
ACTS_AACommand_finish_01_1600 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_finish_01_1600 start err:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ACTS_AACommand_finish_01_1600 stdResult =
'
+
data
.
stdResult
)
console
.
log
(
'
ACTS_AACommand_finish_01_1600 stdResult =
'
+
data
.
stdResult
)
console
.
log
(
'
ACTS_AACommand_finish_01_1600 - executeShellCommand: end
'
)
console
.
log
(
'
ACTS_AACommand_finish_01_1600 - executeShellCommand: end
'
)
await
startAbilityTest
(
'
ACTS_AACommand_finish_01_1600
'
,
this
.
context
);
await
startAbilityTest
(
'
ACTS_AACommand_finish_01_1600
'
,
this
.
context
);
})
})
await
sleep
(
3
000
)
await
sleep
(
2
000
)
cmd
=
'
aa dump -a
'
cmd
=
'
aa dump -a
'
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
,
data
)
=>
{
abilityDelegator
.
executeShellCommand
(
cmd
,
async
(
err
,
data
)
=>
{
console
.
info
(
'
ACTS_AACommand_finish_01_1600 : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
ACTS_AACommand_finish_01_1600 : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
ACTS_AACommand_finish_01_1600 : data :
'
+
JSON
.
stringify
(
data
));
console
.
info
(
'
ACTS_AACommand_finish_01_1600 : data :
'
+
JSON
.
stringify
(
data
));
globalThis
.
stdResult34
=
data
[
"
stdResult
"
];
globalThis
.
stdResult34
=
data
[
"
stdResult
"
];
...
@@ -306,7 +295,7 @@ export default class MainAbility extends Ability {
...
@@ -306,7 +295,7 @@ export default class MainAbility extends Ability {
setTimeout
(()
=>
{
setTimeout
(()
=>
{
Hypium
.
hypiumTest
(
abilityDelegator
,
abilityDelegatorArguments
,
testsuite
)
Hypium
.
hypiumTest
(
abilityDelegator
,
abilityDelegatorArguments
,
testsuite
)
},
5
000
)
},
6
000
)
}
}
onDestroy
()
{
onDestroy
()
{
...
...
ability/ability_runtime/aacommand/AACommandtest/entry/src/main/module.json
浏览文件 @
47713768
...
@@ -33,6 +33,12 @@
...
@@ -33,6 +33,12 @@
}
}
]
]
}
}
],
"requestPermissions"
:
[
{
"name"
:
"ohos.permission.START_ABILITIES_FROM_BACKGROUND"
,
"reason"
:
"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
}
]
]
}
}
}
}
\ No newline at end of file
鸿蒙社区
@harmonycommunity
mentioned in commit
563f67d0
·
11月 20, 2022
mentioned in commit
563f67d0
mentioned in commit 563f67d0da38a6dd02ef65dbc7ff88a87d079e64
开关提交列表
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录