Rename all detail to impl (#1168)

Fixes #1084
This commit is contained in:
Alex Kremer
2024-02-12 11:54:41 +00:00
committed by GitHub
parent cea9c41a88
commit cce695c570
91 changed files with 224 additions and 225 deletions

View File

@@ -34,7 +34,7 @@
#include <utility>
using namespace data::cassandra;
using namespace data::cassandra::detail;
using namespace data::cassandra::impl;
using namespace testing;
class BackendCassandraAsyncExecutorTest : public SyncAsioContextTest {

View File

@@ -42,7 +42,7 @@
#include <vector>
using namespace data::cassandra;
using namespace data::cassandra::detail;
using namespace data::cassandra::impl;
using namespace testing;
class BackendCassandraExecutionStrategyTest : public SyncAsioContextTest {

View File

@@ -29,7 +29,7 @@
#include <optional>
using namespace data::cassandra;
using namespace data::cassandra::detail;
using namespace data::cassandra::impl;
using namespace testing;
class BackendCassandraRetryPolicyTest : public SyncAsioContextTest {};

View File

@@ -30,7 +30,7 @@
#include <vector>
using namespace data::cassandra;
using namespace data::cassandra::detail;
using namespace data::cassandra::impl;
struct FakeResult {};

View File

@@ -34,7 +34,7 @@ using namespace etl;
class AmendmentBlockHandlerTest : public NoLoggerFixture {
protected:
using AmendmentBlockHandlerType = detail::AmendmentBlockHandler<FakeAmendmentBlockAction>;
using AmendmentBlockHandlerType = impl::AmendmentBlockHandler<FakeAmendmentBlockAction>;
boost::asio::io_context ioc_;
};

View File

@@ -40,7 +40,7 @@
#include <vector>
namespace json = boost::json;
using namespace etl::detail;
using namespace etl::impl;
using namespace util;
using namespace data;
using namespace testing;

View File

@@ -33,7 +33,7 @@ constexpr static auto START_SEQ = 1234;
class ETLExtractionDataPipeTest : public NoLoggerFixture {
protected:
etl::detail::ExtractionDataPipe<uint32_t> pipe_{STRIDE, START_SEQ};
etl::impl::ExtractionDataPipe<uint32_t> pipe_{STRIDE, START_SEQ};
};
TEST_F(ETLExtractionDataPipeTest, StrideMatchesInput)

View File

@@ -38,8 +38,7 @@ class ETLExtractorTest : public NoLoggerFixture {
protected:
using ExtractionDataPipeType = MockExtractionDataPipe;
using LedgerFetcherType = MockLedgerFetcher;
using ExtractorType =
etl::detail::Extractor<ExtractionDataPipeType, MockNetworkValidatedLedgers, LedgerFetcherType>;
using ExtractorType = etl::impl::Extractor<ExtractionDataPipeType, MockNetworkValidatedLedgers, LedgerFetcherType>;
ExtractionDataPipeType dataPipe_;
std::shared_ptr<MockNetworkValidatedLedgers> networkValidatedLedgers_ =

View File

@@ -76,7 +76,7 @@ TEST_F(ETLLedgerPublisherTest, PublishLedgerInfoIsWritingFalse)
SystemState dummyState;
dummyState.isWriting = false;
auto const dummyLedgerInfo = CreateLedgerInfo(LEDGERHASH, SEQ, AGE);
detail::LedgerPublisher publisher(ctx, backend, mockCache, mockSubscriptionManagerPtr, dummyState);
impl::LedgerPublisher publisher(ctx, backend, mockCache, mockSubscriptionManagerPtr, dummyState);
publisher.publish(dummyLedgerInfo);
ON_CALL(*backend, fetchLedgerDiff(SEQ, _)).WillByDefault(Return(std::vector<LedgerObject>{}));
@@ -99,7 +99,7 @@ TEST_F(ETLLedgerPublisherTest, PublishLedgerInfoIsWritingTrue)
SystemState dummyState;
dummyState.isWriting = true;
auto const dummyLedgerInfo = CreateLedgerInfo(LEDGERHASH, SEQ, AGE);
detail::LedgerPublisher publisher(ctx, backend, mockCache, mockSubscriptionManagerPtr, dummyState);
impl::LedgerPublisher publisher(ctx, backend, mockCache, mockSubscriptionManagerPtr, dummyState);
publisher.publish(dummyLedgerInfo);
EXPECT_CALL(*backend, fetchLedgerDiff(_, _)).Times(0);
@@ -118,7 +118,7 @@ TEST_F(ETLLedgerPublisherTest, PublishLedgerInfoInRange)
dummyState.isWriting = true;
auto const dummyLedgerInfo = CreateLedgerInfo(LEDGERHASH, SEQ, 0); // age is 0
detail::LedgerPublisher publisher(ctx, backend, mockCache, mockSubscriptionManagerPtr, dummyState);
impl::LedgerPublisher publisher(ctx, backend, mockCache, mockSubscriptionManagerPtr, dummyState);
backend->setRange(SEQ - 1, SEQ);
publisher.publish(dummyLedgerInfo);
@@ -168,7 +168,7 @@ TEST_F(ETLLedgerPublisherTest, PublishLedgerInfoCloseTimeGreaterThanNow)
backend->setRange(SEQ - 1, SEQ);
detail::LedgerPublisher publisher(ctx, backend, mockCache, mockSubscriptionManagerPtr, dummyState);
impl::LedgerPublisher publisher(ctx, backend, mockCache, mockSubscriptionManagerPtr, dummyState);
publisher.publish(dummyLedgerInfo);
EXPECT_CALL(*backend, fetchLedgerDiff(_, _)).Times(0);
@@ -208,7 +208,7 @@ TEST_F(ETLLedgerPublisherTest, PublishLedgerSeqStopIsTrue)
{
SystemState dummyState;
dummyState.isStopping = true;
detail::LedgerPublisher publisher(ctx, backend, mockCache, mockSubscriptionManagerPtr, dummyState);
impl::LedgerPublisher publisher(ctx, backend, mockCache, mockSubscriptionManagerPtr, dummyState);
EXPECT_FALSE(publisher.publish(SEQ, {}));
}
@@ -216,7 +216,7 @@ TEST_F(ETLLedgerPublisherTest, PublishLedgerSeqMaxAttampt)
{
SystemState dummyState;
dummyState.isStopping = false;
detail::LedgerPublisher publisher(ctx, backend, mockCache, mockSubscriptionManagerPtr, dummyState);
impl::LedgerPublisher publisher(ctx, backend, mockCache, mockSubscriptionManagerPtr, dummyState);
static auto constexpr MAX_ATTEMPT = 2;
@@ -231,7 +231,7 @@ TEST_F(ETLLedgerPublisherTest, PublishLedgerSeqStopIsFalse)
{
SystemState dummyState;
dummyState.isStopping = false;
detail::LedgerPublisher publisher(ctx, backend, mockCache, mockSubscriptionManagerPtr, dummyState);
impl::LedgerPublisher publisher(ctx, backend, mockCache, mockSubscriptionManagerPtr, dummyState);
LedgerRange const range{.minSequence = SEQ, .maxSequence = SEQ};
ON_CALL(*backend, hardFetchLedgerRange(_)).WillByDefault(Return(range));
@@ -255,7 +255,7 @@ TEST_F(ETLLedgerPublisherTest, PublishMultipleTxInOrder)
dummyState.isWriting = true;
auto const dummyLedgerInfo = CreateLedgerInfo(LEDGERHASH, SEQ, 0); // age is 0
detail::LedgerPublisher publisher(ctx, backend, mockCache, mockSubscriptionManagerPtr, dummyState);
impl::LedgerPublisher publisher(ctx, backend, mockCache, mockSubscriptionManagerPtr, dummyState);
backend->setRange(SEQ - 1, SEQ);
publisher.publish(dummyLedgerInfo);

View File

@@ -53,7 +53,7 @@ protected:
using LedgerLoaderType = MockLedgerLoader;
using LedgerPublisherType = MockLedgerPublisher;
using AmendmentBlockHandlerType = MockAmendmentBlockHandler;
using TransformerType = etl::detail::
using TransformerType = etl::impl::
Transformer<ExtractionDataPipeType, LedgerLoaderType, LedgerPublisherType, AmendmentBlockHandlerType>;
ExtractionDataPipeType dataPipe_;

View File

@@ -59,7 +59,7 @@ protected:
}
};
namespace detail {
namespace impl {
class SharedStringJsonEqMatcher {
std::string expected_;
@@ -88,10 +88,10 @@ public:
*os << "Expecting json " << expected_;
}
};
} // namespace detail
} // namespace impl
inline ::testing::Matcher<std::shared_ptr<std::string>>
SharedStringJsonEq(std::string const& expected)
{
return detail::SharedStringJsonEqMatcher(expected);
return impl::SharedStringJsonEqMatcher(expected);
}

View File

@@ -29,7 +29,7 @@ constexpr static auto DEFAULT_API_VERSION = 5u;
constexpr static auto MIN_API_VERSION = 2u;
constexpr static auto MAX_API_VERSION = 10u;
using namespace rpc::detail;
using namespace rpc::impl;
namespace json = boost::json;
class RPCAPIVersionTest : public NoLoggerFixture {

View File

@@ -53,7 +53,7 @@ protected:
util::Config config;
util::TagDecoratorFactory tagFactory{config};
rpc::detail::ForwardingProxy<MockLoadBalancer, MockCounters, MockHandlerProvider> proxy{
rpc::impl::ForwardingProxy<MockLoadBalancer, MockCounters, MockHandlerProvider> proxy{
loadBalancer,
counters,
handlerProvider

View File

@@ -33,7 +33,7 @@ using namespace std;
using namespace rpc;
using namespace rpc::validation;
using namespace unittests::detail;
using namespace unittests::impl;
namespace json = boost::json;
@@ -43,7 +43,7 @@ TEST_F(RPCDefaultProcessorTest, ValidInput)
{
runSpawn([](auto yield) {
HandlerMock const handler;
rpc::detail::DefaultProcessor<HandlerMock> const processor;
rpc::impl::DefaultProcessor<HandlerMock> const processor;
auto const input = json::parse(R"({ "something": "works" })");
auto const spec = RpcSpec{{"something", Required{}}};
@@ -60,7 +60,7 @@ TEST_F(RPCDefaultProcessorTest, NoInputVaildCall)
{
runSpawn([](auto yield) {
HandlerWithoutInputMock const handler;
rpc::detail::DefaultProcessor<HandlerWithoutInputMock> const processor;
rpc::impl::DefaultProcessor<HandlerWithoutInputMock> const processor;
auto const data = InOutFake{"works"};
auto const input = json::parse(R"({})");
@@ -75,7 +75,7 @@ TEST_F(RPCDefaultProcessorTest, InvalidInput)
{
runSpawn([](auto yield) {
HandlerMock const handler;
rpc::detail::DefaultProcessor<HandlerMock> const processor;
rpc::impl::DefaultProcessor<HandlerMock> const processor;
auto const input = json::parse(R"({ "other": "nope" })");
auto const spec = RpcSpec{{"something", Required{}}};

View File

@@ -29,7 +29,7 @@
using namespace std;
using namespace rpc;
using namespace rpc::validation;
using namespace unittests::detail;
using namespace unittests::impl;
namespace json = boost::json;

View File

@@ -35,7 +35,7 @@
#include <optional>
#include <string>
namespace unittests::detail {
namespace unittests::impl {
// input data for the test handlers below
struct TestInput {
@@ -181,4 +181,4 @@ struct BasicDOSGuardMock : public web::BaseDOSGuard {
MOCK_METHOD(void, clear, (), (noexcept, override));
};
} // namespace unittests::detail
} // namespace unittests::impl

View File

@@ -33,7 +33,7 @@ namespace http = boost::beast::http;
class IPAdminVerificationStrategyTest : public NoLoggerFixture {
protected:
web::detail::IPAdminVerificationStrategy strat_;
web::impl::IPAdminVerificationStrategy strat_;
http::request<http::string_body> request_ = {};
};
@@ -51,7 +51,7 @@ protected:
std::string const password_ = "secret";
std::string const passwordHash_ = "2bb80d537b1da3e38bd30361aa855686bde0eacd7162fef6a25fe97bf527a25b";
web::detail::PasswordAdminVerificationStrategy strat_{password_};
web::impl::PasswordAdminVerificationStrategy strat_{password_};
static http::request<http::string_body>
makeRequest(std::string const& password, http::field const field = http::field::authorization)
@@ -100,10 +100,10 @@ class MakeAdminVerificationStrategyTest : public testing::TestWithParam<MakeAdmi
TEST_P(MakeAdminVerificationStrategyTest, ChoosesStrategyCorrectly)
{
auto strat = web::detail::make_AdminVerificationStrategy(GetParam().passwordOpt);
auto ipStrat = dynamic_cast<web::detail::IPAdminVerificationStrategy*>(strat.get());
auto strat = web::impl::make_AdminVerificationStrategy(GetParam().passwordOpt);
auto ipStrat = dynamic_cast<web::impl::IPAdminVerificationStrategy*>(strat.get());
EXPECT_EQ(ipStrat != nullptr, GetParam().expectIpStrategy);
auto passwordStrat = dynamic_cast<web::detail::PasswordAdminVerificationStrategy*>(strat.get());
auto passwordStrat = dynamic_cast<web::impl::PasswordAdminVerificationStrategy*>(strat.get());
EXPECT_EQ(passwordStrat != nullptr, GetParam().expectPasswordStrategy);
}

View File

@@ -55,7 +55,7 @@
#include <vector>
using namespace util;
using namespace web::detail;
using namespace web::impl;
using namespace web;
constexpr static auto JSONData = R"JSON(

View File

@@ -47,7 +47,7 @@ class DOSGuardIntervalSweepHandlerTest : public SyncAsioContextTest {
protected:
Config cfg{boost::json::parse(JSONData)};
IntervalSweepHandler sweepHandler{cfg, ctx};
unittests::detail::BasicDOSGuardMock<IntervalSweepHandler> guard{sweepHandler};
unittests::impl::BasicDOSGuardMock<IntervalSweepHandler> guard{sweepHandler};
};
TEST_F(DOSGuardIntervalSweepHandlerTest, SweepAfterInterval)