aboutsummaryrefslogtreecommitdiffstats
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.cpp1
-rw-r--r--searchcore/src/tests/proton/documentdb/configurer/CMakeLists.txt1
-rw-r--r--searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp43
-rw-r--r--searchcore/src/tests/proton/documentdb/documentdbconfig/CMakeLists.txt1
-rw-r--r--searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp19
-rw-r--r--searchcore/src/tests/proton/documentdb/documentdbconfigscout/CMakeLists.txt1
-rw-r--r--searchcore/src/tests/proton/documentdb/documentdbconfigscout/documentdbconfigscout_test.cpp19
-rw-r--r--searchcore/src/tests/proton/documentdb/fileconfigmanager/CMakeLists.txt1
-rw-r--r--searchcore/src/tests/proton/documentdb/fileconfigmanager/fileconfigmanager_test.cpp38
-rw-r--r--searchcore/src/tests/proton/server/CMakeLists.txt1
-rw-r--r--searchcore/src/tests/proton/server/memoryconfigstore_test.cpp21
11 files changed, 22 insertions, 124 deletions
diff --git a/searchcore/src/tests/proton/config/config.cpp b/searchcore/src/tests/proton/config/config.cpp
index 485f063e436..86379e50c9d 100644
--- a/searchcore/src/tests/proton/config/config.cpp
+++ b/searchcore/src/tests/proton/config/config.cpp
@@ -118,7 +118,6 @@ 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() &&
diff --git a/searchcore/src/tests/proton/documentdb/configurer/CMakeLists.txt b/searchcore/src/tests/proton/documentdb/configurer/CMakeLists.txt
index 1e8b241b72c..2f123dfb7b8 100644
--- a/searchcore/src/tests/proton/documentdb/configurer/CMakeLists.txt
+++ b/searchcore/src/tests/proton/documentdb/configurer/CMakeLists.txt
@@ -3,6 +3,7 @@ vespa_add_executable(searchcore_configurer_test_app TEST
SOURCES
configurer_test.cpp
DEPENDS
+ searchcore_test
searchcore_server
searchcore_reprocessing
searchcore_index
diff --git a/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp b/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp
index c2f977c733a..1ecfab99aca 100644
--- a/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp
@@ -19,15 +19,10 @@ LOG_SETUP("configurer_test");
#include <vespa/searchcore/proton/server/searchable_doc_subdb_configurer.h>
#include <vespa/searchcore/proton/server/executorthreadingservice.h>
#include <vespa/searchcore/proton/server/fast_access_doc_subdb_configurer.h>
-#include <vespa/searchcore/proton/server/searchable_feed_view.h>
-#include <vespa/searchcore/proton/server/matchers.h>
#include <vespa/searchcore/proton/server/summaryadapter.h>
-#include <vespa/searchcore/proton/common/commit_time_tracker.h>
-#include <vespa/searchlib/attribute/attributevector.h>
-#include <vespa/searchlib/common/tunefileinfo.h>
+#include <vespa/searchcore/proton/test/documentdb_config_builder.h>
#include <vespa/searchlib/index/dummyfileheadercontext.h>
#include <vespa/searchlib/transactionlog/nosyncproxy.h>
-#include <vespa/vespalib/eval/value_cache/constant_value.h>
#include <vespa/vespalib/io/fileutil.h>
using namespace config;
@@ -317,43 +312,15 @@ struct FastAccessFixture
DocumentDBConfig::SP
createConfig()
{
- return std::make_shared<DocumentDBConfig>(
- 0,
- std::make_shared<RankProfilesConfig>(),
- std::make_shared<RankingConstantsConfig>(),
- std::make_shared<matching::RankingConstants>(),
- std::make_shared<IndexschemaConfig>(),
- std::make_shared<AttributesConfig>(),
- std::make_shared<SummaryConfig>(),
- std::make_shared<SummarymapConfig>(),
- std::make_shared<JuniperrcConfig>(),
- std::make_shared<DocumenttypesConfig>(),
- DocumentTypeRepo::SP(createRepo()),
- std::make_shared<TuneFileDocumentDB>(),
- std::make_shared<Schema>(),
- std::make_shared<DocumentDBMaintenanceConfig>(),
- "client", DOC_TYPE);
+ return test::DocumentDBConfigBuilder(0, std::make_shared<Schema>(), "client", DOC_TYPE).
+ repo(createRepo()).build();
}
DocumentDBConfig::SP
createConfig(const Schema::SP &schema)
{
- return std::make_shared<DocumentDBConfig>(
- 0,
- std::make_shared<RankProfilesConfig>(),
- std::make_shared<RankingConstantsConfig>(),
- std::make_shared<matching::RankingConstants>(),
- std::make_shared<IndexschemaConfig>(),
- std::make_shared<AttributesConfig>(),
- std::make_shared<SummaryConfig>(),
- std::make_shared<SummarymapConfig>(),
- std::make_shared<JuniperrcConfig>(),
- std::make_shared<DocumenttypesConfig>(),
- DocumentTypeRepo::SP(createRepo()),
- std::make_shared<TuneFileDocumentDB>(),
- schema,
- std::make_shared<DocumentDBMaintenanceConfig>(),
- "client", DOC_TYPE);
+ return test::DocumentDBConfigBuilder(0, schema, "client", DOC_TYPE).
+ repo(createRepo()).build();
}
struct SearchViewComparer
diff --git a/searchcore/src/tests/proton/documentdb/documentdbconfig/CMakeLists.txt b/searchcore/src/tests/proton/documentdb/documentdbconfig/CMakeLists.txt
index 1ad3b7f21f6..ee339c1c145 100644
--- a/searchcore/src/tests/proton/documentdb/documentdbconfig/CMakeLists.txt
+++ b/searchcore/src/tests/proton/documentdb/documentdbconfig/CMakeLists.txt
@@ -3,6 +3,7 @@ vespa_add_executable(searchcore_documentdbconfig_test_app TEST
SOURCES
documentdbconfig_test.cpp
DEPENDS
+ searchcore_test
searchcore_server
)
vespa_add_test(NAME searchcore_documentdbconfig_test_app COMMAND searchcore_documentdbconfig_test_app)
diff --git a/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp b/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp
index 5cced5038c8..8fd10b49409 100644
--- a/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp
@@ -5,6 +5,7 @@
LOG_SETUP("documentdbconfig_test");
#include <vespa/searchcore/proton/server/documentdbconfig.h>
+#include <vespa/searchcore/proton/test/documentdb_config_builder.h>
#include <vespa/vespalib/testkit/testapp.h>
using namespace document;
@@ -26,22 +27,8 @@ getConfig(int64_t generation, const Schema::SP &schema,
shared_ptr<DocumentTypeRepo> repo,
const RankProfilesConfig &rankProfiles)
{
- return make_shared<DocumentDBConfig>(
- generation,
- make_shared<RankProfilesConfig>(rankProfiles),
- make_shared<RankingConstantsConfig>(),
- make_shared<matching::RankingConstants>(),
- make_shared<IndexschemaConfig>(),
- make_shared<AttributesConfig>(),
- make_shared<SummaryConfig>(),
- make_shared<SummarymapConfig>(),
- make_shared<summary::JuniperrcConfig>(),
- make_shared<DocumenttypesConfig>(),
- repo,
- make_shared<TuneFileDocumentDB>(),
- schema,
- make_shared<DocumentDBMaintenanceConfig>(),
- "client", "test");
+ return test::DocumentDBConfigBuilder(generation, schema, "client", "test").
+ repo(repo).rankProfiles(make_shared<RankProfilesConfig>(rankProfiles)).build();
}
}
diff --git a/searchcore/src/tests/proton/documentdb/documentdbconfigscout/CMakeLists.txt b/searchcore/src/tests/proton/documentdb/documentdbconfigscout/CMakeLists.txt
index 8de0cc67b2a..6b14919a253 100644
--- a/searchcore/src/tests/proton/documentdb/documentdbconfigscout/CMakeLists.txt
+++ b/searchcore/src/tests/proton/documentdb/documentdbconfigscout/CMakeLists.txt
@@ -3,6 +3,7 @@ vespa_add_executable(searchcore_documentdbconfigscout_test_app TEST
SOURCES
documentdbconfigscout_test.cpp
DEPENDS
+ searchcore_test
searchcore_server
searchcore_attribute
)
diff --git a/searchcore/src/tests/proton/documentdb/documentdbconfigscout/documentdbconfigscout_test.cpp b/searchcore/src/tests/proton/documentdb/documentdbconfigscout/documentdbconfigscout_test.cpp
index 57b77c5a0a5..25c55fa2dbc 100644
--- a/searchcore/src/tests/proton/documentdb/documentdbconfigscout/documentdbconfigscout_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/documentdbconfigscout/documentdbconfigscout_test.cpp
@@ -6,6 +6,7 @@ LOG_SETUP("documentdbconfigscout_test");
#include <vespa/searchcore/proton/server/documentdbconfig.h>
#include <vespa/searchcore/proton/server/documentdbconfigscout.h>
+#include <vespa/searchcore/proton/test/documentdb_config_builder.h>
#include <vespa/vespalib/testkit/testapp.h>
using namespace document;
@@ -27,22 +28,8 @@ getConfig(int64_t generation, const Schema::SP &schema,
shared_ptr<DocumentTypeRepo> repo,
const AttributesConfig &attributes)
{
- return make_shared<DocumentDBConfig>(
- generation,
- make_shared<RankProfilesConfig>(),
- make_shared<RankingConstantsConfig>(),
- make_shared<matching::RankingConstants>(),
- make_shared<IndexschemaConfig>(),
- make_shared<AttributesConfig>(attributes),
- make_shared<SummaryConfig>(),
- make_shared<SummarymapConfig>(),
- make_shared<summary::JuniperrcConfig>(),
- make_shared<DocumenttypesConfig>(),
- repo,
- make_shared<TuneFileDocumentDB>(),
- schema,
- make_shared<DocumentDBMaintenanceConfig>(),
- "client", "test");
+ return test::DocumentDBConfigBuilder(generation, schema, "client", "test").
+ repo(repo).attributes(make_shared<AttributesConfig>(attributes)).build();
}
diff --git a/searchcore/src/tests/proton/documentdb/fileconfigmanager/CMakeLists.txt b/searchcore/src/tests/proton/documentdb/fileconfigmanager/CMakeLists.txt
index d05675249c0..d19e0edf4dc 100644
--- a/searchcore/src/tests/proton/documentdb/fileconfigmanager/CMakeLists.txt
+++ b/searchcore/src/tests/proton/documentdb/fileconfigmanager/CMakeLists.txt
@@ -3,6 +3,7 @@ vespa_add_executable(searchcore_fileconfigmanager_test_app TEST
SOURCES
fileconfigmanager_test.cpp
DEPENDS
+ searchcore_test
searchcore_server
searchcore_pcommon
searchcore_fconfig
diff --git a/searchcore/src/tests/proton/documentdb/fileconfigmanager/fileconfigmanager_test.cpp b/searchcore/src/tests/proton/documentdb/fileconfigmanager/fileconfigmanager_test.cpp
index a0443d6c8e4..e61e3763094 100644
--- a/searchcore/src/tests/proton/documentdb/fileconfigmanager/fileconfigmanager_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/fileconfigmanager/fileconfigmanager_test.cpp
@@ -5,6 +5,7 @@ LOG_SETUP("fileconfigmanager_test");
#include "config-mycfg.h"
#include <vespa/searchcore/proton/server/fileconfigmanager.h>
+#include <vespa/searchcore/proton/test/documentdb_config_builder.h>
#include <vespa/vespalib/io/fileutil.h>
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/searchcore/proton/common/schemautil.h>
@@ -30,22 +31,7 @@ namespace
DocumentDBConfig::SP
getConfig(int64_t generation, const Schema::SP &schema)
{
- return std::make_shared<DocumentDBConfig>(
- generation,
- std::make_shared<vespa::config::search::RankProfilesConfig>(),
- std::make_shared<vespa::config::search::core::RankingConstantsConfig>(),
- std::make_shared<matching::RankingConstants>(),
- std::make_shared<vespa::config::search::IndexschemaConfig>(),
- std::make_shared<vespa::config::search::AttributesConfig>(),
- std::make_shared<vespa::config::search::SummaryConfig>(),
- std::make_shared<vespa::config::search::SummarymapConfig>(),
- std::make_shared<vespa::config::search::summary::JuniperrcConfig>(),
- std::make_shared<document::DocumenttypesConfig>(),
- std::make_shared<document::DocumentTypeRepo>(),
- std::make_shared<search::TuneFileDocumentDB>(),
- schema,
- std::make_shared<DocumentDBMaintenanceConfig>(),
- "client", "test");
+ return test::DocumentDBConfigBuilder(generation, schema, "client", "test").build();
}
Schema::SP
@@ -105,23 +91,7 @@ saveBaseConfigSnapshot(const DocumentDBConfig &snap, const Schema &history, Seri
DocumentDBConfig::SP
makeEmptyConfigSnapshot(void)
{
- return DocumentDBConfig::SP(new DocumentDBConfig(
- 0,
- DocumentDBConfig::RankProfilesConfigSP(),
- DocumentDBConfig::RankingConstantsConfigSP(),
- DocumentDBConfig::RankingConstants::SP(),
- DocumentDBConfig::IndexschemaConfigSP(),
- DocumentDBConfig::AttributesConfigSP(),
- DocumentDBConfig::SummaryConfigSP(),
- DocumentDBConfig::SummarymapConfigSP(),
- DocumentDBConfig::JuniperrcConfigSP(),
- DocumenttypesConfigSP(),
- DocumentTypeRepo::SP(),
- TuneFileDocumentDB::SP(
- new TuneFileDocumentDB()),
- Schema::SP(),
- DocumentDBMaintenanceConfig::SP(),
- "client", "test"));
+ return test::DocumentDBConfigBuilder(0, std::make_shared<Schema>(), "client", "test").build();
}
void incInt(int *i, const DocumentType&) { ++*i; }
@@ -143,7 +113,7 @@ void
assertEqualSnapshot(const DocumentDBConfig &exp, const DocumentDBConfig &act)
{
EXPECT_TRUE(exp.getRankProfilesConfig() == act.getRankProfilesConfig());
- EXPECT_TRUE(exp.getRankingConstantsConfig() == act.getRankingConstantsConfig());
+ EXPECT_TRUE(exp.getRankingConstants() == act.getRankingConstants());
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/CMakeLists.txt b/searchcore/src/tests/proton/server/CMakeLists.txt
index 7b689e33de7..b6191cbb431 100644
--- a/searchcore/src/tests/proton/server/CMakeLists.txt
+++ b/searchcore/src/tests/proton/server/CMakeLists.txt
@@ -46,6 +46,7 @@ vespa_add_executable(searchcore_memoryconfigstore_test_app TEST
SOURCES
memoryconfigstore_test.cpp
DEPENDS
+ searchcore_test
searchcore_server
searchcore_pcommon
)
diff --git a/searchcore/src/tests/proton/server/memoryconfigstore_test.cpp b/searchcore/src/tests/proton/server/memoryconfigstore_test.cpp
index 1156da37aa1..e4c404f5cdd 100644
--- a/searchcore/src/tests/proton/server/memoryconfigstore_test.cpp
+++ b/searchcore/src/tests/proton/server/memoryconfigstore_test.cpp
@@ -7,7 +7,7 @@ LOG_SETUP("memoryconfigstore_test");
#include <vespa/searchcommon/common/schema.h>
#include <vespa/searchcore/proton/server/memoryconfigstore.h>
-#include <vespa/searchlib/common/serialnum.h>
+#include <vespa/searchcore/proton/test/documentdb_config_builder.h>
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/searchcore/proton/common/schemautil.h>
@@ -20,24 +20,7 @@ namespace {
DocumentDBConfig::SP
getConfig(int64_t generation, const Schema::SP &schema)
{
- return DocumentDBConfig::SP(
- new DocumentDBConfig(
- generation,
- DocumentDBConfig::RankProfilesConfigSP(),
- DocumentDBConfig::RankingConstantsConfigSP(),
- DocumentDBConfig::RankingConstants::SP(),
- DocumentDBConfig::IndexschemaConfigSP(),
- DocumentDBConfig::AttributesConfigSP(),
- DocumentDBConfig::SummaryConfigSP(),
- DocumentDBConfig::SummarymapConfigSP(),
- DocumentDBConfig::JuniperrcConfigSP(),
- DocumentDBConfig::DocumenttypesConfigSP(),
- document::DocumentTypeRepo::SP(),
- search::TuneFileDocumentDB::SP(),
- schema,
- DocumentDBMaintenanceConfig::SP(),
- "client",
- "test"));
+ return test::DocumentDBConfigBuilder(generation, schema, "client", "test").build();
}