add dms UT

Signed-off-by: c30051536 <chenbin179@huawei.com>
This commit is contained in:
c30051536 2024-07-30 22:38:13 +08:00
parent efd44053df
commit aa190a93b4
2 changed files with 198 additions and 33 deletions

View File

@ -29,6 +29,7 @@ namespace DistributedSchedule {
namespace {
const std::string BASEDIR = "/data/service/el1/public/database/DistributedSchedule";
const int32_t WAITTIME = 2000;
const uint32_t DSCHED_BUFFER_SIZE = 1024;
}
void DSchedContinueTest::SetUpTestCase()
{
@ -157,6 +158,10 @@ HWTEST_F(DSchedContinueTest, DSchedContinueTest_003_1, TestSize.Level0)
cmd->replyCmd_ = DSCHED_CONTINUE_INVALID_EVENT;
ret = conti->PostReplyTask(cmd);
EXPECT_EQ(ret, ERR_OK);
cmd = nullptr;
ret = conti->PostReplyTask(cmd);
EXPECT_EQ(ret, INVALID_PARAMETERS_ERR);
DTEST_LOG << "DSchedContinueTest DSchedContinueTest_003_1 end ret:" << ret << std::endl;
usleep(WAITTIME);
}
@ -198,6 +203,9 @@ HWTEST_F(DSchedContinueTest, DSchedContinueTest_004_1, TestSize.Level0)
ret = conti->PostContinueSendTask(want, callerUid, status, accessToken);
EXPECT_EQ(ret, ERR_OK);
status = ERR_NONE;
ret = conti->PostContinueSendTask(want, callerUid, status, accessToken);
EXPECT_EQ(ret, ERR_OK);
DTEST_LOG << "DSchedContinueTest DSchedContinueTest_004_1 end ret:" << ret << std::endl;
usleep(WAITTIME);
}
@ -280,6 +288,10 @@ HWTEST_F(DSchedContinueTest, DSchedContinueTest_006_1, TestSize.Level0)
conti->Init();
ret = conti->PostNotifyCompleteTask(ERR_OK);
EXPECT_EQ(ret, ERR_OK);
cmd = nullptr;
ret = conti->OnContinueEndCmd(cmd);
EXPECT_EQ(ret, INVALID_PARAMETERS_ERR);
DTEST_LOG << "DSchedContinueTest DSchedContinueTest_006_1 end ret:" << ret << std::endl;
usleep(WAITTIME);
}
@ -363,6 +375,14 @@ HWTEST_F(DSchedContinueTest, DSchedContinueTest_009_1, TestSize.Level0)
int32_t ret = conti->PackStartCmd(cmd, wantParams);
EXPECT_EQ(ret, ERR_OK);
wantParams = nullptr;
ret = conti->PackStartCmd(cmd, wantParams);
EXPECT_EQ(ret, INVALID_PARAMETERS_ERR);
wantParams = std::make_shared<DistributedWantParams>();
conti->continueInfo_.missionId_ = 0;
EXPECT_NE(ret, ERR_OK);
DTEST_LOG << "DSchedContinueTest DSchedContinueTest_009_1 end ret:" << ret << std::endl;
usleep(WAITTIME);
}
@ -481,6 +501,10 @@ HWTEST_F(DSchedContinueTest, DSchedContinueTest_0014_1, TestSize.Level0)
auto data = std::make_shared<ContinueAbilityData>();
int32_t ret = conti->ExecuteContinueSend(data);
EXPECT_EQ(ret, INVALID_REMOTE_PARAMETERS_ERR);
data = nullptr;
ret = conti->ExecuteContinueSend(data);
EXPECT_EQ(ret, INVALID_PARAMETERS_ERR);
DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0014_1 end ret:" << ret << std::endl;
usleep(WAITTIME);
}
@ -534,6 +558,10 @@ HWTEST_F(DSchedContinueTest, DSchedContinueTest_0016_1, TestSize.Level0)
int32_t ret = conti->PackDataCmd(cmd, want, abilityInfo, callerInfo, accountInfo);
EXPECT_EQ(ret, ERR_OK);
cmd = nullptr;
ret = conti->PackDataCmd(cmd, want, abilityInfo, callerInfo, accountInfo);
EXPECT_EQ(ret, INVALID_PARAMETERS_ERR);
DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0016_1 end ret:" << ret << std::endl;
usleep(WAITTIME);
}
@ -559,6 +587,10 @@ HWTEST_F(DSchedContinueTest, DSchedContinueTest_0017_1, TestSize.Level0)
int32_t ret = conti->ExecuteContinueData(cmd);
EXPECT_EQ(ret, INVALID_REMOTE_PARAMETERS_ERR);
cmd = nullptr;
ret = conti->ExecuteContinueData(cmd);
EXPECT_EQ(ret, INVALID_PARAMETERS_ERR);
DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0017_1 end ret:" << ret << std::endl;
usleep(WAITTIME);
}
@ -583,6 +615,10 @@ HWTEST_F(DSchedContinueTest, DSchedContinueTest_0018_1, TestSize.Level0)
int32_t result = ERR_OK;
int32_t ret = conti->ExecuteNotifyComplete(result);
EXPECT_NE(ret, ERR_OK);
direction = CONTINUE_SOURCE;
ret = conti->ExecuteNotifyComplete(result);
EXPECT_NE(ret, ERR_OK);
DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0018_1 end ret:" << ret << std::endl;
usleep(WAITTIME);
}
@ -611,6 +647,10 @@ HWTEST_F(DSchedContinueTest, DSchedContinueTest_0019_1, TestSize.Level0)
int32_t ret = conti->PackReplyCmd(cmd, replyCmd, appVersion, result, "");
EXPECT_EQ(ret, ERR_OK);
cmd = nullptr;
ret = conti->PackReplyCmd(cmd, replyCmd, appVersion, result, "");
EXPECT_EQ(ret, INVALID_PARAMETERS_ERR);
DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0019_1 end ret:" << ret << std::endl;
usleep(WAITTIME);
}
@ -660,6 +700,10 @@ HWTEST_F(DSchedContinueTest, DSchedContinueTest_0021_1, TestSize.Level0)
int32_t result = 0;
int32_t ret = conti->ExecuteContinueError(result);
EXPECT_EQ(ret, ERR_OK);
direction = CONTINUE_SOURCE;
ret = conti->ExecuteContinueError(result);
EXPECT_EQ(ret, ERR_OK);
DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0021_1 end ret:" << ret << std::endl;
usleep(WAITTIME);
}
@ -686,6 +730,10 @@ HWTEST_F(DSchedContinueTest, DSchedContinueTest_0022_1, TestSize.Level0)
int32_t ret = conti->PackEndCmd(cmd, result);
EXPECT_EQ(ret, ERR_OK);
cmd = nullptr;
ret = conti->PackEndCmd(cmd, result);
EXPECT_EQ(ret, INVALID_PARAMETERS_ERR);
DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0022_1 end ret:" << ret << std::endl;
usleep(WAITTIME);
}
@ -755,8 +803,28 @@ HWTEST_F(DSchedContinueTest, DSchedContinueTest_0025_1, TestSize.Level0)
auto conti = std::make_shared<DSchedContinue>(subType, direction, callback, info);
conti->Init();
int32_t ret = conti->CheckDeviceIdFromRemote("", "", "");
EXPECT_EQ(ret, false);
bool ret = conti->CheckDeviceIdFromRemote("", "", "");
EXPECT_FALSE(ret);
std::string localDevId = "localDevId";
std::string destDevId = "destDevId";
std::string srcDevId = "srcDevId";
ret = conti->CheckDeviceIdFromRemote(localDevId, destDevId, srcDevId);
EXPECT_FALSE(ret);
destDevId = "localDevId";
srcDevId = "localDevId";
ret = conti->CheckDeviceIdFromRemote(localDevId, destDevId, srcDevId);
EXPECT_FALSE(ret);
conti->continueInfo_.sourceDeviceId_ = "localDevId";
ret = conti->CheckDeviceIdFromRemote(localDevId, destDevId, srcDevId);
EXPECT_FALSE(ret);
srcDevId = "srcDevId";
conti->continueInfo_.sourceDeviceId_ = "srcDevId";
ret = conti->CheckDeviceIdFromRemote(localDevId, destDevId, srcDevId);
EXPECT_TRUE(ret);
DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0025_1 end ret:" << ret << std::endl;
usleep(WAITTIME);
}
@ -885,5 +953,102 @@ HWTEST_F(DSchedContinueTest, UpdateWantForContinueTypeTest_0030_1, TestSize.Leve
DTEST_LOG << "DSchedContinueTest UpdateWantForContinueTypeTest_0030_1 end ret:" << ret << std::endl;
usleep(WAITTIME);
}
/**
* @tc.name: DSchedContinueTest_031_1
* @tc.desc: DSchedContinue
* @tc.type: FUNC
*/
HWTEST_F(DSchedContinueTest, DSchedContinueTest_031_1, TestSize.Level0)
{
DTEST_LOG << "DSchedContinueTest DSchedContinueTest_031_1 begin" << std::endl;
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();
AppExecFwk::InnerEvent *event = nullptr;
auto destructor = [](AppExecFwk::InnerEvent *event) {
if (event != nullptr) {
delete event;
}
};
conti->ProcessEvent(AppExecFwk::InnerEvent::Pointer(event, destructor));
conti->continueInfo_.continueType_ = "";
conti->CheckQuickStartConfiguration();
conti->GetSessionId();
conti->GetAbilityNameByContinueType();
EXPECT_NE(nullptr, conti->stateMachine_);
DTEST_LOG << "DSchedContinueTest DSchedContinueTest_031_1 end" << std::endl;
usleep(WAITTIME);
}
/**
* @tc.name: OnDataRecvTest_032_1
* @tc.desc: OnDataRecv
* @tc.type: FUNC
*/
HWTEST_F(DSchedContinueTest, OnDataRecvTest_032_1, TestSize.Level0)
{
DTEST_LOG << "DSchedContinueTest OnDataRecvTest_032_1 begin" << std::endl;
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 command = 0;
std::shared_ptr<DSchedDataBuffer> dataBuffer = nullptr;
conti->OnDataRecv(command, dataBuffer);
EXPECT_EQ(nullptr, dataBuffer);
command = DSCHED_CONTINUE_CMD_START;
dataBuffer = std::make_shared<DSchedDataBuffer>(DSCHED_BUFFER_SIZE);
conti->OnDataRecv(command, dataBuffer);
EXPECT_NE(nullptr, dataBuffer);
command = DSCHED_CONTINUE_CMD_DATA;
conti->OnDataRecv(command, dataBuffer);
EXPECT_NE(nullptr, dataBuffer);
command = DSCHED_CONTINUE_CMD_REPLY;
conti->OnDataRecv(command, dataBuffer);
EXPECT_NE(nullptr, dataBuffer);
command = DSCHED_CONTINUE_CMD_END;
conti->OnDataRecv(command, dataBuffer);
EXPECT_NE(nullptr, dataBuffer);
command = DSCHED_CONTINUE_CMD_MIN;
conti->OnDataRecv(command, dataBuffer);
EXPECT_NE(nullptr, dataBuffer);
DTEST_LOG << "DSchedContinueTest OnDataRecvTest_032_1 end" << std::endl;
usleep(WAITTIME);
}
/**
* @tc.name: UpdateStateTest_033_1
* @tc.desc: UpdateState
* @tc.type: FUNC
*/
HWTEST_F(DSchedContinueTest, UpdateStateTest_033_1, TestSize.Level0)
{
DTEST_LOG << "DSchedContinueTest UpdateStateTest_033_1 begin" << std::endl;
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();
DSchedContinueStateType stateType = DSCHED_CONTINUE_SINK_START_STATE;
conti->UpdateState(stateType);
EXPECT_NE(nullptr, conti->stateMachine_);
DTEST_LOG << "DSchedContinueTest UpdateStateTest_033_1 end" << std::endl;
}
}
}

View File

@ -630,7 +630,7 @@ HWTEST_F(DMSMissionManagerTest, testRegisterMissionListener002, TestSize.Level1)
if (proxy == nullptr) {
return;
}
sptr<IRemoteObject> listener = new RemoteMissionListenerTest();
sptr<IRemoteObject> listener(new RemoteMissionListenerTest());
auto ret = proxy->RegisterMissionListener(U16DEVICE_ID, listener);
EXPECT_TRUE(ret != ERR_NONE);
@ -658,7 +658,7 @@ HWTEST_F(DMSMissionManagerTest, testRegisterMissionListener002, TestSize.Level1)
HWTEST_F(DMSMissionManagerTest, testRegisterMissionListener003, TestSize.Level3)
{
DTEST_LOG << "testRegisterMissionListener003 begin" << std::endl;
sptr<IRemoteObject> listener = new RemoteMissionListenerTest();
sptr<IRemoteObject> listener(new RemoteMissionListenerTest());
auto ret = DistributedSchedMissionManager::GetInstance().RegisterMissionListener(u"", listener);
EXPECT_EQ(ret, INVALID_PARAMETERS_ERR);
DTEST_LOG << "testRegisterMissionListener003 end" << std::endl;
@ -672,7 +672,7 @@ HWTEST_F(DMSMissionManagerTest, testRegisterMissionListener003, TestSize.Level3)
HWTEST_F(DMSMissionManagerTest, testRegisterMissionListener004, TestSize.Level3)
{
DTEST_LOG << "testRegisterMissionListener004 begin" << std::endl;
sptr<IRemoteObject> listener = new RemoteMissionListenerTest();
sptr<IRemoteObject> listener(new RemoteMissionListenerTest());
DtbschedmgrDeviceInfoStorage::GetInstance().uuidNetworkIdMap_["1234567"] = DEVICE_ID;
auto ret = DistributedSchedMissionManager::GetInstance().RegisterMissionListener(U16DEVICE_ID, listener);
EXPECT_EQ(ret, ERR_NONE);
@ -731,7 +731,7 @@ HWTEST_F(DMSMissionManagerTest, testRegisterMissionListener008, TestSize.Level3)
{
DTEST_LOG << "testRegisterMissionListener008 begin" << std::endl;
u16string deviceId = Str8ToStr16(localDeviceId_);
sptr<IRemoteObject> listener = new RemoteMissionListenerTest();
sptr<IRemoteObject> listener(new RemoteMissionListenerTest());
auto ret = DistributedSchedMissionManager::GetInstance().RegisterMissionListener(deviceId, listener);
EXPECT_TRUE(ret == INVALID_PARAMETERS_ERR);
DTEST_LOG << "testRegisterMissionListener008 end" << std::endl;
@ -766,7 +766,7 @@ HWTEST_F(DMSMissionManagerTest, testUnRegisterMissionListener001, TestSize.Level
HWTEST_F(DMSMissionManagerTest, testUnRegisterMissionListener002, TestSize.Level3)
{
DTEST_LOG << "testUnRegisterMissionListener002 begin" << std::endl;
sptr<IRemoteObject> listener = new RemoteMissionListenerTest();
sptr<IRemoteObject> listener(new RemoteMissionListenerTest());
auto ret = DistributedSchedMissionManager::GetInstance().UnRegisterMissionListener(U16DEVICE_ID, listener);
EXPECT_EQ(ret, ERR_NONE);
DTEST_LOG << "testUnRegisterMissionListener002 end" << std::endl;
@ -808,7 +808,7 @@ HWTEST_F(DMSMissionManagerTest, testUnRegisterMissionListener005, TestSize.Level
{
DTEST_LOG << "testUnRegisterMissionListener005 begin" << std::endl;
u16string deviceId = Str8ToStr16(localDeviceId_);
sptr<IRemoteObject> listener = new RemoteMissionListenerTest();
sptr<IRemoteObject> listener(new RemoteMissionListenerTest());
auto ret = DistributedSchedMissionManager::GetInstance().UnRegisterMissionListener(deviceId, listener);
EXPECT_EQ(ret, INVALID_PARAMETERS_ERR);
DTEST_LOG << "testUnRegisterMissionListener005 end" << std::endl;
@ -1309,7 +1309,7 @@ HWTEST_F(DMSMissionManagerTest, testNotifyMissionsChangedFromRemote002, TestSize
callerInfo.dmsVersion = 0;
std::vector<DstbMissionInfo> missionInfos;
DistributedSchedMissionManager::GetInstance().Init();
sptr<IRemoteObject> listener = new RemoteMissionListenerTest();
sptr<IRemoteObject> listener(new RemoteMissionListenerTest());
auto& listenerInfo = DistributedSchedMissionManager::GetInstance().listenDeviceMap_[U16DEVICE_ID];
EXPECT_EQ(listenerInfo.Emplace(listener), true);
auto ret = DistributedSchedMissionManager::GetInstance().NotifyMissionsChangedFromRemote(callerInfo, missionInfos);
@ -1762,7 +1762,7 @@ HWTEST_F(DMSMissionManagerTest, testRegisterMissionListener009, TestSize.Level3)
lock_guard<mutex> autoLock(DtbschedmgrDeviceInfoStorage::GetInstance().uuidNetworkIdLock_);
DtbschedmgrDeviceInfoStorage::GetInstance().uuidNetworkIdMap_[uuid] = localDeviceId_;
}
sptr<IRemoteObject> listener = new RemoteMissionListenerTest();
sptr<IRemoteObject> listener(new RemoteMissionListenerTest());
auto ret = DistributedSchedMissionManager::GetInstance().RegisterMissionListener(deviceId, listener);
EXPECT_EQ(ret, INVALID_PARAMETERS_ERR);
DTEST_LOG << "testRegisterMissionListener009 end" << std::endl;
@ -1784,7 +1784,7 @@ HWTEST_F(DMSMissionManagerTest, testRegisterMissionListener010, TestSize.Level3)
lock_guard<mutex> autoLock(DtbschedmgrDeviceInfoStorage::GetInstance().uuidNetworkIdLock_);
DtbschedmgrDeviceInfoStorage::GetInstance().uuidNetworkIdMap_[uuid] = DEVICE_ID;
}
sptr<IRemoteObject> listener = new RemoteMissionListenerTest();
sptr<IRemoteObject> listener(new RemoteMissionListenerTest());
{
std::lock_guard<std::mutex> autoLock(DistributedSchedMissionManager::GetInstance().listenDeviceLock_);
ListenerInfo listenerInfo;
@ -2141,8 +2141,8 @@ HWTEST_F(DMSMissionManagerTest, testDeviceOfflineNotify003, TestSize.Level3)
DTEST_LOG << "testDeviceOfflineNotify003 begin" << std::endl;
DistributedSchedMissionManager::GetInstance().Init();
DistributedSchedMissionManager::GetInstance().DeviceOnlineNotify(DEVICE_ID);
sptr<IRemoteObject> listener = new RemoteMissionListenerTest();
sptr<IDistributedSched> remoteDmsObj = new DistributedSchedProxy(listener);
sptr<IRemoteObject> listener(new RemoteMissionListenerTest());
sptr<IDistributedSched> remoteDmsObj(new DistributedSchedProxy(listener));
{
std::lock_guard<std::mutex> autoLock(DistributedSchedMissionManager::GetInstance().remoteDmsLock_);
DistributedSchedMissionManager::GetInstance().remoteDmsMap_.clear();
@ -2164,7 +2164,7 @@ HWTEST_F(DMSMissionManagerTest, testStartSyncRemoteMissions015, TestSize.Level3)
{
DTEST_LOG << "testStartSyncRemoteMissions015 begin" << std::endl;
u16string deviceId = Str8ToStr16(DEVICE_ID);
sptr<IRemoteObject> listener = new RemoteMissionListenerTest();
sptr<IRemoteObject> listener(new RemoteMissionListenerTest());
{
std::lock_guard<std::mutex> autoLock(DistributedSchedMissionManager::GetInstance().listenDeviceLock_);
DistributedSchedMissionManager::GetInstance().listenDeviceMap_.clear();
@ -2202,7 +2202,7 @@ HWTEST_F(DMSMissionManagerTest, testStartSyncRemoteMissions016, TestSize.Level3)
{
DTEST_LOG << "testStartSyncRemoteMissions016 begin" << std::endl;
u16string deviceId = Str8ToStr16(DEVICE_ID);
sptr<IRemoteObject> listener = new RemoteMissionListenerTest();
sptr<IRemoteObject> listener(new RemoteMissionListenerTest());
{
std::lock_guard<std::mutex> autoLock(DistributedSchedMissionManager::GetInstance().listenDeviceLock_);
DistributedSchedMissionManager::GetInstance().listenDeviceMap_.clear();
@ -2246,7 +2246,7 @@ HWTEST_F(DMSMissionManagerTest, testUnRegisterMissionListener006, TestSize.Level
DistributedSchedMissionManager::GetInstance().DeviceOnlineNotify(DEVICE_ID);
DTEST_LOG << "testDeviceOnlineNotify001 end" << std::endl;
sptr<IRemoteObject> listener = new RemoteMissionListenerTest();
sptr<IRemoteObject> listener(new RemoteMissionListenerTest());
{
std::lock_guard<std::mutex> autoLock(DistributedSchedMissionManager::GetInstance().listenDeviceLock_);
DistributedSchedMissionManager::GetInstance().listenDeviceMap_.clear();
@ -2287,7 +2287,7 @@ HWTEST_F(DMSMissionManagerTest, testUnRegisterMissionListener007, TestSize.Level
std::lock_guard<std::mutex> autoLock(DistributedSchedMissionManager::GetInstance().listenDeviceLock_);
DistributedSchedMissionManager::GetInstance().listenDeviceMap_.clear();
}
sptr<IRemoteObject> listener = new RemoteMissionListenerTest();
sptr<IRemoteObject> listener(new RemoteMissionListenerTest());
auto deviceInfo = std::make_shared<DmsDeviceInfo>("", 0, "");
DtbschedmgrDeviceInfoStorage::GetInstance().remoteDevices_[DEVICE_ID] = deviceInfo;
auto ret = DistributedSchedMissionManager::GetInstance().UnRegisterMissionListener(deviceId, listener);
@ -2334,7 +2334,7 @@ HWTEST_F(DMSMissionManagerTest, testUnRegisterMissionListener008, TestSize.Level
DTEST_LOG << "testRebornMissionCache002 end" << std::endl;
u16string deviceId = Str8ToStr16(DEVICE_ID);
sptr<IRemoteObject> listener = new RemoteMissionListenerTest();
sptr<IRemoteObject> listener(new RemoteMissionListenerTest());
{
std::lock_guard<std::mutex> autoLock(DistributedSchedMissionManager::GetInstance().listenDeviceLock_);
DistributedSchedMissionManager::GetInstance().listenDeviceMap_.clear();
@ -2369,7 +2369,7 @@ HWTEST_F(DMSMissionManagerTest, testUnRegisterMissionListener009, TestSize.Level
DTEST_LOG << "testFetchDeviceHandler001 end" << std::endl;
u16string deviceId = Str8ToStr16(DEVICE_ID);
sptr<IRemoteObject> listener = new RemoteMissionListenerTest();
sptr<IRemoteObject> listener(new RemoteMissionListenerTest());
sptr<IRemoteObject> nullListener = nullptr;
{
std::lock_guard<std::mutex> autoLock(DistributedSchedMissionManager::GetInstance().listenDeviceLock_);
@ -2553,7 +2553,7 @@ HWTEST_F(DMSMissionManagerTest, testNeedSyncDevice003, TestSize.Level3)
*/
DTEST_LOG << "testDeleteCachedSnapshotInfo001 begin" << std::endl;
u16string deviceId = Str8ToStr16(DEVICE_ID);
sptr<IRemoteObject> listener = new RemoteMissionListenerTest();
sptr<IRemoteObject> listener(new RemoteMissionListenerTest());
{
std::lock_guard<std::mutex> autoLock(DistributedSchedMissionManager::GetInstance().listenDeviceLock_);
DistributedSchedMissionManager::GetInstance().listenDeviceMap_.clear();
@ -2627,7 +2627,7 @@ HWTEST_F(DMSMissionManagerTest, testHasSyncListener002, TestSize.Level3)
DTEST_LOG << "testRebornMissionCache003 end" << std::endl;
u16string deviceId = Str8ToStr16(DEVICE_ID);
sptr<IRemoteObject> listener = new RemoteMissionListenerTest();
sptr<IRemoteObject> listener(new RemoteMissionListenerTest());
{
std::lock_guard<std::mutex> autoLock(DistributedSchedMissionManager::GetInstance().listenDeviceLock_);
DistributedSchedMissionManager::GetInstance().listenDeviceMap_.clear();
@ -2667,7 +2667,7 @@ HWTEST_F(DMSMissionManagerTest, testDequeueCachedSnapshotInfo003, TestSize.Level
{
DTEST_LOG << "testDequeueCachedSnapshotInfo003 begin" << std::endl;
u16string deviceId = Str8ToStr16(DEVICE_ID);
sptr<IRemoteObject> listener = new RemoteMissionListenerTest();
sptr<IRemoteObject> listener(new RemoteMissionListenerTest());
{
std::lock_guard<std::mutex> autoLock(DistributedSchedMissionManager::GetInstance().listenDeviceLock_);
DistributedSchedMissionManager::GetInstance().listenDeviceMap_.clear();
@ -2741,7 +2741,7 @@ HWTEST_F(DMSMissionManagerTest, testNotifyMissionsChangedFromRemote003, TestSize
callerInfo.dmsVersion = 0;
std::vector<DstbMissionInfo> missionInfos;
u16string deviceId = Str8ToStr16(DEVICE_ID);
sptr<IRemoteObject> listener = new RemoteMissionListenerTest();
sptr<IRemoteObject> listener(new RemoteMissionListenerTest());
{
std::lock_guard<std::mutex> autoLock(DistributedSchedMissionManager::GetInstance().listenDeviceLock_);
DistributedSchedMissionManager::GetInstance().listenDeviceMap_.clear();
@ -3030,7 +3030,7 @@ HWTEST_F(DMSMissionManagerTest, testRetryStartSyncRemoteMissions004, TestSize.Le
auto runner = AppExecFwk::EventRunner::Create("MissionManagerHandler");
DistributedSchedMissionManager::GetInstance().missionHandler_ = std::make_shared<AppExecFwk::EventHandler>(runner);
u16string deviceId = Str8ToStr16(DEVICE_ID);
sptr<IRemoteObject> listener = new RemoteMissionListenerTest();
sptr<IRemoteObject> listener(new RemoteMissionListenerTest());
{
std::lock_guard<std::mutex> autoLock(DistributedSchedMissionManager::GetInstance().listenDeviceLock_);
DistributedSchedMissionManager::GetInstance().listenDeviceMap_.clear();
@ -3057,7 +3057,7 @@ HWTEST_F(DMSMissionManagerTest, testRetryStartSyncRemoteMissions005, TestSize.Le
auto runner = AppExecFwk::EventRunner::Create("MissionManagerHandler");
DistributedSchedMissionManager::GetInstance().missionHandler_ = std::make_shared<AppExecFwk::EventHandler>(runner);
u16string deviceId = Str8ToStr16(DEVICE_ID);
sptr<IRemoteObject> listener = new RemoteMissionListenerTest();
sptr<IRemoteObject> listener(new RemoteMissionListenerTest());
{
std::lock_guard<std::mutex> autoLock(DistributedSchedMissionManager::GetInstance().listenDeviceLock_);
DistributedSchedMissionManager::GetInstance().listenDeviceMap_.clear();
@ -3094,7 +3094,7 @@ HWTEST_F(DMSMissionManagerTest, testOnMissionListenerDied003, TestSize.Level3)
{
DTEST_LOG << "testOnMissionListenerDied003 begin" << std::endl;
u16string deviceId = Str8ToStr16(DEVICE_ID);
sptr<IRemoteObject> listener = new RemoteMissionListenerTest();
sptr<IRemoteObject> listener(new RemoteMissionListenerTest());
{
std::lock_guard<std::mutex> autoLock(DistributedSchedMissionManager::GetInstance().listenDeviceLock_);
DistributedSchedMissionManager::GetInstance().listenDeviceMap_.clear();
@ -3119,7 +3119,7 @@ HWTEST_F(DMSMissionManagerTest, testOnMissionListenerDied004, TestSize.Level3)
{
DTEST_LOG << "testOnMissionListenerDied004 begin" << std::endl;
u16string deviceId = Str8ToStr16(DEVICE_ID);
sptr<IRemoteObject> listener = new RemoteMissionListenerTest();
sptr<IRemoteObject> listener(new RemoteMissionListenerTest());
{
std::lock_guard<std::mutex> autoLock(DistributedSchedMissionManager::GetInstance().listenDeviceLock_);
DistributedSchedMissionManager::GetInstance().listenDeviceMap_.clear();
@ -3146,7 +3146,7 @@ HWTEST_F(DMSMissionManagerTest, testOnMissionListenerDied005, TestSize.Level3)
{
DTEST_LOG << "testOnMissionListenerDied005 begin" << std::endl;
u16string deviceId = Str8ToStr16(DEVICE_ID);
sptr<IRemoteObject> listener = new RemoteMissionListenerTest();
sptr<IRemoteObject> listener(new RemoteMissionListenerTest());
{
std::lock_guard<std::mutex> autoLock(DistributedSchedMissionManager::GetInstance().listenDeviceLock_);
DistributedSchedMissionManager::GetInstance().listenDeviceMap_.clear();
@ -3172,8 +3172,8 @@ HWTEST_F(DMSMissionManagerTest, testOnRemoteDmsDied006, TestSize.Level3)
DTEST_LOG << "testOnRemoteDmsDied006 begin" << std::endl;
auto runner = AppExecFwk::EventRunner::Create("MissionManagerHandler");
DistributedSchedMissionManager::GetInstance().missionHandler_ = std::make_shared<AppExecFwk::EventHandler>(runner);
sptr<IRemoteObject> remote = new RemoteMissionListenerTest();
sptr<IDistributedSched> remoteDmsObj = new DistributedSchedProxy(remote);
sptr<IRemoteObject> remote(new RemoteMissionListenerTest());
sptr<IDistributedSched> remoteDmsObj(new DistributedSchedProxy(remote));
{
std::lock_guard<std::mutex> autoLock(DistributedSchedMissionManager::GetInstance().remoteDmsLock_);
DistributedSchedMissionManager::GetInstance().remoteDmsMap_.clear();
@ -3196,7 +3196,7 @@ HWTEST_F(DMSMissionManagerTest, testOnRemoteDmsDied007, TestSize.Level3)
DTEST_LOG << "testOnRemoteDmsDied007 begin" << std::endl;
auto runner = AppExecFwk::EventRunner::Create("MissionManagerHandler");
DistributedSchedMissionManager::GetInstance().missionHandler_ = std::make_shared<AppExecFwk::EventHandler>(runner);
sptr<IRemoteObject> remote = new RemoteMissionListenerTest();
sptr<IRemoteObject> remote(new RemoteMissionListenerTest());
sptr<IDistributedSched> proxy = GetDms();
if (proxy == nullptr) {
return;
@ -3223,8 +3223,8 @@ HWTEST_F(DMSMissionManagerTest, testOnRemoteDmsDied008, TestSize.Level3)
DTEST_LOG << "testOnRemoteDmsDied008 begin" << std::endl;
auto runner = AppExecFwk::EventRunner::Create("MissionManagerHandler");
DistributedSchedMissionManager::GetInstance().missionHandler_ = std::make_shared<AppExecFwk::EventHandler>(runner);
sptr<IRemoteObject> remote = new RemoteMissionListenerTest();
sptr<IDistributedSched> remoteDmsObj = new DistributedSchedProxy(remote);
sptr<IRemoteObject> remote(new RemoteMissionListenerTest());
sptr<IDistributedSched> remoteDmsObj(new DistributedSchedProxy(remote));
{
std::lock_guard<std::mutex> autoLock(DistributedSchedMissionManager::GetInstance().remoteDmsLock_);
DistributedSchedMissionManager::GetInstance().remoteDmsMap_.clear();