Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
a0a6561f
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看板
未验证
提交
a0a6561f
编写于
8月 01, 2022
作者:
O
openharmony_ci
提交者:
Gitee
8月 01, 2022
浏览文件
操作
浏览文件
下载
差异文件
!4719 Adapt to the new framework
Merge pull request !4719 from jiyong/local-20220730-0003
上级
afaa18ad
ddd68663
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
199 addition
and
30 deletion
+199
-30
distributeddatamgr/windowStage/dataShareRdbtest/Test.json
distributeddatamgr/windowStage/dataShareRdbtest/Test.json
+5
-3
distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/MainAbility/MainAbility.ts
...hareRdbtest/entry/src/main/ets/MainAbility/MainAbility.ts
+1
-1
distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/MainAbility/pages/index.ets
...areRdbtest/entry/src/main/ets/MainAbility/pages/index.ets
+10
-19
distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/TestAbility/TestAbility.ts
...hareRdbtest/entry/src/main/ets/TestAbility/TestAbility.ts
+50
-0
distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/TestAbility/pages/index.ets
...areRdbtest/entry/src/main/ets/TestAbility/pages/index.ets
+48
-0
distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...st/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+78
-0
distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/test/DataShareCombinationRdb.ets
...btest/entry/src/main/ets/test/DataShareCombinationRdb.ets
+1
-1
distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/test/DataSharePredicatesRdb.ets
...dbtest/entry/src/main/ets/test/DataSharePredicatesRdb.ets
+1
-1
distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/test/DataSharePublicfunction_Callback.ets
...ry/src/main/ets/test/DataSharePublicfunction_Callback.ets
+1
-1
distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/test/DataSharePublicfunction_Promise.ets
...try/src/main/ets/test/DataSharePublicfunction_Promise.ets
+1
-1
distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/test/DataShareSingleRdb_Callback.ets
...t/entry/src/main/ets/test/DataShareSingleRdb_Callback.ets
+1
-1
distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/test/DataShareSingleRdb_Promise.ets
...st/entry/src/main/ets/test/DataShareSingleRdb_Promise.ets
+1
-1
distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/test/List.test.ets
...ge/dataShareRdbtest/entry/src/main/ets/test/List.test.ets
+0
-0
distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/resources/base/profile/main_pages.json
...est/entry/src/main/resources/base/profile/main_pages.json
+1
-1
未找到文件。
distributeddatamgr/windowStage/dataShareRdbtest/Test.json
浏览文件 @
a0a6561f
{
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"type"
:
"
OH
JSUnitTest"
,
"test-timeout"
:
"180000"
,
"package"
:
"com.example.myapplication"
,
"shell-timeout"
:
"600000"
"bundle-name"
:
"com.example.myapplication"
,
"module-name"
:
"entry"
,
"shell-timeout"
:
"600000"
,
"testcase-timeout"
:
70000
},
"kits"
:
[{
"test-file-name"
:
[
...
...
distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/MainAbility/MainAbility.ts
浏览文件 @
a0a6561f
...
...
@@ -125,7 +125,7 @@ export default class MainAbility extends Ability {
});
dseConnectionId
=
await
context
.
connectAbility
(
dseWant
,
dseConnect
);
})
windowStage
.
setUIContent
(
this
.
context
,
"
pages/index
"
,
null
)
windowStage
.
setUIContent
(
this
.
context
,
"
MainAbility/
pages/index
"
,
null
)
}
onWindowStageDestroy
()
{
...
...
distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/pages/index.ets
→
distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/
MainAbility/
pages/index.ets
浏览文件 @
a0a6561f
...
...
@@ -13,9 +13,10 @@
* limitations under the License.
*/
import file from '@system.file';
import {Core, ExpectExtend} from "hypium/index"
import testsuite from "../Test/List.test"
import router from '@ohos.router';
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from '../../test/List.test'
//InstrumentLog, ReportExtend
...
...
@@ -25,22 +26,12 @@ struct Index {
aboutToAppear(){
console.info("start run testcase!!!!")
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
//const reportExtend = new ReportExtend(file)
//core.addService('report', reportExtend)
core.init()
//core.subscribeEvent('task', reportExtend)
const configService = core.getDefaultService('config')
console.info('parameters---->' + JSON.stringify(globalThis.abilityWant.parameters))
globalThis.abilityWant.parameters.timeout = 70000;
configService.setConfig(globalThis.abilityWant.parameters)
testsuite()
core.execute()
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}
build() {
...
...
distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/TestAbility/TestAbility.ts
0 → 100644
浏览文件 @
a0a6561f
/*
* 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
Ability
from
'
@ohos.application.Ability
'
export
default
class
TestAbility
extends
Ability
{
onCreate
(
want
,
launchParam
)
{
console
.
log
(
'
TestAbility onCreate
'
)
}
onDestroy
()
{
console
.
log
(
'
TestAbility onDestroy
'
)
}
onWindowStageCreate
(
windowStage
)
{
console
.
log
(
'
TestAbility onWindowStageCreate
'
)
windowStage
.
loadContent
(
"
TestAbility/pages/index
"
,
(
err
,
data
)
=>
{
if
(
err
.
code
)
{
console
.
error
(
'
Failed to load the content. Cause:
'
+
JSON
.
stringify
(
err
));
return
;
}
console
.
info
(
'
Succeeded in loading the content. Data:
'
+
JSON
.
stringify
(
data
))
});
globalThis
.
abilityContext
=
this
.
context
;
}
onWindowStageDestroy
()
{
console
.
log
(
'
TestAbility onWindowStageDestroy
'
)
}
onForeground
()
{
console
.
log
(
'
TestAbility onForeground
'
)
}
onBackground
()
{
console
.
log
(
'
TestAbility onBackground
'
)
}
};
\ No newline at end of file
distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/TestAbility/pages/index.ets
0 → 100644
浏览文件 @
a0a6561f
/*
* 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 router from '@ohos.router';
@Entry
@Component
struct Index {
aboutToAppear() {
console.info('TestAbility index aboutToAppear')
}
@State message: string = 'Hello World'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.width('35%')
.height('5%')
.onClick(()=>{
})
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
0 → 100644
浏览文件 @
a0a6561f
/*
* 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
TestRunner
from
'
@ohos.application.testRunner
'
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
var
abilityDelegator
=
undefined
var
abilityDelegatorArguments
=
undefined
function
translateParamsToString
(
parameters
)
{
const
keySet
=
new
Set
([
'
-s class
'
,
'
-s notClass
'
,
'
-s suite
'
,
'
-s it
'
,
'
-s level
'
,
'
-s testType
'
,
'
-s size
'
,
'
-s timeout
'
,
'
-s dryRun
'
])
let
targetParams
=
''
;
for
(
const
key
in
parameters
)
{
if
(
keySet
.
has
(
key
))
{
targetParams
=
`
${
targetParams
}
${
key
}
${
parameters
[
key
]}
`
}
}
return
targetParams
.
trim
()
}
async
function
onAbilityCreateCallback
()
{
console
.
log
(
"
onAbilityCreateCallback
"
);
}
async
function
addAbilityMonitorCallback
(
err
:
any
)
{
console
.
info
(
"
addAbilityMonitorCallback :
"
+
JSON
.
stringify
(
err
))
}
export
default
class
OpenHarmonyTestRunner
implements
TestRunner
{
constructor
()
{
}
onPrepare
()
{
console
.
info
(
"
OpenHarmonyTestRunner OnPrepare
"
)
}
async
onRun
()
{
console
.
log
(
'
OpenHarmonyTestRunner onRun run
'
)
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
testAbilityName
=
abilityDelegatorArguments
.
bundleName
+
'
.MainAbility
'
let
lMonitor
=
{
abilityName
:
testAbilityName
,
onAbilityCreate
:
onAbilityCreateCallback
,
};
abilityDelegator
.
addAbilityMonitor
(
lMonitor
,
addAbilityMonitorCallback
)
var
cmd
=
'
aa start -d 0 -a com.example.myapplication.MainAbility
'
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
cmd
+=
'
'
+
translateParamsToString
(
abilityDelegatorArguments
.
parameters
)
var
debug
=
abilityDelegatorArguments
.
parameters
[
"
-D
"
]
if
(
debug
==
'
true
'
)
{
cmd
+=
'
-D
'
}
console
.
info
(
'
cmd :
'
+
cmd
)
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
:
any
,
d
:
any
)
=>
{
console
.
info
(
'
executeShellCommand : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
executeShellCommand : data :
'
+
d
.
stdResult
);
console
.
info
(
'
executeShellCommand : data :
'
+
d
.
exitCode
);
})
console
.
info
(
'
OpenHarmonyTestRunner onRun end
'
)
}
};
\ No newline at end of file
distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/
T
est/DataShareCombinationRdb.ets
→
distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/
t
est/DataShareCombinationRdb.ets
浏览文件 @
a0a6561f
...
...
@@ -13,7 +13,7 @@
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
'hypium/index'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
"@ohos/hypium"
import dataShare from '@ohos.data.dataShare'
import * as pubfun from './DataSharePublicfunction_Promise'
import dataSharePredicates from '@ohos.data.dataSharePredicates'
...
...
distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/
T
est/DataSharePredicatesRdb.ets
→
distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/
t
est/DataSharePredicatesRdb.ets
浏览文件 @
a0a6561f
...
...
@@ -13,7 +13,7 @@
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
'hypium/index'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
"@ohos/hypium"
import dataShare from '@ohos.data.dataShare'
import dataSharePredicates from '@ohos.data.dataSharePredicates'
import * as pubfun from './DataSharePublicfunction_Promise'
...
...
distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/
T
est/DataSharePublicfunction_Callback.ets
→
distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/
t
est/DataSharePublicfunction_Callback.ets
浏览文件 @
a0a6561f
...
...
@@ -14,7 +14,7 @@
*/
import
file
from
'@system.file'
;
import
{
describe
,
it
,
expect
}
from
'hypium/index'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
"@ohos/hypium"
import
dataShare
from
'@ohos.data.dataShare'
import
dataSharePredicates
from
'@ohos.data.dataSharePredicates'
import
DataShareResultSet
from
'@ohos.data.DataShareResultSet'
...
...
distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/
T
est/DataSharePublicfunction_Promise.ets
→
distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/
t
est/DataSharePublicfunction_Promise.ets
浏览文件 @
a0a6561f
...
...
@@ -14,7 +14,7 @@
*/
import file from '@system.file';
import { describe,
it, expect } from 'hypium/index'
import { describe,
beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium"
import dataShare from '@ohos.data.dataShare'
import dataSharePredicates from '@ohos.data.dataSharePredicates'
import DataShareResultSet from '@ohos.data.DataShareResultSet'
...
...
distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/
T
est/DataShareSingleRdb_Callback.ets
→
distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/
t
est/DataShareSingleRdb_Callback.ets
浏览文件 @
a0a6561f
...
...
@@ -13,7 +13,7 @@
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
'hypium/index'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
"@ohos/hypium"
import dataShare from '@ohos.data.dataShare'
import dataSharePredicates from '@ohos.data.dataSharePredicates'
import * as pubfun from './DataSharePublicfunction_Callback'
...
...
distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/
T
est/DataShareSingleRdb_Promise.ets
→
distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/
t
est/DataShareSingleRdb_Promise.ets
浏览文件 @
a0a6561f
...
...
@@ -13,7 +13,7 @@
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
'hypium/index'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
"@ohos/hypium"
import dataShare from '@ohos.data.dataShare'
import dataSharePredicates from '@ohos.data.dataSharePredicates'
import * as pubfun from './DataSharePublicfunction_Promise'
...
...
distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/
T
est/List.test.ets
→
distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/ets/
t
est/List.test.ets
浏览文件 @
a0a6561f
文件已移动
distributeddatamgr/windowStage/dataShareRdbtest/entry/src/main/resources/base/profile/main_pages.json
浏览文件 @
a0a6561f
{
"src"
:
[
"pages/index"
"
MainAbility/
pages/index"
]
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录