summaryrefslogtreecommitdiffstats
path: root/config-model/src/test/java/com/yahoo/searchdefinition/processing/ImplicitSummariesTestCase.java
diff options
context:
space:
mode:
authorGeir Storli <geirst@oath.com>2018-06-06 15:18:53 +0200
committerGeir Storli <geirst@oath.com>2018-06-06 15:18:53 +0200
commitdd5ae85a9c1fe1b685fa673359ed367bd5d9fdb5 (patch)
tree60812fda3194d4631d552191498764920967365c /config-model/src/test/java/com/yahoo/searchdefinition/processing/ImplicitSummariesTestCase.java
parente679cfae1c200a230de880eeb0855c5733ffa1a7 (diff)
Add new summary transform (attributecombiner) for complex fields that are represented by only struct field attributes.
Diffstat (limited to 'config-model/src/test/java/com/yahoo/searchdefinition/processing/ImplicitSummariesTestCase.java')
-rw-r--r--config-model/src/test/java/com/yahoo/searchdefinition/processing/ImplicitSummariesTestCase.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/ImplicitSummariesTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/ImplicitSummariesTestCase.java
index c7127cf3ede..9212617a870 100644
--- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/ImplicitSummariesTestCase.java
+++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/ImplicitSummariesTestCase.java
@@ -4,6 +4,7 @@ package com.yahoo.searchdefinition.processing;
import com.yahoo.searchdefinition.Search;
import com.yahoo.searchdefinition.SearchBuilder;
import com.yahoo.searchdefinition.parser.ParseException;
+import com.yahoo.vespa.documentmodel.SummaryTransform;
import org.junit.Test;
import java.io.IOException;
@@ -14,6 +15,7 @@ import java.util.logging.Level;
import java.util.logging.LogRecord;
import java.util.logging.Logger;
+import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
@@ -55,4 +57,16 @@ public class ImplicitSummariesTestCase {
}
}
+
+ @Test
+ public void attribute_combiner_transform_is_set_on_array_of_struct_with_only_struct_field_attributes() throws IOException, ParseException {
+ Search search = SearchBuilder.buildFromFile("src/test/derived/array_of_struct_attribute/test.sd");
+ assertEquals(SummaryTransform.ATTRIBUTECOMBINER, search.getSummaryField("elem_array").getTransform());
+ }
+
+ @Test
+ public void attribute_combiner_transform_is_set_on_map_of_struct_with_only_struct_field_attributes() throws IOException, ParseException {
+ Search search = SearchBuilder.buildFromFile("src/test/derived/map_of_struct_attribute/test.sd");
+ assertEquals(SummaryTransform.ATTRIBUTECOMBINER, search.getSummaryField("elem_map").getTransform());
+ }
}