MCPcopy Create free account
hub / github.com/apache/mesos / FetchAndStoreAndExpungeAndExpunge

Function FetchAndStoreAndExpungeAndExpunge

src/tests/state_tests.cpp:234–262  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

232
233
234void FetchAndStoreAndExpungeAndExpunge(State* state)
235{
236 Future<Variable<Slaves>> future1 = state->fetch<Slaves>("slaves");
237 AWAIT_READY(future1);
238
239 Variable<Slaves> variable = future1.get();
240
241 Slaves slaves1 = variable.get();
242 ASSERT_TRUE(slaves1.slaves().empty());
243
244 Slave* slave = slaves1.add_slaves();
245 slave->mutable_info()->set_hostname("localhost");
246
247 variable = variable.mutate(slaves1);
248
249 Future<Option<Variable<Slaves>>> future2 = state->store(variable);
250 AWAIT_READY(future2);
251 ASSERT_SOME(future2.get());
252
253 variable = future2->get();
254
255 Future<bool> future3 = state->expunge(variable);
256 AWAIT_READY(future3);
257 ASSERT_TRUE(future3.get());
258
259 future3 = state->expunge(variable);
260 AWAIT_READY(future3);
261 ASSERT_FALSE(future3.get());
262}
263
264
265void FetchAndStoreAndExpungeAndStoreAndFetch(State* state)

Callers 1

TEST_FFunction · 0.85

Calls 6

storeMethod · 0.65
expungeMethod · 0.65
getMethod · 0.45
emptyMethod · 0.45
slavesMethod · 0.45
mutateMethod · 0.45

Tested by

no test coverage detected