lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sar...@apache.org
Subject lucene-solr:branch_6_0: SOLR-8992: branch_6_0: restore missing TestFieldCollectionResource tests
Date Fri, 20 May 2016 18:18:54 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/branch_6_0 eb9985210 -> 2c6f0282b


SOLR-8992: branch_6_0: restore missing TestFieldCollectionResource tests


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

Branch: refs/heads/branch_6_0
Commit: 2c6f0282b4a29c69c5a5182d8babc52298d0f807
Parents: eb99852
Author: Steve Rowe <sarowe@apache.org>
Authored: Fri May 20 14:18:45 2016 -0400
Committer: Steve Rowe <sarowe@apache.org>
Committed: Fri May 20 14:18:45 2016 -0400

----------------------------------------------------------------------
 .../schema/TestFieldCollectionResource.java     | 33 ++++++++++++++++++++
 1 file changed, 33 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/2c6f0282/solr/core/src/test/org/apache/solr/rest/schema/TestFieldCollectionResource.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/rest/schema/TestFieldCollectionResource.java
b/solr/core/src/test/org/apache/solr/rest/schema/TestFieldCollectionResource.java
index 6fdd298..f3de92b 100644
--- a/solr/core/src/test/org/apache/solr/rest/schema/TestFieldCollectionResource.java
+++ b/solr/core/src/test/org/apache/solr/rest/schema/TestFieldCollectionResource.java
@@ -15,6 +15,8 @@
  * limitations under the License.
  */
 package org.apache.solr.rest.schema;
+import java.io.IOException;
+
 import org.apache.solr.rest.SolrRestletTestBase;
 import org.junit.Test;
 
@@ -37,6 +39,37 @@ public class TestFieldCollectionResource extends SolrRestletTestBase {
              "/fields/[2]/name=='_version_'");
   }
 
+  @Test
+  public void testGetThreeFieldsDontIncludeDynamic() throws IOException {
+    //
+    assertQ("/schema/fields?indent=on&wt=xml&fl=id,_version_,price_i",
+        "count(/response/arr[@name='fields']/lst/str[@name='name']) = 2",
+        "(/response/arr[@name='fields']/lst/str[@name='name'])[1] = 'id'",
+        "(/response/arr[@name='fields']/lst/str[@name='name'])[2] = '_version_'");
+  }
+
+  @Test
+  public void testGetThreeFieldsIncludeDynamic() throws IOException {
+    assertQ("/schema/fields?indent=on&wt=xml&fl=id,_version_,price_i&includeDynamic=on",
+
+        "count(/response/arr[@name='fields']/lst/str[@name='name']) = 3",
+
+        "(/response/arr[@name='fields']/lst/str[@name='name'])[1] = 'id'",
+
+        "(/response/arr[@name='fields']/lst/str[@name='name'])[2] = '_version_'",
+
+        "(/response/arr[@name='fields']/lst/str[@name='name'])[3] = 'price_i'",
+
+        "/response/arr[@name='fields']/lst[    str[@name='name']='price_i'    "
+            +"                                  and str[@name='dynamicBase']='*_i']");
+  }
+  @Test
+  public void testNotFoundFields() throws IOException {
+    assertQ("/schema/fields?indent=on&wt=xml&fl=not_in_there,this_one_either",
+        "count(/response/arr[@name='fields']) = 1",
+        "count(/response/arr[@name='fields']/lst/str[@name='name']) = 0");
+  }
+
 
   @Test
   public void testJsonGetAllFieldsIncludeDynamic() throws Exception {


Mime
View raw message