You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by cp...@apache.org on 2016/04/25 11:34:23 UTC
lucene-solr:branch_5x: LUCENE-7247: TestCoreParser.dumpResults
verbose and test-fail logging tweaks
Repository: lucene-solr
Updated Branches:
refs/heads/branch_5x 33462956c -> 062ba7ef6
LUCENE-7247: TestCoreParser.dumpResults verbose and test-fail logging tweaks
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/062ba7ef
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/062ba7ef
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/062ba7ef
Branch: refs/heads/branch_5x
Commit: 062ba7ef6035b66e866fca52184994d59ebb3ac5
Parents: 3346295
Author: Christine Poerschke <cp...@apache.org>
Authored: Mon Apr 25 09:39:29 2016 +0100
Committer: Christine Poerschke <cp...@apache.org>
Committed: Mon Apr 25 10:14:58 2016 +0100
----------------------------------------------------------------------
.../org/apache/lucene/queryparser/xml/TestCoreParser.java | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/062ba7ef/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestCoreParser.java
----------------------------------------------------------------------
diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestCoreParser.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestCoreParser.java
index 423c038..9989c57 100644
--- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestCoreParser.java
+++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestCoreParser.java
@@ -231,13 +231,15 @@ public class TestCoreParser extends LuceneTestCase {
protected void dumpResults(String qType, Query q, int numDocs) throws IOException {
if (VERBOSE) {
- System.out.println("TEST: qType=" + qType + " query=" + q + " numDocs=" + numDocs);
+ System.out.println("TEST: qType=" + qType + " numDocs=" + numDocs + " " + q.getClass().getCanonicalName() + " query=" + q);
}
final IndexSearcher searcher = searcher();
TopDocs hits = searcher.search(q, numDocs);
- assertTrue(qType + " should produce results ", hits.totalHits > 0);
+ final boolean producedResults = (hits.totalHits > 0);
+ if (!producedResults) {
+ System.out.println("TEST: qType=" + qType + " numDocs=" + numDocs + " " + q.getClass().getCanonicalName() + " query=" + q);
+ }
if (VERBOSE) {
- System.out.println("=========" + qType + "============");
ScoreDoc[] scoreDocs = hits.scoreDocs;
for (int i = 0; i < Math.min(numDocs, hits.totalHits); i++) {
Document ldoc = searcher.doc(scoreDocs[i].doc);
@@ -245,5 +247,6 @@ public class TestCoreParser extends LuceneTestCase {
}
System.out.println();
}
+ assertTrue(qType + " produced no results", producedResults);
}
}