Apache Lucene open-source search software
add test verbosity
Michael McCandless5d74641c6ce6
diff --git a/lucene/src/test/org/apache/lucene/index/TestIndexWriter.java b/lucene/src/test/org/apache/lucene/index/TestIndexWriter.javaindex 97511437b71..e9e998aa1dc 100644--- a/lucene/src/test/org/apache/lucene/index/TestIndexWriter.java+++ b/lucene/src/test/org/apache/lucene/index/TestIndexWriter.java@@ -5140,6 +5140,9 @@ public class TestIndexWriter extends LuceneTestCase {RandomIndexWriter w = new RandomIndexWriter(rand, dir, newIndexWriterConfig(rand, TEST_VERSION_CURRENT, new MockAnalyzer()).setMaxBufferedDocs(_TestUtil.nextInt(rand, 5, 20)));//w.w.setInfoStream(System.out);//w.w.setUseCompoundFile(false);+ if (VERBOSE) {+ w.w.setInfoStream(System.out);+ }final int docCount = 200*RANDOM_MULTIPLIER;final int fieldCount = _TestUtil.nextInt(rand, 1, 5);@@ -5153,6 +5156,10 @@ public class TestIndexWriter extends LuceneTestCase {final Map<String,Document> docs = new HashMap<String,Document>();+ if (VERBOSE) {+ System.out.println("TEST: build index docCount=" + docCount);+ }+for(int i=0;i<docCount;i++) {Document doc = new Document();doc.add(idField);@@ -5176,11 +5183,17 @@ public class TestIndexWriter extends LuceneTestCase {}if (rand.nextInt(5) == 3 && i > 0) {final String delID = ""+rand.nextInt(i);+ if (VERBOSE) {+ System.out.println("TEST: delete doc " + delID);+ }w.deleteDocuments(new Term("id", delID));docs.remove(delID);}}+ if (VERBOSE) {+ System.out.println("TEST: " + docs.size() + " docs in index; now load fields");+ }if (docs.size() > 0) {String[] idsList = docs.keySet().toArray(new String[docs.size()]);@@ -5188,6 +5201,10 @@ public class TestIndexWriter extends LuceneTestCase {IndexReader r = w.getReader();IndexSearcher s = new IndexSearcher(r);+ if (VERBOSE) {+ System.out.println("TEST: cycle x=" + x + " r=" + r);+ }+for(int iter=0;iter<1000*RANDOM_MULTIPLIER;iter++) {String testID = idsList[rand.nextInt(idsList.length)];TopDocs hits = s.search(new TermQuery(new Term("id", testID)), 1);