1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-07-02 05:22:26 +03:00

Refactored client_service interface out of client_context

This commit is contained in:
Teemu Ollakka
2018-06-14 19:44:38 +03:00
parent 1ca3f7b649
commit 256000f934
12 changed files with 391 additions and 265 deletions

View File

@ -13,10 +13,9 @@ namespace
applying_server_fixture()
: sc("s1", "s1",
wsrep::server_context::rm_sync)
, cc(sc,
, cc(sc, sc.client_service(),
wsrep::client_id(1),
wsrep::client_context::m_applier,
false)
wsrep::client_context::m_applier)
, ws_handle(1, (void*)1)
, ws_meta(wsrep::gtid(wsrep::id("1"), wsrep::seqno(1)),
wsrep::stid(wsrep::id("1"), 1, 1),
@ -62,7 +61,7 @@ BOOST_FIXTURE_TEST_CASE(server_context_applying_2pc,
BOOST_FIXTURE_TEST_CASE(server_context_applying_1pc_rollback,
applying_server_fixture)
{
cc.fail_next_applying_ = true;
sc.client_service().fail_next_applying_ = true;
char buf[1] = { 1 };
BOOST_REQUIRE(sc.on_apply(cc, ws_handle, ws_meta,
wsrep::const_buffer(buf, 1)) == 1);
@ -75,7 +74,7 @@ BOOST_FIXTURE_TEST_CASE(server_context_applying_1pc_rollback,
BOOST_FIXTURE_TEST_CASE(server_context_applying_2pc_rollback,
applying_server_fixture)
{
cc.fail_next_applying_ = true;
sc.client_service().fail_next_applying_ = true;
char buf[1] = { 1 };
BOOST_REQUIRE(sc.on_apply(cc, ws_handle, ws_meta,
wsrep::const_buffer(buf, 1)) == 1);
@ -88,9 +87,9 @@ BOOST_AUTO_TEST_CASE(server_context_streaming)
wsrep::mock_server_context sc("s1", "s1",
wsrep::server_context::rm_sync);
wsrep::mock_client_context cc(sc,
sc.client_service(),
wsrep::client_id(1),
wsrep::client_context::m_applier,
false);
wsrep::client_context::m_applier);
wsrep::ws_handle ws_handle(1, (void*)1);
wsrep::ws_meta ws_meta(wsrep::gtid(wsrep::id("1"), wsrep::seqno(1)),
wsrep::stid(wsrep::id("1"), 1, 1),