summaryrefslogtreecommitdiffstats
path: root/storageframework
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2017-05-02 14:44:37 +0200
committerHenning Baldersheim <balder@yahoo-inc.com>2017-05-02 14:44:37 +0200
commit76bd4c8d72d88ee75ba1e1f41c191810fbabc6c4 (patch)
tree960b9b911ec9ad40fecad25aae65dfa62a7f7501 /storageframework
parent29b7b904fc467ee13b01a850f46372049eedf0cd (diff)
Add missing file
Diffstat (limited to 'storageframework')
-rw-r--r--storageframework/src/vespa/storageframework/defaultimplementation/component/testcomponentregister.cpp32
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() {}
+
+}