32 #include <initializer_list> 35 #include "mongo/db/jsobj.h" 36 #include "mongo/db/operation_context_noop.h" 37 #include "mongo/db/record_id.h" 38 #include "mongo/db/service_context.h" 39 #include "mongo/db/service_context_noop.h" 41 #include "mongo/stdx/functional.h" 42 #include "mongo/stdx/memory.h" 43 #include "mongo/util/unowned_ptr.h" 62 auto opCtx = client->makeOperationContext();
64 WriteUnitOfWork::RecoveryUnitState::kNotInUnitOfWork);
88 ServiceContext::UniqueClient
_client = _serviceContext.makeClient(
"hh");
91 namespace harness_helper_detail {
92 template <
typename Target,
typename Current>
95 return std::unique_ptr<Target>(std::addressof(t));
101 template <
typename Target,
typename Current>
104 throw std::runtime_error(
"Must not be null.");
106 Target& target =
dynamic_cast<Target&
>(*p);
virtual ServiceContext::UniqueOperationContext newOperationContext()
Definition: test_harness_helper.h:68
std::unique_ptr< Target > dynamic_ptr_cast(std::unique_ptr< Current > &&p)
Definition: test_harness_helper.h:102
void registerHarnessHelperFactory(stdx::function< std::unique_ptr< HarnessHelper >()> factory)
Definition: test_harness_helper.cpp:45
Copyright (C) 2014 MongoDB Inc.
Definition: bson_collection_catalog_entry.cpp:38
Client * client() const
Definition: test_harness_helper.h:72
const ServiceContext * serviceContext() const
Definition: test_harness_helper.h:80
ServiceContext::UniqueClient _client
Definition: test_harness_helper.h:88
Sets up an OperationContext with a Recovery Unit.
Definition: test_harness_helper.h:55
virtual ~HarnessHelper()=0
std::unique_ptr< HarnessHelper > newHarnessHelper()
Definition: test_harness_helper.cpp:49
virtual ServiceContext::UniqueOperationContext newOperationContext(Client *const client)
Definition: test_harness_helper.h:61
ServiceContextNoop _serviceContext
Definition: test_harness_helper.h:87
ServiceContext * serviceContext()
Definition: test_harness_helper.h:76
Collection *const OperationContext *const opCtx
Definition: collection_impl.cpp:80
std::unique_ptr< Target > noexcept_ptr_conversion(std::unique_ptr< Current > &&p, Target &t) noexcept
Definition: test_harness_helper.h:93
virtual std::unique_ptr< RecoveryUnit > newRecoveryUnit()=0