You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ji...@apache.org on 2019/02/21 07:37:01 UTC
[lucene-solr] branch master updated: LUCENE-8686: Fix test bug in
TestTaxonomyFacetSumValueSource#testRandom
This is an automated email from the ASF dual-hosted git repository.
jimczi 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 4625270 LUCENE-8686: Fix test bug in TestTaxonomyFacetSumValueSource#testRandom
4625270 is described below
commit 4625270ce093411a85c824e1aea5742a6ae1426e
Author: jimczi <ji...@apache.org>
AuthorDate: Thu Feb 21 16:36:26 2019 +0900
LUCENE-8686: Fix test bug in TestTaxonomyFacetSumValueSource#testRandom
---
.../lucene/facet/taxonomy/TestTaxonomyFacetSumValueSource.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetSumValueSource.java b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetSumValueSource.java
index 76493ed..b686d92 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetSumValueSource.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetSumValueSource.java
@@ -452,8 +452,10 @@ public class TestTaxonomyFacetSumValueSource extends FacetTestCase {
List<LabelAndValue> labelValues = new ArrayList<>();
double totValue = 0;
for(Map.Entry<String,Float> ent : expectedValues[i].entrySet()) {
- labelValues.add(new LabelAndValue(ent.getKey(), ent.getValue()));
- totValue += ent.getValue();
+ if (ent.getValue() > 0) {
+ labelValues.add(new LabelAndValue(ent.getKey(), ent.getValue()));
+ totValue += ent.getValue();
+ }
}
sortLabelValues(labelValues);
if (totValue > 0) {