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

Function Names

src/tests/state_tests.cpp:305–328  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

303
304
305void Names(State* state)
306{
307 Future<Variable<Slaves>> future1 = state->fetch<Slaves>("slaves");
308 AWAIT_READY(future1);
309
310 Variable<Slaves> variable = future1.get();
311
312 Slaves slaves1 = variable.get();
313 ASSERT_TRUE(slaves1.slaves().empty());
314
315 Slave* slave = slaves1.add_slaves();
316 slave->mutable_info()->set_hostname("localhost");
317
318 variable = variable.mutate(slaves1);
319
320 Future<Option<Variable<Slaves>>> future2 = state->store(variable);
321 AWAIT_READY(future2);
322 ASSERT_SOME(future2.get());
323
324 Future<set<string>> names = state->names();
325 AWAIT_READY(names);
326 ASSERT_EQ(1u, names->size());
327 EXPECT_NE(names->find("slaves"), names->end());
328}
329
330
331class InMemoryStateTest : public ::testing::Test

Callers 1

TEST_FFunction · 0.70

Calls 9

storeMethod · 0.65
namesMethod · 0.65
getMethod · 0.45
emptyMethod · 0.45
slavesMethod · 0.45
mutateMethod · 0.45
sizeMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected