| 232 | |
| 233 | |
| 234 | void 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 | |
| 265 | void FetchAndStoreAndExpungeAndStoreAndFetch(State* state) |