Yuti-G commented on a change in pull request #747:
URL: https://github.com/apache/lucene/pull/747#discussion_r826462222



##########
File path: 
lucene/facet/src/test/org/apache/lucene/facet/sortedset/TestSortedSetDocValuesFacets.java
##########
@@ -104,6 +104,65 @@ public void testBasic() throws Exception {
               "dim=b path=[] value=2 childCount=2\n  buzz (2)\n  baz (1)\n",
               facets.getTopChildren(10, "b").toString());
 
+          // test getAllDims
+          List<FacetResult> results = facets.getAllDims(10);
+          assertEquals(2, results.size());
+          assertEquals(
+              "dim=b path=[] value=2 childCount=2\n  buzz (2)\n  baz (1)\n",
+              results.get(0).toString());
+          assertEquals(
+              "dim=a path=[] value=-1 childCount=3\n  foo (2)\n  bar (1)\n  
zoo (1)\n",
+              results.get(1).toString());
+
+          // test getAllDims(1, 0) with topN = 0
+          expectThrows(
+              NullPointerException.class,
+              () -> {
+                facets.getAllDims(0);
+              });
+
+          // test getTopDims(10, 10) and expect same results from 
getAllDims(10)
+          List<FacetResult> allDimsResults = facets.getTopDims(10, 10);
+          assertEquals(2, results.size());
+          assertEquals(
+              "dim=b path=[] value=2 childCount=2\n  buzz (2)\n  baz (1)\n",
+              allDimsResults.get(0).toString());
+          assertEquals(
+              "dim=a path=[] value=-1 childCount=3\n  foo (2)\n  bar (1)\n  
zoo (1)\n",
+              allDimsResults.get(1).toString());
+
+          // test getTopDims(2, 1)
+          List<FacetResult> topDimsResults = facets.getTopDims(2, 1);

Review comment:
       Thank you so much! I will check and fix other tests that have this issue.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to