diff options
Diffstat (limited to 'config-model/src/test/java/com/yahoo/searchdefinition/derived')
13 files changed, 59 insertions, 60 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 9ba9f3b37f7..da14e4a8929 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 @@ -8,7 +8,7 @@ import com.yahoo.config.model.deploy.TestProperties; import com.yahoo.document.DocumenttypesConfig; import com.yahoo.document.config.DocumentmanagerConfig; import com.yahoo.searchdefinition.Schema; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.AbstractSchemaTestCase; import com.yahoo.searchdefinition.parser.ParseException; import ai.vespa.rankingexpression.importer.configmodelview.ImportedMlModels; @@ -36,16 +36,16 @@ public abstract class AbstractExportingTestCase extends AbstractSchemaTestCase { toDir.mkdirs(); deleteContent(toDir); - SearchBuilder builder = SearchBuilder.createFromDirectory(searchDefRoot + dirName + "/", new MockFileRegistry(), logger, properties); + SchemaBuilder builder = SchemaBuilder.createFromDirectory(searchDefRoot + dirName + "/", new MockFileRegistry(), logger, properties); return derive(dirName, searchDefinitionName, properties, builder, logger); } private DerivedConfiguration derive(String dirName, String searchDefinitionName, TestProperties properties, - SearchBuilder builder, + SchemaBuilder builder, DeployLogger logger) throws IOException { - DerivedConfiguration config = new DerivedConfiguration(builder.getSearch(searchDefinitionName), + DerivedConfiguration config = new DerivedConfiguration(builder.getSchema(searchDefinitionName), logger, properties, builder.getRankProfileRegistry(), @@ -55,14 +55,14 @@ public abstract class AbstractExportingTestCase extends AbstractSchemaTestCase { return export(dirName, builder, config); } - DerivedConfiguration derive(String dirName, SearchBuilder builder, Schema schema) throws IOException { + DerivedConfiguration derive(String dirName, SchemaBuilder builder, Schema schema) throws IOException { DerivedConfiguration config = new DerivedConfiguration(schema, builder.getRankProfileRegistry(), builder.getQueryProfileRegistry()); return export(dirName, builder, config); } - private DerivedConfiguration export(String name, SearchBuilder builder, DerivedConfiguration config) throws IOException { + private DerivedConfiguration export(String name, SchemaBuilder builder, DerivedConfiguration config) throws IOException { String path = exportConfig(name, config); DerivedConfiguration.exportDocuments(new DocumentManager().produce(builder.getModel(), new DocumentmanagerConfig.Builder()), path); DerivedConfiguration.exportDocuments(new DocumentTypes().produce(builder.getModel(), new DocumenttypesConfig.Builder()), path); @@ -111,14 +111,14 @@ public abstract class AbstractExportingTestCase extends AbstractSchemaTestCase { * Asserts config is correctly derived given a builder. * This will fail if the builder contains multiple search definitions. */ - protected DerivedConfiguration assertCorrectDeriving(SearchBuilder builder, String dirName, DeployLogger logger) throws IOException { + protected DerivedConfiguration assertCorrectDeriving(SchemaBuilder builder, String dirName, DeployLogger logger) throws IOException { builder.build(); DerivedConfiguration derived = derive(dirName, null, new TestProperties(), builder, logger); assertCorrectConfigFiles(dirName); return derived; } - protected DerivedConfiguration assertCorrectDeriving(SearchBuilder builder, Schema schema, String name) throws IOException { + protected DerivedConfiguration assertCorrectDeriving(SchemaBuilder builder, Schema schema, String name) throws IOException { DerivedConfiguration derived = derive(name, builder, schema); assertCorrectConfigFiles(name); return 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 f8316c831f1..58a4350b73b 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 @@ -2,7 +2,7 @@ package com.yahoo.searchdefinition.derived; import com.yahoo.searchdefinition.Schema; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.AbstractSchemaTestCase; import com.yahoo.searchdefinition.document.Attribute; import com.yahoo.searchdefinition.parser.ParseException; @@ -25,7 +25,7 @@ public class AttributeListTestCase extends AbstractSchemaTestCase { @Test public void testDeriving() throws IOException, ParseException { // Test attribute importing - Schema schema = SearchBuilder.buildFromFile("src/test/examples/simple.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/simple.sd"); // Test attribute deriving AttributeFields attributeFields = new AttributeFields(schema); @@ -71,7 +71,7 @@ public class AttributeListTestCase extends AbstractSchemaTestCase { @Test public void fields_in_array_of_struct_are_derived_into_array_attributes() throws IOException, ParseException { - Schema schema = SearchBuilder.buildFromFile("src/test/derived/array_of_struct_attribute/test.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/derived/array_of_struct_attribute/test.sd"); Iterator<Attribute> attributes = new AttributeFields(schema).attributeIterator(); assertAttribute("elem_array.name", Attribute.Type.STRING, Attribute.CollectionType.ARRAY, true, attributes.next()); @@ -81,7 +81,7 @@ public class AttributeListTestCase extends AbstractSchemaTestCase { @Test public void fields_in_map_of_struct_are_derived_into_array_attributes() throws IOException, ParseException { - Schema schema = SearchBuilder.buildFromFile("src/test/derived/map_of_struct_attribute/test.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/derived/map_of_struct_attribute/test.sd"); Iterator<Attribute> attributes = new AttributeFields(schema).attributeIterator(); assertAttribute("str_elem_map.key", Attribute.Type.STRING, Attribute.CollectionType.ARRAY, true, attributes.next()); @@ -101,14 +101,14 @@ public class AttributeListTestCase extends AbstractSchemaTestCase { @Test public void only_zcurve_attribute_is_derived_from_array_of_position_field() throws ParseException { - Schema schema = SearchBuilder.createFromString( + Schema schema = SchemaBuilder.createFromString( joinLines("search test {", " document test {", " field pos_array type array<position> {", " indexing: attribute", " }", " }", - "}")).getSearch(); + "}")).getSchema(); Iterator<Attribute> attributes = new AttributeFields(schema).attributeIterator(); assertAttribute("pos_array_zcurve", Attribute.Type.LONG, Attribute.CollectionType.ARRAY, true, attributes.next()); @@ -117,7 +117,7 @@ public class AttributeListTestCase extends AbstractSchemaTestCase { @Test public void fields_in_map_of_primitive_are_derived_into_array_attributes() throws IOException, ParseException { - Schema schema = SearchBuilder.buildFromFile("src/test/derived/map_attribute/test.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/derived/map_attribute/test.sd"); Iterator<Attribute> attributes = new AttributeFields(schema).attributeIterator(); assertAttribute("str_map.key", Attribute.Type.STRING, Attribute.CollectionType.ARRAY, true, attributes.next()); 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 080752d260f..06d72bb6972 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 @@ -2,7 +2,7 @@ package com.yahoo.searchdefinition.derived; import com.yahoo.searchdefinition.Schema; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.AbstractSchemaTestCase; import com.yahoo.searchdefinition.parser.ParseException; import org.junit.Test; @@ -20,7 +20,7 @@ public class CasingTestCase extends AbstractSchemaTestCase { @Test public void testCasing() throws IOException, ParseException { - Schema schema = SearchBuilder.buildFromFile("src/test/examples/casing.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/casing.sd"); assertEquals(schema.getIndex("color").getName(), "color"); assertEquals(schema.getIndex("Foo").getName(), "Foo"); assertEquals(schema.getIndex("Price").getName(), "Price"); 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 2633f7881bd..604082fb52e 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 @@ -5,7 +5,7 @@ import com.yahoo.document.DataType; import com.yahoo.search.query.profile.QueryProfileRegistry; import com.yahoo.searchdefinition.RankProfileRegistry; import com.yahoo.searchdefinition.Schema; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.AbstractSchemaTestCase; import com.yahoo.searchdefinition.document.SDDocumentType; import com.yahoo.searchdefinition.document.SDField; @@ -30,7 +30,7 @@ public class EmptyRankProfileTestCase extends AbstractSchemaTestCase { doc.addField(field); doc.addField(new SDField("c", DataType.STRING)); - schema = SearchBuilder.buildFromRawSearch(schema, rankProfileRegistry, new QueryProfileRegistry()); + schema = SchemaBuilder.buildFromRawSchema(schema, rankProfileRegistry, new QueryProfileRegistry()); new DerivedConfiguration(schema, rankProfileRegistry); } diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/ExportingTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/ExportingTestCase.java index 867b88019d5..c6a10c5530b 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/derived/ExportingTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/derived/ExportingTestCase.java @@ -2,7 +2,7 @@ package com.yahoo.searchdefinition.derived; import com.yahoo.config.model.deploy.TestProperties; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.parser.ParseException; import org.junit.Test; @@ -146,11 +146,11 @@ public class ExportingTestCase extends AbstractExportingTestCase { @Test public void testTensor2() throws IOException, ParseException { String dir = "src/test/derived/tensor2/"; - SearchBuilder builder = new SearchBuilder(); + SchemaBuilder builder = new SchemaBuilder(); builder.importFile(dir + "first.sd"); builder.importFile(dir + "second.sd"); builder.build(); - derive("tensor2", builder, builder.getSearch("second")); + derive("tensor2", builder, builder.getSchema("second")); assertCorrectConfigFiles("tensor2"); } diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/InheritanceTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/InheritanceTestCase.java index 59950cee638..97cfc48580d 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/derived/InheritanceTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/derived/InheritanceTestCase.java @@ -5,7 +5,7 @@ import com.yahoo.document.DataType; import com.yahoo.document.config.DocumentmanagerConfig; import com.yahoo.searchdefinition.Index; import com.yahoo.searchdefinition.Schema; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.document.SDDocumentType; import com.yahoo.searchdefinition.document.SDField; import com.yahoo.searchdefinition.parser.ParseException; @@ -37,11 +37,11 @@ public class InheritanceTestCase extends AbstractExportingTestCase { @Test public void requireThatIndexedStructFieldCanBeInherited() throws IOException, ParseException { String dir = "src/test/derived/inheritstruct/"; - SearchBuilder builder = new SearchBuilder(); + SchemaBuilder builder = new SchemaBuilder(); builder.importFile(dir + "parent.sd"); builder.importFile(dir + "child.sd"); builder.build(); - derive("inheritstruct", builder, builder.getSearch("child")); + derive("inheritstruct", builder, builder.getSchema("child")); assertCorrectConfigFiles("inheritstruct"); } @@ -60,7 +60,7 @@ public class InheritanceTestCase extends AbstractExportingTestCase { List<String> files = Arrays.asList("grandparent.sd", "mother.sd", "father.sd", "child.sd"); File outDir = tmpDir.newFolder("out"); for (int startIdx = 0; startIdx < files.size(); ++startIdx) { - SearchBuilder builder = new SearchBuilder(); + SchemaBuilder builder = new SchemaBuilder(); for (int fileIdx = startIdx; fileIdx < startIdx + files.size(); ++fileIdx) { String fileName = files.get(fileIdx % files.size()); builder.importFile(dir + fileName); @@ -107,36 +107,36 @@ public class InheritanceTestCase extends AbstractExportingTestCase { @Test public void requireThatStructTypesAreInheritedFromParent() throws IOException, ParseException { String dir = "src/test/derived/inheritfromparent/"; - SearchBuilder builder = new SearchBuilder(); + SchemaBuilder builder = new SchemaBuilder(); builder.importFile(dir + "parent.sd"); builder.importFile(dir + "child.sd"); builder.build(); - derive("inheritfromparent", builder, builder.getSearch("child")); + derive("inheritfromparent", builder, builder.getSchema("child")); assertCorrectConfigFiles("inheritfromparent"); } @Test public void requireThatStructTypesAreInheritedFromGrandParent() throws IOException, ParseException { String dir = "src/test/derived/inheritfromgrandparent/"; - SearchBuilder builder = new SearchBuilder(); + SchemaBuilder builder = new SchemaBuilder(); builder.importFile(dir + "grandparent.sd"); builder.importFile(dir + "parent.sd"); builder.importFile(dir + "child.sd"); builder.build(); - derive("inheritfromgrandparent", builder, builder.getSearch("child")); + derive("inheritfromgrandparent", builder, builder.getSchema("child")); assertCorrectConfigFiles("inheritfromgrandparent"); } @Test public void testInheritance() throws IOException, ParseException { String dir = "src/test/derived/inheritance/"; - SearchBuilder builder = new SearchBuilder(); + SchemaBuilder builder = new SchemaBuilder(); builder.importFile(dir + "grandparent.sd"); builder.importFile(dir + "father.sd"); builder.importFile(dir + "mother.sd"); builder.importFile(dir + "child.sd"); builder.build(); - derive("inheritance", builder, builder.getSearch("child")); + derive("inheritance", builder, builder.getSchema("child")); assertCorrectConfigFiles("inheritance"); } diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/LiteralBoostTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/LiteralBoostTestCase.java index 507c5370237..f8f1bf9e4f1 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/derived/LiteralBoostTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/derived/LiteralBoostTestCase.java @@ -7,7 +7,7 @@ import com.yahoo.search.query.profile.QueryProfileRegistry; import com.yahoo.searchdefinition.RankProfile; import com.yahoo.searchdefinition.RankProfileRegistry; import com.yahoo.searchdefinition.Schema; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.document.SDDocumentType; import com.yahoo.searchdefinition.document.SDField; import com.yahoo.searchdefinition.processing.Processing; @@ -73,7 +73,7 @@ public class LiteralBoostTestCase extends AbstractExportingTestCase { rankProfileRegistry.add(other); other.addRankSetting(new RankProfile.RankSetting("a", RankProfile.RankSetting.Type.LITERALBOOST, 333)); - schema = SearchBuilder.buildFromRawSearch(schema, rankProfileRegistry, new QueryProfileRegistry()); + schema = SchemaBuilder.buildFromRawSchema(schema, rankProfileRegistry, new QueryProfileRegistry()); DerivedConfiguration derived = new DerivedConfiguration(schema, rankProfileRegistry); // Check il script addition @@ -100,7 +100,7 @@ public class LiteralBoostTestCase extends AbstractExportingTestCase { field2.parseIndexingScript("{ summary | index }"); field2.setLiteralBoost(20); - schema = SearchBuilder.buildFromRawSearch(schema, rankProfileRegistry, new QueryProfileRegistry()); + schema = SchemaBuilder.buildFromRawSchema(schema, rankProfileRegistry, new QueryProfileRegistry()); new DerivedConfiguration(schema, rankProfileRegistry); assertIndexing(Arrays.asList("clear_state | guard { input title | tokenize normalize stem:\"BEST\" | summary title | index title; }", "clear_state | guard { input body | tokenize normalize stem:\"BEST\" | summary body | index body; }", diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/MailTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/MailTestCase.java index 198013b73c0..9ad6dfbb972 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/derived/MailTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/derived/MailTestCase.java @@ -1,7 +1,7 @@ // Copyright Yahoo. 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.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.parser.ParseException; import org.junit.Test; import java.io.IOException; @@ -16,7 +16,7 @@ public class MailTestCase extends AbstractExportingTestCase { @Test public void testMail() throws IOException, ParseException { String dir = "src/test/derived/mail/"; - SearchBuilder sb = new SearchBuilder(); + SchemaBuilder sb = new SchemaBuilder(); sb.importFile(dir + "mail.sd"); assertCorrectDeriving(sb, dir, new TestableDeployLogger()); } diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/SchemaInheritanceTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/SchemaInheritanceTestCase.java index 254ed26df36..c7297c41c62 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/derived/SchemaInheritanceTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/derived/SchemaInheritanceTestCase.java @@ -4,8 +4,7 @@ package com.yahoo.searchdefinition.derived; import com.yahoo.config.model.application.provider.MockFileRegistry; import com.yahoo.config.model.deploy.TestProperties; import com.yahoo.io.IOUtils; -import com.yahoo.searchdefinition.RankProfileRegistry; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.parser.ParseException; import org.junit.Test; @@ -20,11 +19,11 @@ public class SchemaInheritanceTestCase extends AbstractExportingTestCase { @Test public void testIt() throws IOException, ParseException { try { - SearchBuilder builder = SearchBuilder.createFromDirectory("src/test/derived/schemainheritance/", + SchemaBuilder builder = SchemaBuilder.createFromDirectory("src/test/derived/schemainheritance/", new MockFileRegistry(), new TestableDeployLogger(), new TestProperties()); - derive("schemainheritance", builder, builder.getSearch("child")); + derive("schemainheritance", builder, builder.getSchema("child")); assertCorrectConfigFiles("schemainheritance"); } finally { diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/SimpleInheritTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/SimpleInheritTestCase.java index 106f5a54cfe..c0f2b6887d2 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/derived/SimpleInheritTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/derived/SimpleInheritTestCase.java @@ -2,7 +2,7 @@ package com.yahoo.searchdefinition.derived; import com.yahoo.searchdefinition.Schema; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.parser.ParseException; import org.junit.Test; @@ -19,12 +19,12 @@ public class SimpleInheritTestCase extends AbstractExportingTestCase { String name = "emptychild"; final String expectedResultsDirName = "src/test/derived/" + name + "/"; - SearchBuilder builder = new SearchBuilder(); + SchemaBuilder builder = new SchemaBuilder(); builder.importFile(expectedResultsDirName + "parent.sd"); builder.importFile(expectedResultsDirName + "child.sd"); builder.build(); - Schema schema = builder.getSearch("child"); + Schema schema = builder.getSchema("child"); String toDirName = "temp/" + name; File toDir = new File(toDirName); 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 92b7184959c..4994cffb92a 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 @@ -29,7 +29,7 @@ import static org.junit.Assert.assertTrue; public class SummaryMapTestCase extends AbstractSchemaTestCase { @Test public void testDeriving() throws IOException, ParseException { - Schema schema = SearchBuilder.buildFromFile("src/test/examples/simple.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/simple.sd"); SummaryMap summaryMap=new SummaryMap(schema); Iterator transforms=summaryMap.resultTransformIterator(); @@ -147,7 +147,7 @@ public class SummaryMapTestCase extends AbstractSchemaTestCase { @Test public void testFailOnSummaryFieldSourceCollision() { try { - SearchBuilder.buildFromFile("src/test/examples/summaryfieldcollision.sd"); + SchemaBuilder.buildFromFile("src/test/examples/summaryfieldcollision.sd"); } catch (Exception e) { assertTrue(e.getMessage().matches(".*equally named field.*")); } @@ -189,14 +189,14 @@ public class SummaryMapTestCase extends AbstractSchemaTestCase { } private Schema buildSearch(String field) throws ParseException { - var builder = new SearchBuilder(new RankProfileRegistry()); + var builder = new SchemaBuilder(new RankProfileRegistry()); builder.importString(joinLines("search test {", " document test {", field, " }", "}")); builder.build(); - return builder.getSearch(); + return builder.getSchema(); } } 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 ea801b54b5c..c996fb0c1b9 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 @@ -3,7 +3,7 @@ package com.yahoo.searchdefinition.derived; import com.yahoo.config.model.application.provider.BaseDeployLogger; import com.yahoo.searchdefinition.Schema; -import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.AbstractSchemaTestCase; import com.yahoo.searchdefinition.parser.ParseException; import com.yahoo.vespa.config.search.SummaryConfig; @@ -35,7 +35,7 @@ public class SummaryTestCase extends AbstractSchemaTestCase { " }", " }", "}"); - Schema schema = SearchBuilder.createFromString(sd).getSearch(); + Schema schema = SchemaBuilder.createFromString(sd).getSchema(); SummaryClass summary = new SummaryClass(schema, schema.getSummary("default"), new BaseDeployLogger()); assertEquals(SummaryClassField.Type.RAW, summary.getField("raw_field").getType()); } @@ -50,14 +50,14 @@ public class SummaryTestCase extends AbstractSchemaTestCase { " }", " }", "}"); - Schema schema = SearchBuilder.createFromString(sd).getSearch(); + Schema schema = SchemaBuilder.createFromString(sd).getSchema(); SummaryClass summary = new SummaryClass(schema, schema.getSummary("default"), new BaseDeployLogger()); assertEquals(SummaryClassField.Type.DATA, summary.getField("raw_field").getType()); } @Test public void testDeriving() throws IOException, ParseException { - Schema schema = SearchBuilder.buildFromFile("src/test/examples/simple.sd"); + Schema schema = SchemaBuilder.buildFromFile("src/test/examples/simple.sd"); SummaryClass summary = new SummaryClass(schema, schema.getSummary("default"), new BaseDeployLogger()); assertEquals("default", summary.getName()); @@ -134,7 +134,7 @@ public class SummaryTestCase extends AbstractSchemaTestCase { } private static Schema buildCampaignAdModel() throws ParseException { - SearchBuilder builder = new SearchBuilder(); + SchemaBuilder builder = new SchemaBuilder(); builder.importString("search campaign { document campaign {} }"); builder.importString(joinLines("search ad {", " document ad {", @@ -150,7 +150,7 @@ public class SummaryTestCase extends AbstractSchemaTestCase { " }", "}")); builder.build(); - return builder.getSearch("ad"); + return builder.getSchema("ad"); } @Test @@ -168,7 +168,7 @@ public class SummaryTestCase extends AbstractSchemaTestCase { " summary foo type string {}", " }", "}"); - var search = SearchBuilder.createFromString(sd).getSearch(); + var search = SchemaBuilder.createFromString(sd).getSchema(); assertOmitSummaryFeatures(true, search, "bar"); assertOmitSummaryFeatures(false, search, "baz"); } diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/TwoStreamingStructsTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/TwoStreamingStructsTestCase.java index 8249245cebe..c3a78bab441 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/derived/TwoStreamingStructsTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/derived/TwoStreamingStructsTestCase.java @@ -1,7 +1,7 @@ // Copyright Yahoo. 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.SearchBuilder; +import com.yahoo.searchdefinition.SchemaBuilder; import com.yahoo.searchdefinition.parser.ParseException; import org.junit.Test; @@ -17,16 +17,16 @@ public class TwoStreamingStructsTestCase extends AbstractExportingTestCase { public void testTwoStreamingStructsExporting() throws ParseException, IOException { String root = "src/test/derived/twostreamingstructs"; - SearchBuilder builder = new SearchBuilder(); + SchemaBuilder builder = new SchemaBuilder(); builder.importFile(root + "/streamingstruct.sd"); builder.importFile(root + "/whatever.sd"); builder.build(); - assertCorrectDeriving(builder, builder.getSearch("streamingstruct"), root); + assertCorrectDeriving(builder, builder.getSchema("streamingstruct"), root); - builder = new SearchBuilder(); + builder = new SchemaBuilder(); builder.importFile(root + "/streamingstruct.sd"); builder.importFile(root + "/whatever.sd"); builder.build(); - assertCorrectDeriving(builder, builder.getSearch("streamingstruct"), root); + assertCorrectDeriving(builder, builder.getSchema("streamingstruct"), root); } } |