未验证 提交 39bae0d7 编写于 作者: O openharmony_ci 提交者: Gitee

!8343 【3.2挑单 元能力】ServiceClientTest测试套适配关联启动

Merge pull request !8343 from HuangXW/cherry-pick-1680531888
......@@ -16,10 +16,6 @@ import("//test/xts/tools/build/suite.gni")
group("serviceability") {
testonly = true
if (is_standard_system) {
deps = [
"actsserviceabilityclienttest:ActsServiceAbilityClientTest",
"actsserviceabilityserverrelyhap:ActsServiceAbilityServerRelyHap",
"actsserviceabilityserversecondrelyhap:ActsServiceAbilityServerSecondRelyHap",
]
deps = [ "actsserviceabilityclienttest:ActsServiceAbilityClientTest" ]
}
}
......@@ -11,9 +11,7 @@
"kits": [
{
"test-file-name": [
"ActsServiceAbilityClientTest.hap",
"ActsServiceAbilityServerRelyHap.hap",
"ActsServiceAbilityServerSecondRelyHap.hap"
"ActsServiceAbilityClientTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
......
......@@ -63,6 +63,24 @@
"type": "page",
"visible": true,
"launchType": "standard"
},
{
"srcPath": "ServiceAbility1",
"name": ".ServiceAbility1",
"icon": "$media:icon",
"srcLanguage": "js",
"description": "$string:description_serviceability",
"visible": true,
"type": "service"
},
{
"srcPath": "ServiceAbility2",
"name": ".ServiceAbility2",
"icon": "$media:icon",
"srcLanguage": "js",
"description": "$string:description_serviceability",
"visible": true,
"type": "service"
}
],
"reqPermissions": [
......
......@@ -15,8 +15,8 @@
import rpc from "@ohos.rpc";
import particleAbility from '@ohos.ability.particleAbility'
import commonEvent from '@ohos.commonEvent'
var serversecond_bundleName = "com.amsst.stserviceabilityserversecond";
var serversecond_abilityName = "com.amsst.stserviceabilityserversecond.ServiceAbility";
var serversecond_bundleName = "com.amsst.stserviceabilityclient";
var serversecond_abilityName = "com.amsst.stserviceabilityclient.ServiceAbility2";
var mConnIdJs;
class StubTest extends rpc.RemoteObject {
constructor(des) {
......
......@@ -15,8 +15,8 @@
import rpc from "@ohos.rpc";
import particleAbility from '@ohos.ability.particleAbility'
import commonEvent from '@ohos.commonEvent'
var server_bundleName = "com.amsst.stserviceabilityserver";
var server_abilityName = "com.amsst.stserviceabilityserver.ServiceAbility";
var server_bundleName = "com.amsst.stserviceabilityclient";
var server_abilityName = "com.amsst.stserviceabilityclient.ServiceAbility1";
var mConnIdJs;
class StubTest extends rpc.RemoteObject {
constructor(des) {
......
......@@ -19,8 +19,8 @@ import rpc from "@ohos.rpc";
import { describe, afterEach, it, expect } from '@ohos/hypium'
export default function ActsStServiceAbilityTest() {
describe('ActsStServiceAbilityTest', function () {
let bundleName = "com.amsst.stserviceabilityserver";
let abilityName = "com.amsst.stserviceabilityserver.ServiceAbility";
let bundleName = "com.amsst.stserviceabilityclient";
let abilityName = "com.amsst.stserviceabilityclient.ServiceAbility1";
let subscriber0100;
let CommonEventSubscribeInfo0100 = {
......
......@@ -23,6 +23,10 @@
{
"name": "TestAbility_label",
"value": "label"
},
{
"name": "description_serviceability",
"value": "hap sample empty service"
}
]
}
\ No newline at end of file
# 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("//test/xts/tools/build/suite.gni")
ohos_hap_assist_suite("ActsServiceAbilityServerRelyHap") {
hap_name = "ActsServiceAbilityServerRelyHap"
js_build_mode = "debug"
hap_profile = "entry/src/main/config.json"
testonly = true
deps = [
":serviceability_resources",
":serviceability_ts_assets",
]
certificate_profile = "signature/openharmony_sx.p7b"
subsystem_name = "ability"
part_name = "ability_runtime"
}
ohos_js_assets("serviceability_ts_assets") {
source_dir = "entry/src/main/ets"
hap_profile = "entry/src/main/config.json"
ets2abc = true
}
ohos_resources("serviceability_resources") {
sources = [ "entry/src/main/resources" ]
hap_profile = "entry/src/main/config.json"
}
{
"app": {
"bundleName": "com.amsst.stserviceabilityserver",
"vendor": "test",
"version": {
"code": 1000110,
"name": "1.1.1"
},
"apiVersion": {
"compatible": 8,
"target": 9
}
},
"deviceConfig": {},
"module": {
"package": "com.amsst.stserviceabilityserver",
"name": ".MyApplication",
"mainAbility": ".MainAbility",
"srcPath": "",
"deviceType": [
"default",
"tablet"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
"installationFree": false
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"orientation": "unspecified",
"visible": true,
"srcPath": "MainAbility",
"name": ".MainAbility",
"srcLanguage": "ets",
"icon": "$media:icon",
"description": "$string:description_mainability",
"formsEnabled": false,
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "standard"
},
{
"srcPath": "ServiceAbility",
"name": ".ServiceAbility",
"icon": "$media:icon",
"srcLanguage": "ets",
"description": "$string:description_serviceability",
"visible": true,
"type": "service"
}
],
"js": [
{
"mode": {
"syntax": "ets",
"type": "pageAbility"
},
"pages": [
"pages/index",
"pages/second"
],
"name": ".MainAbility",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
],
"defPermissions": [
{
"name": "com.ohos.screenlock.DataAbilityShellProvider.PROVIDER"
}
]
}
}
/*
* 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 AbilityStage from "@ohos.app.ability.AbilityStage"
export default class MyAbilityStage extends AbilityStage {
onCreate() {
console.log("MyAbilityStage onCreate");
}
}
\ No newline at end of file
/*
* 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.app.ability.UIAbility'
export default class MainAbility extends Ability {
onCreate(want, launchParam) {
console.log("jws onCreate");
}
onDestroy() {
console.log("jws onDestroy");
}
onWindowStageCreate(windowStage) {
console.log("jws onWindowStageCreate");
}
onWindowStageDestroy() {
console.log("jws onWindowStageDestroy");
}
onForeground() {
console.log("jws onForeground");
}
onBackground() {
console.log("jws onBackground");
}
call(){
}
}
\ No newline at end of file
/*
* 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.
*/
export default {
onCreate() {
console.info('Application onCreate')
},
onDestroy() {
console.info('Application onDestroy')
},
}
\ No newline at end of file
/*
* 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 {Core} from '@ohos/hypium'
@Entry
@Component
struct Index {
aboutToAppear() {
console.info('onShow finish')
const core = Core.getInstance()
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
core.execute()
}
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text('Hello World')
.fontSize(50)
.fontWeight(FontWeight.Bold)
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
/*
* 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 '@system.router';
@Entry
@Component
struct Second {
private content: string = "Second Page"
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text(`${this.content}`)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('back to index')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
router.back()
})
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
{
"string": [
{
"name": "entry_MainAbility",
"value": "ServiceExtAbility"
},
{
"name": "description_mainability",
"value": "eTS_Empty Ability"
},
{
"name": "description_serviceability",
"value": "hap sample empty service"
},
{
"name": "description_dataability",
"value": "hap sample empty provider"
},
{
"name": "description_mainability2",
"value": "eTS_Empty Ability"
},
{
"name": "entry_MainAbility2",
"value": "entry_MainAbility2"
},
{
"name": "description_testdataability",
"value": "hap sample empty provider"
},
{
"name": "permreason_dataability",
"value": "request dataability premission"
}
]
}
\ No newline at end of file
# 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("//test/xts/tools/build/suite.gni")
ohos_hap_assist_suite("ActsServiceAbilityServerSecondRelyHap") {
hap_name = "ActsServiceAbilityServerSecondRelyHap"
js_build_mode = "debug"
hap_profile = "entry/src/main/config.json"
testonly = true
deps = [
":serviceability_resources",
":serviceability_ts_assets",
]
certificate_profile = "signature/openharmony_sx.p7b"
subsystem_name = "ability"
part_name = "ability_runtime"
}
ohos_js_assets("serviceability_ts_assets") {
source_dir = "entry/src/main/ets"
hap_profile = "entry/src/main/config.json"
ets2abc = true
}
ohos_resources("serviceability_resources") {
sources = [ "entry/src/main/resources" ]
hap_profile = "entry/src/main/config.json"
}
{
"app": {
"bundleName": "com.amsst.stserviceabilityserversecond",
"vendor": "test",
"version": {
"code": 1000110,
"name": "1.1.1"
},
"apiVersion": {
"compatible": 8,
"target": 9
}
},
"deviceConfig": {},
"module": {
"package": "com.amsst.stserviceabilityserversecond",
"name": ".MyApplication",
"mainAbility": ".MainAbility",
"srcPath": "",
"deviceType": [
"default",
"tablet"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
"installationFree": false
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"orientation": "unspecified",
"visible": true,
"srcPath": "MainAbility",
"name": ".MainAbility",
"srcLanguage": "ets",
"icon": "$media:icon",
"description": "$string:description_mainability",
"formsEnabled": false,
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "standard"
},
{
"srcPath": "ServiceAbility",
"name": ".ServiceAbility",
"icon": "$media:icon",
"srcLanguage": "ets",
"description": "$string:description_serviceability",
"visible": true,
"type": "service"
}
],
"js": [
{
"mode": {
"syntax": "ets",
"type": "pageAbility"
},
"pages": [
"pages/index",
"pages/second"
],
"name": ".MainAbility",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
],
"defPermissions": [
{
"name": "com.ohos.screenlock.DataAbilityShellProvider.PROVIDER"
}
]
}
}
/*
* 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 AbilityStage from "@ohos.app.ability.AbilityStage"
export default class MyAbilityStage extends AbilityStage {
onCreate() {
console.log("MyAbilityStage onCreate");
}
}
\ No newline at end of file
import Ability from '@ohos.app.ability.UIAbility'
export default class MainAbility extends Ability {
onCreate(want, launchParam) {
console.log("jws onCreate");
}
onDestroy() {
console.log("jws onDestroy");
}
onWindowStageCreate(windowStage) {
console.log("jws onWindowStageCreate");
}
onWindowStageDestroy() {
console.log("jws onWindowStageDestroy");
}
onForeground() {
console.log("jws onForeground");
}
onBackground() {
console.log("jws onBackground");
}
call(){
}
}
\ No newline at end of file
/*
* 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.
*/
export default {
onCreate() {
console.info('Application onCreate')
},
onDestroy() {
console.info('Application onDestroy')
},
}
\ No newline at end of file
/*
* 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 {Core} from '@ohos/hypium'
@Entry
@Component
struct Index {
aboutToAppear() {
console.info('onShow finish')
const core = Core.getInstance()
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
core.execute()
}
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text('Hello World')
.fontSize(50)
.fontWeight(FontWeight.Bold)
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
/*
* 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 '@system.router';
@Entry
@Component
struct Second {
private content: string = "Second Page"
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text(`${this.content}`)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('back to index')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
router.back()
})
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
{
"string": [
{
"name": "entry_MainAbility",
"value": "ServiceExtAbility"
},
{
"name": "description_mainability",
"value": "eTS_Empty Ability"
},
{
"name": "description_serviceability",
"value": "hap sample empty service"
},
{
"name": "description_dataability",
"value": "hap sample empty provider"
},
{
"name": "description_mainability2",
"value": "eTS_Empty Ability"
},
{
"name": "entry_MainAbility2",
"value": "entry_MainAbility2"
},
{
"name": "description_testdataability",
"value": "hap sample empty provider"
},
{
"name": "permreason_dataability",
"value": "request dataability premission"
}
]
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册