| 97 | |
| 98 | |
| 99 | MockSlave::MockSlave( |
| 100 | const string& id, |
| 101 | const slave::Flags& flags, |
| 102 | MasterDetector* detector, |
| 103 | Containerizer* containerizer, |
| 104 | Files* files, |
| 105 | GarbageCollector* gc, |
| 106 | TaskStatusUpdateManager* taskStatusUpdateManager, |
| 107 | ResourceEstimator* resourceEstimator, |
| 108 | QoSController* qosController, |
| 109 | SecretGenerator* secretGenerator, |
| 110 | VolumeGidManager* volumeGidManager, |
| 111 | PendingFutureTracker* futureTracker, |
| 112 | Owned<slave::CSIServer>&& csiServer, |
| 113 | const Option<Authorizer*>& authorizer) |
| 114 | // It is necessary to explicitly call `ProcessBase` constructor here even |
| 115 | // though the direct parent `Slave` already does this. This is because |
| 116 | // `ProcessBase` being a virtual base class, if not being explicitly |
| 117 | // constructed here by passing `id`, will be constructed implicitly first with |
| 118 | // a default constructor, resulting in lost argument `id`. |
| 119 | : ProcessBase(id), |
| 120 | slave::Slave( |
| 121 | id, |
| 122 | flags, |
| 123 | detector, |
| 124 | containerizer, |
| 125 | files, |
| 126 | gc, |
| 127 | taskStatusUpdateManager, |
| 128 | resourceEstimator, |
| 129 | qosController, |
| 130 | secretGenerator, |
| 131 | volumeGidManager, |
| 132 | futureTracker, |
| 133 | std::move(csiServer), |
| 134 | #ifndef __WINDOWS__ |
| 135 | None(), |
| 136 | #endif // __WINDOWS__ |
| 137 | authorizer) |
| 138 | { |
| 139 | // Set up default behaviors, calling the original methods. |
| 140 | EXPECT_CALL(*this, ___run(_, _, _, _, _, _)) |
| 141 | .WillRepeatedly(Invoke(this, &MockSlave::unmocked____run)); |
| 142 | EXPECT_CALL(*this, runTask(_, _, _, _, _, _, _)) |
| 143 | .WillRepeatedly(Invoke(this, &MockSlave::unmocked_runTask)); |
| 144 | EXPECT_CALL(*this, _run(_, _, _, _, _, _)) |
| 145 | .WillRepeatedly(Invoke(this, &MockSlave::unmocked__run)); |
| 146 | EXPECT_CALL(*this, __run(_, _, _, _, _, _, _)) |
| 147 | .WillRepeatedly(Invoke(this, &MockSlave::unmocked___run)); |
| 148 | EXPECT_CALL(*this, runTaskGroup(_, _, _, _, _, _)) |
| 149 | .WillRepeatedly(Invoke(this, &MockSlave::unmocked_runTaskGroup)); |
| 150 | EXPECT_CALL(*this, killTask(_, _)) |
| 151 | .WillRepeatedly(Invoke(this, &MockSlave::unmocked_killTask)); |
| 152 | EXPECT_CALL(*this, authenticate(_, _)) |
| 153 | .WillRepeatedly(Invoke(this, &MockSlave::unmocked_authenticate)); |
| 154 | EXPECT_CALL(*this, removeFramework(_)) |
| 155 | .WillRepeatedly(Invoke(this, &MockSlave::unmocked_removeFramework)); |
| 156 | EXPECT_CALL(*this, __recover(_)) |