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/attribute/attribute_specs_builder/attribute_specs_builder_test.cpp5
-rw-r--r--searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp8
-rw-r--r--searchcore/src/tests/proton/proton_configurer/proton_configurer_test.cpp6
3 files changed, 16 insertions, 3 deletions
diff --git a/searchcore/src/tests/proton/attribute/attribute_specs_builder/attribute_specs_builder_test.cpp b/searchcore/src/tests/proton/attribute/attribute_specs_builder/attribute_specs_builder_test.cpp
index 0e60f9c9004..379c9282b67 100644
--- a/searchcore/src/tests/proton/attribute/attribute_specs_builder/attribute_specs_builder_test.cpp
+++ b/searchcore/src/tests/proton/attribute/attribute_specs_builder/attribute_specs_builder_test.cpp
@@ -6,6 +6,7 @@ LOG_SETUP("attribute_specs_builder_test");
#include <vespa/vespalib/stllike/string.h>
#include <vespa/searchcore/proton/test/attribute_utils.h>
#include <vespa/searchcore/proton/attribute/attribute_specs_builder.h>
+#include <vespa/searchcore/proton/attribute/attribute_specs.h>
#include <vespa/searchcore/proton/common/i_document_type_inspector.h>
#include <vespa/vespalib/test/insertion_operators.h>
#include <vespa/config-indexschema.h>
@@ -173,8 +174,8 @@ public:
}
void assertSpecs(const std::vector<AttributeSpec> &expSpecs)
{
- auto &actSpecs = _builder.getAttributeSpecs();
- EXPECT_EQUAL(expSpecs, actSpecs.getSpecs());
+ const auto &actSpecs = _builder.getAttributeSpecs();
+ EXPECT_EQUAL(expSpecs, actSpecs->getSpecs());
}
void assertConfigs(const std::vector<AttributesConfig::Attribute> &exp)
{
diff --git a/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp b/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp
index 21c211f4a73..7c49956ea69 100644
--- a/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp
@@ -6,6 +6,7 @@
#include <vespa/config-rank-profiles.h>
#include <vespa/config-imported-fields.h>
#include <vespa/config-attributes.h>
+#include <vespa/searchcore/proton/attribute/attribute_specs.h>
using namespace document;
using namespace proton;
@@ -100,4 +101,11 @@ TEST_F("require that makeReplayConfig() drops unneeded configs", Fixture)
EXPECT_TRUE(DDBC::preferOriginalConfig(f.nullCfg).get() == nullptr);
}
+TEST_F("require that attribute spec is setup", Fixture)
+{
+ const auto &attributeSpecs = f.fullCfg->getAttributeSpecs().getSpecs();
+ EXPECT_EQUAL(1, attributeSpecs.size());
+ EXPECT_EQUAL("my_attribute", attributeSpecs[0].getName());
+}
+
TEST_MAIN() { TEST_RUN_ALL(); }
diff --git a/searchcore/src/tests/proton/proton_configurer/proton_configurer_test.cpp b/searchcore/src/tests/proton/proton_configurer/proton_configurer_test.cpp
index 7a8247c8944..2ddb1752d24 100644
--- a/searchcore/src/tests/proton/proton_configurer/proton_configurer_test.cpp
+++ b/searchcore/src/tests/proton/proton_configurer/proton_configurer_test.cpp
@@ -20,6 +20,7 @@
#include <vespa/searchcommon/common/schemaconfigurer.h>
#include <vespa/vespalib/util/threadstackexecutor.h>
#include <vespa/vespalib/test/insertion_operators.h>
+#include <vespa/searchcore/proton/attribute/attribute_specs_builder.h>
using namespace config;
using namespace proton;
@@ -71,12 +72,15 @@ struct DBConfigFixture {
const vespalib::string &configId,
const vespalib::string &docTypeName)
{
+ AttributeSpecsBuilder attributeSpecsBuilder;
+ attributeSpecsBuilder.setup(_attributesBuilder);
return std::make_shared<DocumentDBConfig>
(generation,
std::make_shared<RankProfilesConfig>(_rankProfilesBuilder),
buildRankingConstants(),
std::make_shared<IndexschemaConfig>(_indexschemaBuilder),
- std::make_shared<AttributesConfig>(_attributesBuilder),
+ attributeSpecsBuilder.getAttributesConfig(),
+ attributeSpecsBuilder.getAttributeSpecs(),
std::make_shared<SummaryConfig>(_summaryBuilder),
std::make_shared<SummarymapConfig>(_summarymapBuilder),
std::make_shared<JuniperrcConfig>(_juniperrcBuilder),