MCPcopy Create free account
hub / github.com/baidu/braft / TEST_P

Function TEST_P

test/test_node.cpp:71–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69};
70
71TEST_P(NodeTest, InitShutdown) {
72 brpc::Server server;
73 int ret = braft::add_service(&server, "0.0.0.0:5006");
74 ASSERT_EQ(0, ret);
75 ASSERT_EQ(0, server.Start("0.0.0.0:5006", NULL));
76
77 braft::NodeOptions options;
78 options.fsm = new MockFSM(butil::EndPoint());
79 options.log_uri = "local://./data/log";
80 options.raft_meta_uri = "local://./data/raft_meta";
81 options.snapshot_uri = "local://./data/snapshot";
82
83 braft::Node node("unittest", braft::PeerId(butil::EndPoint(butil::my_ip(), 5006), 0));
84 ASSERT_EQ(0, node.init(options));
85
86 node.shutdown(NULL);
87 node.join();
88
89 //FIXME:
90 bthread::CountdownEvent cond;
91 butil::IOBuf data;
92 data.append("hello");
93 braft::Task task;
94 task.data = &data;
95 task.done = NEW_APPLYCLOSURE(&cond);
96 node.apply(task);
97 cond.wait();
98}
99
100TEST_P(NodeTest, Server) {
101 brpc::Server server1;

Callers

nothing calls this directly

Calls 15

add_serviceFunction · 0.85
PeerIdClass · 0.85
ConfigurationClass · 0.85
bootstrapFunction · 0.85
follower_append_entriesFunction · 0.85
followersMethod · 0.80
wait_leaderMethod · 0.80
leaderMethod · 0.80
node_idMethod · 0.80
ensure_sameMethod · 0.80
cleanMethod · 0.80
set_errorMethod · 0.80

Tested by

no test coverage detected