summaryrefslogtreecommitdiffstats
path: root/config-model/src/test/java/com/yahoo/searchdefinition/processing/FastAccessValidatorTest.java
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@yahoo-inc.com>2017-04-05 16:01:20 +0200
committerBjørn Christian Seime <bjorncs@yahoo-inc.com>2017-04-05 16:01:20 +0200
commitaaaf9ae5ea617c64f1a9156f35862b6191c5c074 (patch)
tree28da4314a57914a4f783f4cd5eb9aaa88d4a6ea3 /config-model/src/test/java/com/yahoo/searchdefinition/processing/FastAccessValidatorTest.java
parent3b06e35228ec7960b541af594ab1a2fa2cf982ab (diff)
Use joinLines + add reference field
Diffstat (limited to 'config-model/src/test/java/com/yahoo/searchdefinition/processing/FastAccessValidatorTest.java')
-rw-r--r--config-model/src/test/java/com/yahoo/searchdefinition/processing/FastAccessValidatorTest.java47
1 files changed, 30 insertions, 17 deletions
diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/FastAccessValidatorTest.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/FastAccessValidatorTest.java
index 2e2633a6c84..8097d828da9 100644
--- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/FastAccessValidatorTest.java
+++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/FastAccessValidatorTest.java
@@ -1,5 +1,6 @@
package com.yahoo.searchdefinition.processing;
+import com.yahoo.config.model.test.TestUtil;
import com.yahoo.searchdefinition.RankProfileRegistry;
import com.yahoo.searchdefinition.SearchBuilder;
import com.yahoo.searchdefinition.parser.ParseException;
@@ -19,26 +20,38 @@ public class FastAccessValidatorTest {
public void throws_exception_on_incompatible_use_of_fastaccess() throws ParseException {
SearchBuilder builder = new SearchBuilder(new RankProfileRegistry());
builder.importString(
- "search test {\n" +
- " document test { \n" +
- " field int_attribute type int { \n" +
- " indexing: attribute \n" +
- " attribute: fast-access\n" +
- " }\n" +
- " field predicate_attribute type predicate {\n" +
- " indexing: attribute \n" +
- " attribute: fast-access\n" +
- " }\n" +
- " field tensor_attribute type tensor(x[]) {\n" +
- " indexing: attribute \n" +
- " attribute: fast-access\n" +
- " }\n" +
- " }\n" +
- "}\n");
+ TestUtil.joinLines(
+ "search parent {",
+ " document parent {",
+ " field int_field type int { indexing: attribute }",
+ " }",
+ "}"));
+ builder.importString(
+ TestUtil.joinLines(
+ "search test {",
+ " document test { ",
+ " field int_attribute type int { ",
+ " indexing: attribute ",
+ " attribute: fast-access",
+ " }",
+ " field predicate_attribute type predicate {",
+ " indexing: attribute ",
+ " attribute: fast-access",
+ " }",
+ " field tensor_attribute type tensor(x[]) {",
+ " indexing: attribute ",
+ " attribute: fast-access",
+ " }",
+ " field reference_attribute type reference<parent> {",
+ " indexing: attribute ",
+ " attribute: fast-access",
+ " }",
+ " }",
+ "}"));
exceptionRule.expect(IllegalArgumentException.class);
exceptionRule.expectMessage(
"For search 'test': The following attributes have a type that is incompatible " +
- "with fast-access: predicate_attribute, tensor_attribute. " +
+ "with fast-access: predicate_attribute, tensor_attribute, reference_attribute. " +
"Predicate, tensor and reference attributes are incompatible with fast-access.");
builder.build();
}