You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mu...@apache.org on 2019/07/10 05:12:12 UTC
[lucene-solr] branch master updated: SOLR-11263: add test for
payload func with undefined field
This is an automated email from the ASF dual-hosted git repository.
munendrasn pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
The following commit(s) were added to refs/heads/master by this push:
new 8322ea5 SOLR-11263: add test for payload func with undefined field
8322ea5 is described below
commit 8322ea55f4f227c06948142909f35b162c607ff8
Author: Munendra S N <mu...@apache.org>
AuthorDate: Wed Jul 10 10:17:55 2019 +0530
SOLR-11263: add test for payload func with undefined field
Payload func with undefined used to throw NPE. In SOLR-11610, this
was fixed to return proper error but there are no tests to verify
changed the behavior.
This add simple test to verify error code and error message
---
.../src/test/org/apache/solr/search/function/TestFunctionQuery.java | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/solr/core/src/test/org/apache/solr/search/function/TestFunctionQuery.java b/solr/core/src/test/org/apache/solr/search/function/TestFunctionQuery.java
index de10cee..499bb6e 100644
--- a/solr/core/src/test/org/apache/solr/search/function/TestFunctionQuery.java
+++ b/solr/core/src/test/org/apache/solr/search/function/TestFunctionQuery.java
@@ -470,6 +470,10 @@ public class TestFunctionQuery extends SolrTestCaseJ4 {
);
// this should pass
assertQ(req("q", "*:*","defType","edismax", "boost","recip(1, 2, 3, 4)"));
+
+ // for undefined field NPE shouldn't be thrown
+ assertQEx("Should Fail as the field is undefined", "undefined field a",
+ req("q", "*:*", "fl", "x:payload(a,b)"), SolrException.ErrorCode.BAD_REQUEST);
}
@Test