lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r583534 [1/2] - in /lucene/java/trunk/src: java/org/apache/lucene/index/ test/org/apache/lucene/ test/org/apache/lucene/analysis/ test/org/apache/lucene/document/ test/org/apache/lucene/index/ test/org/apache/lucene/index/store/ test/org/ap...
Date Wed, 10 Oct 2007 16:46:45 GMT
Author: mikemccand
Date: Wed Oct 10 09:46:35 2007
New Revision: 583534

URL: http://svn.apache.org/viewvc?rev=583534&view=rev
Log:
LUCENE-1021: make all unit tests subclass from a new LuceneTestCase, so that we can assert no unhandled exceptions occurred in ConcurrentMergeScheduler's threads

Added:
    lucene/java/trunk/src/test/org/apache/lucene/util/LuceneTestCase.java   (with props)
Modified:
    lucene/java/trunk/src/java/org/apache/lucene/index/ConcurrentMergeScheduler.java
    lucene/java/trunk/src/test/org/apache/lucene/TestDemo.java
    lucene/java/trunk/src/test/org/apache/lucene/TestHitIterator.java
    lucene/java/trunk/src/test/org/apache/lucene/TestSearch.java
    lucene/java/trunk/src/test/org/apache/lucene/TestSearchForDuplicates.java
    lucene/java/trunk/src/test/org/apache/lucene/analysis/TestAnalyzers.java
    lucene/java/trunk/src/test/org/apache/lucene/analysis/TestCachingTokenFilter.java
    lucene/java/trunk/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java
    lucene/java/trunk/src/test/org/apache/lucene/analysis/TestKeywordAnalyzer.java
    lucene/java/trunk/src/test/org/apache/lucene/analysis/TestLengthFilter.java
    lucene/java/trunk/src/test/org/apache/lucene/analysis/TestPerFieldAnalzyerWrapper.java
    lucene/java/trunk/src/test/org/apache/lucene/analysis/TestStandardAnalyzer.java
    lucene/java/trunk/src/test/org/apache/lucene/analysis/TestStopAnalyzer.java
    lucene/java/trunk/src/test/org/apache/lucene/analysis/TestStopFilter.java
    lucene/java/trunk/src/test/org/apache/lucene/analysis/TestToken.java
    lucene/java/trunk/src/test/org/apache/lucene/document/TestBinaryDocument.java
    lucene/java/trunk/src/test/org/apache/lucene/document/TestDateTools.java
    lucene/java/trunk/src/test/org/apache/lucene/document/TestDocument.java
    lucene/java/trunk/src/test/org/apache/lucene/document/TestNumberTools.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestAddIndexesNoOptimize.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestAtomicUpdate.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestCompoundFile.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestDeletionPolicy.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestDoc.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestDocumentWriter.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestFieldInfos.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestFieldsReader.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestFilterIndexReader.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexInput.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexModifier.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexReader.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriter.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterDelete.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterLockRelease.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterMerging.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestLazyBug.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestLazyProxSkipping.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestMultiLevelSkipList.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestMultiSegmentReader.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestNorms.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestParallelReader.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestParallelTermEnum.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestPayloads.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestPositionBasedTermVectorMapper.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentMerger.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentReader.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentTermDocs.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentTermEnum.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestStressIndexing.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestTerm.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestTermVectorsReader.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestTermdocPerf.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestThreadedOptimize.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestWordlistLoader.java
    lucene/java/trunk/src/test/org/apache/lucene/index/store/TestRAMDirectory.java
    lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestMultiAnalyzer.java
    lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestMultiFieldQueryParser.java
    lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestQueryParser.java
    lucene/java/trunk/src/test/org/apache/lucene/search/BaseTestRangeFilter.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestBoolean2.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestBooleanMinShouldMatch.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestBooleanOr.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestBooleanPrefixQuery.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestBooleanQuery.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestBooleanScorer.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestCachingWrapperFilter.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestDateFilter.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestDisjunctionMaxQuery.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestDocBoost.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestExplanations.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestFuzzyQuery.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestMatchAllDocsQuery.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiPhraseQuery.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiSearcher.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiSearcherRanking.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiThreadTermVectors.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestNot.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestPhrasePrefixQuery.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestPhraseQuery.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestPositionIncrement.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestPrefixFilter.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestPrefixQuery.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestQueryTermVector.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestRangeQuery.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestRemoteCachingWrapperFilter.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestRemoteSearchable.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestScorerPerf.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestSetNorm.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestSimilarity.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestSpanQueryFilter.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestTermScorer.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestTermVectors.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestThreadSafe.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestWildcard.java
    lucene/java/trunk/src/test/org/apache/lucene/search/function/FunctionTestSetup.java
    lucene/java/trunk/src/test/org/apache/lucene/search/payloads/TestBoostingTermQuery.java
    lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestBasics.java
    lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestNearSpansOrdered.java
    lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestSpans.java
    lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestSpansAdvanced.java
    lucene/java/trunk/src/test/org/apache/lucene/store/TestBufferedIndexInput.java
    lucene/java/trunk/src/test/org/apache/lucene/store/TestHugeRamFile.java
    lucene/java/trunk/src/test/org/apache/lucene/store/TestLock.java
    lucene/java/trunk/src/test/org/apache/lucene/store/TestLockFactory.java
    lucene/java/trunk/src/test/org/apache/lucene/store/TestMMapDirectory.java
    lucene/java/trunk/src/test/org/apache/lucene/store/TestWindowsMMap.java
    lucene/java/trunk/src/test/org/apache/lucene/util/TestBitVector.java
    lucene/java/trunk/src/test/org/apache/lucene/util/TestPriorityQueue.java
    lucene/java/trunk/src/test/org/apache/lucene/util/TestSmallFloat.java
    lucene/java/trunk/src/test/org/apache/lucene/util/TestStringHelper.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/ConcurrentMergeScheduler.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/ConcurrentMergeScheduler.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/ConcurrentMergeScheduler.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/ConcurrentMergeScheduler.java Wed Oct 10 09:46:35 2007
@@ -43,6 +43,15 @@
   private List exceptions = new ArrayList();
   private Directory dir;
 
+  private boolean closed;
+
+  public ConcurrentMergeScheduler() {
+    if (allInstances != null) {
+      // Only for testing
+      addMyself();
+    }
+  }
+
   /** Sets the max # simultaneous threads that may be
    *  running.  If a merge is necessary yet we already have
    *  this many threads running, the merge is returned back
@@ -72,7 +81,7 @@
   public synchronized void setMergeThreadPriority(int pri) {
     mergeThreadPriority = pri;
 
-    final int numThreads = mergeThreads.size();
+    final int numThreads = mergeThreadCount();
     for(int i=0;i<numThreads;i++) {
       MergeThread merge = (MergeThread) mergeThreads.get(i);
       try {
@@ -84,12 +93,6 @@
     }
   }
 
-  /** Returns any exceptions that were caught in the merge
-   *  threads. */
-  public List getExceptions() {
-    return exceptions;
-  }
-
   private void message(String message) {
     System.out.println("CMS [" + Thread.currentThread().getName() + "]: " + message);
   }
@@ -101,10 +104,12 @@
       mergeThreadPriority = 1+Thread.currentThread().getPriority();
   }
 
-  public void close() {}
+  public void close() {
+    closed = true;
+  }
 
-  private synchronized void finishThreads() {
-    while(mergeThreads.size() > 0) {
+  public synchronized void sync() {
+    while(mergeThreadCount() > 0) {
       if (VERBOSE) {
         message("now wait for threads; currently " + mergeThreads.size() + " still running");
         for(int i=0;i<mergeThreads.size();i++)
@@ -117,20 +122,8 @@
       }
     }
   }
-
-  public void sync() {
-    finishThreads();
-  }
-
-  // Used for testing
-  private boolean suppressExceptions;
-
-  /** Used for testing */
-  void setSuppressExceptions() {
-    suppressExceptions = true;
-  }
-  void clearSuppressExceptions() {
-    suppressExceptions = false;
+  private synchronized int mergeThreadCount() {
+    return mergeThreads.size();
   }
 
   public void merge(IndexWriter writer)
@@ -179,7 +172,7 @@
           message("    merge involves segments from an external directory; now run in foreground");
       } else {
         synchronized(this) {
-          if (mergeThreads.size() < maxThreadCount) {
+          if (mergeThreadCount() < maxThreadCount) {
             // OK to spawn a new merge thread to handle this
             // merge:
             MergeThread merger = new MergeThread(writer, merge);
@@ -269,10 +262,12 @@
             exceptions.add(exc);
           }
           
-          if (!suppressExceptions)
+          if (!suppressExceptions) {
             // suppressExceptions is normally only set during
             // testing.
+            anyExceptions = true;
             throw new MergePolicy.MergeException(exc);
+          }
         }
       } finally {
         synchronized(ConcurrentMergeScheduler.this) {
@@ -288,5 +283,54 @@
         merge = startMerge;
       return "merge thread: " + merge.segString(dir);
     }
+  }
+
+  static boolean anyExceptions = false;
+
+  /** Used for testing */
+  public static boolean anyUnhandledExceptions() {
+    synchronized(allInstances) {
+      final int count = allInstances.size();
+      // Make sure all outstanding threads are done so we see
+      // any exceptions they may produce:
+      for(int i=0;i<count;i++)
+        ((ConcurrentMergeScheduler) allInstances.get(i)).sync();
+      return anyExceptions;
+    }
+  }
+
+  /** Used for testing */
+  private void addMyself() {
+    synchronized(allInstances) {
+      final int size=0;
+      int upto = 0;
+      for(int i=0;i<size;i++) {
+        final ConcurrentMergeScheduler other = (ConcurrentMergeScheduler) allInstances.get(i);
+        if (!(other.closed && 0 == other.mergeThreadCount()))
+          // Keep this one for now: it still has threads or
+          // may spawn new threads
+          allInstances.set(upto++, other);
+      }
+      allInstances.subList(upto, allInstances.size()).clear();
+      allInstances.add(this);
+    }
+  }
+
+  private boolean suppressExceptions;
+
+  /** Used for testing */
+  void setSuppressExceptions() {
+    suppressExceptions = true;
+  }
+
+  /** Used for testing */
+  void clearSuppressExceptions() {
+    suppressExceptions = false;
+  }
+
+  /** Used for testing */
+  private static List allInstances;
+  public static void setTestMode() {
+    allInstances = new ArrayList();
   }
 }

Modified: lucene/java/trunk/src/test/org/apache/lucene/TestDemo.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/TestDemo.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/TestDemo.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/TestDemo.java Wed Oct 10 09:46:35 2007
@@ -17,7 +17,7 @@
  * limitations under the License.
  */
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.standard.StandardAnalyzer;
 import org.apache.lucene.document.Document;
@@ -38,7 +38,7 @@
  * 
  * @author Daniel Naber
  */
-public class TestDemo extends TestCase {
+public class TestDemo extends LuceneTestCase {
 
   public void testDemo() throws IOException, ParseException {
 

Modified: lucene/java/trunk/src/test/org/apache/lucene/TestHitIterator.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/TestHitIterator.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/TestHitIterator.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/TestHitIterator.java Wed Oct 10 09:46:35 2007
@@ -17,7 +17,7 @@
  * limitations under the License.
  */
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.store.RAMDirectory;
 import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.index.Term;
@@ -36,7 +36,7 @@
  * This test intentionally not put in the search package in order
  * to test HitIterator and Hit package protection.
  */
-public class TestHitIterator extends TestCase {
+public class TestHitIterator extends LuceneTestCase {
   public void testIterator() throws Exception {
     RAMDirectory directory = new RAMDirectory();
 

Modified: lucene/java/trunk/src/test/org/apache/lucene/TestSearch.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/TestSearch.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/TestSearch.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/TestSearch.java Wed Oct 10 09:46:35 2007
@@ -21,7 +21,7 @@
 import java.io.PrintWriter;
 import java.io.StringWriter;
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 import junit.framework.TestSuite;
 import junit.textui.TestRunner;
 
@@ -36,7 +36,7 @@
  *
  * @version $Id$
  */
-public class TestSearch extends TestCase {
+public class TestSearch extends LuceneTestCase {
 
     /** Main for running test case by itself. */
     public static void main(String args[]) {

Modified: lucene/java/trunk/src/test/org/apache/lucene/TestSearchForDuplicates.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/TestSearchForDuplicates.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/TestSearchForDuplicates.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/TestSearchForDuplicates.java Wed Oct 10 09:46:35 2007
@@ -28,7 +28,7 @@
 import org.apache.lucene.search.*;
 import org.apache.lucene.queryParser.*;
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 import junit.framework.TestSuite;
 import junit.textui.TestRunner;
 
@@ -37,7 +37,7 @@
  *
  * @version $Id$
  */
-public class TestSearchForDuplicates extends TestCase {
+public class TestSearchForDuplicates extends LuceneTestCase {
 
     /** Main for running test case by itself. */
     public static void main(String args[]) {

Modified: lucene/java/trunk/src/test/org/apache/lucene/analysis/TestAnalyzers.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/analysis/TestAnalyzers.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/analysis/TestAnalyzers.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/analysis/TestAnalyzers.java Wed Oct 10 09:46:35 2007
@@ -18,9 +18,9 @@
  */
 
 import java.io.*;
-import junit.framework.*;
+import org.apache.lucene.util.LuceneTestCase;
 
-public class TestAnalyzers extends TestCase {
+public class TestAnalyzers extends LuceneTestCase {
 
    public TestAnalyzers(String name) {
       super(name);

Modified: lucene/java/trunk/src/test/org/apache/lucene/analysis/TestCachingTokenFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/analysis/TestCachingTokenFilter.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/analysis/TestCachingTokenFilter.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/analysis/TestCachingTokenFilter.java Wed Oct 10 09:46:35 2007
@@ -20,7 +20,7 @@
 
 import java.io.IOException;
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
@@ -32,7 +32,7 @@
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.RAMDirectory;
 
-public class TestCachingTokenFilter extends TestCase {
+public class TestCachingTokenFilter extends LuceneTestCase {
   private String[] tokens = new String[] {"term1", "term2", "term3", "term2"};
   
   public void testCaching() throws IOException {

Modified: lucene/java/trunk/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java Wed Oct 10 09:46:35 2007
@@ -17,11 +17,11 @@
  * limitations under the License.
  */
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
 import java.io.StringReader;
 
-public class TestISOLatin1AccentFilter extends TestCase {
+public class TestISOLatin1AccentFilter extends LuceneTestCase {
   public void testU() throws Exception {
     TokenStream stream = new WhitespaceTokenizer(new StringReader("Des mot clés À LA CHAÎNE À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö Ø Œ Þ Ù Ú Û Ü Ý Ÿ à á â ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ø œ ß þ ù ú û ü ý ÿ"));
     ISOLatin1AccentFilter filter = new ISOLatin1AccentFilter(stream);

Modified: lucene/java/trunk/src/test/org/apache/lucene/analysis/TestKeywordAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/analysis/TestKeywordAnalyzer.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/analysis/TestKeywordAnalyzer.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/analysis/TestKeywordAnalyzer.java Wed Oct 10 09:46:35 2007
@@ -17,7 +17,7 @@
  * limitations under the License.
  */
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.store.RAMDirectory;
 import org.apache.lucene.document.Document;
@@ -27,12 +27,13 @@
 import org.apache.lucene.search.Hits;
 import org.apache.lucene.queryParser.QueryParser;
 
-public class TestKeywordAnalyzer extends TestCase {
+public class TestKeywordAnalyzer extends LuceneTestCase {
   
   private RAMDirectory directory;
   private IndexSearcher searcher;
 
   public void setUp() throws Exception {
+    super.setUp();
     directory = new RAMDirectory();
     IndexWriter writer = new IndexWriter(directory,
                                          new SimpleAnalyzer(),

Modified: lucene/java/trunk/src/test/org/apache/lucene/analysis/TestLengthFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/analysis/TestLengthFilter.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/analysis/TestLengthFilter.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/analysis/TestLengthFilter.java Wed Oct 10 09:46:35 2007
@@ -17,11 +17,11 @@
  * limitations under the License.
  */
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
 import java.io.StringReader;
 
-public class TestLengthFilter extends TestCase {
+public class TestLengthFilter extends LuceneTestCase {
   
   public void testFilter() throws Exception {
     TokenStream stream = new WhitespaceTokenizer(

Modified: lucene/java/trunk/src/test/org/apache/lucene/analysis/TestPerFieldAnalzyerWrapper.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/analysis/TestPerFieldAnalzyerWrapper.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/analysis/TestPerFieldAnalzyerWrapper.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/analysis/TestPerFieldAnalzyerWrapper.java Wed Oct 10 09:46:35 2007
@@ -1,6 +1,6 @@
 package org.apache.lucene.analysis;
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 import java.io.StringReader;
 
 /**
@@ -20,7 +20,7 @@
  * limitations under the License.
  */
 
-public class TestPerFieldAnalzyerWrapper extends TestCase {
+public class TestPerFieldAnalzyerWrapper extends LuceneTestCase {
   public void testPerField() throws Exception {
     String text = "Qwerty";
     PerFieldAnalyzerWrapper analyzer =

Modified: lucene/java/trunk/src/test/org/apache/lucene/analysis/TestStandardAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/analysis/TestStandardAnalyzer.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/analysis/TestStandardAnalyzer.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/analysis/TestStandardAnalyzer.java Wed Oct 10 09:46:35 2007
@@ -1,6 +1,6 @@
 package org.apache.lucene.analysis;
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.analysis.standard.StandardAnalyzer;
 
 import java.io.StringReader;
@@ -21,7 +21,7 @@
  * limitations under the License.
  */
 
-public class TestStandardAnalyzer extends TestCase {
+public class TestStandardAnalyzer extends LuceneTestCase {
 
     private Analyzer a = new StandardAnalyzer();
 

Modified: lucene/java/trunk/src/test/org/apache/lucene/analysis/TestStopAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/analysis/TestStopAnalyzer.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/analysis/TestStopAnalyzer.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/analysis/TestStopAnalyzer.java Wed Oct 10 09:46:35 2007
@@ -17,14 +17,14 @@
  * limitations under the License.
  */
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
 import java.io.StringReader;
 import java.io.IOException;
 import java.util.Set;
 import java.util.HashSet;
 
-public class TestStopAnalyzer extends TestCase {
+public class TestStopAnalyzer extends LuceneTestCase {
   
   private StopAnalyzer stop = new StopAnalyzer();
   private Set inValidTokens = new HashSet();
@@ -33,7 +33,8 @@
     super(s);
   }
 
-  protected void setUp() {
+  protected void setUp() throws Exception {
+    super.setUp();
     for (int i = 0; i < StopAnalyzer.ENGLISH_STOP_WORDS.length; i++) {
       inValidTokens.add(StopAnalyzer.ENGLISH_STOP_WORDS[i]);
     }

Modified: lucene/java/trunk/src/test/org/apache/lucene/analysis/TestStopFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/analysis/TestStopFilter.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/analysis/TestStopFilter.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/analysis/TestStopFilter.java Wed Oct 10 09:46:35 2007
@@ -19,12 +19,12 @@
 import java.io.IOException;
 import java.io.StringReader;
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
 /**
  * @author yonik
  */
-public class TestStopFilter extends TestCase {
+public class TestStopFilter extends LuceneTestCase {
 
   // other StopFilter functionality is already tested by TestStopAnalyzer
 

Modified: lucene/java/trunk/src/test/org/apache/lucene/analysis/TestToken.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/analysis/TestToken.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/analysis/TestToken.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/analysis/TestToken.java Wed Oct 10 09:46:35 2007
@@ -18,9 +18,9 @@
  */
 
 import java.io.*;
-import junit.framework.*;
+import org.apache.lucene.util.LuceneTestCase;
 
-public class TestToken extends TestCase {
+public class TestToken extends LuceneTestCase {
 
   public TestToken(String name) {
     super(name);

Modified: lucene/java/trunk/src/test/org/apache/lucene/document/TestBinaryDocument.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/document/TestBinaryDocument.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/document/TestBinaryDocument.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/document/TestBinaryDocument.java Wed Oct 10 09:46:35 2007
@@ -1,6 +1,6 @@
 package org.apache.lucene.document;
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
 import org.apache.lucene.analysis.standard.StandardAnalyzer;
 import org.apache.lucene.index.IndexReader;
@@ -30,7 +30,7 @@
  *
  * @version $Id$
  */
-public class TestBinaryDocument extends TestCase
+public class TestBinaryDocument extends LuceneTestCase
 {
 
   String binaryValStored = "this text will be stored as a byte array in the index";

Modified: lucene/java/trunk/src/test/org/apache/lucene/document/TestDateTools.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/document/TestDateTools.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/document/TestDateTools.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/document/TestDateTools.java Wed Oct 10 09:46:35 2007
@@ -6,7 +6,7 @@
 import java.util.Date;
 import java.util.TimeZone;
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
 /**
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -25,7 +25,7 @@
  * limitations under the License.
  */
 
-public class TestDateTools extends TestCase {
+public class TestDateTools extends LuceneTestCase {
 
   public void testStringToDate() throws ParseException {
     

Modified: lucene/java/trunk/src/test/org/apache/lucene/document/TestDocument.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/document/TestDocument.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/document/TestDocument.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/document/TestDocument.java Wed Oct 10 09:46:35 2007
@@ -1,6 +1,6 @@
 package org.apache.lucene.document;
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
 import org.apache.lucene.store.RAMDirectory;
 import org.apache.lucene.document.Document;
@@ -37,7 +37,7 @@
  *
  * @version $Id$
  */
-public class TestDocument extends TestCase
+public class TestDocument extends LuceneTestCase
 {
 
   String binaryVal = "this text will be stored as a byte array in the index";

Modified: lucene/java/trunk/src/test/org/apache/lucene/document/TestNumberTools.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/document/TestNumberTools.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/document/TestNumberTools.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/document/TestNumberTools.java Wed Oct 10 09:46:35 2007
@@ -17,9 +17,9 @@
  * limitations under the License.
  */
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
-public class TestNumberTools extends TestCase {
+public class TestNumberTools extends LuceneTestCase {
     public void testNearZero() {
         for (int i = -100; i <= 100; i++) {
             for (int j = -100; j <= 100; j++) {

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestAddIndexesNoOptimize.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestAddIndexesNoOptimize.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestAddIndexesNoOptimize.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestAddIndexesNoOptimize.java Wed Oct 10 09:46:35 2007
@@ -19,7 +19,7 @@
 
 import java.io.IOException;
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
 import org.apache.lucene.analysis.WhitespaceAnalyzer;
 import org.apache.lucene.document.Document;
@@ -29,7 +29,7 @@
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.RAMDirectory;
 
-public class TestAddIndexesNoOptimize extends TestCase {
+public class TestAddIndexesNoOptimize extends LuceneTestCase {
   public void testSimpleCase() throws IOException {
     // main directory
     Directory dir = new RAMDirectory();

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestAtomicUpdate.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestAtomicUpdate.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestAtomicUpdate.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestAtomicUpdate.java Wed Oct 10 09:46:35 2007
@@ -25,12 +25,12 @@
 import org.apache.lucene.queryParser.*;
 import org.apache.lucene.util._TestUtil;
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
 import java.util.Random;
 import java.io.File;
 
-public class TestAtomicUpdate extends TestCase {
+public class TestAtomicUpdate extends LuceneTestCase {
   private static final Analyzer ANALYZER = new SimpleAnalyzer();
   private static final Random RANDOM = new Random();
 

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java Wed Oct 10 09:46:35 2007
@@ -17,7 +17,7 @@
  * limitations under the License.
  */
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 import java.util.Vector;
 import java.util.Arrays;
 import java.io.ByteArrayOutputStream;
@@ -42,7 +42,7 @@
   against it, and add documents to it.
 */
 
-public class TestBackwardsCompatibility extends TestCase
+public class TestBackwardsCompatibility extends LuceneTestCase
 {
 
   // Uncomment these cases & run in a pre-lockless checkout

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestCompoundFile.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestCompoundFile.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestCompoundFile.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestCompoundFile.java Wed Oct 10 09:46:35 2007
@@ -20,7 +20,7 @@
 import java.io.IOException;
 import java.io.File;
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 import junit.framework.TestSuite;
 import junit.textui.TestRunner;
 import org.apache.lucene.store.IndexOutput;
@@ -35,7 +35,7 @@
  *
  * @version $Id$
  */
-public class TestCompoundFile extends TestCase
+public class TestCompoundFile extends LuceneTestCase
 {
     /** Main for running test case by itself. */
     public static void main(String args[]) {
@@ -58,7 +58,8 @@
     private Directory dir;
 
 
-    public void setUp() throws IOException {
+    public void setUp() throws Exception {
+       super.setUp();
        File file = new File(System.getProperty("tempDir"), "testIndex");
        _TestUtil.rmDir(file);
        dir = FSDirectory.getDirectory(file);

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java Wed Oct 10 09:46:35 2007
@@ -28,12 +28,12 @@
 import org.apache.lucene.util._TestUtil;
 import org.apache.lucene.util.English;
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
 import java.io.IOException;
 import java.io.File;
 
-public class TestConcurrentMergeScheduler extends TestCase {
+public class TestConcurrentMergeScheduler extends LuceneTestCase {
   
   private static final Analyzer ANALYZER = new SimpleAnalyzer();
 
@@ -94,8 +94,6 @@
       }
     }
 
-    assertEquals(0, cms.getExceptions().size());
-
     writer.close();
     IndexReader reader = IndexReader.open(directory);
     assertEquals(200, reader.numDocs());
@@ -139,8 +137,6 @@
       writer.flush();
     }
 
-    assertEquals(0, cms.getExceptions().size());
-
     writer.close();
     IndexReader reader = IndexReader.open(directory);
     // Verify that we did not lose any deletes...
@@ -171,7 +167,6 @@
         
         writer.close();
         TestIndexWriter.assertNoUnreferencedFiles(directory, "testNoExtraFiles autoCommit=" + autoCommit);
-        assertEquals(0, cms.getExceptions().size());
 
         // Reopen
         writer = new IndexWriter(directory, autoCommit, ANALYZER, false);
@@ -211,7 +206,6 @@
         }
 
         writer.close(false);
-        assertEquals(0, cms.getExceptions().size());
 
         IndexReader reader = IndexReader.open(directory);
         assertEquals((1+iter)*181, reader.numDocs());

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestDeletionPolicy.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestDeletionPolicy.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestDeletionPolicy.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestDeletionPolicy.java Wed Oct 10 09:46:35 2007
@@ -17,7 +17,7 @@
  * limitations under the License.
  */
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
 import java.io.IOException;
 
@@ -40,7 +40,7 @@
   against it, and add documents to it.
 */
 
-public class TestDeletionPolicy extends TestCase
+public class TestDeletionPolicy extends LuceneTestCase
 {
   private void verifyCommitOrder(List commits) {
     long last = SegmentInfos.generationFromSegmentsFileName(((IndexCommitPoint) commits.get(0)).getSegmentsFileName());

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestDoc.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestDoc.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestDoc.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestDoc.java Wed Oct 10 09:46:35 2007
@@ -16,7 +16,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 import junit.framework.TestSuite;
 import junit.textui.TestRunner;
 
@@ -37,7 +37,7 @@
  *
  * @version $Id$
  */
-public class TestDoc extends TestCase {
+public class TestDoc extends LuceneTestCase {
 
     /** Main for running test case by itself. */
     public static void main(String args[]) {
@@ -53,7 +53,8 @@
     /** Set the test case. This test case needs
      *  a few text files created in the current working directory.
      */
-    public void setUp() throws IOException {
+    public void setUp() throws Exception {
+        super.setUp();
         workDir = new File(System.getProperty("tempDir"),"TestDoc");
         workDir.mkdirs();
 

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestDocumentWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestDocumentWriter.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestDocumentWriter.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestDocumentWriter.java Wed Oct 10 09:46:35 2007
@@ -17,7 +17,7 @@
  * limitations under the License.
  */
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.SimpleAnalyzer;
 import org.apache.lucene.analysis.Token;
@@ -34,24 +34,20 @@
 
 import java.util.Arrays;
 
-public class TestDocumentWriter extends TestCase {
+public class TestDocumentWriter extends LuceneTestCase {
   private RAMDirectory dir;
 
   public TestDocumentWriter(String s) {
     super(s);
   }
 
-  protected void setUp() {
+  protected void setUp() throws Exception {
+    super.setUp();
     dir = new RAMDirectory();
   }
 
-  protected void tearDown() {
-
-  }
-
   public void test() {
     assertTrue(dir != null);
-
   }
 
   public void testAddDocument() throws Exception {

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestFieldInfos.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestFieldInfos.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestFieldInfos.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestFieldInfos.java Wed Oct 10 09:46:35 2007
@@ -17,7 +17,7 @@
  * limitations under the License.
  */
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.store.RAMDirectory;
 import org.apache.lucene.store.IndexOutput;
@@ -26,7 +26,7 @@
 
 //import org.cnlp.utils.properties.ResourceBundleHelper;
 
-public class TestFieldInfos extends TestCase {
+public class TestFieldInfos extends LuceneTestCase {
 
   private Document testDoc = new Document();
 
@@ -34,11 +34,9 @@
     super(s);
   }
 
-  protected void setUp() {
+  protected void setUp() throws Exception {
+    super.setUp();
     DocHelper.setupDoc(testDoc);
-  }
-
-  protected void tearDown() {
   }
 
   public void test() throws IOException {

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestFieldsReader.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestFieldsReader.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestFieldsReader.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestFieldsReader.java Wed Oct 10 09:46:35 2007
@@ -17,7 +17,7 @@
  * limitations under the License.
  */
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.analysis.WhitespaceAnalyzer;
 import org.apache.lucene.document.*;
 import org.apache.lucene.search.Similarity;
@@ -30,7 +30,7 @@
 import java.io.IOException;
 import java.util.*;
 
-public class TestFieldsReader extends TestCase {
+public class TestFieldsReader extends LuceneTestCase {
   private RAMDirectory dir = new RAMDirectory();
   private Document testDoc = new Document();
   private FieldInfos fieldInfos = null;
@@ -41,7 +41,8 @@
     super(s);
   }
 
-  protected void setUp() throws IOException {
+  protected void setUp() throws Exception {
+    super.setUp();
     fieldInfos = new FieldInfos();
     DocHelper.setupDoc(testDoc);
     fieldInfos.add(testDoc);

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestFilterIndexReader.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestFilterIndexReader.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestFilterIndexReader.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestFilterIndexReader.java Wed Oct 10 09:46:35 2007
@@ -18,7 +18,7 @@
  */
 
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 import junit.framework.TestSuite;
 import junit.textui.TestRunner;
 
@@ -30,7 +30,7 @@
 
 import java.io.IOException;
 
-public class TestFilterIndexReader extends TestCase {
+public class TestFilterIndexReader extends LuceneTestCase {
 
   private static class TestReader extends FilterIndexReader {
 

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexFileDeleter.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexFileDeleter.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexFileDeleter.java Wed Oct 10 09:46:35 2007
@@ -17,7 +17,7 @@
  * limitations under the License.
  */
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 import java.util.Vector;
 import java.util.Arrays;
 import java.io.ByteArrayOutputStream;
@@ -44,7 +44,7 @@
   against it, and add documents to it.
 */
 
-public class TestIndexFileDeleter extends TestCase
+public class TestIndexFileDeleter extends LuceneTestCase
 {
   public void testDeleteLeftoverFiles() throws IOException {
 

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexInput.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexInput.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexInput.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexInput.java Wed Oct 10 09:46:35 2007
@@ -17,12 +17,12 @@
  * limitations under the License.
  */
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.store.IndexInput;
 
 import java.io.IOException;
 
-public class TestIndexInput extends TestCase {
+public class TestIndexInput extends LuceneTestCase {
   public void testRead() throws IOException {
     IndexInput is = new MockIndexInput(new byte[]{(byte) 0x80, 0x01,
             (byte) 0xFF, 0x7F,

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexModifier.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexModifier.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexModifier.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexModifier.java Wed Oct 10 09:46:35 2007
@@ -17,7 +17,7 @@
  * limitations under the License.
  */
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.SimpleAnalyzer;
 import org.apache.lucene.analysis.standard.StandardAnalyzer;
@@ -42,7 +42,7 @@
  * @author Daniel Naber
  * @deprecated
  */
-public class TestIndexModifier extends TestCase {
+public class TestIndexModifier extends LuceneTestCase {
 
   private int docCount = 0;
   

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexReader.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexReader.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexReader.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexReader.java Wed Oct 10 09:46:35 2007
@@ -18,7 +18,7 @@
  */
 
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 import junit.framework.TestSuite;
 import junit.textui.TestRunner;
 import org.apache.lucene.analysis.WhitespaceAnalyzer;
@@ -36,7 +36,7 @@
 import java.io.IOException;
 import java.util.*;
 
-public class TestIndexReader extends TestCase
+public class TestIndexReader extends LuceneTestCase
 {
     /** Main for running test case by itself. */
     public static void main(String args[]) {

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriter.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriter.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriter.java Wed Oct 10 09:46:35 2007
@@ -22,7 +22,7 @@
 import java.util.Arrays;
 import java.util.Random;
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
 import org.apache.lucene.analysis.WhitespaceAnalyzer;
 import org.apache.lucene.analysis.standard.StandardAnalyzer;
@@ -50,7 +50,7 @@
  *
  * @version $Id$
  */
-public class TestIndexWriter extends TestCase
+public class TestIndexWriter extends LuceneTestCase
 {
     public void testDocCount() throws IOException
     {

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterDelete.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterDelete.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterDelete.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterDelete.java Wed Oct 10 09:46:35 2007
@@ -21,7 +21,7 @@
 import java.util.Arrays;
 import java.lang.StackTraceElement;
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
 import org.apache.lucene.analysis.WhitespaceAnalyzer;
 import org.apache.lucene.document.Document;
@@ -33,7 +33,7 @@
 import org.apache.lucene.store.MockRAMDirectory;
 import org.apache.lucene.store.RAMDirectory;
 
-public class TestIndexWriterDelete extends TestCase {
+public class TestIndexWriterDelete extends LuceneTestCase {
 
   // test the simple case
   public void testSimpleCase() throws IOException {

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterLockRelease.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterLockRelease.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterLockRelease.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterLockRelease.java Wed Oct 10 09:46:35 2007
@@ -20,7 +20,7 @@
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.IOException;
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.index.IndexWriter;
 
 /**
@@ -32,10 +32,11 @@
  * @version $Id$
  */
 
-public class TestIndexWriterLockRelease extends TestCase {
+public class TestIndexWriterLockRelease extends LuceneTestCase {
     private java.io.File __test_dir;
 
-    public void setUp() throws IOException {
+    public void setUp() throws Exception {
+        super.setUp();
         if (this.__test_dir == null) {
             String tmp_dir = System.getProperty("java.io.tmpdir", "tmp");
             this.__test_dir = new File(tmp_dir, "testIndexWriter");
@@ -51,7 +52,8 @@
         }
     }
 
-    public void tearDown() throws IOException {
+    public void tearDown() throws Exception {
+        super.tearDown();
         if (this.__test_dir != null) {
             File[] files = this.__test_dir.listFiles();
 

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java Wed Oct 10 09:46:35 2007
@@ -26,9 +26,9 @@
 import org.apache.lucene.store.RAMDirectory;
 import org.apache.lucene.util._TestUtil;
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
-public class TestIndexWriterMergePolicy extends TestCase {
+public class TestIndexWriterMergePolicy extends LuceneTestCase {
 
   // Test the normal case
   public void testNormalCase() throws IOException {

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterMerging.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterMerging.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterMerging.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterMerging.java Wed Oct 10 09:46:35 2007
@@ -20,12 +20,12 @@
 import org.apache.lucene.analysis.standard.StandardAnalyzer;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
 import java.io.IOException;
 
 
-public class TestIndexWriterMerging extends TestCase
+public class TestIndexWriterMerging extends LuceneTestCase
 {
 
   /**

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestLazyBug.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestLazyBug.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestLazyBug.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestLazyBug.java Wed Oct 10 09:46:35 2007
@@ -17,7 +17,7 @@
  * limitations under the License.
  */
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.SimpleAnalyzer;
 import org.apache.lucene.document.*;
@@ -32,7 +32,7 @@
  * Test demonstrating EOF bug on the last field of the last doc 
  * if other docs have allready been accessed.
  */
-public class TestLazyBug extends TestCase {
+public class TestLazyBug extends LuceneTestCase {
 
   public static int BASE_SEED = 13;
 

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestLazyProxSkipping.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestLazyProxSkipping.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestLazyProxSkipping.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestLazyProxSkipping.java Wed Oct 10 09:46:35 2007
@@ -30,13 +30,13 @@
 import org.apache.lucene.store.IndexInput;
 import org.apache.lucene.store.RAMDirectory;
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
 /**
  * Tests lazy skipping on the proximity file.
  *
  */
-public class TestLazyProxSkipping extends TestCase {
+public class TestLazyProxSkipping extends LuceneTestCase {
     private Searcher searcher;
     private int seeksCounter = 0;
     

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestMultiLevelSkipList.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestMultiLevelSkipList.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestMultiLevelSkipList.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestMultiLevelSkipList.java Wed Oct 10 09:46:35 2007
@@ -20,7 +20,7 @@
 import java.io.IOException;
 import java.io.Reader;
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.LowerCaseTokenizer;
@@ -42,7 +42,7 @@
  * testcases.
  * 
  */
-public class TestMultiLevelSkipList extends TestCase {
+public class TestMultiLevelSkipList extends LuceneTestCase {
   public void testSimpleSkip() throws IOException {
     RAMDirectory dir = new RAMDirectory();
     IndexWriter writer = new IndexWriter(dir, new PayloadAnalyzer(), true);

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestMultiSegmentReader.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestMultiSegmentReader.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestMultiSegmentReader.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestMultiSegmentReader.java Wed Oct 10 09:46:35 2007
@@ -17,7 +17,7 @@
  * limitations under the License.
  */
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
 import org.apache.lucene.analysis.standard.StandardAnalyzer;
 import org.apache.lucene.document.Document;
@@ -27,7 +27,7 @@
 
 import java.io.IOException;
 
-public class TestMultiSegmentReader extends TestCase {
+public class TestMultiSegmentReader extends LuceneTestCase {
   protected Directory dir;
   private Document doc1;
   private Document doc2;
@@ -39,7 +39,8 @@
     super(s);
   }
 
-  protected void setUp() throws IOException {
+  protected void setUp() throws Exception {
+    super.setUp();
     dir = new RAMDirectory();
     doc1 = new Document();
     doc2 = new Document();
@@ -63,7 +64,7 @@
     return reader;
   }
 
-  public void test() throws IOException {
+  public void test() throws Exception {
     setUp();
     doTestDocument();
     doTestUndeleteAll();

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestNorms.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestNorms.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestNorms.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestNorms.java Wed Oct 10 09:46:35 2007
@@ -17,7 +17,7 @@
  * limitations under the License.
  */
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.standard.StandardAnalyzer;
@@ -38,7 +38,7 @@
  * Test that norms info is preserved during index life - including
  * separate norms, addDocument, addIndexes, optimize.
  */
-public class TestNorms extends TestCase {
+public class TestNorms extends LuceneTestCase {
 
   private class SimilarityOne extends DefaultSimilarity {
     public float lengthNorm(String fieldName, int numTerms) {
@@ -60,12 +60,10 @@
     super(s);
   }
 
-  protected void setUp() throws IOException {
+  protected void setUp() throws Exception {
+    super.setUp();
     similarityOne = new SimilarityOne();
     anlzr = new StandardAnalyzer();
-  }
-
-  protected void tearDown() throws IOException {
   }
 
   /**

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestParallelReader.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestParallelReader.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestParallelReader.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestParallelReader.java Wed Oct 10 09:46:35 2007
@@ -21,7 +21,7 @@
 import java.util.Arrays;
 import java.util.Collection;
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
 import org.apache.lucene.analysis.standard.StandardAnalyzer;
 import org.apache.lucene.document.Document;
@@ -38,12 +38,13 @@
 import org.apache.lucene.store.RAMDirectory;
 import org.apache.lucene.store.MockRAMDirectory;
 
-public class TestParallelReader extends TestCase {
+public class TestParallelReader extends LuceneTestCase {
 
   private Searcher parallel;
   private Searcher single;
   
   protected void setUp() throws Exception {
+    super.setUp();
     single = single();
     parallel = parallel();
   }

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestParallelTermEnum.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestParallelTermEnum.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestParallelTermEnum.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestParallelTermEnum.java Wed Oct 10 09:46:35 2007
@@ -19,7 +19,7 @@
 
 import java.io.IOException;
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
 import org.apache.lucene.analysis.SimpleAnalyzer;
 import org.apache.lucene.document.Document;
@@ -28,12 +28,13 @@
 import org.apache.lucene.document.Field.Store;
 import org.apache.lucene.store.RAMDirectory;
 
-public class TestParallelTermEnum extends TestCase {
+public class TestParallelTermEnum extends LuceneTestCase {
     private IndexReader ir1;
     private IndexReader ir2;
 
     protected void setUp() throws Exception {
         super.setUp();
+        super.setUp();
         Document doc;
 
         RAMDirectory rd1 = new RAMDirectory();
@@ -66,6 +67,7 @@
     }
 
     protected void tearDown() throws Exception {
+        super.tearDown();
         super.tearDown();
 
         ir1.close();

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestPayloads.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestPayloads.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestPayloads.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestPayloads.java Wed Oct 10 09:46:35 2007
@@ -26,7 +26,7 @@
 import java.util.Map;
 import java.util.Random;
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.Token;
@@ -41,7 +41,7 @@
 import org.apache.lucene.store.RAMDirectory;
 
 
-public class TestPayloads extends TestCase {
+public class TestPayloads extends LuceneTestCase {
     
     // Simple tests to test the Payload class
     public void testPayload() throws Exception {

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestPositionBasedTermVectorMapper.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestPositionBasedTermVectorMapper.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestPositionBasedTermVectorMapper.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestPositionBasedTermVectorMapper.java Wed Oct 10 09:46:35 2007
@@ -15,14 +15,14 @@
  * limitations under the License.
  */
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
 import java.io.IOException;
 import java.util.BitSet;
 import java.util.Iterator;
 import java.util.Map;
 
-public class TestPositionBasedTermVectorMapper extends TestCase {
+public class TestPositionBasedTermVectorMapper extends LuceneTestCase {
   protected String[] tokens;
   protected int[][] thePositions;
   protected TermVectorOffsetInfo[][] offsets;
@@ -33,7 +33,8 @@
     super(s);
   }
 
-  protected void setUp() {
+  protected void setUp() throws Exception {
+    super.setUp();
     tokens = new String[]{"here", "is", "some", "text", "to", "test", "extra"};
     thePositions = new int[tokens.length][];
     offsets = new TermVectorOffsetInfo[tokens.length][];
@@ -57,10 +58,6 @@
     offsets[tokens.length - 1][0] = new TermVectorOffsetInfo(0, 1);
   }
 
-  protected void tearDown() {
-
-  }
-
   public void test() throws IOException {
     PositionBasedTermVectorMapper mapper = new PositionBasedTermVectorMapper();
     
@@ -104,4 +101,4 @@
 
 
   
-}
\ No newline at end of file
+}

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentMerger.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentMerger.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentMerger.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentMerger.java Wed Oct 10 09:46:35 2007
@@ -17,7 +17,7 @@
  * limitations under the License.
  */
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.RAMDirectory;
 import org.apache.lucene.document.Document;
@@ -25,7 +25,7 @@
 import java.io.IOException;
 import java.util.Collection;
 
-public class TestSegmentMerger extends TestCase {
+public class TestSegmentMerger extends LuceneTestCase {
   //The variables for the new merged segment
   private Directory mergedDir = new RAMDirectory();
   private String mergedSegment = "test";
@@ -43,7 +43,8 @@
     super(s);
   }
 
-  protected void setUp() throws IOException {
+  protected void setUp() throws Exception {
+    super.setUp();
     DocHelper.setupDoc(doc1);
     SegmentInfo info1 = DocHelper.writeDoc(merge1Dir, doc1);
     DocHelper.setupDoc(doc2);

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentReader.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentReader.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentReader.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentReader.java Wed Oct 10 09:46:35 2007
@@ -22,14 +22,14 @@
 import java.util.Iterator;
 import java.util.List;
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Fieldable;
 import org.apache.lucene.search.DefaultSimilarity;
 import org.apache.lucene.store.RAMDirectory;
 
-public class TestSegmentReader extends TestCase {
+public class TestSegmentReader extends LuceneTestCase {
   private RAMDirectory dir = new RAMDirectory();
   private Document testDoc = new Document();
   private SegmentReader reader = null;
@@ -39,14 +39,11 @@
   }
   
   //TODO: Setup the reader w/ multiple documents
-  protected void setUp() throws IOException {
+  protected void setUp() throws Exception {
+    super.setUp();
     DocHelper.setupDoc(testDoc);
     SegmentInfo info = DocHelper.writeDoc(dir, testDoc);
     reader = SegmentReader.get(info);
-  }
-
-  protected void tearDown() {
-
   }
 
   public void test() {

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentTermDocs.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentTermDocs.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentTermDocs.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentTermDocs.java Wed Oct 10 09:46:35 2007
@@ -17,7 +17,7 @@
  * limitations under the License.
  */
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.store.RAMDirectory;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.analysis.WhitespaceAnalyzer;
@@ -26,7 +26,7 @@
 
 import java.io.IOException;
 
-public class TestSegmentTermDocs extends TestCase {
+public class TestSegmentTermDocs extends LuceneTestCase {
   private Document testDoc = new Document();
   private Directory dir = new RAMDirectory();
   private SegmentInfo info;
@@ -35,14 +35,10 @@
     super(s);
   }
 
-  protected void setUp() throws IOException {
+  protected void setUp() throws Exception {
+    super.setUp();
     DocHelper.setupDoc(testDoc);
     info = DocHelper.writeDoc(dir, testDoc);
-  }
-
-
-  protected void tearDown() {
-
   }
 
   public void test() {

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentTermEnum.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentTermEnum.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentTermEnum.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentTermEnum.java Wed Oct 10 09:46:35 2007
@@ -19,7 +19,7 @@
 
 import java.io.IOException;
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
 import org.apache.lucene.analysis.WhitespaceAnalyzer;
 import org.apache.lucene.document.Document;
@@ -34,7 +34,7 @@
 /**
  * @author goller
  */
-public class TestSegmentTermEnum extends TestCase
+public class TestSegmentTermEnum extends LuceneTestCase
 {
   Directory dir = new RAMDirectory();
 

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestStressIndexing.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestStressIndexing.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestStressIndexing.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestStressIndexing.java Wed Oct 10 09:46:35 2007
@@ -24,12 +24,12 @@
 import org.apache.lucene.search.*;
 import org.apache.lucene.queryParser.*;
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
 import java.util.Random;
 import java.io.File;
 
-public class TestStressIndexing extends TestCase {
+public class TestStressIndexing extends LuceneTestCase {
   private static final Analyzer ANALYZER = new SimpleAnalyzer();
   private static final Random RANDOM = new Random();
 

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestTerm.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestTerm.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestTerm.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestTerm.java Wed Oct 10 09:46:35 2007
@@ -17,9 +17,9 @@
  * limitations under the License.
  */
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
-public class TestTerm extends TestCase {
+public class TestTerm extends LuceneTestCase {
 
   public void testEquals() {
     final Term base = new Term("same", "same");

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestTermVectorsReader.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestTermVectorsReader.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestTermVectorsReader.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestTermVectorsReader.java Wed Oct 10 09:46:35 2007
@@ -17,7 +17,7 @@
  * limitations under the License.
  */
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.store.MockRAMDirectory;
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.TokenStream;
@@ -32,7 +32,7 @@
 import java.util.Map;
 import java.util.SortedSet;
 
-public class TestTermVectorsReader extends TestCase {
+public class TestTermVectorsReader extends LuceneTestCase {
   //Must be lexicographically sorted, will do in setup, versus trying to maintain here
   private String[] testFields = {"f1", "f2", "f3", "f4"};
   private boolean[] testFieldsStorePos = {true, false, true, false};
@@ -61,7 +61,8 @@
 
   TestToken[] tokens = new TestToken[testTerms.length * TERM_FREQ];
 
-  protected void setUp() throws IOException {
+  protected void setUp() throws Exception {
+    super.setUp();
     /*
     for (int i = 0; i < testFields.length; i++) {
       fieldInfos.add(testFields[i], true, true, testFieldsStorePos[i], testFieldsStoreOff[i]);
@@ -139,10 +140,6 @@
     public TokenStream tokenStream(String fieldName, Reader reader) {
       return new MyTokenStream();
     }
-  }
-
-  protected void tearDown() {
-
   }
 
   public void test() {

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestTermdocPerf.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestTermdocPerf.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestTermdocPerf.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestTermdocPerf.java Wed Oct 10 09:46:35 2007
@@ -17,7 +17,7 @@
  */
 
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.RAMDirectory;
 import org.apache.lucene.analysis.Analyzer;
@@ -49,7 +49,7 @@
 }
 
 
-public class TestTermdocPerf extends TestCase {
+public class TestTermdocPerf extends LuceneTestCase {
 
   void addDocs(Directory dir, final int ndocs, String field, final String val, final int maxTF, final float percentDocs) throws IOException {
     final Random random = new Random(0);

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestThreadedOptimize.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestThreadedOptimize.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestThreadedOptimize.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestThreadedOptimize.java Wed Oct 10 09:46:35 2007
@@ -27,12 +27,12 @@
 import org.apache.lucene.util._TestUtil;
 import org.apache.lucene.util.English;
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
 import java.io.IOException;
 import java.io.File;
 
-public class TestThreadedOptimize extends TestCase {
+public class TestThreadedOptimize extends LuceneTestCase {
   
   private static final Analyzer ANALYZER = new SimpleAnalyzer();
 

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestWordlistLoader.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestWordlistLoader.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestWordlistLoader.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestWordlistLoader.java Wed Oct 10 09:46:35 2007
@@ -22,11 +22,11 @@
 import java.io.StringReader;
 import java.util.HashSet;
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
 import org.apache.lucene.analysis.WordlistLoader;
 
-public class TestWordlistLoader extends TestCase {
+public class TestWordlistLoader extends LuceneTestCase {
 
   public void testWordlistLoading() throws IOException {
     String s = "ONE\n  two \nthree";

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/store/TestRAMDirectory.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/store/TestRAMDirectory.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/store/TestRAMDirectory.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/store/TestRAMDirectory.java Wed Oct 10 09:46:35 2007
@@ -24,7 +24,7 @@
 import java.io.ByteArrayOutputStream;
 
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
 import org.apache.lucene.analysis.WhitespaceAnalyzer;
 import org.apache.lucene.document.Document;
@@ -47,7 +47,7 @@
  * 
  * @version $Id: RAMDirectory.java 150537 2004-09-28 22:45:26 +0200 (Di, 28 Sep 2004) cutting $
  */
-public class TestRAMDirectory extends TestCase {
+public class TestRAMDirectory extends LuceneTestCase {
   
   private File indexDir = null;
   
@@ -55,7 +55,8 @@
   private final int docsToAdd = 500;
   
   // setup the index
-  public void setUp () throws IOException {
+  public void setUp () throws Exception {
+    super.setUp();
     String tempDir = System.getProperty("java.io.tmpdir");
     if (tempDir == null)
       throw new IOException("java.io.tmpdir undefined, cannot run test");
@@ -206,7 +207,8 @@
     assertTrue("contains more then just header", headerSize < bos.size());
   } 
 
-  public void tearDown() {
+  public void tearDown() throws Exception {
+    super.tearDown();
     // cleanup 
     if (indexDir != null && indexDir.exists()) {
       rmDir (indexDir);

Modified: lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestMultiAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestMultiAnalyzer.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestMultiAnalyzer.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestMultiAnalyzer.java Wed Oct 10 09:46:35 2007
@@ -19,7 +19,7 @@
 
 import java.io.Reader;
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
 import org.apache.lucene.search.Query;
 import org.apache.lucene.analysis.Analyzer;
@@ -36,7 +36,7 @@
  * 
  * @author Daniel Naber
  */
-public class TestMultiAnalyzer extends TestCase {
+public class TestMultiAnalyzer extends LuceneTestCase {
 
   private static int multiToken = 0;
 

Modified: lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestMultiFieldQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestMultiFieldQueryParser.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestMultiFieldQueryParser.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestMultiFieldQueryParser.java Wed Oct 10 09:46:35 2007
@@ -17,7 +17,7 @@
  * limitations under the License.
  */
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.Token;
 import org.apache.lucene.analysis.TokenStream;
@@ -42,7 +42,7 @@
  * Tests QueryParser.
  * @author Daniel Naber
  */
-public class TestMultiFieldQueryParser extends TestCase {
+public class TestMultiFieldQueryParser extends LuceneTestCase {
 
   /** test stop words arsing for both the non static form, and for the 
    * corresponding static form (qtxt, fields[]). */

Modified: lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestQueryParser.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestQueryParser.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestQueryParser.java Wed Oct 10 09:46:35 2007
@@ -17,7 +17,7 @@
  * limitations under the License.
  */
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.analysis.*;
 import org.apache.lucene.analysis.Token;
 import org.apache.lucene.analysis.standard.StandardAnalyzer;
@@ -40,7 +40,7 @@
 /**
  * Tests QueryParser.
  */
-public class TestQueryParser extends TestCase {
+public class TestQueryParser extends LuceneTestCase {
 
   public static Analyzer qpAnalyzer = new QPTestAnalyzer();
 
@@ -98,7 +98,8 @@
 
   private int originalMaxClauses;
 
-  public void setUp() {
+  public void setUp() throws Exception {
+    super.setUp();
     originalMaxClauses = BooleanQuery.getMaxClauseCount();
   }
 
@@ -861,7 +862,8 @@
     iw.addDocument(d);
   }
 
-  public void tearDown() {
+  public void tearDown() throws Exception {
+    super.tearDown();
     BooleanQuery.setMaxClauseCount(originalMaxClauses);
   }
 

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/BaseTestRangeFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/BaseTestRangeFilter.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/BaseTestRangeFilter.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/BaseTestRangeFilter.java Wed Oct 10 09:46:35 2007
@@ -19,7 +19,7 @@
 
 import java.util.Random;
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
 import org.apache.lucene.analysis.SimpleAnalyzer;
 import org.apache.lucene.document.Document;
@@ -27,7 +27,7 @@
 import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.store.RAMDirectory;
 
-public class BaseTestRangeFilter extends TestCase {
+public class BaseTestRangeFilter extends LuceneTestCase {
 
     public static final boolean F = false;
     public static final boolean T = true;

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestBoolean2.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestBoolean2.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestBoolean2.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestBoolean2.java Wed Oct 10 09:46:35 2007
@@ -31,19 +31,20 @@
 import org.apache.lucene.queryParser.QueryParser;
 import org.apache.lucene.queryParser.ParseException;
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
 import java.util.Random;
 
 /** Test BooleanQuery2 against BooleanQuery by overriding the standard query parser.
  * This also tests the scoring order of BooleanQuery.
  */
-public class TestBoolean2 extends TestCase {
+public class TestBoolean2 extends LuceneTestCase {
   private IndexSearcher searcher;
 
   public static final String field = "field";
 
   public void setUp() throws Exception {
+    super.setUp();
     RAMDirectory directory = new RAMDirectory();
     IndexWriter writer= new IndexWriter(directory, new WhitespaceAnalyzer(), true);
     for (int i = 0; i < docFields.length; i++) {

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestBooleanMinShouldMatch.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestBooleanMinShouldMatch.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestBooleanMinShouldMatch.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestBooleanMinShouldMatch.java Wed Oct 10 09:46:35 2007
@@ -19,6 +19,7 @@
 
 
 import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.analysis.WhitespaceAnalyzer;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
@@ -33,7 +34,7 @@
 
 /** Test that BooleanQuery.setMinimumNumberShouldMatch works.
  */
-public class TestBooleanMinShouldMatch extends TestCase {
+public class TestBooleanMinShouldMatch extends LuceneTestCase {
 
 
     public Directory index;
@@ -43,6 +44,9 @@
     public void setUp() throws Exception {
 
 
+        super.setUp();
+
+
         String[] data = new String [] {
             "A 1 2 3 4 5 6",
             "Z       4 5 6",
@@ -325,9 +329,9 @@
         // should be a superset to the unconstrained query.
         if (top2.totalHits > top1.totalHits) {
           TestCase.fail("Constrained results not a subset:\n"
-                + CheckHits.topdocsString(top1,0,0)
-                + CheckHits.topdocsString(top2,0,0)
-                + "for query:" + q2.toString());
+                        + CheckHits.topdocsString(top1,0,0)
+                        + CheckHits.topdocsString(top2,0,0)
+                        + "for query:" + q2.toString());
         }
 
         for (int hit=0; hit<top2.totalHits; hit++) {

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestBooleanOr.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestBooleanOr.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestBooleanOr.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestBooleanOr.java Wed Oct 10 09:46:35 2007
@@ -17,7 +17,7 @@
  */
 import java.io.IOException;
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
 import org.apache.lucene.analysis.standard.StandardAnalyzer;
 import org.apache.lucene.document.Document;
@@ -36,7 +36,7 @@
  * <br>Adapted to Lucene testcase by Paul Elschot.
  * @author appler@gmail.com
  */
-public class TestBooleanOr extends TestCase {
+public class TestBooleanOr extends LuceneTestCase {
 
 	private static String FIELD_T = "T";
 	private static String FIELD_C = "C";
@@ -133,6 +133,7 @@
 	}
 
 	protected void setUp() throws Exception {
+		super.setUp();
 		super.setUp();
 
 		//



Mime
View raw message