lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r1045266 - /lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestIndexWriterDelete.java
Date Mon, 13 Dec 2010 18:00:35 GMT
Author: mikemccand
Date: Mon Dec 13 18:00:35 2010
New Revision: 1045266

URL: http://svn.apache.org/viewvc?rev=1045266&view=rev
Log:
add verbosity to test

Modified:
    lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestIndexWriterDelete.java

Modified: lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestIndexWriterDelete.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestIndexWriterDelete.java?rev=1045266&r1=1045265&r2=1045266&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestIndexWriterDelete.java (original)
+++ lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestIndexWriterDelete.java Mon
Dec 13 18:00:35 2010
@@ -645,6 +645,10 @@ public class TestIndexWriterDelete exten
             if (!seen) {
               // Only fail once we are no longer in applyDeletes
               failed = true;
+              if (VERBOSE) {
+                System.out.println("TEST: mock failure: now fail");
+                new Throwable().printStackTrace(System.out);
+              }
               throw new IOException("fail after applyDeletes");
             }
           }
@@ -652,6 +656,10 @@ public class TestIndexWriterDelete exten
             StackTraceElement[] trace = new Exception().getStackTrace();
             for (int i = 0; i < trace.length; i++) {
               if ("applyDeletes".equals(trace[i].getMethodName())) {
+                if (VERBOSE) {
+                  System.out.println("TEST: mock failure: saw applyDeletes");
+                  new Throwable().printStackTrace(System.out);
+                }
                 sawMaybe = true;
                 break;
               }
@@ -671,6 +679,8 @@ public class TestIndexWriterDelete exten
     MockDirectoryWrapper dir = newDirectory();
     IndexWriter modifier = new IndexWriter(dir, newIndexWriterConfig(
                                                                      TEST_VERSION_CURRENT,
new MockAnalyzer(MockTokenizer.WHITESPACE, false)).setMaxBufferedDeleteTerms(2).setReaderPooling(false));
+    modifier.setInfoStream(VERBOSE ? System.out : null);
+
     LogMergePolicy lmp = (LogMergePolicy) modifier.getConfig().getMergePolicy();
     lmp.setUseCompoundFile(true);
     lmp.setUseCompoundDocStore(true);
@@ -691,7 +701,14 @@ public class TestIndexWriterDelete exten
     }
     // flush (and commit if ac)
 
+    if (VERBOSE) {
+      System.out.println("TEST: now optimize");
+    }
+
     modifier.optimize();
+    if (VERBOSE) {
+      System.out.println("TEST: now commit");
+    }
     modifier.commit();
 
     // one of the two files hits
@@ -705,11 +722,18 @@ public class TestIndexWriterDelete exten
     // delete the doc
     // max buf del terms is two, so this is buffered
 
+    if (VERBOSE) {
+      System.out.println("TEST: delete term=" + term);
+    }
+
     modifier.deleteDocuments(term);
 
     // add a doc (needed for the !ac case; see below)
     // doc remains buffered
 
+    if (VERBOSE) {
+      System.out.println("TEST: add empty doc");
+    }
     Document doc = new Document();
     modifier.addDocument(doc);
 
@@ -727,6 +751,9 @@ public class TestIndexWriterDelete exten
     // lose deletes if failing while creating the cfs file)
     boolean failed = false;
     try {
+      if (VERBOSE) {
+        System.out.println("TEST: now commit for failure");
+      }
       modifier.commit();
     } catch (IOException ioe) {
       // expected



Mime
View raw message