summaryrefslogtreecommitdiffstats
path: root/searchcore/src/tests/proton/proton_config_fetcher
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@oath.com>2018-01-09 15:10:12 +0000
committerTor Egge <Tor.Egge@oath.com>2018-01-09 15:10:12 +0000
commit19c0c4bdc483a7eaec97c73ab2217d51880dd333 (patch)
treed1656b8f52ff12b10dc3fb630299fe81bd3d7c2b /searchcore/src/tests/proton/proton_config_fetcher
parente8b197ceb9652cb85f3473675725e3c3d894c98f (diff)
Let proton subscribe to bucketspaces config.
Diffstat (limited to 'searchcore/src/tests/proton/proton_config_fetcher')
-rw-r--r--searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp b/searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp
index b9059338f27..37e4dfc486d 100644
--- a/searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp
+++ b/searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp
@@ -18,6 +18,7 @@
#include <vespa/searchcore/config/config-ranking-constants.h>
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/vespalib/util/varholder.h>
+#include <vespa/config-bucketspaces.h>
#include <mutex>
using namespace config;
@@ -26,6 +27,8 @@ using namespace vespa::config::search::core;
using namespace vespa::config::search::summary;
using namespace vespa::config::search;
using namespace cloud::config::filedistribution;
+using vespa::config::content::core::BucketspacesConfig;
+using vespa::config::content::core::BucketspacesConfigBuilder;
using config::ConfigUri;
using document::DocumentTypeRepo;
@@ -52,6 +55,7 @@ struct ConfigTestFixture {
ProtonConfigBuilder protonBuilder;
DocumenttypesConfigBuilder documenttypesBuilder;
FiledistributorrpcConfigBuilder filedistBuilder;
+ BucketspacesConfigBuilder bucketspacesBuilder;
map<std::string, DoctypeFixture::UP> dbConfig;
ConfigSet set;
IConfigContext::SP context;
@@ -62,6 +66,7 @@ struct ConfigTestFixture {
protonBuilder(),
documenttypesBuilder(),
filedistBuilder(),
+ bucketspacesBuilder(),
dbConfig(),
set(),
context(new ConfigContext(set)),
@@ -70,6 +75,7 @@ struct ConfigTestFixture {
set.addBuilder(configId, &protonBuilder);
set.addBuilder(configId, &documenttypesBuilder);
set.addBuilder(configId, &filedistBuilder);
+ set.addBuilder(configId, &bucketspacesBuilder);
addDocType("_alwaysthere_");
}
@@ -146,6 +152,7 @@ struct ConfigTestFixture {
DocumentTypeRepo::SP(new DocumentTypeRepo(documenttypesBuilder)),
BootstrapConfig::ProtonConfigSP(new ProtonConfig(protonBuilder)),
std::make_shared<FiledistributorrpcConfig>(),
+ std::make_shared<BucketspacesConfig>(bucketspacesBuilder),
std::make_shared<TuneFileDocumentDB>()));
}
@@ -197,11 +204,13 @@ struct ProtonConfigOwner : public proton::IProtonConfigurer
TEST_F("require that bootstrap config manager creats correct key set", BootstrapConfigManager("foo")) {
const ConfigKeySet set(f1.createConfigKeySet());
- ASSERT_EQUAL(3u, set.size());
+ ASSERT_EQUAL(4u, set.size());
ConfigKey protonKey(ConfigKey::create<ProtonConfig>("foo"));
ConfigKey dtKey(ConfigKey::create<DocumenttypesConfig>("foo"));
+ ConfigKey bsKey(ConfigKey::create<BucketspacesConfig>("foo"));
ASSERT_TRUE(set.find(protonKey) != set.end());
ASSERT_TRUE(set.find(dtKey) != set.end());
+ ASSERT_TRUE(set.find(bsKey) != set.end());
}
TEST_FFF("require that bootstrap config manager updates config", ConfigTestFixture("search"),