lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbern...@apache.org
Subject [14/41] lucene-solr:branch_6x: SOLR-10731: Add first test case
Date Mon, 05 Jun 2017 18:36:28 GMT
SOLR-10731: Add first test case


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/9966453f
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/9966453f
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/9966453f

Branch: refs/heads/branch_6x
Commit: 9966453fb2b058980aa3fbedc4a612a68324c96b
Parents: 0662a7a
Author: Joel Bernstein <jbernste@apache.org>
Authored: Tue May 23 20:05:08 2017 -0400
Committer: Joel Bernstein <jbernste@apache.org>
Committed: Mon Jun 5 13:46:02 2017 -0400

----------------------------------------------------------------------
 .../solrj/io/stream/StreamExpressionTest.java   | 23 +++++---------------
 1 file changed, 5 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9966453f/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
index d464989..dc3a380 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
@@ -925,36 +925,23 @@ public class StreamExpressionTest extends SolrCloudTestCase {
   public void testKnnStream() throws Exception {
 
     UpdateRequest update = new UpdateRequest();
-
     update.add(id, "1", "a_t", "hello world have a very nice day blah");
-    update.add(id, "2", "a_t", "hello world have a very nice day fancy sky");
-    update.add(id, "3", "a_t", "hello world have a very nice bug out");
     update.add(id, "4", "a_t", "hello world have a very streaming is fun");
-
-
+    update.add(id, "3", "a_t", "hello world have a very nice bug out");
+    update.add(id, "2", "a_t", "hello world have a very nice day fancy sky");
     update.commit(cluster.getSolrClient(), COLLECTIONORALIAS);
 
-    StreamExpression expression;
-    TupleStream stream;
-
-    StreamFactory factory = new StreamFactory()
-        .withCollectionZkHost(COLLECTIONORALIAS, cluster.getZkServer().getZkAddress())
-        .withFunctionName("random", RandomStream.class);
-
-
     StreamContext context = new StreamContext();
     SolrClientCache cache = new SolrClientCache();
     try {
       context.setSolrClientCache(cache);
-
       ModifiableSolrParams sParams = new ModifiableSolrParams(StreamingTest.mapParams(CommonParams.QT,
"/stream"));
-      sParams.add("expr", "knn(" + COLLECTIONORALIAS + ", id=\"1\", qf=\"a_t\", rows=\"4\",
fl=\"id\")");
+      sParams.add("expr", "knn(" + COLLECTIONORALIAS + ", id=\"1\", qf=\"a_t\", rows=\"4\",
fl=\"id, score\", mintf=\"1\")");
       JettySolrRunner jetty = cluster.getJettySolrRunner(0);
       SolrStream solrStream = new SolrStream(jetty.getBaseUrl().toString() + "/collection1",
sParams);
       List<Tuple> tuples = getTuples(solrStream);
-      System.out.println("## Tuples:"+tuples.size());
-      assertTrue(tuples.size() == 4);
-
+      assertTrue(tuples.size() == 3);
+      assertOrder(tuples,2,3,4);
     } finally {
       cache.close();
     }


Mime
View raw message