| 197 | |
| 198 | |
| 199 | void 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 | |
| 234 | void FetchAndStoreAndExpungeAndExpunge(State* state) |