diff options
Diffstat (limited to 'storageframework')
-rw-r--r-- | storageframework/src/vespa/storageframework/defaultimplementation/component/testcomponentregister.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/storageframework/src/vespa/storageframework/defaultimplementation/component/testcomponentregister.cpp b/storageframework/src/vespa/storageframework/defaultimplementation/component/testcomponentregister.cpp new file mode 100644 index 00000000000..58c60bd17cf --- /dev/null +++ b/storageframework/src/vespa/storageframework/defaultimplementation/component/testcomponentregister.cpp @@ -0,0 +1,32 @@ +// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +#include "testcomponentregister.h" + +namespace storage::framework::defaultimplementation { + +TestComponentRegister::TestComponentRegister(ComponentRegisterImpl::UP compReg) + : _compReg(std::move(compReg)), + _clock(), + _threadPool(_clock), + _memoryManager() +{ + assert(_compReg.get() != 0); + // Set a memory manager, so users can register memory types and + // ask for memory. + _compReg->setMemoryManager(_memoryManager); + // Set a fake clock, giving test control of clock + _compReg->setClock(_clock); + // Set a thread pool so components can make threads in tests. + _compReg->setThreadPool(_threadPool); + // Metric manager should not be needed. Tests of metric system can + // be done without using this class. Components can still register + // metrics without a manager. + + // Status page server should not be needed. Tests of status parts + // can be done without using this class. Components can still + // register status pages without a server +} + +TestComponentRegister::~TestComponentRegister() {} + +} |