diff options
Diffstat (limited to 'config-model/src/test/java/com/yahoo/searchdefinition/derived')
10 files changed, 37 insertions, 43 deletions
diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/AbstractExportingTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/AbstractExportingTestCase.java index a345cabe909..7e0eb01f611 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/derived/AbstractExportingTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/derived/AbstractExportingTestCase.java @@ -7,7 +7,7 @@ import com.yahoo.document.DocumenttypesConfig; import com.yahoo.document.config.DocumentmanagerConfig; import com.yahoo.searchdefinition.Search; import com.yahoo.searchdefinition.SearchBuilder; -import com.yahoo.searchdefinition.SchemaTestCase; +import com.yahoo.searchdefinition.SearchDefinitionTestCase; import com.yahoo.searchdefinition.parser.ParseException; import ai.vespa.rankingexpression.importer.configmodelview.ImportedMlModels; import com.yahoo.vespa.configmodel.producers.DocumentManager; @@ -21,7 +21,7 @@ import java.io.IOException; * * @author bratseth */ -public abstract class AbstractExportingTestCase extends SchemaTestCase { +public abstract class AbstractExportingTestCase extends SearchDefinitionTestCase { private static final String tempDir = "temp/"; private static final String searchDefRoot = "src/test/derived/"; diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/AttributeListTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/AttributeListTestCase.java index 80a92a5b5ec..79ec3027c20 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/derived/AttributeListTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/derived/AttributeListTestCase.java @@ -3,7 +3,7 @@ package com.yahoo.searchdefinition.derived; import com.yahoo.searchdefinition.Search; import com.yahoo.searchdefinition.SearchBuilder; -import com.yahoo.searchdefinition.SchemaTestCase; +import com.yahoo.searchdefinition.SearchDefinitionTestCase; import com.yahoo.searchdefinition.document.Attribute; import com.yahoo.searchdefinition.parser.ParseException; import org.junit.Test; @@ -20,7 +20,7 @@ import static org.junit.Assert.assertFalse; * * @author bratseth */ -public class AttributeListTestCase extends SchemaTestCase { +public class AttributeListTestCase extends SearchDefinitionTestCase { @Test public void testDeriving() throws IOException, ParseException { diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/CasingTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/CasingTestCase.java index 07762fc6937..b47a268d95a 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/derived/CasingTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/derived/CasingTestCase.java @@ -3,7 +3,7 @@ package com.yahoo.searchdefinition.derived; import com.yahoo.searchdefinition.Search; import com.yahoo.searchdefinition.SearchBuilder; -import com.yahoo.searchdefinition.SchemaTestCase; +import com.yahoo.searchdefinition.SearchDefinitionTestCase; import com.yahoo.searchdefinition.parser.ParseException; import org.junit.Test; @@ -16,7 +16,7 @@ import static org.junit.Assert.assertEquals; * * @author vegardh */ -public class CasingTestCase extends SchemaTestCase { +public class CasingTestCase extends SearchDefinitionTestCase { @Test public void testCasing() throws IOException, ParseException { diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/DeriverTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/DeriverTestCase.java index 8b09a4efd57..1209da6d64b 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/derived/DeriverTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/derived/DeriverTestCase.java @@ -4,7 +4,7 @@ package com.yahoo.searchdefinition.derived; import com.yahoo.document.DataType; import com.yahoo.document.DocumentTypeManager; import com.yahoo.document.config.DocumentmanagerConfig; -import com.yahoo.searchdefinition.SchemaTestCase; +import com.yahoo.searchdefinition.SearchDefinitionTestCase; import org.junit.Test; import java.util.List; @@ -16,7 +16,7 @@ import static org.junit.Assert.assertEquals; * * @author bratseth */ -public class DeriverTestCase extends SchemaTestCase { +public class DeriverTestCase extends SearchDefinitionTestCase { @Test public void testDeriveDocManager() { diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/EmptyRankProfileTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/EmptyRankProfileTestCase.java index 47862a2611b..aaac1631722 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/derived/EmptyRankProfileTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/derived/EmptyRankProfileTestCase.java @@ -6,7 +6,7 @@ import com.yahoo.search.query.profile.QueryProfileRegistry; import com.yahoo.searchdefinition.RankProfileRegistry; import com.yahoo.searchdefinition.Search; import com.yahoo.searchdefinition.SearchBuilder; -import com.yahoo.searchdefinition.SchemaTestCase; +import com.yahoo.searchdefinition.SearchDefinitionTestCase; import com.yahoo.searchdefinition.document.SDDocumentType; import com.yahoo.searchdefinition.document.SDField; import ai.vespa.rankingexpression.importer.configmodelview.ImportedMlModels; @@ -17,7 +17,7 @@ import org.junit.Test; * * @author bratseth */ -public class EmptyRankProfileTestCase extends SchemaTestCase { +public class EmptyRankProfileTestCase extends SearchDefinitionTestCase { @Test public void testDeriving() { diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/NativeRankTypeDefinitionsTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/NativeRankTypeDefinitionsTestCase.java index 69c247b94d4..c8ba5168e1c 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/derived/NativeRankTypeDefinitionsTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/derived/NativeRankTypeDefinitionsTestCase.java @@ -1,7 +1,7 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.searchdefinition.derived; -import com.yahoo.searchdefinition.SchemaTestCase; +import com.yahoo.searchdefinition.SearchDefinitionTestCase; import com.yahoo.searchdefinition.document.RankType; import org.junit.Test; @@ -14,7 +14,7 @@ import static org.junit.Assert.*; * * @author geirst */ -public class NativeRankTypeDefinitionsTestCase extends SchemaTestCase { +public class NativeRankTypeDefinitionsTestCase extends SearchDefinitionTestCase { @Test public void testTables() { assertEquals(NativeTable.Type.FIRST_OCCURRENCE.getName(), "firstOccurrenceTable"); diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/SearchOrdererTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/SearchOrdererTestCase.java index 0c677456a87..b770024ebf1 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/derived/SearchOrdererTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/derived/SearchOrdererTestCase.java @@ -6,7 +6,7 @@ import com.yahoo.document.TemporaryStructuredDataType; import com.yahoo.searchdefinition.DocumentReference; import com.yahoo.searchdefinition.DocumentReferences; import com.yahoo.searchdefinition.Search; -import com.yahoo.searchdefinition.SchemaTestCase; +import com.yahoo.searchdefinition.SearchDefinitionTestCase; import com.yahoo.searchdefinition.document.SDDocumentType; import com.yahoo.searchdefinition.document.SDField; import com.yahoo.searchdefinition.document.TemporarySDField; @@ -26,47 +26,47 @@ import static org.junit.Assert.assertEquals; * @author bratseth * @author bjorncs */ -public class SearchOrdererTestCase extends SchemaTestCase { +public class SearchOrdererTestCase extends SearchDefinitionTestCase { - private static Map<String, Search> createSchemas() { - Map<String, Search> schemas = new HashMap<>(); + private static Map<String, Search> createSearchDefinitions() { + Map<String, Search> searchDefinitions = new HashMap<>(); - Search grandParent = createSchema("grandParent", schemas); + Search grandParent = createSearchDefinition("grandParent", searchDefinitions); - Search mother = createSchema("mother", schemas); + Search mother = createSearchDefinition("mother", searchDefinitions); inherit(mother, grandParent); - Search father = createSchema("father", schemas); + Search father = createSearchDefinition("father", searchDefinitions); inherit(father, grandParent); createDocumentReference(father, mother, "wife_ref"); - Search daugther = createSchema("daughter", schemas); + Search daugther = createSearchDefinition("daughter", searchDefinitions); inherit(daugther, father); inherit(daugther, mother); - Search son = createSchema("son", schemas); + Search son = createSearchDefinition("son", searchDefinitions); inherit(son, father); inherit(son, mother); - Search product = createSchema("product", schemas); + Search product = createSearchDefinition("product", searchDefinitions); - Search pc = createSchema("pc", schemas); + Search pc = createSearchDefinition("pc", searchDefinitions); inherit(pc, product); - Search pcAccessory = createSchema("accessory-pc", schemas); + Search pcAccessory = createSearchDefinition("accessory-pc", searchDefinitions); inherit(pcAccessory, product); createDocumentReference(pcAccessory, pc, "pc_ref"); - createSchema("alone", schemas); + createSearchDefinition("alone", searchDefinitions); - return schemas; + return searchDefinitions; } - private static Search createSchema(String name, Map<String, Search> schemas) { + private static Search createSearchDefinition(String name, Map<String, Search> searchDefinitions) { Search search = new Search(name, null); SDDocumentType document = new SDDocumentType(name); document.setDocumentReferences(new DocumentReferences(emptyMap())); search.addDocument(document); - schemas.put(search.getName(), search); + searchDefinitions.put(search.getName(), search); return search; } @@ -75,13 +75,13 @@ public class SearchOrdererTestCase extends SchemaTestCase { } private static void assertOrder(List<String> expectedSearchOrder, List<String> inputNames) { - Map<String, Search> schemas = createSchemas(); - List<Search> inputSchemas = inputNames.stream() - .map(schemas::get) + Map<String, Search> searchDefinitions = createSearchDefinitions(); + List<Search> inputSearchDefinitions = inputNames.stream() + .map(searchDefinitions::get) .map(Objects::requireNonNull) .collect(toList()); List<String> actualSearchOrder = new SearchOrderer() - .order(inputSchemas) + .order(inputSearchDefinitions) .stream() .map(Search::getName) .collect(toList()); @@ -104,37 +104,31 @@ public class SearchOrdererTestCase extends SchemaTestCase { assertOrder(Arrays.asList("alone", "grandParent", "mother", "father", "daughter", "product", "pc", "son"), Arrays.asList("grandParent", "mother", "father", "daughter", "son", "product", "pc", "alone")); } - @Test public void testOneLevelReordering() { assertOrder(Arrays.asList("alone", "grandParent", "mother", "father", "daughter", "product", "pc", "son"), Arrays.asList("grandParent", "daughter", "son", "mother", "father", "pc", "product", "alone")); } - @Test public void testMultiLevelReordering() { assertOrder(Arrays.asList("alone", "grandParent", "mother", "father", "daughter", "product", "pc", "son"), Arrays.asList("daughter", "son", "mother", "father", "grandParent", "pc", "product", "alone")); } - @Test public void testAloneIsKeptInPlaceWithMultiLevelReordering() { assertOrder(Arrays.asList("alone", "grandParent", "mother", "father", "daughter", "product", "pc", "son"), Arrays.asList("alone", "daughter", "son", "mother", "father", "grandParent", "pc", "product")); } - @Test public void testPartialMultiLevelReordering() { assertOrder(Arrays.asList("alone", "grandParent", "mother", "father", "daughter", "product", "pc", "son"), Arrays.asList("daughter", "grandParent", "mother", "son", "father", "product", "pc", "alone")); } - @Test public void testMultilevelReorderingAccrossHierarchies() { assertOrder(Arrays.asList("alone", "grandParent", "mother", "father", "daughter", "product", "pc", "son"), Arrays.asList("daughter", "pc", "son", "mother", "grandParent", "father", "product", "alone")); } - @Test public void referees_are_ordered_before_referrer() { assertOrder(Arrays.asList("alone", "grandParent", "mother", "father", "daughter", "product", "pc", "accessory-pc", "son"), diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/SummaryMapTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/SummaryMapTestCase.java index 07d7405b1db..f85f9994e04 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/derived/SummaryMapTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/derived/SummaryMapTestCase.java @@ -25,7 +25,7 @@ import static org.junit.Assert.assertTrue; * * @author bratseth */ -public class SummaryMapTestCase extends SchemaTestCase { +public class SummaryMapTestCase extends SearchDefinitionTestCase { @Test public void testDeriving() throws IOException, ParseException { Search search = SearchBuilder.buildFromFile("src/test/examples/simple.sd"); diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/SummaryTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/SummaryTestCase.java index afbc9f52f6b..b82620b1cf5 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/derived/SummaryTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/derived/SummaryTestCase.java @@ -4,7 +4,7 @@ package com.yahoo.searchdefinition.derived; import com.yahoo.config.model.application.provider.BaseDeployLogger; import com.yahoo.searchdefinition.Search; import com.yahoo.searchdefinition.SearchBuilder; -import com.yahoo.searchdefinition.SchemaTestCase; +import com.yahoo.searchdefinition.SearchDefinitionTestCase; import com.yahoo.searchdefinition.parser.ParseException; import org.junit.Test; @@ -20,7 +20,7 @@ import static org.junit.Assert.assertNull; * * @author bratseth */ -public class SummaryTestCase extends SchemaTestCase { +public class SummaryTestCase extends SearchDefinitionTestCase { @Test public void testDeriving() throws IOException, ParseException { diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/TypeConversionTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/TypeConversionTestCase.java index c03e915aa8b..24575df8c91 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/derived/TypeConversionTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/derived/TypeConversionTestCase.java @@ -6,7 +6,7 @@ import com.yahoo.document.DataType; import com.yahoo.search.query.profile.QueryProfileRegistry; import com.yahoo.searchdefinition.RankProfileRegistry; import com.yahoo.searchdefinition.Search; -import com.yahoo.searchdefinition.SchemaTestCase; +import com.yahoo.searchdefinition.SearchDefinitionTestCase; import com.yahoo.searchdefinition.document.SDDocumentType; import com.yahoo.searchdefinition.document.SDField; import com.yahoo.searchdefinition.processing.Processing; @@ -20,7 +20,7 @@ import static org.junit.Assert.assertFalse; * * @author bratseth */ -public class TypeConversionTestCase extends SchemaTestCase { +public class TypeConversionTestCase extends SearchDefinitionTestCase { /** Tests that exact-string stuff is not spilled over to the default index */ @Test |