修改绝对路径依赖

Signed-off-by: 师皓杰 <shihaojie10@huawei.com>
This commit is contained in:
师皓杰 2024-08-22 13:38:29 +08:00
parent 13e2bb7369
commit 9585512102
22 changed files with 6 additions and 343 deletions

View File

@ -61,11 +61,8 @@ if (os_account_part) {
dtbabilitymgr_external_deps += [ "os_account:os_account_innerkits" ]
}
dtbabilitymgr_public_deps = [
"//foundation/ability/dmsfwk/services/dtbschedmgr:distributedschedsvr",
"//third_party/googletest:gmock_main",
"//third_party/googletest:gtest_main",
]
dtbabilitymgr_public_deps =
[ "${distributed_service}/dtbschedmgr:distributedschedsvr" ]
dtbabilitymgr_sources = [
"${distributed_service}/dtbabilitymgr/src/continuation_manager/app_connection_stub.cpp",

View File

@ -115,8 +115,6 @@ if (dmsfwk_mmi_listener) {
dsched_public_deps = [
"${distributed_service}/dtbschedmgr:distributedschedsvr",
"${dms_path}/common:distributed_sched_utils",
"//third_party/googletest:gmock_main",
"//third_party/googletest:gtest_main",
]
dtbschedmgr_sources = [ "unittest/distributed_sched_test_util.cpp" ]
@ -131,11 +129,6 @@ distributed_event_sources = [
ohos_unittest("distributedschedsvrtest") {
module_out_path = module_output_path
deps = [
"${dms_path}/test/sceneProject/unittest/bundle_dependencies/bmsThirdBundle:bmsThirdBundle",
"${dms_path}/test/sceneProject/unittest/ohos_test:copy_ohos_test",
]
sources = [
"unittest/continue_scene_session_handler_test.cpp",
"unittest/distributed_sched_adapter_test.cpp",
@ -244,11 +237,6 @@ ohos_unittest("dschedcontinuetest") {
public_deps = dsched_public_deps
}
deps = [
"${dms_path}/test/sceneProject/unittest/bundle_dependencies/bmsThirdBundle:bmsThirdBundle",
"${dms_path}/test/sceneProject/unittest/ohos_test:copy_ohos_test",
]
if (dmsfwk_mission_manager) {
defines = [ "SUPPORT_DISTRIBUTED_MISSION_MANAGER" ]
}
@ -366,10 +354,7 @@ ohos_unittest("bundlemanagerinternaltest") {
"${distributed_service}/dtbschedmgr/test/resource:coverage_flags",
]
configs += dsched_configs
deps = [
"${dms_path}/test/sceneProject/unittest/bundle_dependencies/bmsThirdBundle:bmsThirdBundle",
"${dms_path}/test/sceneProject/unittest/ohos_test:copy_ohos_test",
]
if (is_standard_system) {
external_deps = dsched_external_deps
public_deps = dsched_public_deps
@ -397,14 +382,12 @@ ohos_unittest("softbusadaptertest") {
"${dms_path}/services/dtbschedmgr/test/resource:coverage_flags",
]
configs += dsched_configs
deps = [
"${dms_path}/test/sceneProject/unittest/bundle_dependencies/bmsThirdBundle:bmsThirdBundle",
"${dms_path}/test/sceneProject/unittest/ohos_test:copy_ohos_test",
]
if (is_standard_system) {
external_deps = dsched_external_deps
public_deps = dsched_public_deps
}
external_deps += [ "googletest:gmock" ]
part_name = "dmsfwk"
subsystem_name = "ability"
}
@ -639,6 +622,7 @@ group("unittest") {
":dschedcontinuestatetest",
":dschedcontinuetest",
":dschedswitchstatustest",
":hisyseventreporttest",
":softbusadaptertest",
"${dms_path}/common/test/unittest:distributed_sched_utils_test",
]

View File

@ -39,7 +39,6 @@ constexpr int32_t SLEEP_TIME = 1000;
void BundleManagerInternalTest::SetUpTestCase()
{
DTEST_LOG << "BundleManagerInternalTest::SetUpTestCase" << std::endl;
DistributedSchedUtil::InstallThirdPartyHap();
std::this_thread::sleep_for(std::chrono::milliseconds(SLEEP_TIME));
}

View File

@ -51,7 +51,6 @@ void DSchedContinuationTest::SetUpTestCase()
const std::string pkgName = "DBinderBus_" + std::to_string(getprocpid());
std::shared_ptr<DmInitCallback> initCallback_ = std::make_shared<DeviceInitCallBack>();
DeviceManager::GetInstance().InitDeviceManager(pkgName, initCallback_);
DistributedSchedUtil::InstallThirdPartyHap();
std::this_thread::sleep_for(std::chrono::milliseconds(SLEEP_TIME));
}

View File

@ -100,7 +100,6 @@ void DistributedSchedServiceFirstTest::SetUpTestCase()
const std::string pkgName = "DBinderBus_" + std::to_string(getprocpid());
std::shared_ptr<DmInitCallback> initCallback_ = std::make_shared<DeviceInitCallBack>();
DeviceManager::GetInstance().InitDeviceManager(pkgName, initCallback_);
DistributedSchedUtil::InstallThirdPartyHap();
std::this_thread::sleep_for(std::chrono::milliseconds(SLEEP_TIME));
}

View File

@ -99,7 +99,6 @@ void DistributedSchedServiceSecondTest::SetUpTestCase()
const std::string pkgName = "DBinderBus_" + std::to_string(getprocpid());
std::shared_ptr<DmInitCallback> initCallback_ = std::make_shared<DeviceInitCallBack>();
DeviceManager::GetInstance().InitDeviceManager(pkgName, initCallback_);
DistributedSchedUtil::InstallThirdPartyHap();
std::this_thread::sleep_for(std::chrono::milliseconds(SLEEP_TIME));
}

View File

@ -35,7 +35,6 @@ namespace DistributedSchedule {
using namespace AppExecFwk;
namespace {
const std::string TAG = "DistributedSchedUtil";
const std::string HAP_FILE_PATH = "/data/test/resource/dmsfwk/resource/bmsThirdBundle.hap";
const char* DISTSCHED_PROCESS_NAME = "distributedsched";
constexpr int32_t DMS_LOAD_SA_TIMEOUT_MS = 10000;
constexpr int32_t USER_ID = 100;
@ -130,32 +129,6 @@ sptr<AppExecFwk::IBundleMgr> DistributedSchedUtil::GetBundleManager()
return iface_cast<AppExecFwk::IBundleMgr>(bmsProxy);
}
int32_t DistributedSchedUtil::InstallThirdPartyHap()
{
auto bms = GetBundleManager();
if (bms == nullptr) {
HILOGE("bms is null");
return FAILED_RETURN;
}
auto installer = bms->GetBundleInstaller();
if (!installer) {
HILOGE("installer is null");
return FAILED_RETURN;
}
InstallParam installParam;
installParam.installFlag = InstallFlag::NORMAL;
installParam.userId = USER_ID;
sptr<StatusReceiverImpl> statusReceiver(new (std::nothrow) StatusReceiverImpl());
if (!statusReceiver) {
return FAILED_RETURN;
}
bool result = installer->Install(HAP_FILE_PATH, installParam, statusReceiver);
if (!result) {
return FAILED_RETURN;
}
return 0;
}
void DistributedSchedUtil::MockProcessAndPermission(const char* processName, const char *perms[], int32_t permsNum)
{
uint64_t tokenId;

View File

@ -37,7 +37,6 @@ public:
static void LoadSystemAbilitySuccessNotify(const sptr<IRemoteObject>& remoteObject);
static void LoadSystemAbilityFailNotify();
static sptr<AppExecFwk::IBundleMgr> GetBundleManager();
static int32_t InstallThirdPartyHap();
static std::mutex remoteMutex_;
static sptr<IRemoteObject> remote_;

View File

@ -720,9 +720,6 @@ HWTEST_F(DMSContinueManagerTest, testGetAbilityNameByMissionId_001, TestSize.Lev
int32_t ret = DMSContinueSendMgr::GetInstance().GetAbilityNameByMissionId(MISSIONID_01, abilityName);
EXPECT_EQ(abilityName, ABILITY_NAME_01);
EXPECT_EQ(ret, ERR_OK);
ret = DMSContinueSendMgr::GetInstance().GetBundleNameByMissionId(MISSIONID_02, abilityName);
EXPECT_EQ(ret, INVALID_PARAMETERS_ERR);
DTEST_LOG << "DMSContinueManagerTest testGetAbilityNameByMissionId_001 end" << std::endl;
}

View File

@ -1,22 +0,0 @@
# Copyright (c) 2023 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.
group("bundle_dependencies") {
testonly = true
deps = []
deps += [
# deps file
"dependencies_entry:dependencies_entry",
]
}

View File

@ -1,38 +0,0 @@
# Copyright (c) 2023 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("//build/ohos/app/app.gni")
import("../../../../../dmsfwk.gni")
ohos_hap("bmsThirdBundle") {
hap_profile = "./src/main/config.json"
hap_name = "bmsThirdBundle"
subsystem_name = "bundlemanager"
final_hap_path = "$root_out_dir/tests/unittest/dmsfwk/distributedschedsvrtest/resource/${hap_name}.hap"
testonly = true
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile =
"${dms_path}/test/sceneProject/signature/com.third.hiworld.example.p7b"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./src/main/js/resources" ]
hap_profile = "./src/main/config.json"
}

View File

@ -1,56 +0,0 @@
{
"app": {
"bundleName": "com.third.hiworld.example",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 3,
"target": 3
}
},
"deviceConfig": {
"default": {}
},
"module": {
"package": "com.third.hiworld.example.hap",
"name": "bmsThirdBundle",
"deviceType": [
"tablet",
"default",
"tv",
"car",
"2in1"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "testability",
"moduleType": "entry"
},
"abilities": [
{
"name": "bmsThirdBundle",
"icon": "$media:snowball",
"label": "bmsThirdBundle Ability",
"launchType": "singleton",
"orientation": "unspecified",
"type": "page",
"visible": true
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": true
}
}
]
}
}

View File

@ -1,22 +0,0 @@
/*
* Copyright (c) 2023 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('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};

View File

@ -1,6 +0,0 @@
{
"strings": {
"hello": "Hello",
"world": "World"
}
}

View File

@ -1,6 +0,0 @@
{
"strings": {
"hello": "您好",
"world": "世界"
}
}

View File

@ -1,24 +0,0 @@
/*
* Copyright (c) 2023 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.
*/
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
font-size: 100px;
}

View File

@ -1,20 +0,0 @@
<!--
Copyright (c) 2023 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.
-->
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>

View File

@ -1,25 +0,0 @@
/*
* Copyright (c) 2023 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.
*/
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
}
}

View File

@ -1,12 +0,0 @@
{
"string": [
{
"name": "entry_MainAbility",
"value": "bmsfirstright"
},
{
"name": "mainability_description",
"value": "JS_Phone_Empty Feature Ability"
}
]
}

View File

@ -1,21 +0,0 @@
# 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("//build/ohos.gni")
ohos_copy("copy_ohos_test") {
sources = [ "./ohos_test.xml" ]
outputs = [ "$root_out_dir/tests/unittest/dmsfwk/distributedschedsvrtest/resource/ohos_test.xml" ]
part_name = "dmsfwk"
subsystem_name = "ability"
}

View File

@ -1,31 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--Copyright (c) 2023 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.
-->
<configuration ver="2.0">
<target name="distributedschedsvrtest">
<preparer>
<option name="push" value="bmsThirdBundle.hap -> /data/test/resource/dmsfwk/resource/" src="res"/>
</preparer>
</target>
<target name="bundlemanagerinternaltest">
<preparer>
<option name="push" value="bmsThirdBundle.hap -> /data/test/resource/dmsfwk/resource/" src="res"/>
</preparer>
</target>
<target name="dschedcontinuetest">
<preparer>
<option name="push" value="bmsThirdBundle.hap -> /data/test/resource/dmsfwk/resource/" src="res"/>
</preparer>
</target>
</configuration>