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

Function FetchAndStoreAndExpungeAndFetch

src/tests/state_tests.cpp:199–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197
198
199void FetchAndStoreAndExpungeAndFetch(State* state)
200{
201 Future<Variable<Slaves>> future1 = state->fetch<Slaves>("slaves");
202 AWAIT_READY(future1);
203
204 Variable<Slaves> variable = future1.get();
205
206 Slaves slaves1 = variable.get();
207 ASSERT_TRUE(slaves1.slaves().empty());
208
209 Slave* slave = slaves1.add_slaves();
210 slave->mutable_info()->set_hostname("localhost");
211
212 variable = variable.mutate(slaves1);
213
214 Future<Option<Variable<Slaves>>> future2 = state->store(variable);
215 AWAIT_READY(future2);
216 ASSERT_SOME(future2.get());
217
218 variable = future2->get();
219
220 Future<bool> future3 = state->expunge(variable);
221 AWAIT_READY(future3);
222 ASSERT_TRUE(future3.get());
223
224 future1 = state->fetch<Slaves>("slaves");
225 AWAIT_READY(future1);
226
227 variable = future1.get();
228
229 Slaves slaves2 = variable.get();
230 ASSERT_TRUE(slaves2.slaves().empty());
231}
232
233
234void FetchAndStoreAndExpungeAndExpunge(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