diff options
Diffstat (limited to 'container-search/src/test/java/com/yahoo/prelude/fastsearch')
-rw-r--r-- | container-search/src/test/java/com/yahoo/prelude/fastsearch/DocsumDefinitionTestCase.java (renamed from container-search/src/test/java/com/yahoo/prelude/fastsearch/test/DocsumDefinitionTestCase.java) | 10 | ||||
-rw-r--r-- | container-search/src/test/java/com/yahoo/prelude/fastsearch/IndexedBackendTestCase.java (renamed from container-search/src/test/java/com/yahoo/prelude/fastsearch/test/FastSearcherTestCase.java) | 27 | ||||
-rw-r--r-- | container-search/src/test/java/com/yahoo/prelude/fastsearch/PartialFillTestCase.java (renamed from container-search/src/test/java/com/yahoo/prelude/fastsearch/test/PartialFillTestCase.java) | 18 |
3 files changed, 16 insertions, 39 deletions
diff --git a/container-search/src/test/java/com/yahoo/prelude/fastsearch/test/DocsumDefinitionTestCase.java b/container-search/src/test/java/com/yahoo/prelude/fastsearch/DocsumDefinitionTestCase.java index ade094115fe..ba9988b865c 100644 --- a/container-search/src/test/java/com/yahoo/prelude/fastsearch/test/DocsumDefinitionTestCase.java +++ b/container-search/src/test/java/com/yahoo/prelude/fastsearch/DocsumDefinitionTestCase.java @@ -1,14 +1,6 @@ // Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.prelude.fastsearch.test; +package com.yahoo.prelude.fastsearch; -import com.yahoo.prelude.fastsearch.ByteField; -import com.yahoo.prelude.fastsearch.DataField; -import com.yahoo.prelude.fastsearch.DocsumDefinition; -import com.yahoo.prelude.fastsearch.DocsumDefinitionSet; -import com.yahoo.prelude.fastsearch.FastHit; -import com.yahoo.prelude.fastsearch.IntegerField; -import com.yahoo.prelude.fastsearch.StringField; -import com.yahoo.document.DocumentId; import com.yahoo.document.GlobalId; import com.yahoo.search.schema.DocumentSummary; import com.yahoo.search.schema.Schema; diff --git a/container-search/src/test/java/com/yahoo/prelude/fastsearch/test/FastSearcherTestCase.java b/container-search/src/test/java/com/yahoo/prelude/fastsearch/IndexedBackendTestCase.java index 8270700a66b..917206bf00c 100644 --- a/container-search/src/test/java/com/yahoo/prelude/fastsearch/test/FastSearcherTestCase.java +++ b/container-search/src/test/java/com/yahoo/prelude/fastsearch/IndexedBackendTestCase.java @@ -1,14 +1,9 @@ // Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.prelude.fastsearch.test; +package com.yahoo.prelude.fastsearch; import com.yahoo.container.QrSearchersConfig; import com.yahoo.container.handler.VipStatus; import com.yahoo.container.protect.Error; -import com.yahoo.prelude.fastsearch.ClusterParams; -import com.yahoo.prelude.fastsearch.DocumentdbInfoConfig; -import com.yahoo.prelude.fastsearch.FastSearcher; -import com.yahoo.prelude.fastsearch.SummaryParameters; -import com.yahoo.prelude.fastsearch.VespaBackEndSearcher; import com.yahoo.search.Query; import com.yahoo.search.Result; import com.yahoo.search.dispatch.MockDispatcher; @@ -38,14 +33,14 @@ import static org.junit.jupiter.api.Assertions.*; * * @author bratseth */ -public class FastSearcherTestCase { +public class IndexedBackendTestCase { private static final String SCHEMA = "test"; private static final String CLUSTER = "test"; @Test void testNullQuery() { - Logger.getLogger(FastSearcher.class.getName()).setLevel(Level.ALL); - FastSearcher fastSearcher = new FastSearcher("container.0", + Logger.getLogger(IndexedBackend.class.getName()).setLevel(Level.ALL); + IndexedBackend fastSearcher = new IndexedBackend("container.0", MockDispatcher.create(List.of()), new SummaryParameters(null), new ClusterParams("testhittype"), @@ -62,7 +57,7 @@ public class FastSearcherTestCase { assertEquals(Error.NULL_QUERY.code, message.getCode()); } - private Result doSearch(VespaBackEndSearcher searcher, Query query, int offset, int hits) { + private Result doSearch(VespaBackend searcher, Query query, int offset, int hits) { query.setOffset(offset); query.setHits(hits); return searcher.search(SCHEMA, query); @@ -70,7 +65,7 @@ public class FastSearcherTestCase { @Test void testSinglePassGroupingIsForcedWithSingleNodeGroups() { - FastSearcher fastSearcher = new FastSearcher("container.0", + IndexedBackend fastSearcher = new IndexedBackend("container.0", MockDispatcher.create(List.of(new Node(CLUSTER, 0, "host0", 0))), new SummaryParameters(null), new ClusterParams("testhittype"), @@ -93,7 +88,7 @@ public class FastSearcherTestCase { @Test void testRankProfileValidation() { - FastSearcher fastSearcher = new FastSearcher("container.0", + IndexedBackend fastSearcher = new IndexedBackend("container.0", MockDispatcher.create(List.of(new Node(CLUSTER, 0, "host0", 0))), new SummaryParameters(null), new ClusterParams("testhittype"), @@ -112,7 +107,7 @@ public class FastSearcherTestCase { .add(new RankProfile.Builder("default").setHasRankFeatures(false) .setHasSummaryFeatures(false) .build()); - FastSearcher backend = new FastSearcher("container.0", + IndexedBackend backend = new IndexedBackend("container.0", MockDispatcher.create(Collections.singletonList(new Node(CLUSTER, 0, "host0", 0))), new SummaryParameters(null), new ClusterParams("testhittype"), @@ -132,7 +127,7 @@ public class FastSearcherTestCase { void testSinglePassGroupingIsNotForcedWithSingleNodeGroups() { MockDispatcher dispatcher = MockDispatcher.create(List.of(new Node(CLUSTER, 0, "host0", 0), new Node(CLUSTER, 2, "host1", 0))); - FastSearcher fastSearcher = new FastSearcher("container.0", + IndexedBackend fastSearcher = new IndexedBackend("container.0", dispatcher, new SummaryParameters(null), new ClusterParams("testhittype"), @@ -182,11 +177,11 @@ public class FastSearcherTestCase { assertTrue(vipStatus.isInRotation()); //Verify that deconstruct does not touch vipstatus } - private String searchError(String query, VespaBackEndSearcher searcher) { + private String searchError(String query, VespaBackend searcher) { return search(query, searcher).hits().getError().getDetailedMessage(); } - private Result search(String query, VespaBackEndSearcher searcher) { + private Result search(String query, VespaBackend searcher) { return searcher.search(SCHEMA, new Query(query)); } diff --git a/container-search/src/test/java/com/yahoo/prelude/fastsearch/test/PartialFillTestCase.java b/container-search/src/test/java/com/yahoo/prelude/fastsearch/PartialFillTestCase.java index a033ccdace6..7760e204d4b 100644 --- a/container-search/src/test/java/com/yahoo/prelude/fastsearch/test/PartialFillTestCase.java +++ b/container-search/src/test/java/com/yahoo/prelude/fastsearch/PartialFillTestCase.java @@ -1,12 +1,8 @@ // Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.prelude.fastsearch.test; +package com.yahoo.prelude.fastsearch; -import com.yahoo.component.chain.Chain; -import com.yahoo.prelude.fastsearch.FastHit; -import com.yahoo.prelude.fastsearch.VespaBackEndSearcher; import com.yahoo.search.Query; import com.yahoo.search.Result; -import com.yahoo.search.Searcher; import com.yahoo.search.result.ErrorHit; import com.yahoo.search.result.ErrorMessage; import org.junit.jupiter.api.Test; @@ -22,7 +18,7 @@ import static org.junit.jupiter.api.Assertions.*; */ public class PartialFillTestCase { - public static class FS4 extends VespaBackEndSearcher { + public static class FS4 extends VespaBackend { public List<Result> history = new ArrayList<>(); protected Result doSearch2(String schema, Query query) { return new Result(query); @@ -32,7 +28,7 @@ public class PartialFillTestCase { } } - public static class BadFS4 extends VespaBackEndSearcher { + public static class BadFS4 extends VespaBackend { protected Result doSearch2(String schema, Query query) { return new Result(query); } @@ -137,14 +133,8 @@ public class PartialFillTestCase { } } - private void doFill(VespaBackEndSearcher searcher, Result result, String summaryClass) { + private void doFill(VespaBackend searcher, Result result, String summaryClass) { searcher.fill(result, summaryClass); } - private Chain<Searcher> chainedAsSearchChain(Searcher topOfChain) { - List<Searcher> searchers = new ArrayList<>(); - searchers.add(topOfChain); - return new Chain<>(searchers); - } - } |