summaryrefslogtreecommitdiffstats
path: root/container-search/src/test
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2018-10-07 12:53:49 +0200
committerGitHub <noreply@github.com>2018-10-07 12:53:49 +0200
commitdedf5f2f6cf5c4ee2b6b9e214bc445d4c4639869 (patch)
tree2407b63720681c045c084d9e5fa9636c5399734a /container-search/src/test
parent36d28c100f03ab1f5a82d3cbe6f5f8cf40a0a519 (diff)
Revert "Limit document selection per cluster by the document type of the clus…"
Diffstat (limited to 'container-search/src/test')
-rw-r--r--container-search/src/test/java/com/yahoo/vespa/streamingvisitors/VdsStreamingSearcherTestCase.java28
-rw-r--r--container-search/src/test/java/com/yahoo/vespa/streamingvisitors/VdsVisitorTestCase.java14
2 files changed, 17 insertions, 25 deletions
diff --git a/container-search/src/test/java/com/yahoo/vespa/streamingvisitors/VdsStreamingSearcherTestCase.java b/container-search/src/test/java/com/yahoo/vespa/streamingvisitors/VdsStreamingSearcherTestCase.java
index 0d58b10fde4..c8c653d67ed 100644
--- a/container-search/src/test/java/com/yahoo/vespa/streamingvisitors/VdsStreamingSearcherTestCase.java
+++ b/container-search/src/test/java/com/yahoo/vespa/streamingvisitors/VdsStreamingSearcherTestCase.java
@@ -4,14 +4,12 @@ package com.yahoo.vespa.streamingvisitors;
import com.yahoo.config.subscription.ConfigGetter;
import com.yahoo.document.select.parser.TokenMgrException;
import com.yahoo.messagebus.routing.Route;
-import com.yahoo.prelude.fastsearch.CacheKey;
-import com.yahoo.prelude.fastsearch.CacheParams;
-import com.yahoo.prelude.fastsearch.ClusterParams;
import com.yahoo.prelude.fastsearch.DocumentdbInfoConfig;
import com.yahoo.document.select.parser.ParseException;
import com.yahoo.fs4.QueryPacket;
-import com.yahoo.prelude.fastsearch.SummaryParameters;
-import com.yahoo.prelude.fastsearch.TimeoutException;
+import com.yahoo.prelude.Ping;
+import com.yahoo.prelude.Pong;
+import com.yahoo.prelude.fastsearch.*;
import com.yahoo.search.Query;
import com.yahoo.search.Result;
import com.yahoo.search.result.Hit;
@@ -27,11 +25,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.*;
/**
* @author <a href="mailto:ulf@yahoo-inc.com">Ulf Carlin</a>
@@ -41,20 +35,18 @@ public class VdsStreamingSearcherTestCase {
public static final String GROUPDOC_ID_PREFIX = "groupdoc:namespace:group1:userspecific";
private static class MockVisitor implements Visitor {
- private final Query query;
- final String searchCluster;
- final Route route;
- final String documentType;
+ private Query query;
+ String searchCluster;
+ Route route;
int totalHitCount;
private final List<SearchResult.Hit> hits = new ArrayList<>();
private final Map<String, DocumentSummary.Summary> summaryMap = new HashMap<>();
private final List<Grouping> groupings = new ArrayList<>();
- MockVisitor(Query query, String searchCluster, Route route, String documentType) {
+ MockVisitor(Query query, String searchCluster, Route route) {
this.query = query;
this.searchCluster = searchCluster;
this.route = route;
- this.documentType = documentType;
}
@Override
@@ -132,8 +124,8 @@ public class VdsStreamingSearcherTestCase {
private static class MockVisitorFactory implements VisitorFactory {
@Override
- public Visitor createVisitor(Query query, String searchCluster, Route route, String documentType) {
- return new MockVisitor(query, searchCluster, route, documentType);
+ public Visitor createVisitor(Query query, String searchCluster, Route route) {
+ return new MockVisitor(query, searchCluster, route);
}
}
diff --git a/container-search/src/test/java/com/yahoo/vespa/streamingvisitors/VdsVisitorTestCase.java b/container-search/src/test/java/com/yahoo/vespa/streamingvisitors/VdsVisitorTestCase.java
index c84088a19bb..6964fd3b5e8 100644
--- a/container-search/src/test/java/com/yahoo/vespa/streamingvisitors/VdsVisitorTestCase.java
+++ b/container-search/src/test/java/com/yahoo/vespa/streamingvisitors/VdsVisitorTestCase.java
@@ -224,15 +224,15 @@ public class VdsVisitorTestCase {
return query;
}
- private void verifyVisitorParameters(VisitorParameters params, QueryArguments qa, String searchCluster, String docType, Route route) {
+ private void verifyVisitorParameters(VisitorParameters params, QueryArguments qa, String searchCluster, Route route) {
//System.out.println("params="+params);
// Verify parameters based on properties
if (qa.userId != null) {
- assertEquals(docType + " and id.user=="+qa.userId, params.getDocumentSelection());
+ assertEquals("id.user=="+qa.userId, params.getDocumentSelection());
} else if (qa.groupName != null) {
- assertEquals(docType + " and id.group==\""+qa.groupName+"\"", params.getDocumentSelection());
+ assertEquals("id.group==\""+qa.groupName+"\"", params.getDocumentSelection());
} else if (qa.selection != null) {
- assertEquals(docType + " and " +qa.selection, params.getDocumentSelection());
+ assertEquals(qa.selection, params.getDocumentSelection());
} else {
assertEquals("", params.getDocumentSelection());
}
@@ -407,15 +407,15 @@ public class VdsVisitorTestCase {
}
private void verifyVisitorOk(MockVisitorSessionFactory factory, QueryArguments qa, Route route, String searchCluster) throws Exception {
- VdsVisitor visitor = new VdsVisitor(buildQuery(qa), searchCluster, route, "mytype", factory);
+ VdsVisitor visitor = new VdsVisitor(buildQuery(qa), searchCluster, route, factory);
visitor.doSearch();
- verifyVisitorParameters(factory.getParams(), qa, searchCluster, "mytype", route);
+ verifyVisitorParameters(factory.getParams(), qa, searchCluster, route);
supplyResults(visitor);
verifyResults(qa, visitor);
}
private void verifyVisitorFails(MockVisitorSessionFactory factory, QueryArguments qa, Route route, String searchCluster) throws Exception {
- VdsVisitor visitor = new VdsVisitor(buildQuery(qa), searchCluster, route, "mytype", factory);
+ VdsVisitor visitor = new VdsVisitor(buildQuery(qa), searchCluster, route, factory);
try {
visitor.doSearch();
assertTrue("Visitor did not fail", false);