summaryrefslogtreecommitdiffstats
path: root/searchcore/src/tests/proton
diff options
context:
space:
mode:
Diffstat (limited to 'searchcore/src/tests/proton')
-rw-r--r--searchcore/src/tests/proton/config/config.cpp13
-rw-r--r--searchcore/src/tests/proton/docsummary/docsummary.cpp2
-rw-r--r--searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp5
-rw-r--r--searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp2
-rw-r--r--searchcore/src/tests/proton/documentdb/documentdb_test.cpp2
-rw-r--r--searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp2
-rw-r--r--searchcore/src/tests/proton/documentdb/documentdbconfigscout/documentdbconfigscout_test.cpp2
-rw-r--r--searchcore/src/tests/proton/documentdb/fileconfigmanager/fileconfigmanager_test.cpp7
-rw-r--r--searchcore/src/tests/proton/server/memoryconfigstore_test.cpp1
9 files changed, 32 insertions, 4 deletions
diff --git a/searchcore/src/tests/proton/config/config.cpp b/searchcore/src/tests/proton/config/config.cpp
index 3cb6f3c3e23..5a26e3ac016 100644
--- a/searchcore/src/tests/proton/config/config.cpp
+++ b/searchcore/src/tests/proton/config/config.cpp
@@ -10,12 +10,14 @@ LOG_SETUP("config_test");
#include <vespa/searchcore/proton/server/documentdbconfigmanager.h>
#include <vespa/searchcore/proton/server/protonconfigurer.h>
#include <vespa/vespalib/util/varholder.h>
+#include <vespa/fileacquirer/config-filedistributorrpc.h>
using namespace config;
using namespace proton;
using namespace vespa::config::search::core;
using namespace vespa::config::search::summary;
using namespace vespa::config::search;
+using namespace cloud::config::filedistribution;
using config::ConfigUri;
using document::DocumentTypeRepo;
@@ -30,6 +32,7 @@ struct DoctypeFixture {
typedef vespalib::LinkedPtr<DoctypeFixture> LP;
AttributesConfigBuilder attributesBuilder;
RankProfilesConfigBuilder rankProfilesBuilder;
+ RankingConstantsConfigBuilder rankingConstantsBuilder;
IndexschemaConfigBuilder indexschemaBuilder;
SummaryConfigBuilder summaryBuilder;
SummarymapConfigBuilder summarymapBuilder;
@@ -40,6 +43,7 @@ struct ConfigTestFixture {
const std::string configId;
ProtonConfigBuilder protonBuilder;
DocumenttypesConfigBuilder documenttypesBuilder;
+ FiledistributorrpcConfigBuilder filedistBuilder;
map<std::string, DoctypeFixture::LP> dbConfig;
ConfigSet set;
IConfigContext::SP context;
@@ -49,6 +53,7 @@ struct ConfigTestFixture {
: configId(id),
protonBuilder(),
documenttypesBuilder(),
+ filedistBuilder(),
dbConfig(),
set(),
context(new ConfigContext(set)),
@@ -56,6 +61,7 @@ struct ConfigTestFixture {
{
set.addBuilder(configId, &protonBuilder);
set.addBuilder(configId, &documenttypesBuilder);
+ set.addBuilder(configId, &filedistBuilder);
addDocType("_alwaysthere_");
}
@@ -77,6 +83,7 @@ struct ConfigTestFixture {
DoctypeFixture::LP fixture(new DoctypeFixture());
set.addBuilder(db.configid, &fixture->attributesBuilder);
set.addBuilder(db.configid, &fixture->rankProfilesBuilder);
+ set.addBuilder(db.configid, &fixture->rankingConstantsBuilder);
set.addBuilder(db.configid, &fixture->indexschemaBuilder);
set.addBuilder(db.configid, &fixture->summaryBuilder);
set.addBuilder(db.configid, &fixture->summarymapBuilder);
@@ -111,6 +118,7 @@ struct ConfigTestFixture {
DoctypeFixture::LP fixture(dbConfig[name]);
return (fixture->attributesBuilder == dbc->getAttributesConfig() &&
fixture->rankProfilesBuilder == dbc->getRankProfilesConfig() &&
+ fixture->rankingConstantsBuilder == dbc->getRankingConstantsConfig() &&
fixture->indexschemaBuilder == dbc->getIndexschemaConfig() &&
fixture->summaryBuilder == dbc->getSummaryConfig() &&
fixture->summarymapBuilder == dbc->getSummarymapConfig() &&
@@ -127,6 +135,7 @@ struct ConfigTestFixture {
BootstrapConfig::DocumenttypesConfigSP(new DocumenttypesConfig(documenttypesBuilder)),
DocumentTypeRepo::SP(new DocumentTypeRepo(documenttypesBuilder)),
BootstrapConfig::ProtonConfigSP(new ProtonConfig(protonBuilder)),
+ BootstrapConfig::FiledistributorrpcConfigSP(new FiledistributorrpcConfig()),
TuneFileDocumentDB::SP(new TuneFileDocumentDB())));
}
@@ -166,7 +175,7 @@ typedef OwnerFixture<DocumentDBConfig::SP, IDocumentDBConfigOwner> DBOwner;
TEST_F("require that bootstrap config manager creats correct key set", BootstrapConfigManager("foo")) {
const ConfigKeySet set(f1.createConfigKeySet());
- ASSERT_EQUAL(2u, set.size());
+ ASSERT_EQUAL(3u, set.size());
ConfigKey protonKey(ConfigKey::create<ProtonConfig>("foo"));
ConfigKey dtKey(ConfigKey::create<DocumenttypesConfig>("foo"));
ASSERT_TRUE(set.find(protonKey) != set.end());
@@ -196,7 +205,7 @@ TEST_FF("require_that_documentdb_config_manager_subscribes_for_config",
DocumentDBConfigManager(f1.configId + "/typea", "typea")) {
f1.addDocType("typea");
const ConfigKeySet keySet(f2.createConfigKeySet());
- ASSERT_EQUAL(6u, keySet.size());
+ ASSERT_EQUAL(7u, keySet.size());
ConfigRetriever retriever(keySet, f1.context);
f2.forwardConfig(f1.getBootstrapConfig(1));
f2.update(retriever.getBootstrapConfigs()); // Cheating, but we only need the configs
diff --git a/searchcore/src/tests/proton/docsummary/docsummary.cpp b/searchcore/src/tests/proton/docsummary/docsummary.cpp
index b472c612281..e5365ba0ede 100644
--- a/searchcore/src/tests/proton/docsummary/docsummary.cpp
+++ b/searchcore/src/tests/proton/docsummary/docsummary.cpp
@@ -31,6 +31,7 @@ using namespace search::docsummary;
using namespace search::engine;
using namespace search::index;
using namespace search::transactionlog;
+using namespace cloud::config::filedistribution;
using search::TuneFileDocumentDB;
using document::DocumenttypesConfig;
using storage::spi::Timestamp;
@@ -169,6 +170,7 @@ public:
_documenttypesConfig,
_repo,
BootstrapConfig::ProtonConfigSP(new ProtonConfig()),
+ BootstrapConfig::FiledistributorrpcConfigSP(new FiledistributorrpcConfig()),
_tuneFileDocumentDB));
_configMgr.forwardConfig(b);
_configMgr.nextGeneration(0);
diff --git a/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp b/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp
index 4017364eb41..e401f8e0301 100644
--- a/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp
@@ -320,8 +320,8 @@ createConfig()
DocumentDBConfig::SP config
(new DocumentDBConfig(
0,
- DocumentDBConfig::RankProfilesConfigSP(
- new RankProfilesConfig()),
+ DocumentDBConfig::RankProfilesConfigSP(new RankProfilesConfig()),
+ DocumentDBConfig::RankingConstantsConfigSP(new RankingConstantsConfig()),
DocumentDBConfig::IndexschemaConfigSP(new IndexschemaConfig()),
DocumentDBConfig::AttributesConfigSP(new AttributesConfig()),
DocumentDBConfig::SummaryConfigSP(new SummaryConfig()),
@@ -344,6 +344,7 @@ createConfig(const Schema::SP &schema)
(new DocumentDBConfig(
0,
DocumentDBConfig::RankProfilesConfigSP(new RankProfilesConfig()),
+ DocumentDBConfig::RankingConstantsConfigSP(new RankingConstantsConfig()),
DocumentDBConfig::IndexschemaConfigSP(new IndexschemaConfig()),
DocumentDBConfig::AttributesConfigSP(new AttributesConfig()),
DocumentDBConfig::SummaryConfigSP(new SummaryConfig()),
diff --git a/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp b/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp
index 5c6a7db1876..a98f07439c9 100644
--- a/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp
@@ -31,6 +31,7 @@ using namespace search;
using namespace search::common;
using namespace search::index;
using namespace search::transactionlog;
+using namespace cloud::config::filedistribution;
using namespace searchcorespi;
using namespace vespalib;
using proton::bucketdb::BucketDBHandler;
@@ -262,6 +263,7 @@ struct MyConfigSnapshot
documenttypesConfig,
_builder.getDocumentTypeRepo(),
BootstrapConfig::ProtonConfigSP(new ProtonConfig()),
+ BootstrapConfig::FiledistributorrpcConfigSP(new FiledistributorrpcConfig()),
tuneFileDocumentDB));
config::DirSpec spec(cfgDir);
DocumentDBConfigHelper mgr(spec, "searchdocument");
diff --git a/searchcore/src/tests/proton/documentdb/documentdb_test.cpp b/searchcore/src/tests/proton/documentdb/documentdb_test.cpp
index 605a8fc5530..d6d54d31f16 100644
--- a/searchcore/src/tests/proton/documentdb/documentdb_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/documentdb_test.cpp
@@ -28,6 +28,7 @@ using search::index::Schema;
using search::transactionlog::TransLogServer;
using namespace proton;
using namespace vespalib::slime;
+using namespace cloud::config::filedistribution;
using search::TuneFileDocumentDB;
using document::DocumenttypesConfig;
using search::index::DummyFileHeaderContext;
@@ -79,6 +80,7 @@ Fixture::Fixture()
documenttypesConfig,
repo,
BootstrapConfig::ProtonConfigSP(new ProtonConfig()),
+ BootstrapConfig::FiledistributorrpcConfigSP(new FiledistributorrpcConfig()),
tuneFileDocumentDB));
mgr.forwardConfig(b);
mgr.nextGeneration(0);
diff --git a/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp b/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp
index 5f9de9ae545..831c5d522d9 100644
--- a/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp
@@ -14,6 +14,7 @@ using namespace search::index;
using namespace vespa::config::search;
using std::shared_ptr;
using std::make_shared;
+using vespa::config::search::core::RankingConstantsConfig;
typedef shared_ptr<DocumentDBConfig> DDBCSP;
@@ -28,6 +29,7 @@ getConfig(int64_t generation, const Schema::SP &schema,
return make_shared<DocumentDBConfig>(
generation,
make_shared<RankProfilesConfig>(rankProfiles),
+ make_shared<RankingConstantsConfig>(),
make_shared<IndexschemaConfig>(),
make_shared<AttributesConfig>(),
make_shared<SummaryConfig>(),
diff --git a/searchcore/src/tests/proton/documentdb/documentdbconfigscout/documentdbconfigscout_test.cpp b/searchcore/src/tests/proton/documentdb/documentdbconfigscout/documentdbconfigscout_test.cpp
index e935fff1431..bb0a3e33b50 100644
--- a/searchcore/src/tests/proton/documentdb/documentdbconfigscout/documentdbconfigscout_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/documentdbconfigscout/documentdbconfigscout_test.cpp
@@ -15,6 +15,7 @@ using namespace search::index;
using namespace vespa::config::search;
using std::shared_ptr;
using std::make_shared;
+using vespa::config::search::core::RankingConstantsConfig;
typedef shared_ptr<DocumentDBConfig> DDBCSP;
@@ -29,6 +30,7 @@ getConfig(int64_t generation, const Schema::SP &schema,
return make_shared<DocumentDBConfig>(
generation,
make_shared<RankProfilesConfig>(),
+ make_shared<RankingConstantsConfig>(),
make_shared<IndexschemaConfig>(),
make_shared<AttributesConfig>(attributes),
make_shared<SummaryConfig>(),
diff --git a/searchcore/src/tests/proton/documentdb/fileconfigmanager/fileconfigmanager_test.cpp b/searchcore/src/tests/proton/documentdb/fileconfigmanager/fileconfigmanager_test.cpp
index 499f8a11aaf..c811c8912b0 100644
--- a/searchcore/src/tests/proton/documentdb/fileconfigmanager/fileconfigmanager_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/fileconfigmanager/fileconfigmanager_test.cpp
@@ -18,6 +18,7 @@ using namespace search::index;
using namespace search;
using namespace vespa::config::search::core;
using namespace vespa::config::search;
+using namespace cloud::config::filedistribution;
typedef DocumentDBConfigHelper DBCM;
typedef DocumentDBConfig::DocumenttypesConfigSP DocumenttypesConfigSP;
@@ -32,6 +33,7 @@ DocumentDBConfig::SP
getConfig(int64_t generation, const Schema::SP &schema)
{
typedef DocumentDBConfig::RankProfilesConfigSP RankProfilesConfigSP;
+ typedef DocumentDBConfig::RankingConstantsConfigSP RankingConstantsConfigSP;
typedef DocumentDBConfig::IndexschemaConfigSP IndexschemaConfigSP;
typedef DocumentDBConfig::AttributesConfigSP AttributesConfigSP;
typedef DocumentDBConfig::SummaryConfigSP SummaryConfigSP;
@@ -40,6 +42,7 @@ getConfig(int64_t generation, const Schema::SP &schema)
typedef DocumentDBConfig::DocumenttypesConfigSP DocumenttypesConfigSP;
RankProfilesConfigSP rp(new vespa::config::search::RankProfilesConfig);
+ RankingConstantsConfigSP rc(new vespa::config::search::core::RankingConstantsConfig);
IndexschemaConfigSP is(new vespa::config::search::IndexschemaConfig);
AttributesConfigSP a(new vespa::config::search::AttributesConfig);
SummaryConfigSP s(new vespa::config::search::SummaryConfig);
@@ -54,6 +57,7 @@ getConfig(int64_t generation, const Schema::SP &schema)
new DocumentDBConfig(
generation,
rp,
+ rc,
is,
a,
s,
@@ -95,6 +99,7 @@ makeBaseConfigSnapshot()
dtcfg,
DocumentTypeRepo::SP(new DocumentTypeRepo(*dtcfg)),
BootstrapConfig::ProtonConfigSP(new ProtonConfig()),
+ BootstrapConfig::FiledistributorrpcConfigSP(new FiledistributorrpcConfig()),
TuneFileDocumentDB::SP(new TuneFileDocumentDB())));
dbcm.forwardConfig(b);
dbcm.nextGeneration(0);
@@ -126,6 +131,7 @@ makeEmptyConfigSnapshot(void)
return DocumentDBConfig::SP(new DocumentDBConfig(
0,
DocumentDBConfig::RankProfilesConfigSP(),
+ DocumentDBConfig::RankingConstantsConfigSP(),
DocumentDBConfig::IndexschemaConfigSP(),
DocumentDBConfig::AttributesConfigSP(),
DocumentDBConfig::SummaryConfigSP(),
@@ -159,6 +165,7 @@ void
assertEqualSnapshot(const DocumentDBConfig &exp, const DocumentDBConfig &act)
{
EXPECT_TRUE(exp.getRankProfilesConfig() == act.getRankProfilesConfig());
+ EXPECT_TRUE(exp.getRankingConstantsConfig() == act.getRankingConstantsConfig());
EXPECT_TRUE(exp.getIndexschemaConfig() == act.getIndexschemaConfig());
EXPECT_TRUE(exp.getAttributesConfig() == act.getAttributesConfig());
EXPECT_TRUE(exp.getSummaryConfig() == act.getSummaryConfig());
diff --git a/searchcore/src/tests/proton/server/memoryconfigstore_test.cpp b/searchcore/src/tests/proton/server/memoryconfigstore_test.cpp
index 301633404bc..f1cbd012ab5 100644
--- a/searchcore/src/tests/proton/server/memoryconfigstore_test.cpp
+++ b/searchcore/src/tests/proton/server/memoryconfigstore_test.cpp
@@ -24,6 +24,7 @@ getConfig(int64_t generation, const Schema::SP &schema)
new DocumentDBConfig(
generation,
DocumentDBConfig::RankProfilesConfigSP(),
+ DocumentDBConfig::RankingConstantsConfigSP(),
DocumentDBConfig::IndexschemaConfigSP(),
DocumentDBConfig::AttributesConfigSP(),
DocumentDBConfig::SummaryConfigSP(),