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 [2/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
Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestBooleanPrefixQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestBooleanPrefixQuery.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestBooleanPrefixQuery.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestBooleanPrefixQuery.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 junit.framework.Test;
 import junit.framework.TestSuite;
 import junit.textui.TestRunner;
@@ -39,7 +39,7 @@
  * @version $Id$
  **/
 
-public class TestBooleanPrefixQuery extends TestCase {
+public class TestBooleanPrefixQuery extends LuceneTestCase {
 
   public static void main(String[] args) {
     TestRunner.run(suite());

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

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestBooleanScorer.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestBooleanScorer.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestBooleanScorer.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestBooleanScorer.java Wed Oct 10 09:46:35 2007
@@ -26,13 +26,13 @@
 import org.apache.lucene.index.Term;
 import org.apache.lucene.store.RAMDirectory;
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
 /**
  *
  * @version $rcs = ' $Id$ ' ;
  */
-public class TestBooleanScorer extends TestCase
+public class TestBooleanScorer extends LuceneTestCase
 {
 
   public TestBooleanScorer(String name) {

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestCachingWrapperFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestCachingWrapperFilter.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestCachingWrapperFilter.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestCachingWrapperFilter.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 org.apache.lucene.store.Directory;
 import org.apache.lucene.store.RAMDirectory;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.analysis.standard.StandardAnalyzer;
 
-public class TestCachingWrapperFilter extends TestCase {
+public class TestCachingWrapperFilter extends LuceneTestCase {
   public void testCachingWorks() throws Exception {
     Directory dir = new RAMDirectory();
     IndexWriter writer = new IndexWriter(dir, new StandardAnalyzer(), true);

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestDateFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestDateFilter.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestDateFilter.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestDateFilter.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.SimpleAnalyzer;
 import org.apache.lucene.document.DateTools;
 import org.apache.lucene.document.Document;
@@ -35,7 +35,7 @@
   * @version $Revision$
   */
 public class TestDateFilter
-    extends TestCase
+    extends LuceneTestCase
 {
     public TestDateFilter(String name)
     {

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestDisjunctionMaxQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestDisjunctionMaxQuery.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestDisjunctionMaxQuery.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestDisjunctionMaxQuery.java Wed Oct 10 09:46:35 2007
@@ -18,7 +18,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.Document;
 import org.apache.lucene.document.Field;
@@ -35,7 +35,7 @@
  * Test of the DisjunctionMaxQuery.
  *
  */
-public class TestDisjunctionMaxQuery extends TestCase{
+public class TestDisjunctionMaxQuery extends LuceneTestCase{
 
     /** threshold for comparing floats */
     public static final float SCORE_COMP_THRESH = 0.0000f;
@@ -72,6 +72,8 @@
     public IndexSearcher s;
 
     public void setUp() throws Exception {
+
+        super.setUp();
 
         index = new RAMDirectory();
         IndexWriter writer = new IndexWriter(index,

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestDocBoost.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestDocBoost.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestDocBoost.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestDocBoost.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.SimpleAnalyzer;
 import org.apache.lucene.document.*;
 import org.apache.lucene.index.IndexWriter;
@@ -29,7 +29,7 @@
  *
  * @version $Revision$
  */
-public class TestDocBoost extends TestCase {
+public class TestDocBoost extends LuceneTestCase {
   public TestDocBoost(String name) {
     super(name);
   }

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestExplanations.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestExplanations.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestExplanations.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestExplanations.java Wed Oct 10 09:46:35 2007
@@ -32,7 +32,7 @@
 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;
 import java.util.BitSet;
@@ -49,7 +49,7 @@
  *
  * @see "Subclasses for actual tests"
  */
-public class TestExplanations extends TestCase {
+public class TestExplanations extends LuceneTestCase {
   protected IndexSearcher searcher;
 
   public static final String FIELD = "field";
@@ -57,10 +57,12 @@
     new QueryParser(FIELD, new WhitespaceAnalyzer());
 
   public void tearDown() throws Exception {
+    super.tearDown();
     searcher.close();
   }
   
   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/TestFuzzyQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestFuzzyQuery.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestFuzzyQuery.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestFuzzyQuery.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;
 import org.apache.lucene.document.Field;
@@ -32,7 +32,7 @@
  *
  * @author Daniel Naber
  */
-public class TestFuzzyQuery extends TestCase {
+public class TestFuzzyQuery extends LuceneTestCase {
 
   public void testFuzziness() throws Exception {
     RAMDirectory directory = new RAMDirectory();

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestMatchAllDocsQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestMatchAllDocsQuery.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestMatchAllDocsQuery.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestMatchAllDocsQuery.java Wed Oct 10 09:46:35 2007
@@ -25,14 +25,14 @@
 import org.apache.lucene.index.Term;
 import org.apache.lucene.store.RAMDirectory;
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
 /**
  * Tests MatchAllDocsQuery.
  * 
  * @author Daniel Naber
  */
-public class TestMatchAllDocsQuery extends TestCase {
+public class TestMatchAllDocsQuery extends LuceneTestCase {
 
   public void testQuery() throws IOException {
     RAMDirectory dir = new RAMDirectory();

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiPhraseQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiPhraseQuery.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiPhraseQuery.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiPhraseQuery.java Wed Oct 10 09:46:35 2007
@@ -28,7 +28,7 @@
 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;
 import java.util.LinkedList;
@@ -39,7 +39,7 @@
  *
  * @version $Id$
  */
-public class TestMultiPhraseQuery extends TestCase
+public class TestMultiPhraseQuery extends LuceneTestCase
 {
     public TestMultiPhraseQuery(String name) {
         super(name);

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiSearcher.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiSearcher.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiSearcher.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiSearcher.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.KeywordAnalyzer;
 import org.apache.lucene.analysis.standard.StandardAnalyzer;
 import org.apache.lucene.document.Document;
@@ -41,7 +41,7 @@
  *
  * @version $Id$
  */
-public class TestMultiSearcher extends TestCase
+public class TestMultiSearcher extends LuceneTestCase
 {
     public TestMultiSearcher(String name)
     {

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiSearcherRanking.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiSearcherRanking.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiSearcherRanking.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiSearcherRanking.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;
 import org.apache.lucene.document.Field;
@@ -35,7 +35,7 @@
  *
  * @version $Id: TestMultiSearcher.java 150492 2004-09-06 22:01:49Z dnaber $
  */
-public class TestMultiSearcherRanking extends TestCase {
+public class TestMultiSearcherRanking extends LuceneTestCase {
   
   private final boolean verbose = false;  // set to true to output hits
   private final String FIELD_NAME = "body";
@@ -111,6 +111,7 @@
    * initializes multiSearcher and singleSearcher with the same document set
    */
   protected void setUp() throws Exception {
+    super.setUp();
     // create MultiSearcher from two seperate searchers
     Directory d1 = new RAMDirectory();
     IndexWriter iw1 = new IndexWriter(d1, new StandardAnalyzer(), true);

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiThreadTermVectors.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiThreadTermVectors.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiThreadTermVectors.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiThreadTermVectors.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.SimpleAnalyzer;
 import org.apache.lucene.document.*;
 import org.apache.lucene.index.IndexReader;
@@ -32,7 +32,7 @@
  *
  * @version $rcs = ' $Id$ ' ;
  */
-public class TestMultiThreadTermVectors extends TestCase {
+public class TestMultiThreadTermVectors extends LuceneTestCase {
   private RAMDirectory directory = new RAMDirectory();
   public int numDocs = 100;
   public int numThreads = 3;
@@ -42,6 +42,7 @@
   }
   
   public void setUp() throws Exception {
+    super.setUp();
     IndexWriter writer
             = new IndexWriter(directory, new SimpleAnalyzer(), true);
     //writer.setUseCompoundFile(false);

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestNot.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestNot.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestNot.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestNot.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.queryParser.QueryParser;
@@ -31,7 +31,7 @@
  *
  * @version $Revision$
  */
-public class TestNot extends TestCase {
+public class TestNot extends LuceneTestCase {
   public TestNot(String name) {
     super(name);
   }

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestPhrasePrefixQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestPhrasePrefixQuery.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestPhrasePrefixQuery.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestPhrasePrefixQuery.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.SimpleAnalyzer;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
@@ -37,7 +37,7 @@
  * @version $Id$
  */
 public class TestPhrasePrefixQuery
-    extends TestCase
+    extends LuceneTestCase
 {
     public TestPhrasePrefixQuery(String name)
     {

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestPhraseQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestPhraseQuery.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestPhraseQuery.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestPhraseQuery.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.document.*;
 import org.apache.lucene.index.IndexWriter;
@@ -34,7 +34,7 @@
  * @see TestPositionIncrement
  * @author Erik Hatcher
  */
-public class TestPhraseQuery extends TestCase {
+public class TestPhraseQuery extends LuceneTestCase {
 
   /** threshold for comparing floats */
   public static final float SCORE_COMP_THRESH = 1e-6f;
@@ -44,6 +44,7 @@
   private RAMDirectory directory;
 
   public void setUp() throws Exception {
+    super.setUp();
     directory = new RAMDirectory();
     Analyzer analyzer = new Analyzer() {
       public TokenStream tokenStream(String fieldName, Reader reader) {
@@ -80,6 +81,7 @@
   }
 
   public void tearDown() throws Exception {
+    super.tearDown();
     searcher.close();
     directory.close();
   }

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestPositionIncrement.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestPositionIncrement.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestPositionIncrement.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestPositionIncrement.java Wed Oct 10 09:46:35 2007
@@ -33,7 +33,7 @@
 import java.io.Reader;
 import java.io.StringReader;
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
 /**
  * Term position unit test.
@@ -41,7 +41,7 @@
  *
  * @version $Revision$
  */
-public class TestPositionIncrement extends TestCase {
+public class TestPositionIncrement extends LuceneTestCase {
 
   public void testSetPosition() throws Exception {
     Analyzer analyzer = new Analyzer() {

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestPrefixFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestPrefixFilter.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestPrefixFilter.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestPrefixFilter.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;
@@ -31,7 +31,7 @@
  * @author Yura Smolsky
  * @author yonik
  */
-public class TestPrefixFilter extends TestCase {
+public class TestPrefixFilter extends LuceneTestCase {
   public void testPrefixFilter() throws Exception {
     RAMDirectory directory = new RAMDirectory();
 

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestPrefixQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestPrefixQuery.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestPrefixQuery.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestPrefixQuery.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;
@@ -30,7 +30,7 @@
  *
  * @author Erik Hatcher
  */
-public class TestPrefixQuery extends TestCase {
+public class TestPrefixQuery extends LuceneTestCase {
   public void testPrefixQuery() throws Exception {
     RAMDirectory directory = new RAMDirectory();
 

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestQueryTermVector.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestQueryTermVector.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestQueryTermVector.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestQueryTermVector.java Wed Oct 10 09:46:35 2007
@@ -17,21 +17,14 @@
  * limitations under the License.
  */
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.analysis.WhitespaceAnalyzer;
 
-public class TestQueryTermVector extends TestCase {
+public class TestQueryTermVector extends LuceneTestCase {
 
 
   public TestQueryTermVector(String s) {
     super(s);
-  }
-
-  protected void setUp() {
-  }
-
-  protected void tearDown() {
-
   }
 
   public void testConstructor() {

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestRangeQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestRangeQuery.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestRangeQuery.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestRangeQuery.java Wed Oct 10 09:46:35 2007
@@ -24,18 +24,19 @@
 import org.apache.lucene.index.Term;
 import org.apache.lucene.store.RAMDirectory;
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 import java.io.IOException;
 
 /**
  * @author goller
  */
-public class TestRangeQuery extends TestCase {
+public class TestRangeQuery extends LuceneTestCase {
 
   private int docCount = 0;
   private RAMDirectory dir;
 
-  public void setUp() {
+  public void setUp() throws Exception {
+    super.setUp();
     dir = new RAMDirectory();
   }
 

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestRemoteCachingWrapperFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestRemoteCachingWrapperFilter.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestRemoteCachingWrapperFilter.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestRemoteCachingWrapperFilter.java Wed Oct 10 09:46:35 2007
@@ -20,7 +20,7 @@
 import java.rmi.Naming;
 import java.rmi.registry.LocateRegistry;
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
 import org.apache.lucene.analysis.SimpleAnalyzer;
 import org.apache.lucene.document.Document;
@@ -34,7 +34,7 @@
  * NOTE: This is copied from TestRemoteSearchable since it already had a remote index set up.
  * @author Matt Ericson
  */
-public class TestRemoteCachingWrapperFilter extends TestCase {
+public class TestRemoteCachingWrapperFilter extends LuceneTestCase {
   public TestRemoteCachingWrapperFilter(String name) {
     super(name);
   }

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestRemoteSearchable.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestRemoteSearchable.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestRemoteSearchable.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestRemoteSearchable.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.SimpleAnalyzer;
 import org.apache.lucene.document.*;
 import org.apache.lucene.index.IndexWriter;
@@ -33,7 +33,7 @@
 /**
  * @version $Id$
  */
-public class TestRemoteSearchable extends TestCase {
+public class TestRemoteSearchable extends LuceneTestCase {
   public TestRemoteSearchable(String name) {
     super(name);
   }

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestScorerPerf.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestScorerPerf.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestScorerPerf.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestScorerPerf.java Wed Oct 10 09:46:35 2007
@@ -1,6 +1,6 @@
 package org.apache.lucene.search;
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
 import java.util.Random;
 import java.util.BitSet;
@@ -37,7 +37,7 @@
  *
  * @version $Id$
  */
-public class TestScorerPerf extends TestCase {
+public class TestScorerPerf extends LuceneTestCase {
   Random r = new Random(0);
   boolean validate = true;  // set to false when doing performance testing
 

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestSetNorm.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestSetNorm.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestSetNorm.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestSetNorm.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.SimpleAnalyzer;
 import org.apache.lucene.document.*;
 import org.apache.lucene.index.IndexReader;
@@ -30,7 +30,7 @@
  *
  * @version $Revision$
  */
-public class TestSetNorm extends TestCase {
+public class TestSetNorm extends LuceneTestCase {
   public TestSetNorm(String name) {
     super(name);
   }

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestSimilarity.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestSimilarity.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestSimilarity.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestSimilarity.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.Collection;
 
@@ -34,7 +34,7 @@
  *
  * @version $Revision$
  */
-public class TestSimilarity extends TestCase {
+public class TestSimilarity extends LuceneTestCase {
   public TestSimilarity(String name) {
     super(name);
   }

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestSpanQueryFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestSpanQueryFilter.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestSpanQueryFilter.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestSpanQueryFilter.java Wed Oct 10 09:46:35 2007
@@ -16,7 +16,7 @@
  * limitations under the License.
  */
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.analysis.SimpleAnalyzer;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
@@ -32,20 +32,13 @@
 import java.util.Iterator;
 import java.util.List;
 
-public class TestSpanQueryFilter extends TestCase {
+public class TestSpanQueryFilter extends LuceneTestCase {
 
 
   public TestSpanQueryFilter(String s) {
     super(s);
   }
 
-  protected void setUp() {
-  }
-
-  protected void tearDown() {
-
-  }
-
   public void testFilterWorks() throws Exception {
     Directory dir = new RAMDirectory();
     IndexWriter writer = new IndexWriter(dir, new SimpleAnalyzer(), true);
@@ -78,4 +71,4 @@
     }
     reader.close();
   }
-}
\ No newline at end of file
+}

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestTermScorer.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestTermScorer.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestTermScorer.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestTermScorer.java Wed Oct 10 09:46:35 2007
@@ -21,7 +21,7 @@
 import java.util.ArrayList;
 import java.util.List;
 
-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;
@@ -30,7 +30,7 @@
 import org.apache.lucene.index.Term;
 import org.apache.lucene.store.RAMDirectory;
 
-public class TestTermScorer extends TestCase
+public class TestTermScorer extends LuceneTestCase
 {
     protected RAMDirectory directory;
     private static final String FIELD = "field";
@@ -45,8 +45,9 @@
         super(s);
     }
 
-    protected void setUp() throws IOException
+    protected void setUp() throws Exception
     {
+        super.setUp();
         directory = new RAMDirectory();
 
 
@@ -61,11 +62,6 @@
         indexSearcher = new IndexSearcher(directory);
         indexReader = indexSearcher.getIndexReader();
 
-
-    }
-
-    protected void tearDown()
-    {
 
     }
 

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestTermVectors.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestTermVectors.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestTermVectors.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestTermVectors.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.SimpleAnalyzer;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
@@ -32,7 +32,7 @@
 import java.util.Map;
 import java.util.SortedSet;
 
-public class TestTermVectors extends TestCase {
+public class TestTermVectors extends LuceneTestCase {
   private IndexSearcher searcher;
   private RAMDirectory directory = new RAMDirectory();
   public TestTermVectors(String s) {
@@ -40,6 +40,7 @@
   }
 
   public void setUp() throws Exception {                  
+    super.setUp();
     IndexWriter writer
             = new IndexWriter(directory, new SimpleAnalyzer(), true);
     //writer.setUseCompoundFile(true);
@@ -67,10 +68,6 @@
     }
     writer.close();
     searcher = new IndexSearcher(directory);
-  }
-
-  protected void tearDown() {
-
   }
 
   public void test() {

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestThreadSafe.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestThreadSafe.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestThreadSafe.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestThreadSafe.java Wed Oct 10 09:46:35 2007
@@ -17,6 +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.index.IndexReader;
@@ -32,7 +33,7 @@
  * 
  * @version $Id$
  */
-public class TestThreadSafe extends TestCase {
+public class TestThreadSafe extends LuceneTestCase {
   Random r = new Random();
   Directory dir1;
   Directory dir2;

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestWildcard.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestWildcard.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestWildcard.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestWildcard.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.SimpleAnalyzer;
 import org.apache.lucene.analysis.WhitespaceAnalyzer;
 import org.apache.lucene.document.Document;
@@ -38,7 +38,7 @@
  * 
  */
 public class TestWildcard
-    extends TestCase {
+    extends LuceneTestCase {
   public void testEquals() {
     WildcardQuery wq1 = new WildcardQuery(new Term("field", "b*a"));
     WildcardQuery wq2 = new WildcardQuery(new Term("field", "b*a"));

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/function/FunctionTestSetup.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/function/FunctionTestSetup.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/function/FunctionTestSetup.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/function/FunctionTestSetup.java Wed Oct 10 09:46:35 2007
@@ -26,12 +26,12 @@
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.RAMDirectory;
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
 /**
  * Setup for function tests
  */
-public abstract class FunctionTestSetup extends TestCase {
+public abstract class FunctionTestSetup extends LuceneTestCase {
 
   /**
    * Actual score computation order is slightly different than assumptios
@@ -76,12 +76,14 @@
   /* @override */
   protected void tearDown() throws Exception {
     super.tearDown();
+    super.tearDown();
     dir = null;
     anlzr = null;
   }
 
   /* @override */
   protected void setUp() throws Exception {
+    super.setUp();
     // prepare a small index with just a few documents.  
     super.setUp();
     dir = new RAMDirectory();

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/payloads/TestBoostingTermQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/payloads/TestBoostingTermQuery.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/payloads/TestBoostingTermQuery.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/payloads/TestBoostingTermQuery.java Wed Oct 10 09:46:35 2007
@@ -16,7 +16,7 @@
  * limitations under the License.
  */
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.analysis.*;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
@@ -32,7 +32,7 @@
 import java.io.IOException;
 import java.io.Reader;
 
-public class TestBoostingTermQuery extends TestCase {
+public class TestBoostingTermQuery extends LuceneTestCase {
   private IndexSearcher searcher;
   private BoostingSimilarity similarity = new BoostingSimilarity();
   private byte[] payloadField = new byte[]{1};
@@ -81,7 +81,8 @@
     }
   }
 
-  protected void setUp() throws IOException {
+  protected void setUp() throws Exception {
+    super.setUp();
     RAMDirectory directory = new RAMDirectory();
     PayloadAnalyzer analyzer = new PayloadAnalyzer();
     IndexWriter writer
@@ -104,11 +105,6 @@
     searcher.setSimilarity(similarity);
   }
 
-
-  protected void tearDown() {
-
-  }
-
   public void test() throws IOException {
     BoostingTermQuery query = new BoostingTermQuery(new Term("field", "seventy"));
     TopDocs hits = searcher.search(query, null, 100);
@@ -231,4 +227,4 @@
       return freq == 0 ? 0 : 1;
     }
   }
-}
\ No newline at end of file
+}

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestBasics.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestBasics.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestBasics.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestBasics.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;
 
@@ -44,10 +44,11 @@
  *
  * @author Doug Cutting
  */
-public class TestBasics extends TestCase {
+public class TestBasics extends LuceneTestCase {
   private IndexSearcher searcher;
 
   public void setUp() throws Exception {
+    super.setUp();
     RAMDirectory directory = new RAMDirectory();
     IndexWriter writer
       = new IndexWriter(directory, new SimpleAnalyzer(), true);

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestNearSpansOrdered.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestNearSpansOrdered.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestNearSpansOrdered.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestNearSpansOrdered.java Wed Oct 10 09:46:35 2007
@@ -34,9 +34,9 @@
 
 import org.apache.lucene.queryParser.QueryParser;
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
-public class TestNearSpansOrdered extends TestCase {
+public class TestNearSpansOrdered extends LuceneTestCase {
   protected IndexSearcher searcher;
 
   public static final String FIELD = "field";
@@ -44,10 +44,12 @@
     new QueryParser(FIELD, new WhitespaceAnalyzer());
 
   public void tearDown() throws Exception {
+    super.tearDown();
     searcher.close();
   }
   
   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/spans/TestSpans.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestSpans.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestSpans.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestSpans.java Wed Oct 10 09:46:35 2007
@@ -26,16 +26,17 @@
 import org.apache.lucene.analysis.WhitespaceAnalyzer;
 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 TestSpans extends TestCase {
+public class TestSpans 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/spans/TestSpansAdvanced.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestSpansAdvanced.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestSpansAdvanced.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestSpansAdvanced.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.standard.StandardAnalyzer;
 import org.apache.lucene.document.Document;
@@ -36,7 +36,7 @@
  *
  * @author Reece Wilton
  */
-public class TestSpansAdvanced extends TestCase {
+public class TestSpansAdvanced extends LuceneTestCase {
 
     // location to the index
     protected Directory mDirectory;;
@@ -52,6 +52,7 @@
      */
     protected void setUp() throws Exception {
         super.setUp();
+        super.setUp();
 
         // create test index
         mDirectory = new RAMDirectory();
@@ -65,6 +66,7 @@
     }
 
     protected void tearDown() throws Exception {
+        super.tearDown();
         searcher.close();
         mDirectory.close();
         mDirectory = null;

Modified: lucene/java/trunk/src/test/org/apache/lucene/store/TestBufferedIndexInput.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/store/TestBufferedIndexInput.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/store/TestBufferedIndexInput.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/store/TestBufferedIndexInput.java Wed Oct 10 09:46:35 2007
@@ -34,9 +34,9 @@
 import org.apache.lucene.search.TermQuery;
 import org.apache.lucene.util._TestUtil;
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
-public class TestBufferedIndexInput extends TestCase {
+public class TestBufferedIndexInput extends LuceneTestCase {
 	// Call readByte() repeatedly, past the buffer boundary, and see that it
 	// is working as expected.
 	// Our input comes from a dynamically generated/ "file" - see

Modified: lucene/java/trunk/src/test/org/apache/lucene/store/TestHugeRamFile.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/store/TestHugeRamFile.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/store/TestHugeRamFile.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/store/TestHugeRamFile.java Wed Oct 10 09:46:35 2007
@@ -20,10 +20,10 @@
 import java.io.IOException;
 import java.util.HashMap;
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
 /** Test huge RAMFile with more than Integer.MAX_VALUE bytes. */
-public class TestHugeRamFile extends TestCase {
+public class TestHugeRamFile extends LuceneTestCase {
   
   private static final long MAX_VALUE = (long) 2 * (long) Integer.MAX_VALUE;
 

Modified: lucene/java/trunk/src/test/org/apache/lucene/store/TestLock.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/store/TestLock.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/store/TestLock.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/store/TestLock.java Wed Oct 10 09:46:35 2007
@@ -56,9 +56,9 @@
 
 
 import java.io.IOException;
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 
-public class TestLock extends TestCase {
+public class TestLock extends LuceneTestCase {
 
     public void testObtain() {
         LockMock lock = new LockMock();

Modified: lucene/java/trunk/src/test/org/apache/lucene/store/TestLockFactory.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/store/TestLockFactory.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/store/TestLockFactory.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/store/TestLockFactory.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.Hashtable;
 import java.util.Enumeration;
@@ -36,7 +36,7 @@
 import org.apache.lucene.search.Hits;
 import org.apache.lucene.analysis.WhitespaceAnalyzer;
 
-public class TestLockFactory extends TestCase {
+public class TestLockFactory extends LuceneTestCase {
 
     // Verify: we can provide our own LockFactory implementation, the right
     // methods are called at the right time, locks are created, etc.

Modified: lucene/java/trunk/src/test/org/apache/lucene/store/TestMMapDirectory.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/store/TestMMapDirectory.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/store/TestMMapDirectory.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/store/TestMMapDirectory.java Wed Oct 10 09:46:35 2007
@@ -17,10 +17,10 @@
  * limitations under the License.
  */
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 import java.lang.reflect.Method;
 
-public class TestMMapDirectory extends TestCase {
+public class TestMMapDirectory extends LuceneTestCase {
 
   // Simply verify that if there is a method in FSDirectory
   // that returns IndexInput or a subclass, that

Modified: lucene/java/trunk/src/test/org/apache/lucene/store/TestWindowsMMap.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/store/TestWindowsMMap.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/store/TestWindowsMMap.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/store/TestWindowsMMap.java Wed Oct 10 09:46:35 2007
@@ -1,96 +1,97 @@
-package org.apache.lucene.store;
-
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import java.util.HashSet;
-import java.util.Random;
-import java.io.File;
-
-import junit.framework.TestCase;
-
-import org.apache.lucene.analysis.standard.StandardAnalyzer;
-import org.apache.lucene.document.Document;
-import org.apache.lucene.document.Field;
-import org.apache.lucene.index.IndexWriter;
-import org.apache.lucene.search.IndexSearcher;
-import org.apache.lucene.store.FSDirectory;
-
-public class TestWindowsMMap extends TestCase {
-	
-	private final static String alphabet = "abcdefghijklmnopqrstuvwzyz";
-	private Random random;
-	
-	public void setUp() {
-		random = new Random();
-		System.setProperty("org.apache.lucene.FSDirectory.class", "org.apache.lucene.store.MMapDirectory");
-	}
-	
-	private String randomToken() {
-		int tl = 1 + random.nextInt(7);
-		StringBuffer sb = new StringBuffer();
-		for(int cx = 0; cx < tl; cx ++) {
-			int c = random.nextInt(25);
-			sb.append(alphabet.substring(c, c+1));
-		}
-		return sb.toString();
-	}
-	
-	private String randomField() {
-		int fl = 1 + random.nextInt(3);
-		StringBuffer fb = new StringBuffer();
-		for(int fx = 0; fx < fl; fx ++) {
-			fb.append(randomToken());
-			fb.append(" ");
-		}
-		return fb.toString();
-	}
-	
-	private final static String storePathname = 
-    new File(System.getProperty("tempDir"),"testLuceneMmap").getAbsolutePath();
-
-	public void testMmapIndex() throws Exception {
-		FSDirectory storeDirectory;
-		storeDirectory = FSDirectory.getDirectory(storePathname);
-
-		// plan to add a set of useful stopwords, consider changing some of the
-		// interior filters.
-		StandardAnalyzer analyzer = new StandardAnalyzer(new HashSet());
-		// TODO: something about lock timeouts and leftover locks.
-		IndexWriter writer = new IndexWriter(storeDirectory, analyzer, true);
-		IndexSearcher searcher = new IndexSearcher(storePathname);
-		
-		for(int dx = 0; dx < 1000; dx ++) {
-			String f = randomField();
-			Document doc = new Document();
-			doc.add(new Field("data", f, Field.Store.YES, Field.Index.TOKENIZED));	
-			writer.addDocument(doc);
-		}
-		
-		searcher.close();
-		writer.close();
-                rmDir(new File(storePathname));
-	}
-
-        private void rmDir(File dir) {
-          File[] files = dir.listFiles();
-          for (int i = 0; i < files.length; i++) {
-            files[i].delete();
-          }
-          dir.delete();
-        }
-}
+package org.apache.lucene.store;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.util.HashSet;
+import java.util.Random;
+import java.io.File;
+
+import org.apache.lucene.util.LuceneTestCase;
+
+import org.apache.lucene.analysis.standard.StandardAnalyzer;
+import org.apache.lucene.document.Document;
+import org.apache.lucene.document.Field;
+import org.apache.lucene.index.IndexWriter;
+import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.store.FSDirectory;
+
+public class TestWindowsMMap extends LuceneTestCase {
+	
+	private final static String alphabet = "abcdefghijklmnopqrstuvwzyz";
+	private Random random;
+	
+	public void setUp() throws Exception {
+		super.setUp();
+		random = new Random();
+		System.setProperty("org.apache.lucene.FSDirectory.class", "org.apache.lucene.store.MMapDirectory");
+	}
+	
+	private String randomToken() {
+		int tl = 1 + random.nextInt(7);
+		StringBuffer sb = new StringBuffer();
+		for(int cx = 0; cx < tl; cx ++) {
+			int c = random.nextInt(25);
+			sb.append(alphabet.substring(c, c+1));
+		}
+		return sb.toString();
+	}
+	
+	private String randomField() {
+		int fl = 1 + random.nextInt(3);
+		StringBuffer fb = new StringBuffer();
+		for(int fx = 0; fx < fl; fx ++) {
+			fb.append(randomToken());
+			fb.append(" ");
+		}
+		return fb.toString();
+	}
+	
+	private final static String storePathname = 
+    new File(System.getProperty("tempDir"),"testLuceneMmap").getAbsolutePath();
+
+	public void testMmapIndex() throws Exception {
+		FSDirectory storeDirectory;
+		storeDirectory = FSDirectory.getDirectory(storePathname);
+
+		// plan to add a set of useful stopwords, consider changing some of the
+		// interior filters.
+		StandardAnalyzer analyzer = new StandardAnalyzer(new HashSet());
+		// TODO: something about lock timeouts and leftover locks.
+		IndexWriter writer = new IndexWriter(storeDirectory, analyzer, true);
+		IndexSearcher searcher = new IndexSearcher(storePathname);
+		
+		for(int dx = 0; dx < 1000; dx ++) {
+			String f = randomField();
+			Document doc = new Document();
+			doc.add(new Field("data", f, Field.Store.YES, Field.Index.TOKENIZED));	
+			writer.addDocument(doc);
+		}
+		
+		searcher.close();
+		writer.close();
+                rmDir(new File(storePathname));
+	}
+
+        private void rmDir(File dir) {
+          File[] files = dir.listFiles();
+          for (int i = 0; i < files.length; i++) {
+            files[i].delete();
+          }
+          dir.delete();
+        }
+}

Added: lucene/java/trunk/src/test/org/apache/lucene/util/LuceneTestCase.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/util/LuceneTestCase.java?rev=583534&view=auto
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/util/LuceneTestCase.java (added)
+++ lucene/java/trunk/src/test/org/apache/lucene/util/LuceneTestCase.java Wed Oct 10 09:46:35 2007
@@ -0,0 +1,52 @@
+package org.apache.lucene.util;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.lucene.index.ConcurrentMergeScheduler;
+import junit.framework.TestCase;
+
+/** Base class for all Lucene unit tests.  Currently the
+ *  only added functionality over JUnit's TestCase is
+ *  asserting that no unhandled exceptions occurred in
+ *  threads launched by ConcurrentMergeScheduler.  If you
+ *  override either <code>setUp()</code> or
+ *  <code>tearDown()</code> in your unit test, make sure you
+ *  call <code>super.setUp()</code> and
+ *  <code>super.tearDown()</code>.
+ */
+
+public class LuceneTestCase extends TestCase {
+
+  public LuceneTestCase() {
+    super();
+  }
+
+  public LuceneTestCase(String name) {
+    super(name);
+  }
+
+  protected void setUp() throws Exception {
+    ConcurrentMergeScheduler.setTestMode();
+  }
+
+  protected void tearDown() throws Exception {
+    if (ConcurrentMergeScheduler.anyUnhandledExceptions()) {
+      fail("ConcurrentMergeScheduler hit unhandled exceptions");
+    }
+  }
+}

Propchange: lucene/java/trunk/src/test/org/apache/lucene/util/LuceneTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: lucene/java/trunk/src/test/org/apache/lucene/util/TestBitVector.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/util/TestBitVector.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/util/TestBitVector.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/util/TestBitVector.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.store.Directory;
 import org.apache.lucene.store.RAMDirectory;
 
@@ -29,7 +29,7 @@
  * 
  * @version $Id$
  */
-public class TestBitVector extends TestCase
+public class TestBitVector extends LuceneTestCase
 {
     public TestBitVector(String s) {
         super(s);

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

Modified: lucene/java/trunk/src/test/org/apache/lucene/util/TestSmallFloat.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/util/TestSmallFloat.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/util/TestSmallFloat.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/util/TestSmallFloat.java Wed Oct 10 09:46:35 2007
@@ -16,14 +16,14 @@
  * limitations under the License.
  */
 
-import junit.framework.TestCase;
+import org.apache.lucene.util.LuceneTestCase;
 import java.util.Random;
 
 /**
  * @author yonik
  * @version $Id$
  */
-public class TestSmallFloat extends TestCase {
+public class TestSmallFloat extends LuceneTestCase {
 
   // original lucene byteToFloat
   static float orig_byteToFloat(byte b) {

Modified: lucene/java/trunk/src/test/org/apache/lucene/util/TestStringHelper.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/util/TestStringHelper.java?rev=583534&r1=583533&r2=583534&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/util/TestStringHelper.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/util/TestStringHelper.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 TestStringHelper extends TestCase {
+public class TestStringHelper extends LuceneTestCase {
 
 
   public void testStringDifference() {



Mime
View raw message