Merge pull request !1078 from 师皓杰/master
This commit is contained in:
openharmony_ci 2024-09-13 02:55:43 +00:00 committed by Gitee
commit f8b007c1c6
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
7 changed files with 368 additions and 364 deletions

View File

@ -541,5 +541,110 @@ HWTEST_F(BundleManagerInternalTest, GetBundleNameId_002, TestSize.Level3)
EXPECT_EQ(ret, CAN_NOT_FOUND_ABILITY_ERR);
DTEST_LOG << "BundleManagerInternalTest GetBundleNameId_002 end "<< std::endl;
}
/**
* @tc.name: IsSameDeveloperId_001
* @tc.desc: IsSameDeveloperId
* @tc.type: FUNC
*/
HWTEST_F(BundleManagerInternalTest, IsSameDeveloperId_001, TestSize.Level3)
{
DTEST_LOG << "BundleManagerInternalTest IsSameDeveloperId_001 begin" << std::endl;
std::string bundleNameInCurrentSide;
std::string developerId4OtherSide;
bool ret = BundleManagerInternal::IsSameDeveloperId(bundleNameInCurrentSide, developerId4OtherSide);
EXPECT_EQ(ret, false);
developerId4OtherSide = "developerId4OtherSide";
ret = BundleManagerInternal::IsSameDeveloperId(bundleNameInCurrentSide, developerId4OtherSide);
EXPECT_EQ(ret, false);
bundleNameInCurrentSide = "bundleNameInCurrentSide";
ret = BundleManagerInternal::IsSameDeveloperId(bundleNameInCurrentSide, developerId4OtherSide);
EXPECT_EQ(ret, false);
developerId4OtherSide.clear();
ret = BundleManagerInternal::IsSameDeveloperId(bundleNameInCurrentSide, developerId4OtherSide);
EXPECT_EQ(ret, false);
DTEST_LOG << "BundleManagerInternalTest IsSameDeveloperId_001 end "<< std::endl;
}
/**
* @tc.name: GetContinueBundle4Src_001
* @tc.desc: GetContinueBundle4Src
* @tc.type: FUNC
*/
HWTEST_F(BundleManagerInternalTest, GetContinueBundle4Src_001, TestSize.Level3)
{
DTEST_LOG << "BundleManagerInternalTest GetContinueBundle4Src_001 begin" << std::endl;
std::string srcBundleName;
std::vector<std::string> bundleNameList;
bool ret = BundleManagerInternal::GetContinueBundle4Src(srcBundleName, bundleNameList);
EXPECT_EQ(ret, false);
DTEST_LOG << "BundleManagerInternalTest GetContinueBundle4Src_001 end "<< std::endl;
}
/**
* @tc.name: GetAppProvisionInfo4CurrentUser_001
* @tc.desc: GetAppProvisionInfo4CurrentUser
* @tc.type: FUNC
*/
HWTEST_F(BundleManagerInternalTest, GetAppProvisionInfo4CurrentUser_001, TestSize.Level3)
{
DTEST_LOG << "BundleManagerInternalTest GetAppProvisionInfo4CurrentUser_001 begin" << std::endl;
std::string bundleName;
AppExecFwk::AppProvisionInfo appProvisionInfo;
bool ret = BundleManagerInternal::GetAppProvisionInfo4CurrentUser(bundleName, appProvisionInfo);
EXPECT_EQ(ret, false);
DTEST_LOG << "BundleManagerInternalTest GetAppProvisionInfo4CurrentUser_001 end "<< std::endl;
}
/**
* @tc.name: GetContinueType_001
* @tc.desc: GetContinueType
* @tc.type: FUNC
*/
HWTEST_F(BundleManagerInternalTest, GetContinueType_001, TestSize.Level3)
{
DTEST_LOG << "BundleManagerInternalTest GetContinueType_001 begin" << std::endl;
std::string networkId = "networkId";
std::string bundleName;
uint8_t continueTypeId = 0;
std::string str = BundleManagerInternal::GetContinueType(networkId, bundleName, continueTypeId);
EXPECT_EQ(str, "");
DTEST_LOG << "BundleManagerInternalTest GetContinueType_001 end "<< std::endl;
}
/**
* @tc.name: GetContinueTypeId_001
* @tc.desc: GetContinueTypeId
* @tc.type: FUNC
*/
HWTEST_F(BundleManagerInternalTest, GetContinueTypeId_001, TestSize.Level3)
{
DTEST_LOG << "BundleManagerInternalTest GetContinueTypeId_001 begin" << std::endl;
std::string networkId = "networkId";
std::string abilityName;
uint8_t continueTypeId = 0;
int32_t ret = BundleManagerInternal::GetContinueTypeId(networkId, abilityName, continueTypeId);
EXPECT_EQ(ret, CAN_NOT_FOUND_ABILITY_ERR);
DTEST_LOG << "BundleManagerInternalTest GetContinueTypeId_001 end "<< std::endl;
}
/**
* @tc.name: GetBundleNameById_001
* @tc.desc: GetBundleNameById
* @tc.type: FUNC
*/
HWTEST_F(BundleManagerInternalTest, GetBundleNameById_001, TestSize.Level3)
{
DTEST_LOG << "BundleManagerInternalTest GetBundleNameById_001 begin" << std::endl;
std::string networkId = "networkId";
std::string bundleName;
uint16_t bundleNameId = 0;
int32_t ret = BundleManagerInternal::GetBundleNameById(networkId, bundleNameId, bundleName);
EXPECT_EQ(ret, CAN_NOT_FOUND_ABILITY_ERR);
DTEST_LOG << "BundleManagerInternalTest GetBundleNameById_001 end "<< std::endl;
}
}
}
}

View File

@ -378,5 +378,64 @@ HWTEST_F(DSchedContinueManagerTest, HandleContinueEnd_001, TestSize.Level3)
EXPECT_EQ(DSchedContinueManager::GetInstance().cntSource_, 0);
DTEST_LOG << "DSchedContinueManagerTest HandleContinueEnd_001 end" << std::endl;
}
/**
* @tc.name: GetFirstBundleName_001
* @tc.desc: test GetFirstBundleName func
* @tc.type: FUNC
*/
HWTEST_F(DSchedContinueManagerTest, GetFirstBundleName_001, TestSize.Level3)
{
DTEST_LOG << "DSchedContinueManagerTest GetFirstBundleName_001 begin" << std::endl;
DSchedContinueInfo info(LOCAL_DEVICEID, "sourceBundleName", REMOTE_DEVICEID, "sinkBundleName",
"continueType");
std::string firstBundleName;
std::string bundleName;
std::string deviceId;
int32_t direction = 1;
int32_t subType;
const sptr<IRemoteObject> callback = nullptr;
const OHOS::AAFwk::WantParams wantParams;
DSchedContinueManager::GetInstance().CompleteBundleName(info, direction, subType);
direction = 0;
DSchedContinueManager::GetInstance().CompleteBundleName(info, direction, subType);
DSchedContinueManager::GetInstance().HandleContinueMissionWithBundleName(info, callback, wantParams);
bool ret = DSchedContinueManager::GetInstance().GetFirstBundleName(info, firstBundleName, bundleName, deviceId);
EXPECT_EQ(ret, false);
DTEST_LOG << "DSchedContinueManagerTest GetFirstBundleName_001 end" << std::endl;
}
/**
* @tc.name: GetDSchedContinueByWant_001
* @tc.desc: test GetDSchedContinueByWant func
* @tc.type: FUNC
*/
HWTEST_F(DSchedContinueManagerTest, GetDSchedContinueByWant_001, TestSize.Level3)
{
DTEST_LOG << "DSchedContinueManagerTest GetDSchedContinueByWant_001 begin" << std::endl;
OHOS::AAFwk::Want want;
int32_t missionId = 0;
DSchedContinueManager::GetInstance().continues_.clear();
auto ret = DSchedContinueManager::GetInstance().GetDSchedContinueByWant(want, missionId);
EXPECT_EQ(ret, nullptr);
DTEST_LOG << "DSchedContinueManagerTest GetDSchedContinueByWant_001 end" << std::endl;
}
/**
* @tc.name: NotifyTerminateContinuation_001
* @tc.desc: test NotifyTerminateContinuation func
* @tc.type: FUNC
*/
HWTEST_F(DSchedContinueManagerTest, NotifyTerminateContinuation_001, TestSize.Level3)
{
DTEST_LOG << "DSchedContinueManagerTest NotifyTerminateContinuation_001 begin" << std::endl;
int32_t missionId = 0;
int32_t sessionId = 0;
DSchedContinueManager::GetInstance().continues_.clear();
DSchedContinueManager::GetInstance().HandleDataRecv(sessionId, nullptr);
DSchedContinueManager::GetInstance().NotifyTerminateContinuation(missionId);
EXPECT_EQ(DSchedContinueManager::GetInstance().continues_.empty(), true);
DTEST_LOG << "DSchedContinueManagerTest NotifyTerminateContinuation_001 end" << std::endl;
}
}
}
}

View File

@ -18,6 +18,7 @@
#include "distributed_sched_service.h"
#include "dsched_continue.h"
#include "dtbschedmgr_log.h"
#include "softbus_error_code.h"
#include "test_log.h"
using namespace testing;
@ -28,6 +29,7 @@ namespace DistributedSchedule {
namespace {
const std::string BASEDIR = "/data/service/el1/public/database/DistributedSchedule";
const std::string BUNDLEMAME_1 = "bundleName";
const int32_t WAITTIME = 2000;
const uint32_t DSCHED_BUFFER_SIZE = 1024;
}
@ -1050,5 +1052,64 @@ HWTEST_F(DSchedContinueTest, UpdateStateTest_033_1, TestSize.Level0)
EXPECT_NE(nullptr, conti->stateMachine_);
DTEST_LOG << "DSchedContinueTest UpdateStateTest_033_1 end" << std::endl;
}
/**
* @tc.name: CheckStartPermission_034_1
* @tc.desc: CheckStartPermission
* @tc.type: FUNC
*/
HWTEST_F(DSchedContinueTest, CheckStartPermission_034_1, TestSize.Level0)
{
DTEST_LOG << "DSchedContinueTest CheckStartPermission_034_1 begin" << std::endl;
auto cmd = std::make_shared<DSchedContinueDataCmd>();
ASSERT_NE(nullptr, cmd);
cmd->srcBundleName_ = BUNDLEMAME_1;
cmd->dstBundleName_ = BUNDLEMAME_1;
std::string deviceId = "123";
std::string bundleName = "test";
int32_t subType = CONTINUE_PULL;
int32_t direction = CONTINUE_SINK;
sptr<IRemoteObject> callback = nullptr;
auto info = DSchedContinueInfo(deviceId, bundleName, deviceId, bundleName, "");
auto conti = std::make_shared<DSchedContinue>(subType, direction, callback, info);
conti->Init();
int32_t ret = conti->CheckStartPermission(cmd);
EXPECT_EQ(ret, INVALID_PARAMETERS_ERR);
cmd->srcBundleName_.clear();
ret = conti->CheckStartPermission(cmd);
EXPECT_EQ(ret, INVALID_PARAMETERS_ERR);
DTEST_LOG << "DSchedContinueTest CheckStartPermission_034_1 end" << std::endl;
}
/**
* @tc.name: ConvertToDmsSdkErr_035_1
* @tc.desc: ConvertToDmsSdkErr
* @tc.type: FUNC
*/
HWTEST_F(DSchedContinueTest, ConvertToDmsSdkErr_035_1, TestSize.Level0)
{
DTEST_LOG << "DSchedContinueTest ConvertToDmsSdkErr_035_1 begin" << std::endl;
auto cmd = std::make_shared<DSchedContinueDataCmd>();
ASSERT_NE(nullptr, cmd);
cmd->srcBundleName_ = BUNDLEMAME_1;
cmd->dstBundleName_ = BUNDLEMAME_1;
std::string deviceId = "123";
std::string bundleName = "test";
int32_t subType = CONTINUE_PULL;
int32_t direction = CONTINUE_SINK;
sptr<IRemoteObject> callback = nullptr;
auto info = DSchedContinueInfo(deviceId, bundleName, deviceId, bundleName, "");
auto conti = std::make_shared<DSchedContinue>(subType, direction, callback, info);
conti->Init();
int32_t ret = conti->ConvertToDmsSdkErr(0);
EXPECT_EQ(ret, ERR_OK);
ret = conti->ConvertToDmsSdkErr(SoftBusErrNo::SOFTBUS_CONN_PASSIVE_TYPE_AP_STA_CHIP_CONFLICT);
EXPECT_EQ(ret, DmsInterfaceSdkErr::ERR_BIND_REMOTE_HOTSPOT_ENABLE_STATE);
ret = conti->ConvertToDmsSdkErr(-1);
EXPECT_EQ(ret, DmsInterfaceSdkErr::ERR_DMS_WORK_ABNORMALLY);
DTEST_LOG << "DSchedContinueTest ConvertToDmsSdkErr_035_1 end" << std::endl;
}
}
}

View File

@ -1468,5 +1468,23 @@ HWTEST_F(DistributedSchedServiceSecondTest, StartAbility_001, TestSize.Level3)
EXPECT_NE(ret, ERR_OK);
DTEST_LOG << "DistributedSchedServiceSecondTest StartAbility_001 end" << std::endl;
}
/**
* @tc.name: CheckTargetPermission4DiffBundle_001
* @tc.desc: CheckTargetPermission4DiffBundle
* @tc.type: FUNC
*/
HWTEST_F(DistributedSchedServiceSecondTest, CheckTargetPermission4DiffBundle_001, TestSize.Level3)
{
DTEST_LOG << "DistributedSchedServiceSecondTest CheckTargetPermission4DiffBundle_001 start" << std::endl;
OHOS::AAFwk::Want want;
CallerInfo callerInfo;
AccountInfo accountInfo;
int32_t flag = 0;
int32_t ret = DistributedSchedService::GetInstance().CheckTargetPermission4DiffBundle(want,
callerInfo, accountInfo, flag, true);
EXPECT_EQ(ret, INVALID_PARAMETERS_ERR);
DTEST_LOG << "DistributedSchedServiceSecondTest CheckTargetPermission4DiffBundle_001 end" << std::endl;
}
}
}
}

View File

@ -564,5 +564,25 @@ HWTEST_F(DistributedBmStorageTest, DelDataOfLogoutDevTest_001, TestSize.Level1)
}
DTEST_LOG << "DistributedBmStorageTest DelDataOfLogoutDevTest_001 end" << std::endl;
}
/**
* @tc.name: GetDistributedBundleInfoTest_001
* @tc.desc: test GetDistributedBundleInfo
* @tc.type: FUNC
*/
HWTEST_F(DistributedBmStorageTest, GetDistributedBundleInfoTest_001, TestSize.Level1)
{
DTEST_LOG << "DistributedBmStorageTest GetDistributedBundleInfoTest_001 start" << std::endl;
auto distributedDataStorage = GetDmsBmStorage();
EXPECT_NE(distributedDataStorage, nullptr);
if (distributedDataStorage != nullptr) {
std::string networkId;
uint16_t bundleNameId = 0;
DmsBundleInfo distributeBundleInfo;
bool ret = dmsBmStorage_->GetDistributedBundleInfo(networkId, bundleNameId, distributeBundleInfo);
EXPECT_EQ(ret, false);
}
DTEST_LOG << "DistributedBmStorageTest GetDistributedBundleInfoTest_001 end" << std::endl;
}
} // namespace DistributedSchedule
} // namespace OHOS
} // namespace OHOS

View File

@ -878,5 +878,38 @@ HWTEST_F(DMSContinueManagerTest, testUpdateContinueLaunchMission_001, TestSize.L
EXPECT_TRUE(DMSContinueSendMgr::GetInstance().UpdateContinueLaunchMission(info));
DTEST_LOG << "DMSContinueManagerTest testUpdateContinueLaunchMission_001 end" << std::endl;
}
/**
* @tc.name: testGetFinalBundleName_001
* @tc.desc: test GetFinalBundleName
* @tc.type: FUNC
*/
HWTEST_F(DMSContinueManagerTest, testGetFinalBundleName_001, TestSize.Level1)
{
DTEST_LOG << "DMSContinueManagerTest testGetFinalBundleName_001 start" << std::endl;
DmsBundleInfo info;
std::string finalBundleName;
AppExecFwk::BundleInfo localBundleInfo;
std::string continueType;
bool ret = DMSContinueRecvMgr::GetInstance().GetFinalBundleName(info, finalBundleName,
localBundleInfo, continueType);
EXPECT_EQ(ret, false);
DTEST_LOG << "DMSContinueManagerTest testGetFinalBundleName_001 end" << std::endl;
}
/**
* @tc.name: testContinueTypeCheck_001
* @tc.desc: test ContinueTypeCheck
* @tc.type: FUNC
*/
HWTEST_F(DMSContinueManagerTest, testContinueTypeCheck_001, TestSize.Level1)
{
DTEST_LOG << "DMSContinueManagerTest testContinueTypeCheck_001 start" << std::endl;
AppExecFwk::BundleInfo localBundleInfo;
std::string continueType;
bool ret = DMSContinueRecvMgr::GetInstance().ContinueTypeCheck(localBundleInfo, continueType);
EXPECT_EQ(ret, false);
DTEST_LOG << "DMSContinueManagerTest testContinueTypeCheck_001 end" << std::endl;
}
} // namespace DistributedSchedule
} // namespace OHOS
} // namespace OHOS

View File

@ -409,23 +409,12 @@ HWTEST_F(DMSMissionManagerTest, testNeedSyncDevice002, TestSize.Level3)
HWTEST_F(DMSMissionManagerTest, testHasSyncListener001, TestSize.Level3)
{
DTEST_LOG << "testHasSyncListener001 begin" << std::endl;
DistributedSchedMissionManager::GetInstance().CleanMissionResources(DEVICE_ID);
bool ret = DistributedSchedMissionManager::GetInstance().HasSyncListener(DEVICE_ID);
EXPECT_FALSE(ret);
DTEST_LOG << "testHasSyncListener001 end" << std::endl;
}
/**
* @tc.name: testCleanMissionResources001
* @tc.desc: prepare and sync missions from remote
* @tc.type: FUNC
*/
HWTEST_F(DMSMissionManagerTest, testCleanMissionResources001, TestSize.Level3)
{
DTEST_LOG << "testCleanMissionResources001 begin" << std::endl;
DistributedSchedMissionManager::GetInstance().CleanMissionResources(DEVICE_ID);
DTEST_LOG << "testCleanMissionResources001 end" << std::endl;
}
/**
* @tc.name: testStopSyncRemoteMissions001
* @tc.desc: stop sync missions from remote with fake deviceId
@ -1149,35 +1138,12 @@ HWTEST_F(DMSMissionManagerTest, testDeviceOnlineNotify003, TestSize.Level3)
{
DTEST_LOG << "testDeviceOnlineNotify003 begin" << std::endl;
DistributedSchedMissionManager::GetInstance().Init();
DistributedSchedMissionManager::GetInstance().DeviceOnlineNotify("");
DistributedSchedMissionManager::GetInstance().DeviceOnlineNotify(DEVICE_ID);
EXPECT_NE(DistributedSchedMissionManager::GetInstance().missionHandler_, nullptr);
DTEST_LOG << "testDeviceOnlineNotify003 end" << std::endl;
}
/**
* @tc.name: testDeviceOfflineNotify001
* @tc.desc: test device offline notify
* @tc.type: FUNC
*/
HWTEST_F(DMSMissionManagerTest, testDeviceOfflineNotify001, TestSize.Level3)
{
DTEST_LOG << "testDeviceOfflineNotify001 begin" << std::endl;
DistributedSchedMissionManager::GetInstance().DeviceOfflineNotify("");
DTEST_LOG << "testDeviceOfflineNotify001 end" << std::endl;
}
/**
* @tc.name: testDeviceOfflineNotify002
* @tc.desc: test device offline notify
* @tc.type: FUNC
*/
HWTEST_F(DMSMissionManagerTest, testDeviceOfflineNotify002, TestSize.Level3)
{
DTEST_LOG << "testDeviceOfflineNotify002 begin" << std::endl;
std::set<std::string> remoteSyncDeviceSet_ = set<std::string>();
DistributedSchedMissionManager::GetInstance().DeviceOfflineNotify(DEVICE_ID);
DTEST_LOG << "testDeviceOfflineNotify002 end" << std::endl;
}
/**
* @tc.name: testOnRemoteDied001
* @tc.desc: test on remote died
@ -1186,22 +1152,18 @@ HWTEST_F(DMSMissionManagerTest, testDeviceOfflineNotify002, TestSize.Level3)
HWTEST_F(DMSMissionManagerTest, testOnRemoteDied001, TestSize.Level3)
{
DTEST_LOG << "testOnRemoteDied001 begin" << std::endl;
//DeviceOfflineNotify
DistributedSchedMissionManager::GetInstance().DeviceOfflineNotify("");
std::set<std::string> remoteSyncDeviceSet_ = set<std::string>();
DistributedSchedMissionManager::GetInstance().DeviceOfflineNotify(DEVICE_ID);
//OnRemoteDied
wptr<IRemoteObject> remote = nullptr;
DistributedSchedMissionManager::GetInstance().OnRemoteDied(remote);
DTEST_LOG << "testOnRemoteDied001 end" << std::endl;
}
/**
* @tc.name: testOnRemoteDied002
* @tc.desc: test on remote died
* @tc.type: FUNC
*/
HWTEST_F(DMSMissionManagerTest, testOnRemoteDied002, TestSize.Level3)
{
DTEST_LOG << "testOnRemoteDied002 begin" << std::endl;
wptr<IRemoteObject> remote = new RemoteMissionListenerTest();
remote = new RemoteMissionListenerTest();
DistributedSchedMissionManager::GetInstance().OnRemoteDied(remote);
DTEST_LOG << "testOnRemoteDied002 end" << std::endl;
EXPECT_NE(remote.promote(), nullptr);
DTEST_LOG << "testOnRemoteDied001 end" << std::endl;
}
/**
@ -1230,26 +1192,13 @@ HWTEST_F(DMSMissionManagerTest, testStartSyncMissionsFromRemote001, TestSize.Lev
HWTEST_F(DMSMissionManagerTest, testStopSyncMissionsFromRemote001, TestSize.Level3)
{
DTEST_LOG << "testStopSyncMissionsFromRemote001 begin" << std::endl;
std::vector<DstbMissionInfo> missionInfos;
CallerInfo callerInfo;
DistributedSchedMissionManager::GetInstance().Init();
DistributedSchedMissionManager::GetInstance().StopSyncMissionsFromRemote("");
DTEST_LOG << "testStopSyncMissionsFromRemote001 end" << std::endl;
}
/**
* @tc.name: testStopSyncMissionsFromRemote002
* @tc.desc: stop sync missions from remote
* @tc.type: FUNC
*/
HWTEST_F(DMSMissionManagerTest, testStopSyncMissionsFromRemote002, TestSize.Level3)
{
DTEST_LOG << "testStopSyncMissionsFromRemote002 begin" << std::endl;
std::vector<DstbMissionInfo> missionInfos;
CallerInfo callerInfo;
DistributedSchedMissionManager::GetInstance().Init();
DistributedSchedMissionManager::GetInstance().remoteSyncDeviceSet_.clear();
DistributedSchedMissionManager::GetInstance().remoteSyncDeviceSet_.insert(DEVICE_ID);
DistributedSchedMissionManager::GetInstance().StopSyncMissionsFromRemote(DEVICE_ID);
DTEST_LOG << "testStopSyncMissionsFromRemote002 end" << std::endl;
EXPECT_EQ(DistributedSchedMissionManager::GetInstance().remoteSyncDeviceSet_.empty(), true);
DTEST_LOG << "testStopSyncMissionsFromRemote001 end" << std::endl;
}
/**
@ -1305,6 +1254,7 @@ HWTEST_F(DMSMissionManagerTest, testNotifyLocalMissionsChanged001, TestSize.Leve
DTEST_LOG << "testNotifyLocalMissionsChanged001 begin" << std::endl;
DistributedSchedMissionManager::GetInstance().Init();
DistributedSchedMissionManager::GetInstance().NotifyLocalMissionsChanged();
EXPECT_NE(DistributedSchedMissionManager::GetInstance().missionChangeHandler_, nullptr);
DTEST_LOG << "testNotifyLocalMissionsChanged001 end" << std::endl;
}
@ -1316,8 +1266,11 @@ HWTEST_F(DMSMissionManagerTest, testNotifyLocalMissionsChanged001, TestSize.Leve
HWTEST_F(DMSMissionManagerTest, testNotifyMissionSnapshotCreated001, TestSize.Level3)
{
DTEST_LOG << "testNotifyMissionSnapshotCreated001 begin" << std::endl;
DistributedSchedMissionManager::GetInstance().missionChangeHandler_ = nullptr;
DistributedSchedMissionManager::GetInstance().NotifyMissionSnapshotCreated(1);
DistributedSchedMissionManager::GetInstance().Init();
DistributedSchedMissionManager::GetInstance().NotifyMissionSnapshotCreated(1);
EXPECT_NE(DistributedSchedMissionManager::GetInstance().missionChangeHandler_, nullptr);
DTEST_LOG << "testNotifyMissionSnapshotCreated001 end" << std::endl;
}
@ -1331,6 +1284,7 @@ HWTEST_F(DMSMissionManagerTest, testNotifyMissionSnapshotChanged001, TestSize.Le
DTEST_LOG << "testNotifyMissionSnapshotChanged001 begin" << std::endl;
DistributedSchedMissionManager::GetInstance().Init();
DistributedSchedMissionManager::GetInstance().NotifyMissionSnapshotChanged(1);
EXPECT_NE(DistributedSchedMissionManager::GetInstance().missionChangeHandler_, nullptr);
DTEST_LOG << "testNotifyMissionSnapshotChanged001 end" << std::endl;
}
@ -1344,6 +1298,7 @@ HWTEST_F(DMSMissionManagerTest, testNotifyMissionSnapshotDestroyed001, TestSize.
DTEST_LOG << "testNotifyMissionSnapshotDestroyed001 begin" << std::endl;
DistributedSchedMissionManager::GetInstance().Init();
DistributedSchedMissionManager::GetInstance().NotifyMissionSnapshotDestroyed(1);
EXPECT_NE(DistributedSchedMissionManager::GetInstance().missionChangeHandler_, nullptr);
DTEST_LOG << "testNotifyMissionSnapshotDestroyed001 end" << std::endl;
}
@ -1361,35 +1316,6 @@ HWTEST_F(DMSMissionManagerTest, testNotifyMissionsChangedToRemote001, TestSize.L
DTEST_LOG << "testNotifyMissionsChangedToRemote001 end" << std::endl;
}
/**
* @tc.name: testNotifyMissionsChangedToRemoteInner001
* @tc.desc: notify missions changed to remote inner
* @tc.type: FUNC
*/
HWTEST_F(DMSMissionManagerTest, testNotifyMissionsChangedToRemoteInner001, TestSize.Level3)
{
DTEST_LOG << "testNotifyMissionsChangedToRemoteInner001 begin" << std::endl;
CallerInfo callerInfo;
std::vector<DstbMissionInfo> missionInfos;
DistributedSchedMissionManager::GetInstance().NotifyMissionsChangedToRemoteInner("", missionInfos, callerInfo);
DTEST_LOG << "testNotifyMissionsChangedToRemoteInner001 end" << std::endl;
}
/**
* @tc.name: testNotifyMissionsChangedToRemoteInner002
* @tc.desc: notify missions changed to remote inner
* @tc.type: FUNC
*/
HWTEST_F(DMSMissionManagerTest, testNotifyMissionsChangedToRemoteInner002, TestSize.Level3)
{
DTEST_LOG << "testNotifyMissionsChangedToRemoteInner002 begin" << std::endl;
CallerInfo callerInfo;
std::vector<DstbMissionInfo> missionInfos;
DistributedSchedMissionManager::GetInstance().NotifyMissionsChangedToRemoteInner(
DEVICE_ID, missionInfos, callerInfo);
DTEST_LOG << "testNotifyMissionsChangedToRemoteInner002 end" << std::endl;
}
/**
* @tc.name: testOnRemoteDmsDied001
* @tc.desc: on remote dms died
@ -1398,102 +1324,24 @@ HWTEST_F(DMSMissionManagerTest, testNotifyMissionsChangedToRemoteInner002, TestS
HWTEST_F(DMSMissionManagerTest, testOnRemoteDmsDied001, TestSize.Level3)
{
DTEST_LOG << "testOnRemoteDmsDied001 begin" << std::endl;
//NotifyMissionsChangedToRemoteInner
CallerInfo callerInfo;
std::vector<DstbMissionInfo> missionInfos;
DistributedSchedMissionManager::GetInstance().NotifyMissionsChangedToRemoteInner("", missionInfos, callerInfo);
DistributedSchedMissionManager::GetInstance().NotifyMissionsChangedToRemoteInner(
DEVICE_ID, missionInfos, callerInfo);
wptr<IRemoteObject> remote = nullptr;
DistributedSchedMissionManager::GetInstance().OnRemoteDmsDied(remote);
remote = wptr<IRemoteObject>();
DistributedSchedMissionManager::GetInstance().OnRemoteDmsDied(remote);
DistributedSchedMissionManager::GetInstance().missionHandler_ = nullptr;
DistributedSchedMissionManager::GetInstance().OnRemoteDmsDied(remote);
EXPECT_EQ(DistributedSchedMissionManager::GetInstance().missionHandler_, nullptr);
DTEST_LOG << "testOnRemoteDmsDied001 end" << std::endl;
}
/**
* @tc.name: testOnRemoteDmsDied002
* @tc.desc: on remote dms died
* @tc.type: FUNC
*/
HWTEST_F(DMSMissionManagerTest, testOnRemoteDmsDied002, TestSize.Level3)
{
DTEST_LOG << "testOnRemoteDmsDied002 begin" << std::endl;
wptr<IRemoteObject> remote = wptr<IRemoteObject>();
DistributedSchedMissionManager::GetInstance().OnRemoteDmsDied(remote);
DTEST_LOG << "testOnRemoteDmsDied002 end" << std::endl;
}
/**
* @tc.name: testRetryStartSyncRemoteMissions001
* @tc.desc: retry start sync remote missions
* @tc.type: FUNC
*/
HWTEST_F(DMSMissionManagerTest, testRetryStartSyncRemoteMissions001, TestSize.Level3)
{
DTEST_LOG << "testRetryStartSyncRemoteMissions001 begin" << std::endl;
DistributedSchedMissionManager::GetInstance().Init();
DistributedSchedMissionManager::GetInstance().RetryStartSyncRemoteMissions("", localDeviceId_, 1);
DTEST_LOG << "testRetryStartSyncRemoteMissions001 end" << std::endl;
}
/**
* @tc.name: testRetryStartSyncRemoteMissions002
* @tc.desc: retry start sync remote missions
* @tc.type: FUNC
*/
HWTEST_F(DMSMissionManagerTest, testRetryStartSyncRemoteMissions002, TestSize.Level3)
{
DTEST_LOG << "testRetryStartSyncRemoteMissions002 begin" << std::endl;
DistributedSchedMissionManager::GetInstance().Init();
DistributedSchedMissionManager::GetInstance().RetryStartSyncRemoteMissions(DEVICE_ID, localDeviceId_, 1);
DTEST_LOG << "testRetryStartSyncRemoteMissions002 end" << std::endl;
}
/**
* @tc.name: testOnMissionListenerDied001
* @tc.desc: on mission listener died
* @tc.type: FUNC
*/
HWTEST_F(DMSMissionManagerTest, testOnMissionListenerDied001, TestSize.Level3)
{
DTEST_LOG << "testOnMissionListenerDied001 begin" << std::endl;
sptr<IRemoteObject> remote = nullptr;
DistributedSchedMissionManager::GetInstance().OnMissionListenerDied(remote);
DTEST_LOG << "testOnMissionListenerDied001 end" << std::endl;
}
/**
* @tc.name: testOnMissionListenerDied002
* @tc.desc: on mission listener died
* @tc.type: FUNC
*/
HWTEST_F(DMSMissionManagerTest, testOnMissionListenerDied002, TestSize.Level3)
{
DTEST_LOG << "testOnMissionListenerDied002 begin" << std::endl;
sptr<IRemoteObject> remote = sptr<IRemoteObject>();
DistributedSchedMissionManager::GetInstance().OnMissionListenerDied(remote);
DTEST_LOG << "testOnMissionListenerDied002 end" << std::endl;
}
/**
* @tc.name: testOnRemoteDmsDied003
* @tc.desc: on remote dms died
* @tc.type: FUNC
*/
HWTEST_F(DMSMissionManagerTest, testOnRemoteDmsDied003, TestSize.Level3)
{
DTEST_LOG << "testOnRemoteDmsDied003 begin" << std::endl;
sptr<IRemoteObject> remote = nullptr;
DistributedSchedMissionManager::GetInstance().OnRemoteDmsDied(remote);
DTEST_LOG << "testOnRemoteDmsDied003 end" << std::endl;
}
/**
* @tc.name: testOnRemoteDmsDied004
* @tc.desc: on remote dms died
* @tc.type: FUNC
*/
HWTEST_F(DMSMissionManagerTest, testOnRemoteDmsDied004, TestSize.Level3)
{
DTEST_LOG << "testOnRemoteDmsDied004 begin" << std::endl;
sptr<IRemoteObject> remote = sptr<IRemoteObject>();
DistributedSchedMissionManager::GetInstance().OnRemoteDmsDied(remote);
DTEST_LOG << "testOnRemoteDmsDied004 end" << std::endl;
}
/**
* @tc.name: testRetryRegisterMissionChange001
* @tc.desc: retry register mission change
@ -1502,8 +1350,21 @@ HWTEST_F(DMSMissionManagerTest, testOnRemoteDmsDied004, TestSize.Level3)
HWTEST_F(DMSMissionManagerTest, testRetryRegisterMissionChange001, TestSize.Level3)
{
DTEST_LOG << "testRetryRegisterMissionChange001 begin" << std::endl;
//RetryStartSyncRemoteMissions
DistributedSchedMissionManager::GetInstance().Init();
DistributedSchedMissionManager::GetInstance().RetryStartSyncRemoteMissions("", localDeviceId_, 1);
DistributedSchedMissionManager::GetInstance().RetryStartSyncRemoteMissions(DEVICE_ID, localDeviceId_, 1);
//OnMissionListenerDied
sptr<IRemoteObject> remote = nullptr;
DistributedSchedMissionManager::GetInstance().OnMissionListenerDied(remote);
remote = sptr<IRemoteObject>();
DistributedSchedMissionManager::GetInstance().OnMissionListenerDied(remote);
//RetryRegisterMissionChange
DistributedSchedMissionManager::GetInstance().RetryRegisterMissionChange(1);
EXPECT_NE(DistributedSchedMissionManager::GetInstance().missionHandler_, nullptr);
DTEST_LOG << "testRetryRegisterMissionChange001 end" << std::endl;
}
@ -1523,19 +1384,6 @@ HWTEST_F(DMSMissionManagerTest, testMissionSnapshotChanged001, TestSize.Level3)
DTEST_LOG << "testMissionSnapshotChanged001 end" << std::endl;
}
/**
* @tc.name: testOnDnetDied001
* @tc.desc: on dnet died
* @tc.type: FUNC
*/
HWTEST_F(DMSMissionManagerTest, testOnDnetDied001, TestSize.Level3)
{
DTEST_LOG << "testOnDnetDied001 begin" << std::endl;
DistributedSchedMissionManager::GetInstance().Init();
DistributedSchedMissionManager::GetInstance().OnDnetDied();
DTEST_LOG << "testOnDnetDied001 end" << std::endl;
}
/**
* @tc.name: ProxyCallStopSyncMissionsFromRemote001
* @tc.desc: call dms proxy StopSyncMissionsFromRemote
@ -1545,6 +1393,13 @@ HWTEST_F(DMSMissionManagerTest, testOnDnetDied001, TestSize.Level3)
HWTEST_F(DMSMissionManagerTest, ProxyCallStopSyncMissionsFromRemote001, TestSize.Level3)
{
DTEST_LOG << "DistributedSchedServiceTest ProxyCallStopSyncMissionsFromRemote001 start" << std::endl;
//OnDnetDied
DistributedSchedMissionManager::GetInstance().Init();
DistributedSchedMissionManager::GetInstance().OnDnetDied();
DistributedSchedMissionManager::GetInstance().isRegMissionChange_ = false;
DistributedSchedMissionManager::GetInstance().OnDnetDied();
//proxy StopSyncMissionsFromRemote
sptr<IDistributedSched> proxy = GetDms();
ASSERT_NE(nullptr, proxy);
CallerInfo callerInfo;
@ -2120,6 +1975,7 @@ HWTEST_F(DMSMissionManagerTest, testDeviceOfflineNotify003, TestSize.Level3)
DistributedSchedMissionManager::GetInstance().remoteDmsMap_[DEVICE_ID] = remoteDmsObj;
}
DistributedSchedMissionManager::GetInstance().DeviceOfflineNotify(DEVICE_ID);
EXPECT_EQ(DistributedSchedMissionManager::GetInstance().remoteDmsMap_.empty(), true);
DTEST_LOG << "testDeviceOfflineNotify003 end" << std::endl;
}
@ -2374,6 +2230,7 @@ HWTEST_F(DMSMissionManagerTest, testCleanMissionResources002, TestSize.Level3)
DistributedSchedMissionManager::GetInstance().listenDeviceMap_[deviceId] = listenerInfo;
}
DistributedSchedMissionManager::GetInstance().CleanMissionResources(DEVICE_ID);
EXPECT_EQ(DistributedSchedMissionManager::GetInstance().listenDeviceMap_.empty(), true);
DTEST_LOG << "testCleanMissionResources002 end" << std::endl;
}
@ -2482,26 +2339,11 @@ HWTEST_F(DMSMissionManagerTest, testStartSyncMissionsFromRemote003, TestSize.Lev
DistributedSchedMissionManager::GetInstance().GenerateCallerInfo(callerInfo);
DistributedSchedMissionManager::GetInstance().isRegMissionChange_ = false;
auto ret = DistributedSchedMissionManager::GetInstance().StartSyncMissionsFromRemote(callerInfo, missionInfos);
DistributedSchedMissionManager::GetInstance().StopSyncMissionsFromRemote(DEVICE_ID);
EXPECT_EQ(ret, ERR_NONE);
DTEST_LOG << "testStartSyncMissionsFromRemote003 end" << std::endl;
}
/**
* @tc.name: testStopSyncMissionsFromRemote003
* @tc.desc: stop sync missions from remote
* @tc.type: FUNC
*/
HWTEST_F(DMSMissionManagerTest, testStopSyncMissionsFromRemote003, TestSize.Level3)
{
DTEST_LOG << "testStopSyncMissionsFromRemote003 begin" << std::endl;
std::vector<DstbMissionInfo> missionInfos;
auto runner = AppExecFwk::EventRunner::Create("MissionManagerHandler");
DistributedSchedMissionManager::GetInstance().missionHandler_ = std::make_shared<AppExecFwk::EventHandler>(runner);
DistributedSchedMissionManager::GetInstance().missonChangeListener_ = nullptr;
DistributedSchedMissionManager::GetInstance().StopSyncMissionsFromRemote(DEVICE_ID);
DTEST_LOG << "testStopSyncMissionsFromRemote003 end" << std::endl;
}
/**
* @tc.name: testNeedSyncDevice003
* @tc.desc: need sync device
@ -2606,20 +2448,6 @@ HWTEST_F(DMSMissionManagerTest, testHasSyncListener002, TestSize.Level3)
DTEST_LOG << "testHasSyncListener002 end" << std::endl;
}
/**
* @tc.name: testOnRemoteDied003
* @tc.desc: test on remote died
* @tc.type: FUNC
*/
HWTEST_F(DMSMissionManagerTest, testOnRemoteDied003, TestSize.Level3)
{
DTEST_LOG << "testOnRemoteDied003 begin" << std::endl;
wptr<IRemoteObject> remote = new RemoteMissionListenerTest();
DistributedSchedMissionManager::GetInstance().missionHandler_ = nullptr;
DistributedSchedMissionManager::GetInstance().OnRemoteDied(remote);
DTEST_LOG << "testOnRemoteDied003 end" << std::endl;
}
/**
* @tc.name: testDequeueCachedSnapshotInfo003
* @tc.desc: enqueue cached snapshot info
@ -2721,37 +2549,6 @@ HWTEST_F(DMSMissionManagerTest, testNotifyMissionsChangedFromRemote003, TestSize
DTEST_LOG << "testNotifyMissionsChangedFromRemote003 end" << std::endl;
}
/**
* @tc.name: testNotifyMissionSnapshotCreated002
* @tc.desc: notify mission snapshot created
* @tc.type: FUNC
*/
HWTEST_F(DMSMissionManagerTest, testNotifyMissionSnapshotCreated002, TestSize.Level3)
{
DTEST_LOG << "testNotifyMissionSnapshotCreated002 begin" << std::endl;
auto missionChangeRunner = AppExecFwk::EventRunner::Create("DistributedMissionChange");
DistributedSchedMissionManager::GetInstance().missionChangeHandler_ =
std::make_shared<AppExecFwk::EventHandler>(missionChangeRunner);
DistributedSchedMissionManager::GetInstance().NotifyMissionSnapshotCreated(1);
DTEST_LOG << "testNotifyMissionSnapshotCreated002 end" << std::endl;
}
/**
* @tc.name: testNotifyMissionSnapshotCreated003
* @tc.desc: notify mission snapshot created
* @tc.type: FUNC
*/
HWTEST_F(DMSMissionManagerTest, testNotifyMissionSnapshotCreated003, TestSize.Level3)
{
DTEST_LOG << "testNotifyMissionSnapshotCreated003 begin" << std::endl;
auto missionChangeRunner = AppExecFwk::EventRunner::Create("DistributedMissionChange");
DistributedSchedMissionManager::GetInstance().missionChangeHandler_ =
std::make_shared<AppExecFwk::EventHandler>(missionChangeRunner);
DistributedSchedMissionManager::GetInstance().distributedDataStorage_ = nullptr;
DistributedSchedMissionManager::GetInstance().NotifyMissionSnapshotCreated(1);
DTEST_LOG << "testNotifyMissionSnapshotCreated003 end" << std::endl;
}
/**
* @tc.name: testNotifyMissionsChangedToRemote002
* @tc.desc: notify missions changed to remote
@ -2812,31 +2609,6 @@ HWTEST_F(DMSMissionManagerTest, testNotifyMissionsChangedToRemote003, TestSize.L
DTEST_LOG << "testNotifyMissionsChangedToRemote003 end" << std::endl;
}
/**
* @tc.name: testNotifyMissionsChangedToRemoteInner003
* @tc.desc: notify missions changed to remote inner
* @tc.type: FUNC
*/
HWTEST_F(DMSMissionManagerTest, testNotifyMissionsChangedToRemoteInner003, TestSize.Level3)
{
DTEST_LOG << "testNotifyMissionsChangedToRemoteInner003 begin" << std::endl;
sptr<IDistributedSched> proxy = GetDms();
ASSERT_NE(nullptr, proxy);
{
std::lock_guard<std::mutex> autoLock(DistributedSchedMissionManager::GetInstance().remoteDmsLock_);
DistributedSchedMissionManager::GetInstance().remoteDmsMap_.clear();
}
{
std::lock_guard<std::mutex> autoLock(DistributedSchedMissionManager::GetInstance().remoteDmsLock_);
DistributedSchedMissionManager::GetInstance().remoteDmsMap_[DEVICE_ID] = proxy;
}
CallerInfo callerInfo;
std::vector<DstbMissionInfo> missionInfos;
DistributedSchedMissionManager::GetInstance().NotifyMissionsChangedToRemoteInner(
DEVICE_ID, missionInfos, callerInfo);
DTEST_LOG << "testNotifyMissionsChangedToRemoteInner003 end" << std::endl;
}
/**
* @tc.name: testFetchDeviceHandler003
* @tc.desc: fetch device handler
@ -2936,49 +2708,6 @@ HWTEST_F(DMSMissionManagerTest, testFetchDeviceHandler005, TestSize.Level3)
DTEST_LOG << "testFetchDeviceHandler005 end" << std::endl;
}
/**
* @tc.name: testOnRemoteDmsDied009
* @tc.desc: on remote dms died
* @tc.type: FUNC
*/
HWTEST_F(DMSMissionManagerTest, testOnRemoteDmsDied009, TestSize.Level3)
{
DTEST_LOG << "testOnRemoteDmsDied009 begin" << std::endl;
wptr<IRemoteObject> remote = new RemoteMissionListenerTest();
DistributedSchedMissionManager::GetInstance().missionHandler_ = nullptr;
DistributedSchedMissionManager::GetInstance().OnRemoteDmsDied(remote);
DTEST_LOG << "testOnRemoteDmsDied009 end" << std::endl;
}
/**
* @tc.name: testOnRemoteDmsDied005
* @tc.desc: on remote dms died
* @tc.type: FUNC
*/
HWTEST_F(DMSMissionManagerTest, testOnRemoteDmsDied005, TestSize.Level3)
{
DTEST_LOG << "testOnRemoteDmsDied005 begin" << std::endl;
wptr<IRemoteObject> remote = new RemoteMissionListenerTest();
auto runner = AppExecFwk::EventRunner::Create("MissionManagerHandler");
DistributedSchedMissionManager::GetInstance().missionHandler_ = std::make_shared<AppExecFwk::EventHandler>(runner);
DistributedSchedMissionManager::GetInstance().OnRemoteDmsDied(remote);
DTEST_LOG << "testOnRemoteDmsDied005 end" << std::endl;
}
/**
* @tc.name: testRetryStartSyncRemoteMissions003
* @tc.desc: retry start sync remote missions
* @tc.type: FUNC
*/
HWTEST_F(DMSMissionManagerTest, testRetryStartSyncRemoteMissions003, TestSize.Level3)
{
DTEST_LOG << "testRetryStartSyncRemoteMissions003 begin" << std::endl;
auto runner = AppExecFwk::EventRunner::Create("MissionManagerHandler");
DistributedSchedMissionManager::GetInstance().missionHandler_ = std::make_shared<AppExecFwk::EventHandler>(runner);
DistributedSchedMissionManager::GetInstance().RetryStartSyncRemoteMissions(DEVICE_ID, localDeviceId_, 1);
DTEST_LOG << "testRetryStartSyncRemoteMissions003 end" << std::endl;
}
/**
* @tc.name: testRetryStartSyncRemoteMissions004
* @tc.desc: retry start sync remote missions
@ -3003,6 +2732,7 @@ HWTEST_F(DMSMissionManagerTest, testRetryStartSyncRemoteMissions004, TestSize.Le
DistributedSchedMissionManager::GetInstance().listenDeviceMap_[deviceId] = listenerInfo;
}
DistributedSchedMissionManager::GetInstance().RetryStartSyncRemoteMissions(DEVICE_ID, localDeviceId_, 1);
EXPECT_NE(DistributedSchedMissionManager::GetInstance().missionHandler_, nullptr);
DTEST_LOG << "testRetryStartSyncRemoteMissions004 end" << std::endl;
}
@ -3040,6 +2770,7 @@ HWTEST_F(DMSMissionManagerTest, testRetryStartSyncRemoteMissions005, TestSize.Le
DistributedSchedMissionManager::GetInstance().remoteDmsMap_[DEVICE_ID] = proxy;
}
DistributedSchedMissionManager::GetInstance().RetryStartSyncRemoteMissions(DEVICE_ID, localDeviceId_, 1);
EXPECT_NE(DistributedSchedMissionManager::GetInstance().missionHandler_, nullptr);
DTEST_LOG << "testRetryStartSyncRemoteMissions005 end" << std::endl;
}
@ -3065,6 +2796,7 @@ HWTEST_F(DMSMissionManagerTest, testOnMissionListenerDied003, TestSize.Level3)
DistributedSchedMissionManager::GetInstance().listenDeviceMap_[deviceId] = listenerInfo;
}
DistributedSchedMissionManager::GetInstance().OnMissionListenerDied(listener);
EXPECT_EQ(DistributedSchedMissionManager::GetInstance().listenDeviceMap_.empty(), true);
DTEST_LOG << "testOnMissionListenerDied003 end" << std::endl;
}
@ -3092,6 +2824,7 @@ HWTEST_F(DMSMissionManagerTest, testOnMissionListenerDied004, TestSize.Level3)
DistributedSchedMissionManager::GetInstance().listenDeviceMap_[deviceId] = listenerInfo;
}
DistributedSchedMissionManager::GetInstance().OnMissionListenerDied(listener);
EXPECT_EQ(DistributedSchedMissionManager::GetInstance().listenDeviceMap_.empty(), false);
DTEST_LOG << "testOnMissionListenerDied004 end" << std::endl;
}
@ -3117,6 +2850,7 @@ HWTEST_F(DMSMissionManagerTest, testOnMissionListenerDied005, TestSize.Level3)
DistributedSchedMissionManager::GetInstance().listenDeviceMap_[deviceId] = listenerInfo;
}
DistributedSchedMissionManager::GetInstance().OnMissionListenerDied(listener);
EXPECT_EQ(DistributedSchedMissionManager::GetInstance().listenDeviceMap_.empty(), true);
DTEST_LOG << "testOnMissionListenerDied005 end" << std::endl;
}
@ -3141,6 +2875,7 @@ HWTEST_F(DMSMissionManagerTest, testOnRemoteDmsDied006, TestSize.Level3)
DistributedSchedMissionManager::GetInstance().remoteDmsMap_[DEVICE_ID] = remoteDmsObj;
}
DistributedSchedMissionManager::GetInstance().OnRemoteDmsDied(remote);
EXPECT_EQ(DistributedSchedMissionManager::GetInstance().listenDeviceMap_.empty(), true);
DTEST_LOG << "testOnRemoteDmsDied006 end" << std::endl;
}
@ -3166,6 +2901,7 @@ HWTEST_F(DMSMissionManagerTest, testOnRemoteDmsDied007, TestSize.Level3)
DistributedSchedMissionManager::GetInstance().remoteDmsMap_[DEVICE_ID] = proxy;
}
DistributedSchedMissionManager::GetInstance().OnRemoteDmsDied(remote);
EXPECT_EQ(DistributedSchedMissionManager::GetInstance().listenDeviceMap_.empty(), true);
DTEST_LOG << "testOnRemoteDmsDied007 end" << std::endl;
}
@ -3202,36 +2938,8 @@ HWTEST_F(DMSMissionManagerTest, testOnRemoteDmsDied008, TestSize.Level3)
DistributedSchedMissionManager::GetInstance().listenDeviceMap_[deviceId] = listenerInfo;
}
DistributedSchedMissionManager::GetInstance().OnRemoteDmsDied(remote);
EXPECT_EQ(DistributedSchedMissionManager::GetInstance().listenDeviceMap_.empty(), false);
DTEST_LOG << "testOnRemoteDmsDied008 end" << std::endl;
}
/**
* @tc.name: testRetryRegisterMissionChange002
* @tc.desc: retry register mission change
* @tc.type: FUNC
*/
HWTEST_F(DMSMissionManagerTest, testRetryRegisterMissionChange002, TestSize.Level3)
{
DTEST_LOG << "testRetryRegisterMissionChange002 begin" << std::endl;
auto runner = AppExecFwk::EventRunner::Create("MissionManagerHandler");
DistributedSchedMissionManager::GetInstance().missionHandler_ = std::make_shared<AppExecFwk::EventHandler>(runner);
DistributedSchedMissionManager::GetInstance().RetryRegisterMissionChange(1);
DTEST_LOG << "testRetryRegisterMissionChange002 end" << std::endl;
}
/**
* @tc.name: testOnDnetDied002
* @tc.desc: on dnet died
* @tc.type: FUNC
*/
HWTEST_F(DMSMissionManagerTest, testOnDnetDied002, TestSize.Level3)
{
DTEST_LOG << "testOnDnetDied002 begin" << std::endl;
auto runner = AppExecFwk::EventRunner::Create("MissionManagerHandler");
DistributedSchedMissionManager::GetInstance().missionHandler_ = std::make_shared<AppExecFwk::EventHandler>(runner);
DistributedSchedMissionManager::GetInstance().isRegMissionChange_ = false;
DistributedSchedMissionManager::GetInstance().OnDnetDied();
DTEST_LOG << "testOnDnetDied002 end" << std::endl;
}
} // namespace DistributedSchedule
} // namespace OHOS
} // namespace OHOS