lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r1045267 - in /lucene/dev/branches/branch_3x: ./ lucene/ lucene/src/test/org/apache/lucene/index/TestIndexWriterDelete.java solr/
Date Mon, 13 Dec 2010 18:02:21 GMT
Author: mikemccand
Date: Mon Dec 13 18:02:20 2010
New Revision: 1045267

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

Modified:
    lucene/dev/branches/branch_3x/   (props changed)
    lucene/dev/branches/branch_3x/lucene/   (props changed)
    lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/index/TestIndexWriterDelete.java
    lucene/dev/branches/branch_3x/solr/   (props changed)

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/index/TestIndexWriterDelete.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/index/TestIndexWriterDelete.java?rev=1045267&r1=1045266&r2=1045267&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/index/TestIndexWriterDelete.java
(original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/index/TestIndexWriterDelete.java
Mon Dec 13 18:02:20 2010
@@ -628,6 +628,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");
             }
           }
@@ -635,6 +639,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;
               }
@@ -654,6 +662,8 @@ public class TestIndexWriterDelete exten
     MockDirectoryWrapper dir = newDirectory();
     IndexWriter modifier = new IndexWriter(dir, newIndexWriterConfig(
         TEST_VERSION_CURRENT, new WhitespaceAnalyzer(TEST_VERSION_CURRENT)).setMaxBufferedDeleteTerms(2).setReaderPooling(false));
+    modifier.setInfoStream(VERBOSE ? System.out : null);
+
     LogMergePolicy lmp = (LogMergePolicy) modifier.getConfig().getMergePolicy();
     lmp.setUseCompoundFile(true);
     lmp.setUseCompoundDocStore(true);
@@ -674,7 +684,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
@@ -688,11 +705,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);
 
@@ -710,6 +734,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