Index: solr/src/test/org/apache/solr/core/TestPropInjectDefaults.java =================================================================== --- solr/src/test/org/apache/solr/core/TestPropInjectDefaults.java (revision 0) +++ solr/src/test/org/apache/solr/core/TestPropInjectDefaults.java (revision 0) @@ -0,0 +1,68 @@ +package org.apache.solr.core; + +/** + * 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.io.IOException; + +import org.apache.lucene.index.ConcurrentMergeScheduler; +import org.apache.lucene.index.IndexWriter; +import org.apache.lucene.index.LogByteSizeMergePolicy; +import org.apache.solr.update.DirectUpdateHandler2; +import org.apache.solr.util.AbstractSolrTestCase; + +public class TestPropInjectDefaults extends AbstractSolrTestCase { + + @Override + public String getSchemaFile() { + return "schema.xml"; + } + + @Override + public String getSolrConfigFile() { + return "solrconfig-propinject-indexdefault.xml"; + } + + class ExposeWriterHandler extends DirectUpdateHandler2 { + public ExposeWriterHandler() throws IOException { + super(h.getCore()); + } + + public IndexWriter getWriter() throws IOException { + forceOpenWriter(); + return writer; + } + } + + public void testMergePolicyDefaults() throws Exception { + ExposeWriterHandler uh = new ExposeWriterHandler(); + IndexWriter writer = uh.getWriter(); + LogByteSizeMergePolicy mp = (LogByteSizeMergePolicy)writer.getMergePolicy(); + assertEquals(32.0, mp.getMaxMergeMB()); + uh.close(); + } + + + public void testPropsDefaults() throws Exception { + ExposeWriterHandler uh = new ExposeWriterHandler(); + IndexWriter writer = uh.getWriter(); + ConcurrentMergeScheduler cms = (ConcurrentMergeScheduler)writer.getMergeScheduler(); + assertEquals(4, cms.getMaxThreadCount()); + uh.close(); + } + +} Property changes on: solr\src\test\org\apache\solr\core\TestPropInjectDefaults.java ___________________________________________________________________ Added: svn:eol-style + native Index: solr/src/test/org/apache/solr/core/TestPropInject.java =================================================================== --- solr/src/test/org/apache/solr/core/TestPropInject.java (revision 996417) +++ solr/src/test/org/apache/solr/core/TestPropInject.java (working copy) @@ -14,10 +14,7 @@ } public String getSolrConfigFile() { - if ("testMergePolicyDefaults".equals(getName()) || "testPropsDefaults".equals(getName())) - return "solrconfig-propinject-indexdefault.xml"; - else - return "solrconfig-propinject.xml"; + return "solrconfig-propinject.xml"; } class ExposeWriterHandler extends DirectUpdateHandler2 { @@ -38,14 +35,6 @@ assertEquals(64.0, mp.getMaxMergeMB()); uh.close(); } - - public void testMergePolicyDefaults() throws Exception { - ExposeWriterHandler uh = new ExposeWriterHandler(); - IndexWriter writer = uh.getWriter(); - LogByteSizeMergePolicy mp = (LogByteSizeMergePolicy)writer.getMergePolicy(); - assertEquals(32.0, mp.getMaxMergeMB()); - uh.close(); - } public void testProps() throws Exception { ExposeWriterHandler uh = new ExposeWriterHandler(); @@ -54,12 +43,4 @@ assertEquals(2, cms.getMaxThreadCount()); uh.close(); } - - public void testPropsDefaults() throws Exception { - ExposeWriterHandler uh = new ExposeWriterHandler(); - IndexWriter writer = uh.getWriter(); - ConcurrentMergeScheduler cms = (ConcurrentMergeScheduler)writer.getMergeScheduler(); - assertEquals(4, cms.getMaxThreadCount()); - uh.close(); - } } Index: solr/src/test/org/apache/solr/schema/LegacyDateFieldTest.java =================================================================== --- solr/src/test/org/apache/solr/schema/LegacyDateFieldTest.java (revision 996417) +++ solr/src/test/org/apache/solr/schema/LegacyDateFieldTest.java (working copy) @@ -20,14 +20,16 @@ import org.apache.solr.schema.DateField; import org.apache.solr.util.DateMathParser; import org.apache.lucene.document.Fieldable; -import org.apache.lucene.util.LocalizedTestCase; +import org.apache.lucene.util.LuceneTestCase; +import org.junit.runner.RunWith; import java.util.Date; import java.util.TimeZone; import java.util.Locale; import java.text.DateFormat; -public class LegacyDateFieldTest extends LocalizedTestCase { +@RunWith(LuceneTestCase.LocalizedTestCaseRunner.class) +public class LegacyDateFieldTest extends LuceneTestCase { // if and when this class is removed, make sure to refactor all // appropriate code to DateFieldTest Index: solr/src/test/org/apache/solr/util/DateMathParserTest.java =================================================================== --- solr/src/test/org/apache/solr/util/DateMathParserTest.java (revision 996417) +++ solr/src/test/org/apache/solr/util/DateMathParserTest.java (working copy) @@ -17,8 +17,9 @@ package org.apache.solr.util; -import org.apache.lucene.util.LocalizedTestCase; +import org.apache.lucene.util.LuceneTestCase; import org.apache.solr.util.DateMathParser; +import org.junit.runner.RunWith; import java.text.SimpleDateFormat; import java.text.DateFormat; @@ -34,7 +35,8 @@ /** * Tests that the functions in DateMathParser */ -public class DateMathParserTest extends LocalizedTestCase { +@RunWith(LuceneTestCase.LocalizedTestCaseRunner.class) +public class DateMathParserTest extends LuceneTestCase { public static TimeZone UTC = TimeZone.getTimeZone("UTC"); Index: modules/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestLaoBreakIterator.java =================================================================== --- modules/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestLaoBreakIterator.java (revision 996417) +++ modules/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestLaoBreakIterator.java (working copy) @@ -33,7 +33,7 @@ private BreakIterator wordIterator; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); InputStream is = getClass().getResourceAsStream("Lao.brk"); wordIterator = new LaoBreakIterator(RuleBasedBreakIterator.getInstanceFromCompiledRules(is)); Index: modules/analysis/common/src/test/org/apache/lucene/analysis/charfilter/TestMappingCharFilter.java =================================================================== --- modules/analysis/common/src/test/org/apache/lucene/analysis/charfilter/TestMappingCharFilter.java (revision 996417) +++ modules/analysis/common/src/test/org/apache/lucene/analysis/charfilter/TestMappingCharFilter.java (working copy) @@ -30,7 +30,7 @@ NormalizeCharMap normMap; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); normMap = new NormalizeCharMap(); Index: modules/analysis/common/src/test/org/apache/lucene/analysis/charfilter/HTMLStripCharFilterTest.java =================================================================== --- modules/analysis/common/src/test/org/apache/lucene/analysis/charfilter/HTMLStripCharFilterTest.java (revision 996417) +++ modules/analysis/common/src/test/org/apache/lucene/analysis/charfilter/HTMLStripCharFilterTest.java (working copy) @@ -18,8 +18,6 @@ */ import java.io.BufferedReader; -import java.io.File; -import java.io.FileReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; @@ -34,18 +32,13 @@ public class HTMLStripCharFilterTest extends LuceneTestCase { - - public HTMLStripCharFilterTest(String s) { - super(s); - } - @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { super.tearDown(); } //this is some text here is a link and another link . This is an entity: & plus a <. Here is an & Index: modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestAnalyzers.java =================================================================== --- modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestAnalyzers.java (revision 996417) +++ modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestAnalyzers.java (working copy) @@ -39,10 +39,6 @@ public class TestAnalyzers extends BaseTokenStreamTestCase { - public TestAnalyzers(String name) { - super(name); - } - public void testSimple() throws Exception { Analyzer a = new SimpleAnalyzer(TEST_VERSION_CURRENT); assertAnalyzesTo(a, "foo bar FOO BAR", Index: modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestKeywordAnalyzer.java =================================================================== --- modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestKeywordAnalyzer.java (revision 996417) +++ modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestKeywordAnalyzer.java (working copy) @@ -39,7 +39,7 @@ private IndexSearcher searcher; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); directory = new RAMDirectory(); IndexWriter writer = new IndexWriter(directory, new IndexWriterConfig( Index: modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestStopAnalyzer.java =================================================================== --- modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestStopAnalyzer.java (revision 996417) +++ modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestStopAnalyzer.java (working copy) @@ -34,13 +34,9 @@ private StopAnalyzer stop = new StopAnalyzer(TEST_VERSION_CURRENT); private Set inValidTokens = new HashSet(); - - public TestStopAnalyzer(String s) { - super(s); - } @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); Iterator it = StopAnalyzer.ENGLISH_STOP_WORDS_SET.iterator(); Index: modules/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenCountAnalyzer.java =================================================================== --- modules/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenCountAnalyzer.java (revision 996417) +++ modules/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenCountAnalyzer.java (working copy) @@ -28,10 +28,6 @@ public class TestLimitTokenCountAnalyzer extends BaseTokenStreamTestCase { - public TestLimitTokenCountAnalyzer(String name) { - super(name); - } - public void testLimitTokenCountAnalyzer() throws IOException { Analyzer a = new LimitTokenCountAnalyzer(new WhitespaceAnalyzer(TEST_VERSION_CURRENT), 2); // dont use assertAnalyzesTo here, as the end offset is not the end of the string! Index: modules/analysis/common/src/test/org/apache/lucene/analysis/ngram/NGramTokenizerTest.java =================================================================== --- modules/analysis/common/src/test/org/apache/lucene/analysis/ngram/NGramTokenizerTest.java (revision 996417) +++ modules/analysis/common/src/test/org/apache/lucene/analysis/ngram/NGramTokenizerTest.java (working copy) @@ -29,7 +29,7 @@ private StringReader input; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); input = new StringReader("abcde"); } Index: modules/analysis/common/src/test/org/apache/lucene/analysis/ngram/EdgeNGramTokenFilterTest.java =================================================================== --- modules/analysis/common/src/test/org/apache/lucene/analysis/ngram/EdgeNGramTokenFilterTest.java (revision 996417) +++ modules/analysis/common/src/test/org/apache/lucene/analysis/ngram/EdgeNGramTokenFilterTest.java (working copy) @@ -30,7 +30,7 @@ private TokenStream input; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); input = new WhitespaceTokenizer(TEST_VERSION_CURRENT, new StringReader("abcde")); } Index: modules/analysis/common/src/test/org/apache/lucene/analysis/ngram/EdgeNGramTokenizerTest.java =================================================================== --- modules/analysis/common/src/test/org/apache/lucene/analysis/ngram/EdgeNGramTokenizerTest.java (revision 996417) +++ modules/analysis/common/src/test/org/apache/lucene/analysis/ngram/EdgeNGramTokenizerTest.java (working copy) @@ -29,7 +29,7 @@ private StringReader input; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); input = new StringReader("abcde"); } Index: modules/analysis/common/src/test/org/apache/lucene/analysis/ngram/NGramTokenFilterTest.java =================================================================== --- modules/analysis/common/src/test/org/apache/lucene/analysis/ngram/NGramTokenFilterTest.java (revision 996417) +++ modules/analysis/common/src/test/org/apache/lucene/analysis/ngram/NGramTokenFilterTest.java (working copy) @@ -30,7 +30,7 @@ private TokenStream input; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); input = new WhitespaceTokenizer(TEST_VERSION_CURRENT, new StringReader("abcde")); } Index: modules/analysis/common/src/test/org/apache/lucene/analysis/query/QueryAutoStopWordAnalyzerTest.java =================================================================== --- modules/analysis/common/src/test/org/apache/lucene/analysis/query/QueryAutoStopWordAnalyzerTest.java (revision 996417) +++ modules/analysis/common/src/test/org/apache/lucene/analysis/query/QueryAutoStopWordAnalyzerTest.java (working copy) @@ -47,7 +47,7 @@ QueryAutoStopWordAnalyzer protectedAnalyzer; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); dir = new RAMDirectory(); appAnalyzer = new WhitespaceAnalyzer(TEST_VERSION_CURRENT); @@ -67,7 +67,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { reader.close(); super.tearDown(); } Index: modules/analysis/common/src/test/org/apache/lucene/analysis/payloads/NumericPayloadTokenFilterTest.java =================================================================== --- modules/analysis/common/src/test/org/apache/lucene/analysis/payloads/NumericPayloadTokenFilterTest.java (revision 996417) +++ modules/analysis/common/src/test/org/apache/lucene/analysis/payloads/NumericPayloadTokenFilterTest.java (working copy) @@ -29,11 +29,6 @@ public class NumericPayloadTokenFilterTest extends BaseTokenStreamTestCase { - - public NumericPayloadTokenFilterTest(String s) { - super(s); - } - public void test() throws IOException { String test = "The quick red fox jumped over the lazy brown dogs"; Index: modules/analysis/common/src/test/org/apache/lucene/analysis/payloads/TypeAsPayloadTokenFilterTest.java =================================================================== --- modules/analysis/common/src/test/org/apache/lucene/analysis/payloads/TypeAsPayloadTokenFilterTest.java (revision 996417) +++ modules/analysis/common/src/test/org/apache/lucene/analysis/payloads/TypeAsPayloadTokenFilterTest.java (working copy) @@ -29,11 +29,6 @@ public class TypeAsPayloadTokenFilterTest extends BaseTokenStreamTestCase { - - public TypeAsPayloadTokenFilterTest(String s) { - super(s); - } - public void test() throws IOException { String test = "The quick red fox jumped over the lazy brown dogs"; Index: modules/analysis/common/src/test/org/apache/lucene/analysis/payloads/TokenOffsetPayloadTokenFilterTest.java =================================================================== --- modules/analysis/common/src/test/org/apache/lucene/analysis/payloads/TokenOffsetPayloadTokenFilterTest.java (revision 996417) +++ modules/analysis/common/src/test/org/apache/lucene/analysis/payloads/TokenOffsetPayloadTokenFilterTest.java (working copy) @@ -27,11 +27,6 @@ public class TokenOffsetPayloadTokenFilterTest extends BaseTokenStreamTestCase { - - public TokenOffsetPayloadTokenFilterTest(String s) { - super(s); - } - public void test() throws IOException { String test = "The quick red fox jumped over the lazy brown dogs"; Index: modules/analysis/common/src/test/org/apache/lucene/analysis/sinks/TokenTypeSinkTokenizerTest.java =================================================================== --- modules/analysis/common/src/test/org/apache/lucene/analysis/sinks/TokenTypeSinkTokenizerTest.java (revision 996417) +++ modules/analysis/common/src/test/org/apache/lucene/analysis/sinks/TokenTypeSinkTokenizerTest.java (working copy) @@ -28,10 +28,6 @@ public class TokenTypeSinkTokenizerTest extends BaseTokenStreamTestCase { - public TokenTypeSinkTokenizerTest(String s) { - super(s); - } - public void test() throws IOException { TokenTypeSinkFilter sinkFilter = new TokenTypeSinkFilter("D"); String test = "The quick red fox jumped over the lazy brown dogs"; Index: modules/analysis/common/src/test/org/apache/lucene/analysis/sinks/DateRecognizerSinkTokenizerTest.java =================================================================== --- modules/analysis/common/src/test/org/apache/lucene/analysis/sinks/DateRecognizerSinkTokenizerTest.java (revision 996417) +++ modules/analysis/common/src/test/org/apache/lucene/analysis/sinks/DateRecognizerSinkTokenizerTest.java (working copy) @@ -26,11 +26,6 @@ public class DateRecognizerSinkTokenizerTest extends BaseTokenStreamTestCase { - - public DateRecognizerSinkTokenizerTest(String s) { - super(s); - } - public void test() throws IOException { DateRecognizerSinkFilter sinkFilter = new DateRecognizerSinkFilter(new SimpleDateFormat("MM/dd/yyyy", Locale.US)); String test = "The quick red fox jumped over the lazy brown dogs on 7/11/2006 The dogs finally reacted on 7/12/2006"; Index: modules/analysis/common/src/test/org/apache/lucene/analysis/sinks/TestTeeSinkTokenFilter.java =================================================================== --- modules/analysis/common/src/test/org/apache/lucene/analysis/sinks/TestTeeSinkTokenFilter.java (revision 996417) +++ modules/analysis/common/src/test/org/apache/lucene/analysis/sinks/TestTeeSinkTokenFilter.java (working copy) @@ -39,7 +39,6 @@ import org.apache.lucene.util.English; import java.io.IOException; import java.io.StringReader; -import java.util.Random; /** @@ -51,13 +50,8 @@ protected String[] tokens1; protected String[] tokens2; - - public TestTeeSinkTokenFilter(String s) { - super(s); - } - @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); tokens1 = new String[]{"The", "quick", "Burgundy", "Fox", "jumped", "over", "the", "lazy", "Red", "Dogs"}; tokens2 = new String[]{"The", "Lazy", "Dogs", "should", "stay", "on", "the", "porch"}; Index: modules/analysis/common/src/test/org/apache/lucene/analysis/sinks/TokenRangeSinkTokenizerTest.java =================================================================== --- modules/analysis/common/src/test/org/apache/lucene/analysis/sinks/TokenRangeSinkTokenizerTest.java (revision 996417) +++ modules/analysis/common/src/test/org/apache/lucene/analysis/sinks/TokenRangeSinkTokenizerTest.java (working copy) @@ -24,11 +24,6 @@ public class TokenRangeSinkTokenizerTest extends BaseTokenStreamTestCase { - - public TokenRangeSinkTokenizerTest(String s) { - super(s); - } - public void test() throws IOException { TokenRangeSinkFilter sinkFilter = new TokenRangeSinkFilter(2, 4); String test = "The quick red fox jumped over the lazy brown dogs"; Index: modules/analysis/common/src/test/org/apache/lucene/analysis/shingle/ShingleFilterTest.java =================================================================== --- modules/analysis/common/src/test/org/apache/lucene/analysis/shingle/ShingleFilterTest.java (revision 996417) +++ modules/analysis/common/src/test/org/apache/lucene/analysis/shingle/ShingleFilterTest.java (working copy) @@ -788,7 +788,7 @@ }; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); testTokenWithHoles = new Token[] { createToken("please", 0, 6), Index: modules/analysis/common/src/test/org/apache/lucene/analysis/shingle/TestShingleMatrixFilter.java =================================================================== --- modules/analysis/common/src/test/org/apache/lucene/analysis/shingle/TestShingleMatrixFilter.java (revision 996417) +++ modules/analysis/common/src/test/org/apache/lucene/analysis/shingle/TestShingleMatrixFilter.java (working copy) @@ -40,10 +40,6 @@ public class TestShingleMatrixFilter extends BaseTokenStreamTestCase { - public TestShingleMatrixFilter(String name) { - super(name); - } - public void testIterator() throws IOException { WhitespaceTokenizer wst = new WhitespaceTokenizer(TEST_VERSION_CURRENT, new StringReader("one two three four five")); Index: lucene/src/test/org/apache/lucene/queryParser/TestQueryParser.java =================================================================== --- lucene/src/test/org/apache/lucene/queryParser/TestQueryParser.java (revision 996432) +++ lucene/src/test/org/apache/lucene/queryParser/TestQueryParser.java (working copy) @@ -60,23 +60,17 @@ import org.apache.lucene.search.WildcardQuery; import org.apache.lucene.search.BooleanClause.Occur; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LocalizedTestCase; +import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.automaton.BasicAutomata; import org.apache.lucene.util.automaton.CharacterRunAutomaton; import org.apache.lucene.util.automaton.RegExp; +import org.junit.runner.RunWith; /** * Tests QueryParser. */ -public class TestQueryParser extends LocalizedTestCase { - - public TestQueryParser(String name) { - super(name, new HashSet(Arrays.asList( - "testLegacyDateRange", "testDateRange", - "testCJK", "testNumber", "testFarsiRangeCollating", - "testLocalDateFormat" - ))); - } +@RunWith(LuceneTestCase.LocalizedTestCaseRunner.class) +public class TestQueryParser extends LuceneTestCase { public static Analyzer qpAnalyzer = new QPTestAnalyzer(); @@ -150,7 +144,7 @@ private int originalMaxClauses; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); originalMaxClauses = BooleanQuery.getMaxClauseCount(); } @@ -1142,7 +1136,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { BooleanQuery.setMaxClauseCount(originalMaxClauses); super.tearDown(); } Index: lucene/src/test/org/apache/lucene/analysis/TestToken.java =================================================================== --- lucene/src/test/org/apache/lucene/analysis/TestToken.java (revision 996417) +++ lucene/src/test/org/apache/lucene/analysis/TestToken.java (working copy) @@ -27,10 +27,6 @@ public class TestToken extends LuceneTestCase { - public TestToken(String name) { - super(name); - } - public void testCtor() throws Exception { Token t = new Token(); char[] content = "hello".toCharArray(); Index: lucene/src/test/org/apache/lucene/analysis/BaseTokenStreamTestCase.java =================================================================== --- lucene/src/test/org/apache/lucene/analysis/BaseTokenStreamTestCase.java (revision 996417) +++ lucene/src/test/org/apache/lucene/analysis/BaseTokenStreamTestCase.java (working copy) @@ -29,15 +29,6 @@ * Base class for all Lucene unit tests that use TokenStreams. */ public abstract class BaseTokenStreamTestCase extends LuceneTestCase { - - public BaseTokenStreamTestCase() { - super(); - } - - public BaseTokenStreamTestCase(String name) { - super(name); - } - // some helpers to test Analyzers and TokenStreams: public static interface CheckClearAttributesAttribute extends Attribute { Index: lucene/src/test/org/apache/lucene/analysis/tokenattributes/TestSimpleAttributeImpls.java =================================================================== --- lucene/src/test/org/apache/lucene/analysis/tokenattributes/TestSimpleAttributeImpls.java (revision 996417) +++ lucene/src/test/org/apache/lucene/analysis/tokenattributes/TestSimpleAttributeImpls.java (working copy) @@ -24,10 +24,6 @@ @Deprecated public class TestSimpleAttributeImpls extends LuceneTestCase { - - public TestSimpleAttributeImpls(String name) { - super(name); - } public void testFlagsAttribute() throws Exception { FlagsAttributeImpl att = new FlagsAttributeImpl(); Index: lucene/src/test/org/apache/lucene/analysis/tokenattributes/TestCharTermAttributeImpl.java =================================================================== --- lucene/src/test/org/apache/lucene/analysis/tokenattributes/TestCharTermAttributeImpl.java (revision 996417) +++ lucene/src/test/org/apache/lucene/analysis/tokenattributes/TestCharTermAttributeImpl.java (working copy) @@ -26,10 +26,6 @@ public class TestCharTermAttributeImpl extends LuceneTestCase { - public TestCharTermAttributeImpl(String name) { - super(name); - } - public void testResize() { CharTermAttributeImpl t = new CharTermAttributeImpl(); char[] content = "hello".toCharArray(); Index: lucene/src/test/org/apache/lucene/search/TestNot.java =================================================================== --- lucene/src/test/org/apache/lucene/search/TestNot.java (revision 996417) +++ lucene/src/test/org/apache/lucene/search/TestNot.java (working copy) @@ -33,9 +33,6 @@ * @version $Revision$ */ public class TestNot extends LuceneTestCase { - public TestNot(String name) { - super(name); - } public void testNot() throws Exception { Directory store = newDirectory(); Index: lucene/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java =================================================================== --- lucene/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java (revision 996432) +++ lucene/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java (working copy) @@ -55,15 +55,11 @@ private final String FIELD_NAME = "body"; private Query query; - public TestTimeLimitingCollector(String name) { - super(name); - } - /** * initializes searcher with a document set */ @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); final String docText[] = { "docThatNeverMatchesSoWeCanRequireLastDocCollectedToBeGreaterThanZero", @@ -99,7 +95,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { searcher.close(); reader.close(); directory.close(); Index: lucene/src/test/org/apache/lucene/search/TestPhraseQuery.java =================================================================== --- lucene/src/test/org/apache/lucene/search/TestPhraseQuery.java (revision 996432) +++ lucene/src/test/org/apache/lucene/search/TestPhraseQuery.java (working copy) @@ -91,7 +91,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { searcher.close(); reader.close(); directory.close(); Index: lucene/src/test/org/apache/lucene/search/TestTermRangeQuery.java =================================================================== --- lucene/src/test/org/apache/lucene/search/TestTermRangeQuery.java (revision 996432) +++ lucene/src/test/org/apache/lucene/search/TestTermRangeQuery.java (working copy) @@ -45,13 +45,13 @@ private Directory dir; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); dir = newDirectory(); } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { dir.close(); super.tearDown(); } Index: lucene/src/test/org/apache/lucene/search/TestBooleanMinShouldMatch.java =================================================================== --- lucene/src/test/org/apache/lucene/search/TestBooleanMinShouldMatch.java (revision 996432) +++ lucene/src/test/org/apache/lucene/search/TestBooleanMinShouldMatch.java (working copy) @@ -37,7 +37,7 @@ private IndexSearcher s; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); String[] data = new String [] { @@ -71,7 +71,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { s.close(); r.close(); index.close(); Index: lucene/src/test/org/apache/lucene/search/TestBooleanOr.java =================================================================== --- lucene/src/test/org/apache/lucene/search/TestBooleanOr.java (revision 996432) +++ lucene/src/test/org/apache/lucene/search/TestBooleanOr.java (working copy) @@ -131,7 +131,7 @@ } @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); // @@ -164,7 +164,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { searcher.close(); reader.close(); dir.close(); Index: lucene/src/test/org/apache/lucene/search/TestDateSort.java =================================================================== --- lucene/src/test/org/apache/lucene/search/TestDateSort.java (revision 996433) +++ lucene/src/test/org/apache/lucene/search/TestDateSort.java (working copy) @@ -47,7 +47,7 @@ private IndexReader reader; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); // Create an index writer. directory = newDirectory(); @@ -71,7 +71,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { reader.close(); directory.close(); super.tearDown(); Index: lucene/src/test/org/apache/lucene/search/TestSort.java =================================================================== --- lucene/src/test/org/apache/lucene/search/TestSort.java (revision 996433) +++ lucene/src/test/org/apache/lucene/search/TestSort.java (working copy) @@ -69,15 +69,6 @@ private Query queryG; private Sort sort; - public TestSort (String name) { - super (name); - } - - public static Test suite() { - return new TestSuite (TestSort.class); - } - - // document data: // the tracer field is used to determine which document was hit // the contents field is used to search and sort by relevance @@ -209,7 +200,7 @@ } @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); full = getFullIndex(); searchX = getXIndex(); @@ -226,7 +217,7 @@ private ArrayList dirs = new ArrayList(); @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { full.reader.close(); searchX.reader.close(); searchY.reader.close(); Index: lucene/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java =================================================================== --- lucene/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java (revision 996417) +++ lucene/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java (working copy) @@ -46,7 +46,7 @@ static Directory small; static IndexReader reader; - void assertEquals(String m, float e, float a) { + static public void assertEquals(String m, float e, float a) { Assert.assertEquals(m, e, a, SCORE_COMP_THRESH); } Index: lucene/src/test/org/apache/lucene/search/TestWildcardRandom.java =================================================================== --- lucene/src/test/org/apache/lucene/search/TestWildcardRandom.java (revision 996433) +++ lucene/src/test/org/apache/lucene/search/TestWildcardRandom.java (working copy) @@ -43,7 +43,7 @@ private Directory dir; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); dir = newDirectory(); RandomIndexWriter writer = new RandomIndexWriter(random, dir, @@ -91,7 +91,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { searcher.close(); reader.close(); dir.close(); Index: lucene/src/test/org/apache/lucene/search/payloads/TestPayloadNearQuery.java =================================================================== --- lucene/src/test/org/apache/lucene/search/payloads/TestPayloadNearQuery.java (revision 996433) +++ lucene/src/test/org/apache/lucene/search/payloads/TestPayloadNearQuery.java (working copy) @@ -54,10 +54,6 @@ private byte[] payload2 = new byte[]{2}; private byte[] payload4 = new byte[]{4}; - public TestPayloadNearQuery(String s) { - super(s); - } - private class PayloadAnalyzer extends Analyzer { @Override public TokenStream tokenStream(String fieldName, Reader reader) { @@ -104,7 +100,7 @@ } @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); directory = newDirectory(); RandomIndexWriter writer = new RandomIndexWriter(random, directory, @@ -126,7 +122,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { searcher.close(); reader.close(); directory.close(); Index: lucene/src/test/org/apache/lucene/search/payloads/TestPayloadTermQuery.java =================================================================== --- lucene/src/test/org/apache/lucene/search/payloads/TestPayloadTermQuery.java (revision 996433) +++ lucene/src/test/org/apache/lucene/search/payloads/TestPayloadTermQuery.java (working copy) @@ -60,10 +60,6 @@ private byte[] payloadMultiField2 = new byte[]{4}; protected Directory directory; - public TestPayloadTermQuery(String s) { - super(s); - } - private class PayloadAnalyzer extends Analyzer { @@ -109,7 +105,7 @@ } @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); directory = newDirectory(); RandomIndexWriter writer = new RandomIndexWriter(random, directory, @@ -133,7 +129,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { searcher.close(); reader.close(); directory.close(); Index: lucene/src/test/org/apache/lucene/search/TestBooleanScorer.java =================================================================== --- lucene/src/test/org/apache/lucene/search/TestBooleanScorer.java (revision 996417) +++ lucene/src/test/org/apache/lucene/search/TestBooleanScorer.java (working copy) @@ -31,11 +31,6 @@ public class TestBooleanScorer extends LuceneTestCase { - - public TestBooleanScorer(String name) { - super(name); - } - private static final String FIELD = "category"; public void testMethod() throws Exception { Index: lucene/src/test/org/apache/lucene/search/spans/TestNearSpansOrdered.java =================================================================== --- lucene/src/test/org/apache/lucene/search/spans/TestNearSpansOrdered.java (revision 996433) +++ lucene/src/test/org/apache/lucene/search/spans/TestNearSpansOrdered.java (working copy) @@ -43,7 +43,7 @@ new QueryParser(TEST_VERSION_CURRENT, FIELD, new MockAnalyzer()); @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { searcher.close(); reader.close(); directory.close(); @@ -51,7 +51,7 @@ } @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); directory = newDirectory(); RandomIndexWriter writer= new RandomIndexWriter(random, directory); Index: lucene/src/test/org/apache/lucene/search/spans/TestSpans.java =================================================================== --- lucene/src/test/org/apache/lucene/search/spans/TestSpans.java (revision 996433) +++ lucene/src/test/org/apache/lucene/search/spans/TestSpans.java (working copy) @@ -47,7 +47,7 @@ public static final String field = "field"; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); directory = newDirectory(); RandomIndexWriter writer= new RandomIndexWriter(random, directory); @@ -62,7 +62,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { searcher.close(); reader.close(); directory.close(); Index: lucene/src/test/org/apache/lucene/search/spans/TestFieldMaskingSpanQuery.java =================================================================== --- lucene/src/test/org/apache/lucene/search/spans/TestFieldMaskingSpanQuery.java (revision 996433) +++ lucene/src/test/org/apache/lucene/search/spans/TestFieldMaskingSpanQuery.java (working copy) @@ -52,7 +52,7 @@ protected IndexReader reader; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); directory = newDirectory(); RandomIndexWriter writer= new RandomIndexWriter(random, directory); @@ -116,7 +116,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { searcher.close(); reader.close(); directory.close(); Index: lucene/src/test/org/apache/lucene/search/spans/TestSpansAdvanced.java =================================================================== --- lucene/src/test/org/apache/lucene/search/spans/TestSpansAdvanced.java (revision 996433) +++ lucene/src/test/org/apache/lucene/search/spans/TestSpansAdvanced.java (working copy) @@ -52,7 +52,7 @@ * Initializes the tests by adding 4 identical documents to the index. */ @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); // create test index mDirectory = newDirectory(); @@ -69,7 +69,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { searcher.close(); reader.close(); mDirectory.close(); Index: lucene/src/test/org/apache/lucene/search/spans/TestSpansAdvanced2.java =================================================================== --- lucene/src/test/org/apache/lucene/search/spans/TestSpansAdvanced2.java (revision 996433) +++ lucene/src/test/org/apache/lucene/search/spans/TestSpansAdvanced2.java (working copy) @@ -41,7 +41,7 @@ * Initializes the tests by adding documents to the index. */ @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); // create test index @@ -61,7 +61,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { searcher2.close(); reader2.close(); super.tearDown(); Index: lucene/src/test/org/apache/lucene/search/spans/TestPayloadSpans.java =================================================================== --- lucene/src/test/org/apache/lucene/search/spans/TestPayloadSpans.java (revision 996433) +++ lucene/src/test/org/apache/lucene/search/spans/TestPayloadSpans.java (working copy) @@ -55,13 +55,9 @@ protected IndexReader indexReader; private IndexReader closeIndexReader; private Directory directory; - - public TestPayloadSpans(String s) { - super(s); - } @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); PayloadHelper helper = new PayloadHelper(); searcher = helper.setUp(similarity, 1000); Index: lucene/src/test/org/apache/lucene/search/TestMultiSearcher.java =================================================================== --- lucene/src/test/org/apache/lucene/search/TestMultiSearcher.java (revision 996417) +++ lucene/src/test/org/apache/lucene/search/TestMultiSearcher.java (working copy) @@ -42,11 +42,6 @@ */ public class TestMultiSearcher extends LuceneTestCase { - - public TestMultiSearcher(String name) - { - super(name); - } /** * ReturnS a new instance of the concrete MultiSearcher class Index: lucene/src/test/org/apache/lucene/search/TestTermVectors.java =================================================================== --- lucene/src/test/org/apache/lucene/search/TestTermVectors.java (revision 996433) +++ lucene/src/test/org/apache/lucene/search/TestTermVectors.java (working copy) @@ -38,12 +38,8 @@ private IndexReader reader; private Directory directory; - public TestTermVectors(String s) { - super(s); - } - @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); directory = newDirectory(); RandomIndexWriter writer = new RandomIndexWriter(random, directory, new MockAnalyzer(MockTokenizer.SIMPLE, true)); @@ -79,7 +75,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { searcher.close(); reader.close(); directory.close(); Index: lucene/src/test/org/apache/lucene/search/TestQueryTermVector.java =================================================================== --- lucene/src/test/org/apache/lucene/search/TestQueryTermVector.java (revision 996417) +++ lucene/src/test/org/apache/lucene/search/TestQueryTermVector.java (working copy) @@ -23,11 +23,6 @@ public class TestQueryTermVector extends LuceneTestCase { - - public TestQueryTermVector(String s) { - super(s); - } - public void testConstructor() { BytesRef [] queryTerm = {new BytesRef("foo"), new BytesRef("bar"), new BytesRef("foo"), new BytesRef("again"), new BytesRef("foo"), new BytesRef("bar"), new BytesRef("go"), Index: lucene/src/test/org/apache/lucene/search/TestTopDocsCollector.java =================================================================== --- lucene/src/test/org/apache/lucene/search/TestTopDocsCollector.java (revision 996433) +++ lucene/src/test/org/apache/lucene/search/TestTopDocsCollector.java (working copy) @@ -102,7 +102,7 @@ } @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); // populate an index with 30 documents, this should be enough for the test. @@ -117,7 +117,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { reader.close(); dir.close(); dir = null; Index: lucene/src/test/org/apache/lucene/search/TestParallelMultiSearcher.java =================================================================== --- lucene/src/test/org/apache/lucene/search/TestParallelMultiSearcher.java (revision 996417) +++ lucene/src/test/org/apache/lucene/search/TestParallelMultiSearcher.java (working copy) @@ -24,10 +24,6 @@ */ public class TestParallelMultiSearcher extends TestMultiSearcher { - public TestParallelMultiSearcher(String name) { - super(name); - } - @Override protected MultiSearcher getMultiSearcherInstance(Searcher[] searchers) throws IOException { Index: lucene/src/test/org/apache/lucene/search/TestTermScorer.java =================================================================== --- lucene/src/test/org/apache/lucene/search/TestTermScorer.java (revision 996433) +++ lucene/src/test/org/apache/lucene/search/TestTermScorer.java (working copy) @@ -39,12 +39,8 @@ protected IndexSearcher indexSearcher; protected IndexReader indexReader; - public TestTermScorer(String s) { - super(s); - } - @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); directory = newDirectory(); @@ -62,7 +58,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { indexSearcher.close(); indexReader.close(); directory.close(); Index: lucene/src/test/org/apache/lucene/search/TestPhrasePrefixQuery.java =================================================================== --- lucene/src/test/org/apache/lucene/search/TestPhrasePrefixQuery.java (revision 996417) +++ lucene/src/test/org/apache/lucene/search/TestPhrasePrefixQuery.java (working copy) @@ -35,9 +35,6 @@ * This class tests PhrasePrefixQuery class. */ public class TestPhrasePrefixQuery extends LuceneTestCase { - public TestPhrasePrefixQuery(String name) { - super(name); - } /** * Index: lucene/src/test/org/apache/lucene/search/TestSetNorm.java =================================================================== --- lucene/src/test/org/apache/lucene/search/TestSetNorm.java (revision 996417) +++ lucene/src/test/org/apache/lucene/search/TestSetNorm.java (working copy) @@ -33,9 +33,6 @@ * @version $Revision$ */ public class TestSetNorm extends LuceneTestCase { - public TestSetNorm(String name) { - super(name); - } public void testSetNorm() throws Exception { Directory store = newDirectory(); Index: lucene/src/test/org/apache/lucene/search/TestExplanations.java =================================================================== --- lucene/src/test/org/apache/lucene/search/TestExplanations.java (revision 996433) +++ lucene/src/test/org/apache/lucene/search/TestExplanations.java (working copy) @@ -57,7 +57,7 @@ new QueryParser(TEST_VERSION_CURRENT, FIELD, new MockAnalyzer()); @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { searcher.close(); reader.close(); directory.close(); @@ -65,7 +65,7 @@ } @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); directory = newDirectory(); RandomIndexWriter writer= new RandomIndexWriter(random, directory); Index: lucene/src/test/org/apache/lucene/search/TestFieldCache.java =================================================================== --- lucene/src/test/org/apache/lucene/search/TestFieldCache.java (revision 996433) +++ lucene/src/test/org/apache/lucene/search/TestFieldCache.java (working copy) @@ -36,13 +36,9 @@ private static final int NUM_DOCS = 1000 * RANDOM_MULTIPLIER; private String[] unicodeStrings; private Directory directory; - - public TestFieldCache(String s) { - super(s); - } @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); directory = newDirectory(); RandomIndexWriter writer= new RandomIndexWriter(random, directory); @@ -86,7 +82,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { reader.close(); directory.close(); super.tearDown(); Index: lucene/src/test/org/apache/lucene/search/TestRegexpRandom2.java =================================================================== --- lucene/src/test/org/apache/lucene/search/TestRegexpRandom2.java (revision 996433) +++ lucene/src/test/org/apache/lucene/search/TestRegexpRandom2.java (working copy) @@ -51,7 +51,7 @@ private Directory dir; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); dir = newDirectory(); RandomIndexWriter writer = new RandomIndexWriter(random, dir, @@ -85,7 +85,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { reader.close(); searcher.close(); dir.close(); Index: lucene/src/test/org/apache/lucene/search/TestMultiThreadTermVectors.java =================================================================== --- lucene/src/test/org/apache/lucene/search/TestMultiThreadTermVectors.java (revision 996433) +++ lucene/src/test/org/apache/lucene/search/TestMultiThreadTermVectors.java (working copy) @@ -34,12 +34,8 @@ public int numDocs = 100; public int numThreads = 3; - public TestMultiThreadTermVectors(String s) { - super(s); - } - @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); directory = newDirectory(); IndexWriter writer = new IndexWriter(directory, newIndexWriterConfig( TEST_VERSION_CURRENT, new MockAnalyzer())); @@ -56,7 +52,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { directory.close(); super.tearDown(); } Index: lucene/src/test/org/apache/lucene/search/TestDateFilter.java =================================================================== --- lucene/src/test/org/apache/lucene/search/TestDateFilter.java (revision 996417) +++ lucene/src/test/org/apache/lucene/search/TestDateFilter.java (working copy) @@ -35,10 +35,7 @@ * @version $Revision$ */ public class TestDateFilter extends LuceneTestCase { - public TestDateFilter(String name) { - super(name); - } - + /** * */ Index: lucene/src/test/org/apache/lucene/search/TestFilteredSearch.java =================================================================== --- lucene/src/test/org/apache/lucene/search/TestFilteredSearch.java (revision 996417) +++ lucene/src/test/org/apache/lucene/search/TestFilteredSearch.java (working copy) @@ -38,10 +38,6 @@ */ public class TestFilteredSearch extends LuceneTestCase { - public TestFilteredSearch(String name) { - super(name); - } - private static final String FIELD = "category"; public void testFilteredSearch() throws CorruptIndexException, LockObtainFailedException, IOException { Index: lucene/src/test/org/apache/lucene/search/TestDisjunctionMaxQuery.java =================================================================== --- lucene/src/test/org/apache/lucene/search/TestDisjunctionMaxQuery.java (revision 996433) +++ lucene/src/test/org/apache/lucene/search/TestDisjunctionMaxQuery.java (working copy) @@ -75,7 +75,7 @@ public IndexSearcher s; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); index = newDirectory(); @@ -150,7 +150,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { s.close(); r.close(); index.close(); Index: lucene/src/test/org/apache/lucene/search/TestSimilarity.java =================================================================== --- lucene/src/test/org/apache/lucene/search/TestSimilarity.java (revision 996417) +++ lucene/src/test/org/apache/lucene/search/TestSimilarity.java (working copy) @@ -36,9 +36,6 @@ * @version $Revision$ */ public class TestSimilarity extends LuceneTestCase { - public TestSimilarity(String name) { - super(name); - } public static class SimpleSimilarity extends Similarity { @Override public float lengthNorm(String field, int numTerms) { return 1.0f; } Index: lucene/src/test/org/apache/lucene/search/TestRegexpRandom.java =================================================================== --- lucene/src/test/org/apache/lucene/search/TestRegexpRandom.java (revision 996433) +++ lucene/src/test/org/apache/lucene/search/TestRegexpRandom.java (working copy) @@ -43,7 +43,7 @@ private Directory dir; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); dir = newDirectory(); RandomIndexWriter writer = new RandomIndexWriter(random, dir, @@ -90,7 +90,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { searcher.close(); reader.close(); dir.close(); Index: lucene/src/test/org/apache/lucene/search/TestTopScoreDocCollector.java =================================================================== --- lucene/src/test/org/apache/lucene/search/TestTopScoreDocCollector.java (revision 996417) +++ lucene/src/test/org/apache/lucene/search/TestTopScoreDocCollector.java (working copy) @@ -26,13 +26,6 @@ public class TestTopScoreDocCollector extends LuceneTestCase { - public TestTopScoreDocCollector() { - } - - public TestTopScoreDocCollector(String name) { - super(name); - } - public void testOutOfOrderCollection() throws Exception { Directory dir = newDirectory(); RandomIndexWriter writer = new RandomIndexWriter(random, dir); Index: lucene/src/test/org/apache/lucene/search/TestSpanQueryFilter.java =================================================================== --- lucene/src/test/org/apache/lucene/search/TestSpanQueryFilter.java (revision 996417) +++ lucene/src/test/org/apache/lucene/search/TestSpanQueryFilter.java (working copy) @@ -31,11 +31,6 @@ public class TestSpanQueryFilter extends LuceneTestCase { - - public TestSpanQueryFilter(String s) { - super(s); - } - public void testFilterWorks() throws Exception { Directory dir = newDirectory(); RandomIndexWriter writer = new RandomIndexWriter(random, dir); Index: lucene/src/test/org/apache/lucene/search/TestComplexExplanations.java =================================================================== --- lucene/src/test/org/apache/lucene/search/TestComplexExplanations.java (revision 996433) +++ lucene/src/test/org/apache/lucene/search/TestComplexExplanations.java (working copy) @@ -32,7 +32,7 @@ * nice with boosts of 0.0 */ @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); searcher.setSimilarity(createQnorm1Similarity()); } Index: lucene/src/test/org/apache/lucene/search/TestPrefixRandom.java =================================================================== --- lucene/src/test/org/apache/lucene/search/TestPrefixRandom.java (revision 996433) +++ lucene/src/test/org/apache/lucene/search/TestPrefixRandom.java (working copy) @@ -43,7 +43,7 @@ private Directory dir; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); dir = newDirectory(); RandomIndexWriter writer = new RandomIndexWriter(random, dir, @@ -68,7 +68,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { reader.close(); searcher.close(); dir.close(); Index: lucene/src/test/org/apache/lucene/search/TestCustomSearcherSort.java =================================================================== --- lucene/src/test/org/apache/lucene/search/TestCustomSearcherSort.java (revision 996433) +++ lucene/src/test/org/apache/lucene/search/TestCustomSearcherSort.java (working copy) @@ -46,7 +46,7 @@ * Create index and query for test cases. */ @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); index = newDirectory(); RandomIndexWriter writer = new RandomIndexWriter(random, index); @@ -74,7 +74,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { reader.close(); index.close(); super.tearDown(); Index: lucene/src/test/org/apache/lucene/search/TestPrefixInBooleanQuery.java =================================================================== --- lucene/src/test/org/apache/lucene/search/TestPrefixInBooleanQuery.java (revision 996433) +++ lucene/src/test/org/apache/lucene/search/TestPrefixInBooleanQuery.java (working copy) @@ -43,7 +43,7 @@ private IndexSearcher searcher; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); directory = newDirectory(); RandomIndexWriter writer = new RandomIndexWriter(random, directory); Index: lucene/src/test/org/apache/lucene/search/TestDocBoost.java =================================================================== --- lucene/src/test/org/apache/lucene/search/TestDocBoost.java (revision 996417) +++ lucene/src/test/org/apache/lucene/search/TestDocBoost.java (working copy) @@ -32,9 +32,6 @@ * @version $Revision$ */ public class TestDocBoost extends LuceneTestCase { - public TestDocBoost(String name) { - super(name); - } public void testDocBoost() throws Exception { Directory store = newDirectory(); Index: lucene/src/test/org/apache/lucene/search/TestMultiSearcherRanking.java =================================================================== --- lucene/src/test/org/apache/lucene/search/TestMultiSearcherRanking.java (revision 996433) +++ lucene/src/test/org/apache/lucene/search/TestMultiSearcherRanking.java (working copy) @@ -107,7 +107,7 @@ * initializes multiSearcher and singleSearcher with the same document set */ @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); // create MultiSearcher from two seperate searchers d1 = newDirectory(); @@ -136,7 +136,7 @@ Directory d1, d2, d; @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { multiSearcher.close(); singleSearcher.close(); d1.close(); Index: lucene/src/test/org/apache/lucene/search/TestMultiPhraseQuery.java =================================================================== --- lucene/src/test/org/apache/lucene/search/TestMultiPhraseQuery.java (revision 996417) +++ lucene/src/test/org/apache/lucene/search/TestMultiPhraseQuery.java (working copy) @@ -38,9 +38,6 @@ * */ public class TestMultiPhraseQuery extends LuceneTestCase { - public TestMultiPhraseQuery(String name) { - super(name); - } public void testPhrasePrefix() throws IOException { Directory indexStore = newDirectory(); Index: lucene/src/test/org/apache/lucene/search/TestBooleanPrefixQuery.java =================================================================== --- lucene/src/test/org/apache/lucene/search/TestBooleanPrefixQuery.java (revision 996417) +++ lucene/src/test/org/apache/lucene/search/TestBooleanPrefixQuery.java (working copy) @@ -18,9 +18,6 @@ */ import org.apache.lucene.util.LuceneTestCase; -import junit.framework.Test; -import junit.framework.TestSuite; -import junit.textui.TestRunner; import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.index.IndexReader; @@ -37,18 +34,6 @@ public class TestBooleanPrefixQuery extends LuceneTestCase { - public static void main(String[] args) { - TestRunner.run(suite()); - } - - public static Test suite() { - return new TestSuite(TestBooleanPrefixQuery.class); - } - - public TestBooleanPrefixQuery(String name) { - super(name); - } - private int getCount(IndexReader r, Query q) throws Exception { if (q instanceof BooleanQuery) { return ((BooleanQuery) q).getClauses().length; Index: lucene/src/test/org/apache/lucene/search/TestFilteredQuery.java =================================================================== --- lucene/src/test/org/apache/lucene/search/TestFilteredQuery.java (revision 996433) +++ lucene/src/test/org/apache/lucene/search/TestFilteredQuery.java (working copy) @@ -45,7 +45,7 @@ private Filter filter; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); directory = newDirectory(); RandomIndexWriter writer = new RandomIndexWriter (random, directory); @@ -97,7 +97,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { searcher.close(); reader.close(); directory.close(); Index: lucene/src/test/org/apache/lucene/index/TestDoc.java =================================================================== --- lucene/src/test/org/apache/lucene/index/TestDoc.java (revision 996433) +++ lucene/src/test/org/apache/lucene/index/TestDoc.java (working copy) @@ -58,7 +58,7 @@ * a few text files created in the current working directory. */ @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); workDir = new File(TEMP_DIR,"TestDoc"); workDir.mkdirs(); Index: lucene/src/test/org/apache/lucene/index/TestParallelTermEnum.java =================================================================== --- lucene/src/test/org/apache/lucene/index/TestParallelTermEnum.java (revision 996433) +++ lucene/src/test/org/apache/lucene/index/TestParallelTermEnum.java (working copy) @@ -35,7 +35,7 @@ private Directory rd2; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); Document doc; rd1 = newDirectory(); @@ -68,7 +68,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { ir1.close(); ir2.close(); rd1.close(); Index: lucene/src/test/org/apache/lucene/index/TestIndexReader.java =================================================================== --- lucene/src/test/org/apache/lucene/index/TestIndexReader.java (revision 996417) +++ lucene/src/test/org/apache/lucene/index/TestIndexReader.java (working copy) @@ -30,9 +30,6 @@ import java.util.Set; import java.util.SortedSet; -import junit.framework.TestSuite; -import junit.textui.TestRunner; - import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; @@ -61,19 +58,7 @@ public class TestIndexReader extends LuceneTestCase { - /** Main for running test case by itself. */ - public static void main(String args[]) { - TestRunner.run (new TestSuite(TestIndexReader.class)); -// TestRunner.run (new TestIndexReader("testBasicDelete")); -// TestRunner.run (new TestIndexReader("testDeleteReaderWriterConflict")); -// TestRunner.run (new TestIndexReader("testDeleteReaderReaderConflict")); -// TestRunner.run (new TestIndexReader("testFilesOpenClose")); - } - public TestIndexReader(String name) { - super(name); - } - public void testCommitUserData() throws Exception { Directory d = newDirectory(); Index: lucene/src/test/org/apache/lucene/index/TestStressIndexing2.java =================================================================== --- lucene/src/test/org/apache/lucene/index/TestStressIndexing2.java (revision 996417) +++ lucene/src/test/org/apache/lucene/index/TestStressIndexing2.java (working copy) @@ -35,8 +35,10 @@ import org.apache.lucene.index.IndexWriterConfig.OpenMode; import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.Directory; +import org.junit.runner.RunWith; -public class TestStressIndexing2 extends MultiCodecTestCase { +@RunWith(LuceneTestCase.MultiCodecTestCaseRunner.class) +public class TestStressIndexing2 extends LuceneTestCase { static int maxFields=4; static int bigFieldSize=10; static boolean sameFieldOrder=false; Index: lucene/src/test/org/apache/lucene/index/TestTermVectorsReader.java =================================================================== --- lucene/src/test/org/apache/lucene/index/TestTermVectorsReader.java (revision 996433) +++ lucene/src/test/org/apache/lucene/index/TestTermVectorsReader.java (working copy) @@ -48,10 +48,6 @@ private FieldInfos fieldInfos = new FieldInfos(); private static int TERM_FREQ = 3; - public TestTermVectorsReader(String s) { - super(s); - } - private class TestToken implements Comparable { String text; int pos; @@ -65,7 +61,7 @@ TestToken[] tokens = new TestToken[testTerms.length * TERM_FREQ]; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); /* for (int i = 0; i < testFields.length; i++) { @@ -125,7 +121,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { dir.close(); super.tearDown(); } Index: lucene/src/test/org/apache/lucene/index/TestSegmentTermDocs.java =================================================================== --- lucene/src/test/org/apache/lucene/index/TestSegmentTermDocs.java (revision 996433) +++ lucene/src/test/org/apache/lucene/index/TestSegmentTermDocs.java (working copy) @@ -31,12 +31,8 @@ private Directory dir; private SegmentInfo info; - public TestSegmentTermDocs(String s) { - super(s); - } - @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); dir = newDirectory(); DocHelper.setupDoc(testDoc); @@ -44,7 +40,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { dir.close(); super.tearDown(); } Index: lucene/src/test/org/apache/lucene/index/TestIndexWriter.java =================================================================== --- lucene/src/test/org/apache/lucene/index/TestIndexWriter.java (revision 996417) +++ lucene/src/test/org/apache/lucene/index/TestIndexWriter.java (working copy) @@ -79,10 +79,6 @@ import org.apache.lucene.util.Bits; public class TestIndexWriter extends LuceneTestCase { - - public TestIndexWriter(String name) { - super(name); - } public void testDocCount() throws IOException { Directory dir = newDirectory(); Index: lucene/src/test/org/apache/lucene/index/TestDocumentWriter.java =================================================================== --- lucene/src/test/org/apache/lucene/index/TestDocumentWriter.java (revision 996433) +++ lucene/src/test/org/apache/lucene/index/TestDocumentWriter.java (working copy) @@ -42,19 +42,15 @@ public class TestDocumentWriter extends LuceneTestCase { private Directory dir; - - public TestDocumentWriter(String s) { - super(s); - } @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); dir = newDirectory(); } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { dir.close(); super.tearDown(); } Index: lucene/src/test/org/apache/lucene/index/TestIndexWriterLockRelease.java =================================================================== --- lucene/src/test/org/apache/lucene/index/TestIndexWriterLockRelease.java (revision 996433) +++ lucene/src/test/org/apache/lucene/index/TestIndexWriterLockRelease.java (working copy) @@ -36,7 +36,7 @@ private java.io.File __test_dir; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); if (this.__test_dir == null) { this.__test_dir = new File(TEMP_DIR, "testIndexWriter"); @@ -53,7 +53,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { if (this.__test_dir != null) { File[] files = this.__test_dir.listFiles(); Index: lucene/src/test/org/apache/lucene/index/TestIndexReaderCloneNorms.java =================================================================== --- lucene/src/test/org/apache/lucene/index/TestIndexReaderCloneNorms.java (revision 996433) +++ lucene/src/test/org/apache/lucene/index/TestIndexReaderCloneNorms.java (working copy) @@ -65,12 +65,8 @@ private float normDelta = (float) 0.001; - public TestIndexReaderCloneNorms(String s) { - super(s); - } - @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); similarityOne = new SimilarityOne(); anlzr = new MockAnalyzer(); Index: lucene/src/test/org/apache/lucene/index/TestCodecs.java =================================================================== --- lucene/src/test/org/apache/lucene/index/TestCodecs.java (revision 996417) +++ lucene/src/test/org/apache/lucene/index/TestCodecs.java (working copy) @@ -39,8 +39,9 @@ import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.store.Directory; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.MultiCodecTestCase; +import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.Version; +import org.junit.runner.RunWith; // TODO: test multiple codecs here? @@ -59,8 +60,8 @@ // goes to 1 before next one known to exist // - skipTo(term) // - skipTo(doc) - -public class TestCodecs extends MultiCodecTestCase { +@RunWith(LuceneTestCase.MultiCodecTestCaseRunner.class) +public class TestCodecs extends LuceneTestCase { private static String[] fieldNames = new String[] {"one", "two", "three", "four"}; private final static int NUM_TEST_ITER = 20 * RANDOM_MULTIPLIER; Index: lucene/src/test/org/apache/lucene/index/TestMultiReader.java =================================================================== --- lucene/src/test/org/apache/lucene/index/TestMultiReader.java (revision 996417) +++ lucene/src/test/org/apache/lucene/index/TestMultiReader.java (working copy) @@ -20,9 +20,6 @@ import java.io.IOException; public class TestMultiReader extends TestDirectoryReader { - public TestMultiReader(String s) { - super(s); - } @Override protected IndexReader openReader() throws IOException { Index: lucene/src/test/org/apache/lucene/index/TestFieldInfos.java =================================================================== --- lucene/src/test/org/apache/lucene/index/TestFieldInfos.java (revision 996433) +++ lucene/src/test/org/apache/lucene/index/TestFieldInfos.java (working copy) @@ -30,12 +30,8 @@ private Document testDoc = new Document(); - public TestFieldInfos(String s) { - super(s); - } - @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); DocHelper.setupDoc(testDoc); } Index: lucene/src/test/org/apache/lucene/index/TestPositionBasedTermVectorMapper.java =================================================================== --- lucene/src/test/org/apache/lucene/index/TestPositionBasedTermVectorMapper.java (revision 996433) +++ lucene/src/test/org/apache/lucene/index/TestPositionBasedTermVectorMapper.java (working copy) @@ -28,13 +28,8 @@ protected TermVectorOffsetInfo[][] offsets; protected int numPositions; - - public TestPositionBasedTermVectorMapper(String s) { - super(s); - } - @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); tokens = new String[]{"here", "is", "some", "text", "to", "test", "extra"}; thePositions = new int[tokens.length][]; Index: lucene/src/test/org/apache/lucene/index/TestCompoundFile.java =================================================================== --- lucene/src/test/org/apache/lucene/index/TestCompoundFile.java (revision 996433) +++ lucene/src/test/org/apache/lucene/index/TestCompoundFile.java (working copy) @@ -55,7 +55,7 @@ @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); File file = new File(TEMP_DIR, "testIndex"); _TestUtil.rmDir(file); @@ -64,7 +64,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { dir.close(); _TestUtil.rmDir(new File(TEMP_DIR, "testIndex")); super.tearDown(); Index: lucene/src/test/org/apache/lucene/index/TestDirectoryReader.java =================================================================== --- lucene/src/test/org/apache/lucene/index/TestDirectoryReader.java (revision 996433) +++ lucene/src/test/org/apache/lucene/index/TestDirectoryReader.java (working copy) @@ -35,13 +35,9 @@ private Document doc2; protected SegmentReader [] readers = new SegmentReader[2]; protected SegmentInfos sis; - - public TestDirectoryReader(String s) { - super(s); - } @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); dir = newDirectory(); doc1 = new Document(); @@ -55,7 +51,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { if (readers[0] != null) readers[0].close(); if (readers[1] != null) readers[1].close(); dir.close(); Index: lucene/src/test/org/apache/lucene/index/TestFieldsReader.java =================================================================== --- lucene/src/test/org/apache/lucene/index/TestFieldsReader.java (revision 996433) +++ lucene/src/test/org/apache/lucene/index/TestFieldsReader.java (working copy) @@ -48,12 +48,8 @@ private FieldInfos fieldInfos = null; private final static String TEST_SEGMENT_NAME = "_0"; - public TestFieldsReader(String s) { - super(s); - } - @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); fieldInfos = new FieldInfos(); DocHelper.setupDoc(testDoc); @@ -68,7 +64,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { dir.close(); super.tearDown(); } Index: lucene/src/test/org/apache/lucene/index/TestTransactionRollback.java =================================================================== --- lucene/src/test/org/apache/lucene/index/TestTransactionRollback.java (revision 996433) +++ lucene/src/test/org/apache/lucene/index/TestTransactionRollback.java (working copy) @@ -122,7 +122,7 @@ */ @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); dir = newDirectory(); //Build index, of records 1 to 100, committing after each batch of 10 @@ -144,7 +144,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { dir.close(); super.tearDown(); } Index: lucene/src/test/org/apache/lucene/index/TestIndexReaderReopen.java =================================================================== --- lucene/src/test/org/apache/lucene/index/TestIndexReaderReopen.java (revision 996433) +++ lucene/src/test/org/apache/lucene/index/TestIndexReaderReopen.java (working copy) @@ -1093,7 +1093,7 @@ @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); indexDir = new File(TEMP_DIR, "IndexReaderReopen"); } Index: lucene/src/test/org/apache/lucene/index/TestSegmentMerger.java =================================================================== --- lucene/src/test/org/apache/lucene/index/TestSegmentMerger.java (revision 996433) +++ lucene/src/test/org/apache/lucene/index/TestSegmentMerger.java (working copy) @@ -39,14 +39,9 @@ private Directory merge2Dir; private Document doc2 = new Document(); private SegmentReader reader2 = null; - - public TestSegmentMerger(String s) { - super(s); - } - @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); mergedDir = newDirectory(); merge1Dir = newDirectory(); @@ -60,7 +55,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { reader1.close(); reader2.close(); mergedDir.close(); Index: lucene/src/test/org/apache/lucene/index/TestStressIndexing.java =================================================================== --- lucene/src/test/org/apache/lucene/index/TestStressIndexing.java (revision 996417) +++ lucene/src/test/org/apache/lucene/index/TestStressIndexing.java (working copy) @@ -22,10 +22,12 @@ import org.apache.lucene.document.*; import org.apache.lucene.index.IndexWriterConfig.OpenMode; import org.apache.lucene.search.*; +import org.junit.runner.RunWith; import java.io.File; -public class TestStressIndexing extends MultiCodecTestCase { +@RunWith(LuceneTestCase.MultiCodecTestCaseRunner.class) +public class TestStressIndexing extends LuceneTestCase { private static abstract class TimedThread extends Thread { volatile boolean failed; int count; Index: lucene/src/test/org/apache/lucene/index/TestParallelReader.java =================================================================== --- lucene/src/test/org/apache/lucene/index/TestParallelReader.java (revision 996433) +++ lucene/src/test/org/apache/lucene/index/TestParallelReader.java (working copy) @@ -42,14 +42,14 @@ private Directory dir, dir1, dir2; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); single = single(random); parallel = parallel(random); } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { single.getIndexReader().close(); parallel.getIndexReader().close(); dir.close(); Index: lucene/src/test/org/apache/lucene/index/TestSegmentReader.java =================================================================== --- lucene/src/test/org/apache/lucene/index/TestSegmentReader.java (revision 996433) +++ lucene/src/test/org/apache/lucene/index/TestSegmentReader.java (working copy) @@ -34,14 +34,10 @@ private Directory dir; private Document testDoc = new Document(); private SegmentReader reader = null; - - public TestSegmentReader(String s) { - super(s); - } //TODO: Setup the reader w/ multiple documents @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); dir = newDirectory(); DocHelper.setupDoc(testDoc); @@ -50,7 +46,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { reader.close(); dir.close(); super.tearDown(); Index: lucene/src/test/org/apache/lucene/index/TestNorms.java =================================================================== --- lucene/src/test/org/apache/lucene/index/TestNorms.java (revision 996433) +++ lucene/src/test/org/apache/lucene/index/TestNorms.java (working copy) @@ -56,12 +56,8 @@ private float lastNorm = 0; private float normDelta = (float) 0.001; - public TestNorms(String s) { - super(s); - } - @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); similarityOne = new SimilarityOne(); anlzr = new MockAnalyzer(); Index: lucene/src/test/org/apache/lucene/messages/TestNLS.java =================================================================== --- lucene/src/test/org/apache/lucene/messages/TestNLS.java (revision 996417) +++ lucene/src/test/org/apache/lucene/messages/TestNLS.java (working copy) @@ -19,11 +19,13 @@ import java.util.Locale; -import org.apache.lucene.util.LocalizedTestCase; +import org.apache.lucene.util.LuceneTestCase; +import org.junit.runner.RunWith; /** */ -public class TestNLS extends LocalizedTestCase { +@RunWith(LuceneTestCase.LocalizedTestCaseRunner.class) +public class TestNLS extends LuceneTestCase { public void testMessageLoading() { Message invalidSyntax = new MessageImpl( MessagesTestBundle.Q0001E_INVALID_SYNTAX, "XXX"); Index: lucene/src/test/org/apache/lucene/store/TestRAMDirectory.java =================================================================== --- lucene/src/test/org/apache/lucene/store/TestRAMDirectory.java (revision 996433) +++ lucene/src/test/org/apache/lucene/store/TestRAMDirectory.java (working copy) @@ -47,7 +47,7 @@ // setup the index @Override - protected void setUp () throws Exception { + public void setUp() throws Exception { super.setUp(); indexDir = new File(TEMP_DIR, "RAMDirIndex"); @@ -152,7 +152,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { // cleanup if (indexDir != null && indexDir.exists()) { rmDir (indexDir); Index: lucene/src/test/org/apache/lucene/store/TestMultiMMap.java =================================================================== --- lucene/src/test/org/apache/lucene/store/TestMultiMMap.java (revision 996433) +++ lucene/src/test/org/apache/lucene/store/TestMultiMMap.java (working copy) @@ -38,7 +38,7 @@ File workDir; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); workDir = new File(TEMP_DIR, "TestMultiMMap"); workDir.mkdirs(); Index: lucene/src/test/org/apache/lucene/store/TestWindowsMMap.java =================================================================== --- lucene/src/test/org/apache/lucene/store/TestWindowsMMap.java (revision 996433) +++ lucene/src/test/org/apache/lucene/store/TestWindowsMMap.java (working copy) @@ -34,7 +34,7 @@ private final static String alphabet = "abcdefghijklmnopqrstuvwzyz"; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); } Index: lucene/src/test/org/apache/lucene/util/TestBitVector.java =================================================================== --- lucene/src/test/org/apache/lucene/util/TestBitVector.java (revision 996417) +++ lucene/src/test/org/apache/lucene/util/TestBitVector.java (working copy) @@ -28,9 +28,6 @@ */ public class TestBitVector extends LuceneTestCase { - public TestBitVector(String s) { - super(s); - } /** * Test the default constructor on BitVectors of various sizes. Index: lucene/src/test/org/apache/lucene/util/LocalizedTestCase.java =================================================================== --- lucene/src/test/org/apache/lucene/util/LocalizedTestCase.java (revision 996417) +++ lucene/src/test/org/apache/lucene/util/LocalizedTestCase.java (working copy) @@ -1,110 +0,0 @@ -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 java.util.Locale; -import java.util.Set; - -/** - * Base test class for Lucene test classes that test Locale-sensitive behavior. - *

- * This class will run tests under the default Locale, but then will also run - * tests under all available JVM locales. This is helpful to ensure tests will - * not fail under a different environment. - *

- */ -public abstract class LocalizedTestCase extends LuceneTestCase { - /** - * Before changing the default Locale, save the default Locale here so that it - * can be restored. - */ - private final Locale defaultLocale = Locale.getDefault(); - - /** - * The locale being used as the system default Locale - */ - private Locale locale; - - /** - * An optional limited set of testcases that will run under different Locales. - */ - private final Set testWithDifferentLocales; - - public LocalizedTestCase() { - super(); - testWithDifferentLocales = null; - } - - public LocalizedTestCase(String name) { - super(name); - testWithDifferentLocales = null; - } - - public LocalizedTestCase(Set testWithDifferentLocales) { - super(); - this.testWithDifferentLocales = testWithDifferentLocales; - } - - public LocalizedTestCase(String name, Set testWithDifferentLocales) { - super(name); - this.testWithDifferentLocales = testWithDifferentLocales; - } - - @Override - protected void setUp() throws Exception { - super.setUp(); - Locale.setDefault(locale); - } - - @Override - protected void tearDown() throws Exception { - assertEquals("default locale unexpectedly changed:", locale, Locale - .getDefault()); - Locale.setDefault(defaultLocale); - super.tearDown(); - } - - @Override - public void runBare() throws Throwable { - // Do the test with the default Locale (default) - try { - locale = defaultLocale; - super.runBare(); - } catch (Throwable e) { - System.out.println("Test failure of '" + getName() - + "' occurred with the default Locale " + locale); - throw e; - } - - if (testWithDifferentLocales == null - || testWithDifferentLocales.contains(getName())) { - // Do the test again under different Locales - Locale systemLocales[] = Locale.getAvailableLocales(); - for (int i = 0; i < systemLocales.length; i++) { - try { - locale = systemLocales[i]; - super.runBare(); - } catch (Throwable e) { - System.out.println("Test failure of '" + getName() - + "' occurred under a different Locale " + locale); - throw e; - } - } - } - } -} Index: lucene/src/test/org/apache/lucene/util/LuceneTestCaseJ4.java =================================================================== --- lucene/src/test/org/apache/lucene/util/LuceneTestCaseJ4.java (revision 996433) +++ lucene/src/test/org/apache/lucene/util/LuceneTestCaseJ4.java (working copy) @@ -54,6 +54,8 @@ import org.junit.runner.RunWith; import org.junit.runner.manipulation.Filter; import org.junit.runner.manipulation.NoTestsRemainException; +import org.junit.runner.notification.Failure; +import org.junit.runner.notification.RunListener; import org.junit.runner.notification.RunNotifier; import org.junit.runners.BlockJUnit4ClassRunner; import org.junit.runners.model.FrameworkMethod; @@ -78,9 +80,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; - /** * Base class for all Lucene unit tests, Junit4 variant. * Replaces LuceneTestCase. @@ -117,7 +116,7 @@ // get from that override is provided by InterceptTestCaseEvents //@RunWith(RunBareWrapper.class) @RunWith(LuceneTestCaseJ4.LuceneTestCaseRunner.class) -public abstract class LuceneTestCaseJ4 { +public abstract class LuceneTestCaseJ4 extends Assert { /** * true iff tests are run in verbose mode. Note: if it is false, tests are not @@ -337,6 +336,7 @@ // set current method name for logging LuceneTestCaseJ4.this.name = method.getName(); // check if the current test's class annotated all test* methods with @Test + /* final Class clazz = LuceneTestCaseJ4.this.getClass(); if (!checkedClasses.containsKey(clazz)) { checkedClasses.put(clazz, PLACEHOLDER); @@ -346,6 +346,7 @@ } } } + */ super.starting(method); } @@ -476,7 +477,29 @@ } } + + // These deprecated methods should be removed soon, when all tests using no Epsilon are fixed: + + @Deprecated + static public void assertEquals(double expected, double actual) { + assertEquals(null, expected, actual); + } + + @Deprecated + static public void assertEquals(String message, double expected, double actual) { + assertEquals(message, Double.valueOf(expected), Double.valueOf(actual)); + } + @Deprecated + static public void assertEquals(float expected, float actual) { + assertEquals(null, expected, actual); + } + + @Deprecated + static public void assertEquals(String message, float expected, float actual) { + assertEquals(message, Float.valueOf(expected), Float.valueOf(actual)); + } + /** * Convinience method for logging an iterator. * @@ -777,8 +800,23 @@ /** optionally filters the tests to be run by TEST_METHOD */ public static class LuceneTestCaseRunner extends BlockJUnit4ClassRunner { + private List testMethods; @Override + protected List computeTestMethods() { + if (testMethods != null) + return testMethods; + testMethods = getTestClass().getAnnotatedMethods(Test.class); + for (Method m : getTestClass().getJavaClass().getMethods()) + if (m.getName().startsWith("test") && + m.getAnnotation(Test.class) == null && + m.getParameterTypes().length == 0 && + m.getGenericReturnType() == Void.TYPE) + testMethods.add(new FrameworkMethod(m)); + return testMethods; + } + + @Override protected void runChild(FrameworkMethod arg0, RunNotifier arg1) { for (int i = 0; i < TEST_ITER; i++) super.runChild(arg0, arg1); @@ -804,4 +842,104 @@ } } } + + /** + * Test runner for Lucene test classes that test Locale-sensitive behavior. + *

+ * This class will run tests under the default Locale, but then will also run + * tests under all available JVM locales. This is helpful to ensure tests will + * not fail under a different environment. + *

+ */ + public static class LocalizedTestCaseRunner extends LuceneTestCaseRunner { + /** + * Before changing the default Locale, save the default Locale here so + * that it can be restored. + */ + private final Locale defaultLocale = Locale.getDefault(); + + /** + * The locale being used as the system default Locale + */ + private Locale locale; + + private final RunListener listener = new RunListener() { + @Override + public void testFailure(Failure failure) throws Exception { + super.testFailure(failure); + String methodName = failure.getDescription().getMethodName(); + if (locale.equals(defaultLocale)) + System.out.println("Test failure of '" + methodName + + "' occurred with the default Locale " + locale); + else + System.out.println("Test failure of '" + methodName + + "' occurred under a different Locale " + locale); + } + }; + + public LocalizedTestCaseRunner(Class clazz) throws InitializationError { + super(clazz); + } + + @Override + protected void runChild(FrameworkMethod arg0, RunNotifier arg1) { + arg1.addListener(listener); + locale = defaultLocale; + super.runChild(arg0, arg1); + + for (Locale other : Locale.getAvailableLocales()) { + locale = other; + Locale.setDefault(locale); + super.runChild(arg0, arg1); + } + + Locale.setDefault(defaultLocale); + } + } + + /** + * Test runner for Lucene test classes that run across all core codecs. + */ + public static class MultiCodecTestCaseRunner extends LuceneTestCaseRunner { + /** + * Before changing the default Codec, save the default Codec here so + * that it can be restored. + */ + private final String defaultCodec = CodecProvider.getDefaultCodec(); + + /** + * The Codec being used as the system default + */ + private String codec; + + private final RunListener listener = new RunListener() { + @Override + public void testFailure(Failure failure) throws Exception { + super.testFailure(failure); + String methodName = failure.getDescription().getMethodName(); + System.out.println("Test failure of '" + methodName + + "' occurred with codec " + codec); + } + }; + + public MultiCodecTestCaseRunner(Class clazz) throws InitializationError { + super(clazz); + } + + @Override + protected void runChild(FrameworkMethod arg0, RunNotifier arg1) { + arg1.addListener(listener); + // If we're running w/ PreFlex codec we must swap in the + // test-only PreFlexRW codec (since core PreFlex can + // only read segments): + swapCodec(new PreFlexRWCodec()); + for (String other : CodecProvider.CORE_CODECS) { + codec = other; + CodecProvider.setDefaultCodec(codec); + super.runChild(arg0, arg1); + } + CodecProvider.setDefaultCodec(defaultCodec); + } + + } } Index: lucene/src/test/org/apache/lucene/util/LuceneTestCase.java =================================================================== --- lucene/src/test/org/apache/lucene/util/LuceneTestCase.java (revision 996433) +++ lucene/src/test/org/apache/lucene/util/LuceneTestCase.java (working copy) @@ -17,38 +17,6 @@ * limitations under the License. */ -import java.io.File; -import java.io.PrintStream; -import java.io.IOException; -import java.util.Arrays; -import java.util.IdentityHashMap; -import java.util.Iterator; -import java.util.Locale; -import java.util.Map; -import java.util.Random; -import java.util.ArrayList; -import java.util.List; -import java.util.Collections; -import java.util.TimeZone; - -import junit.framework.TestCase; -import junit.framework.TestResult; - -import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.document.Field; -import org.apache.lucene.document.Field.Index; -import org.apache.lucene.document.Field.Store; -import org.apache.lucene.document.Field.TermVector; -import org.apache.lucene.index.ConcurrentMergeScheduler; -import org.apache.lucene.index.IndexWriterConfig; -import org.apache.lucene.index.codecs.Codec; -import org.apache.lucene.search.BooleanQuery; -import org.apache.lucene.search.FieldCache; -import org.apache.lucene.search.FieldCache.CacheEntry; -import org.apache.lucene.store.Directory; -import org.apache.lucene.store.MockDirectoryWrapper; -import org.apache.lucene.util.FieldCacheSanityChecker.Insanity; - /** * Base class for all Lucene unit tests. *

@@ -68,339 +36,5 @@ * @see #assertSaneFieldCaches * */ -public abstract class LuceneTestCase extends TestCase { - - /** - * true iff tests are run in verbose mode. Note: if it is false, tests are not - * expected to print any messages. - */ - public static final boolean VERBOSE = LuceneTestCaseJ4.VERBOSE; - - /** Use this constant when creating Analyzers and any other version-dependent stuff. */ - public static final Version TEST_VERSION_CURRENT = LuceneTestCaseJ4.TEST_VERSION_CURRENT; - - /** Create indexes in this directory, optimally use a subdir, named after the test */ - public static final File TEMP_DIR = LuceneTestCaseJ4.TEMP_DIR; - - /** Gets the codec to run tests with. */ - public static final String TEST_CODEC = LuceneTestCaseJ4.TEST_CODEC; - /** Gets the locale to run tests with */ - static final String TEST_LOCALE = LuceneTestCaseJ4.TEST_LOCALE; - /** Gets the timezone to run tests with */ - static final String TEST_TIMEZONE = LuceneTestCaseJ4.TEST_TIMEZONE; - /** Gets the directory to run tests with */ - static final String TEST_DIRECTORY = LuceneTestCaseJ4.TEST_DIRECTORY; - /** Get the random seed for tests */ - static final String TEST_SEED = LuceneTestCaseJ4.TEST_SEED; - - /** - * A random multiplier which you should use when writing random tests: - * multiply it by the number of iterations - */ - public static final int RANDOM_MULTIPLIER = LuceneTestCaseJ4.RANDOM_MULTIPLIER; - - private int savedBoolMaxClauseCount; - - private volatile Thread.UncaughtExceptionHandler savedUncaughtExceptionHandler = null; - - private Codec codec; - - private Locale locale; - private Locale savedLocale; - private TimeZone timeZone; - private TimeZone savedTimeZone; - - private Map stores; - - /** Used to track if setUp and tearDown are called correctly from subclasses */ - private boolean setup; - - private static class UncaughtExceptionEntry { - public final Thread thread; - public final Throwable exception; - - public UncaughtExceptionEntry(Thread thread, Throwable exception) { - this.thread = thread; - this.exception = exception; - } - } - private List uncaughtExceptions = Collections.synchronizedList(new ArrayList()); - - public LuceneTestCase() { - super(); - } - - public LuceneTestCase(String name) { - super(name); - } - - @Override - protected void setUp() throws Exception { - super.setUp(); - assertFalse("ensure your tearDown() calls super.tearDown()!!!", setup); - seed = Long.valueOf(TEST_SEED.equals("random") ? seedRnd.nextLong() : Long.parseLong(TEST_SEED)); - random = new Random(seed); - setup = true; - stores = new IdentityHashMap(); - savedUncaughtExceptionHandler = Thread.getDefaultUncaughtExceptionHandler(); - Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() { - public void uncaughtException(Thread t, Throwable e) { - uncaughtExceptions.add(new UncaughtExceptionEntry(t, e)); - if (savedUncaughtExceptionHandler != null) - savedUncaughtExceptionHandler.uncaughtException(t, e); - } - }); - - ConcurrentMergeScheduler.setTestMode(); - savedBoolMaxClauseCount = BooleanQuery.getMaxClauseCount(); - codec = LuceneTestCaseJ4.installTestCodecs(); - savedLocale = Locale.getDefault(); - locale = TEST_LOCALE.equals("random") - ? LuceneTestCaseJ4.randomLocale(seedRnd) - : LuceneTestCaseJ4.localeForName(TEST_LOCALE); - Locale.setDefault(locale); - savedTimeZone = TimeZone.getDefault(); - timeZone = TEST_TIMEZONE.equals("random") - ? LuceneTestCaseJ4.randomTimeZone(seedRnd) - : TimeZone.getTimeZone(TEST_TIMEZONE); - TimeZone.setDefault(timeZone); - } - - /** - * Forcible purges all cache entries from the FieldCache. - *

- * This method will be called by tearDown to clean up FieldCache.DEFAULT. - * If a (poorly written) test has some expectation that the FieldCache - * will persist across test methods (ie: a static IndexReader) this - * method can be overridden to do nothing. - *

- * @see FieldCache#purgeAllCaches() - */ - protected void purgeFieldCache(final FieldCache fc) { - fc.purgeAllCaches(); - } - - protected String getTestLabel() { - return getClass().getName() + "." + getName(); - } - - @Override - protected void tearDown() throws Exception { - assertTrue("ensure your setUp() calls super.setUp()!!!", setup); - setup = false; - BooleanQuery.setMaxClauseCount(savedBoolMaxClauseCount); - LuceneTestCaseJ4.removeTestCodecs(codec); - Locale.setDefault(savedLocale); - TimeZone.setDefault(savedTimeZone); - System.clearProperty("solr.solr.home"); - System.clearProperty("solr.data.dir"); - try { - Thread.setDefaultUncaughtExceptionHandler(savedUncaughtExceptionHandler); - if (!uncaughtExceptions.isEmpty()) { - System.err.println("The following exceptions were thrown by threads:"); - for (UncaughtExceptionEntry entry : uncaughtExceptions) { - System.err.println("*** Thread: " + entry.thread.getName() + " ***"); - entry.exception.printStackTrace(System.err); - } - fail("Some threads threw uncaught exceptions!"); - } - - // this isn't as useful as calling directly from the scope where the - // index readers are used, because they could be gc'ed just before - // tearDown is called. - // But it's better then nothing. - assertSaneFieldCaches(getTestLabel()); - - if (ConcurrentMergeScheduler.anyUnhandledExceptions()) { - // Clear the failure so that we don't just keep - // failing subsequent test cases - ConcurrentMergeScheduler.clearUnhandledExceptions(); - fail("ConcurrentMergeScheduler hit unhandled exceptions"); - } - } finally { - purgeFieldCache(FieldCache.DEFAULT); - } - - // now look for unclosed resources - for (MockDirectoryWrapper d : stores.keySet()) { - if (d.isOpen()) { - StackTraceElement elements[] = stores.get(d); - StackTraceElement element = (elements.length > 1) ? elements[1] : null; - fail("directory of testcase " + getName() + " was not closed, opened from: " + element); - } - } - stores = null; - super.tearDown(); - } - - /** - * Asserts that FieldCacheSanityChecker does not detect any - * problems with FieldCache.DEFAULT. - *

- * If any problems are found, they are logged to System.err - * (allong with the msg) when the Assertion is thrown. - *

- *

- * This method is called by tearDown after every test method, - * however IndexReaders scoped inside test methods may be garbage - * collected prior to this method being called, causing errors to - * be overlooked. Tests are encouraged to keep their IndexReaders - * scoped at the class level, or to explicitly call this method - * directly in the same scope as the IndexReader. - *

- * @see FieldCacheSanityChecker - */ - protected void assertSaneFieldCaches(final String msg) { - final CacheEntry[] entries = FieldCache.DEFAULT.getCacheEntries(); - Insanity[] insanity = null; - try { - try { - insanity = FieldCacheSanityChecker.checkSanity(entries); - } catch (RuntimeException e) { - dumpArray(msg+ ": FieldCache", entries, System.err); - throw e; - } - - assertEquals(msg + ": Insane FieldCache usage(s) found", - 0, insanity.length); - insanity = null; - } finally { - - // report this in the event of any exception/failure - // if no failure, then insanity will be null anyway - if (null != insanity) { - dumpArray(msg + ": Insane FieldCache usage(s)", insanity, System.err); - } - - } - } - - /** - * Convinience method for logging an iterator. - * @param label String logged before/after the items in the iterator - * @param iter Each next() is toString()ed and logged on it's own line. If iter is null this is logged differnetly then an empty iterator. - * @param stream Stream to log messages to. - */ - public static void dumpIterator(String label, Iterator iter, - PrintStream stream) { - stream.println("*** BEGIN "+label+" ***"); - if (null == iter) { - stream.println(" ... NULL ..."); - } else { - while (iter.hasNext()) { - stream.println(iter.next().toString()); - } - } - stream.println("*** END "+label+" ***"); - } - - /** - * Convinience method for logging an array. Wraps the array in an iterator and delegates - * @see #dumpIterator(String,Iterator,PrintStream) - */ - public static void dumpArray(String label, Object[] objs, - PrintStream stream) { - Iterator iter = (null == objs) ? null : Arrays.asList(objs).iterator(); - dumpIterator(label, iter, stream); - } - - /** create a new index writer config with random defaults */ - public IndexWriterConfig newIndexWriterConfig(Version v, Analyzer a) { - return LuceneTestCaseJ4.newIndexWriterConfig(random, v, a); - } - - /** - * Returns a new Dictionary instance. Use this when the test does not - * care about the specific Directory implementation (most tests). - *

- * The Directory is wrapped with {@link MockDirectoryWrapper}. - * By default this means it will be picky, such as ensuring that you - * properly close it and all open files in your test. It will emulate - * some features of Windows, such as not allowing open files to be - * overwritten. - */ - public MockDirectoryWrapper newDirectory() throws IOException { - StackTraceElement[] stack = new Exception().getStackTrace(); - Directory impl = LuceneTestCaseJ4.newDirectoryImpl(random, TEST_DIRECTORY); - MockDirectoryWrapper dir = new MockDirectoryWrapper(impl); - stores.put(dir, stack); - return dir; - } - - /** - * Returns a new Dictionary instance, with contents copied from the - * provided directory. See {@link #newDirectory()} for more - * information. - */ - public MockDirectoryWrapper newDirectory(Directory d) throws IOException { - StackTraceElement[] stack = new Exception().getStackTrace(); - Directory impl = LuceneTestCaseJ4.newDirectoryImpl(random, TEST_DIRECTORY); - for (String file : d.listAll()) { - d.copy(impl, file, file); - } - MockDirectoryWrapper dir = new MockDirectoryWrapper(impl); - stores.put(dir, stack); - return dir; - } - - public Field newField(String name, String value, Index index) { - return LuceneTestCaseJ4.newField(random, name, value, index); - } - - public Field newField(String name, String value, Store store, Index index) { - return LuceneTestCaseJ4.newField(random, name, value, store, index); - } - - public Field newField(String name, String value, Store store, Index index, TermVector tv) { - return LuceneTestCaseJ4.newField(random, name, value, store, index, tv); - } - - /** Gets a resource from the classpath as {@link File}. This method should only be used, - * if a real file is needed. To get a stream, code should prefer - * {@link Class#getResourceAsStream} using {@code this.getClass()}. - */ - protected File getDataFile(String name) throws IOException { - try { - return new File(this.getClass().getResource(name).toURI()); - } catch (Exception e) { - throw new IOException("Cannot find resource: " + name); - } - } - - - @Override - public void run(TestResult result) { - for (int i = 0; i < LuceneTestCaseJ4.TEST_ITER; i++) - if (LuceneTestCaseJ4.TEST_METHOD == null || - getName().equals(LuceneTestCaseJ4.TEST_METHOD)) - super.run(result); - } - - @Override - public void runBare() throws Throwable { - //long t0 = System.currentTimeMillis(); - try { - seed = null; - super.runBare(); - } catch (Throwable e) { - System.out.println("NOTE: random codec of testcase '" + getName() + "' was: " + codec); - if (TEST_LOCALE.equals("random")) - System.out.println("NOTE: random locale of testcase '" + getName() + "' was: " + locale); - if (TEST_TIMEZONE.equals("random")) // careful to not deliver NPE here in case they forgot super.setUp - System.out.println("NOTE: random timezone of testcase '" + getName() + "' was: " + (timeZone == null ? "(null)" : timeZone.getID())); - if (seed != null) { - System.out.println("NOTE: random seed of testcase '" + getName() + "' was: " + seed); - } - throw e; - } - //long t = System.currentTimeMillis() - t0; - //System.out.println(t + " msec for " + getName()); - } - - // recorded seed - protected Long seed = null; - protected Random random = null; - - // static members - private static final Random seedRnd = new Random(); +public abstract class LuceneTestCase extends LuceneTestCaseJ4 { } Index: lucene/src/test/org/apache/lucene/util/TestFieldCacheSanityChecker.java =================================================================== --- lucene/src/test/org/apache/lucene/util/TestFieldCacheSanityChecker.java (revision 996433) +++ lucene/src/test/org/apache/lucene/util/TestFieldCacheSanityChecker.java (working copy) @@ -38,7 +38,7 @@ private static final int NUM_DOCS = 1000; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); dirA = newDirectory(); dirB = newDirectory(); @@ -74,7 +74,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { readerA.close(); readerB.close(); readerX.close(); Index: lucene/src/test/org/apache/lucene/util/MultiCodecTestCase.java =================================================================== --- lucene/src/test/org/apache/lucene/util/MultiCodecTestCase.java (revision 996417) +++ lucene/src/test/org/apache/lucene/util/MultiCodecTestCase.java (working copy) @@ -1,46 +0,0 @@ -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.codecs.CodecProvider; - -/** - * Base test class for Lucene test classes that to test across - * all core codecs. - */ -public abstract class MultiCodecTestCase extends LuceneTestCase { - - @Override - public void runBare() throws Throwable { - final String savedDefaultCodec = CodecProvider.getDefaultCodec(); - try { - for(String codec : CodecProvider.CORE_CODECS) { - CodecProvider.setDefaultCodec(codec); - try { - super.runBare(); - } catch (Throwable e) { - System.out.println("Test failure of '" + getName() - + "' occurred with \"" + codec + "\" codec"); - throw e; - } - } - } finally { - CodecProvider.setDefaultCodec(savedDefaultCodec); - } - } -} Index: lucene/src/test/org/apache/lucene/util/TestPriorityQueue.java =================================================================== --- lucene/src/test/org/apache/lucene/util/TestPriorityQueue.java (revision 996417) +++ lucene/src/test/org/apache/lucene/util/TestPriorityQueue.java (working copy) @@ -20,9 +20,6 @@ import java.util.Random; public class TestPriorityQueue extends LuceneTestCase { - public TestPriorityQueue(String name) { - super(name); - } private static class IntegerQueue extends PriorityQueue { public IntegerQueue(int count) { Index: lucene/src/test/org/apache/lucene/util/automaton/TestDeterminism.java =================================================================== --- lucene/src/test/org/apache/lucene/util/automaton/TestDeterminism.java (revision 996433) +++ lucene/src/test/org/apache/lucene/util/automaton/TestDeterminism.java (working copy) @@ -26,7 +26,7 @@ public class TestDeterminism extends LuceneTestCase { @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); } Index: lucene/src/test/org/apache/lucene/util/automaton/TestUTF32ToUTF8.java =================================================================== --- lucene/src/test/org/apache/lucene/util/automaton/TestUTF32ToUTF8.java (revision 996433) +++ lucene/src/test/org/apache/lucene/util/automaton/TestUTF32ToUTF8.java (working copy) @@ -27,7 +27,7 @@ public class TestUTF32ToUTF8 extends LuceneTestCase { @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); } Index: lucene/src/test/org/apache/lucene/document/TestDateTools.java =================================================================== --- lucene/src/test/org/apache/lucene/document/TestDateTools.java (revision 996417) +++ lucene/src/test/org/apache/lucene/document/TestDateTools.java (working copy) @@ -8,7 +8,8 @@ import java.util.TimeZone; import java.util.Locale; -import org.apache.lucene.util.LocalizedTestCase; +import org.apache.lucene.util.LuceneTestCase; +import org.junit.runner.RunWith; /** * Licensed to the Apache Software Foundation (ASF) under one or more @@ -26,9 +27,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +@RunWith(LuceneTestCase.LocalizedTestCaseRunner.class) +public class TestDateTools extends LuceneTestCase { -public class TestDateTools extends LocalizedTestCase { - public void testStringToDate() throws ParseException { Date d = null; Index: lucene/contrib/wordnet/src/test/org/apache/lucene/wordnet/TestWordnet.java =================================================================== --- lucene/contrib/wordnet/src/test/org/apache/lucene/wordnet/TestWordnet.java (revision 996417) +++ lucene/contrib/wordnet/src/test/org/apache/lucene/wordnet/TestWordnet.java (working copy) @@ -38,7 +38,7 @@ new File(TEMP_DIR,"testLuceneWordnet").getAbsolutePath(); @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); // create a temporary synonym index File testFile = getDataFile("testSynonyms.txt"); @@ -70,7 +70,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { searcher.close(); rmDir(storePathName); // delete our temporary synonym index super.tearDown(); Index: lucene/contrib/ant/src/test/org/apache/lucene/ant/HtmlDocumentTest.java =================================================================== --- lucene/contrib/ant/src/test/org/apache/lucene/ant/HtmlDocumentTest.java (revision 996417) +++ lucene/contrib/ant/src/test/org/apache/lucene/ant/HtmlDocumentTest.java (working copy) @@ -24,10 +24,6 @@ public class HtmlDocumentTest extends DocumentTestCase { - public HtmlDocumentTest (String name) { - super(name); - } - HtmlDocument doc; @Override Index: lucene/contrib/ant/src/test/org/apache/lucene/ant/TextDocumentTest.java =================================================================== --- lucene/contrib/ant/src/test/org/apache/lucene/ant/TextDocumentTest.java (revision 996417) +++ lucene/contrib/ant/src/test/org/apache/lucene/ant/TextDocumentTest.java (working copy) @@ -24,10 +24,6 @@ public class TextDocumentTest extends DocumentTestCase { - public TextDocumentTest (String name) { - super(name); - } - TextDocument doc; @Override Index: lucene/contrib/ant/src/test/org/apache/lucene/ant/DocumentTestCase.java =================================================================== --- lucene/contrib/ant/src/test/org/apache/lucene/ant/DocumentTestCase.java (revision 996417) +++ lucene/contrib/ant/src/test/org/apache/lucene/ant/DocumentTestCase.java (working copy) @@ -25,10 +25,6 @@ public abstract class DocumentTestCase extends LuceneTestCase { - public DocumentTestCase(String name) { - super(name); - } - protected File getFile(String filename) throws IOException { String fullname = this.getClass().getResource(filename).getFile(); Index: lucene/contrib/ant/src/test/org/apache/lucene/ant/IndexTaskTest.java =================================================================== --- lucene/contrib/ant/src/test/org/apache/lucene/ant/IndexTaskTest.java (revision 996417) +++ lucene/contrib/ant/src/test/org/apache/lucene/ant/IndexTaskTest.java (working copy) @@ -50,7 +50,7 @@ *@exception IOException Description of Exception */ @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); // slightly hackish way to get the src/test dir String docsDir = getDataFile("test.txt").getParent(); @@ -87,7 +87,7 @@ * TODO: remove indexDir? */ @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { searcher.close(); dir.close(); super.tearDown(); Index: lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/ext/TestExtensions.java =================================================================== --- lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/ext/TestExtensions.java (revision 996417) +++ lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/ext/TestExtensions.java (working copy) @@ -27,7 +27,7 @@ private Extensions ext; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); this.ext = new Extensions(); } Index: lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/ext/TestExtendableQueryParser.java =================================================================== --- lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/ext/TestExtendableQueryParser.java (revision 996417) +++ lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/ext/TestExtendableQueryParser.java (working copy) @@ -35,10 +35,6 @@ private static char[] DELIMITERS = new char[] { Extensions.DEFAULT_EXTENSION_FIELD_DELIMITER, '-', '|' }; - public TestExtendableQueryParser(String name) { - super(name); - } - @Override public QueryParser getParser(Analyzer a) throws Exception { return getParser(a, null); Index: lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestQPHelper.java =================================================================== --- lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestQPHelper.java (revision 996417) +++ lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestQPHelper.java (working copy) @@ -25,8 +25,6 @@ import java.util.Date; import java.util.GregorianCalendar; import java.util.HashMap; -import java.util.HashSet; -import java.util.Arrays; import java.util.List; import java.util.Locale; import java.util.Map; @@ -74,10 +72,11 @@ import org.apache.lucene.search.WildcardQuery; import org.apache.lucene.search.BooleanClause.Occur; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LocalizedTestCase; +import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.automaton.BasicAutomata; import org.apache.lucene.util.automaton.CharacterRunAutomaton; import org.apache.lucene.util.automaton.RegExp; +import org.junit.runner.RunWith; /** * This test case is a copy of the core Lucene query parser test, it was adapted @@ -85,16 +84,9 @@ * * Tests QueryParser. */ -public class TestQPHelper extends LocalizedTestCase { +@RunWith(LuceneTestCase.LocalizedTestCaseRunner.class) +public class TestQPHelper extends LuceneTestCase { - public TestQPHelper(String name) { - super(name, new HashSet(Arrays.asList(new String[]{ - "testLegacyDateRange", "testDateRange", - "testCJK", "testNumber", "testFarsiRangeCollating", - "testLocalDateFormat" - }))); - } - public static Analyzer qpAnalyzer = new QPTestAnalyzer(); public static final class QPTestFilter extends TokenFilter { @@ -194,7 +186,7 @@ private int originalMaxClauses; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); originalMaxClauses = BooleanQuery.getMaxClauseCount(); } @@ -1262,7 +1254,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { BooleanQuery.setMaxClauseCount(originalMaxClauses); super.tearDown(); } Index: lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestQueryParserWrapper.java =================================================================== --- lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestQueryParserWrapper.java (revision 996417) +++ lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestQueryParserWrapper.java (working copy) @@ -68,10 +68,11 @@ import org.apache.lucene.search.TermRangeQuery; import org.apache.lucene.search.WildcardQuery; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LocalizedTestCase; +import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.automaton.BasicAutomata; import org.apache.lucene.util.automaton.CharacterRunAutomaton; import org.apache.lucene.util.automaton.RegExp; +import org.junit.runner.RunWith; /** * This test case is a copy of the core Lucene query parser test, it was adapted @@ -82,15 +83,8 @@ * @deprecated this entire test case tests QueryParserWrapper which is * deprecated. When QPW is gone, so will the test. */ -public class TestQueryParserWrapper extends LocalizedTestCase { - - public TestQueryParserWrapper(String name) { - super(name, new HashSet(Arrays.asList(new String[]{ - "testLegacyDateRange", "testDateRange", - "testCJK", "testNumber", "testFarsiRangeCollating", - "testLocalDateFormat" - }))); - } +@RunWith(LuceneTestCase.LocalizedTestCaseRunner.class) +public class TestQueryParserWrapper extends LuceneTestCase { public static Analyzer qpAnalyzer = new QPTestAnalyzer(); @@ -209,7 +203,7 @@ private int originalMaxClauses; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); originalMaxClauses = BooleanQuery.getMaxClauseCount(); } @@ -1213,7 +1207,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { BooleanQuery.setMaxClauseCount(originalMaxClauses); super.tearDown(); } Index: lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/surround/query/BooleanQueryTst.java =================================================================== --- lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/surround/query/BooleanQueryTst.java (revision 996417) +++ lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/surround/query/BooleanQueryTst.java (working copy) @@ -28,15 +28,14 @@ import org.apache.lucene.queryParser.surround.parser.QueryParser; -import junit.framework.TestCase; -import junit.framework.Assert; +import org.junit.Assert; public class BooleanQueryTst { String queryText; final int[] expectedDocNrs; SingleFieldTestDb dBase; String fieldName; - TestCase testCase; + Assert testCase; BasicQueryFactory qf; boolean verbose = true; @@ -45,7 +44,7 @@ int[] expectedDocNrs, SingleFieldTestDb dBase, String fieldName, - TestCase testCase, + Assert testCase, BasicQueryFactory qf) { this.queryText = queryText; this.expectedDocNrs = expectedDocNrs; Index: lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/spans/TestSpanQueryParserSimpleSample.java =================================================================== --- lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/spans/TestSpanQueryParserSimpleSample.java (revision 996417) +++ lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/spans/TestSpanQueryParserSimpleSample.java (working copy) @@ -95,14 +95,6 @@ */ public class TestSpanQueryParserSimpleSample extends LuceneTestCase { - public TestSpanQueryParserSimpleSample() { - // empty constructor - } - - public TestSpanQueryParserSimpleSample(String testName) { - super(testName); - } - public void testBasicDemo() throws Exception { SyntaxParser queryParser = new StandardSyntaxParser(); Index: lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/spans/TestSpanQueryParser.java =================================================================== --- lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/spans/TestSpanQueryParser.java (revision 996417) +++ lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/spans/TestSpanQueryParser.java (working copy) @@ -106,7 +106,7 @@ } @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); this.spanProcessorPipeline = new QueryNodeProcessorPipeline(); Index: lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/complexPhrase/TestComplexPhraseQuery.java =================================================================== --- lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/complexPhrase/TestComplexPhraseQuery.java (revision 996417) +++ lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/complexPhrase/TestComplexPhraseQuery.java (working copy) @@ -109,7 +109,7 @@ } @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); rd = newDirectory(); IndexWriter w = new IndexWriter(rd, newIndexWriterConfig(TEST_VERSION_CURRENT, analyzer)); @@ -126,7 +126,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { searcher.close(); rd.close(); super.tearDown(); Index: lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/analyzing/TestAnalyzingQueryParser.java =================================================================== --- lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/analyzing/TestAnalyzingQueryParser.java (revision 996417) +++ lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/analyzing/TestAnalyzingQueryParser.java (working copy) @@ -45,7 +45,7 @@ private String[] fuzzyExpected; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); wildcardInput = new String[] { "übersetzung über*ung", "Mötley Cr\u00fce Mötl?* Crü?", "Renée Zellweger Ren?? Zellw?ger" }; Index: lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/precedence/TestPrecedenceQueryParser.java =================================================================== --- lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/precedence/TestPrecedenceQueryParser.java (revision 996417) +++ lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/precedence/TestPrecedenceQueryParser.java (working copy) @@ -28,7 +28,6 @@ import org.apache.lucene.analysis.tokenattributes.OffsetAttribute; import org.apache.lucene.document.DateTools; import org.apache.lucene.index.Term; -import org.apache.lucene.queryParser.QueryParser; import org.apache.lucene.search.BooleanClause; import org.apache.lucene.search.BooleanQuery; import org.apache.lucene.search.FuzzyQuery; @@ -41,26 +40,19 @@ import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.WildcardQuery; import org.apache.lucene.search.BooleanClause.Occur; -import org.apache.lucene.util.LocalizedTestCase; +import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.automaton.BasicAutomata; import org.apache.lucene.util.automaton.CharacterRunAutomaton; +import org.junit.runner.RunWith; import java.io.IOException; import java.io.Reader; import java.text.DateFormat; -import java.util.Arrays; import java.util.Calendar; import java.util.GregorianCalendar; -import java.util.HashSet; -public class TestPrecedenceQueryParser extends LocalizedTestCase { - - public TestPrecedenceQueryParser(String name) { - super(name, new HashSet(Arrays.asList(new String[]{ - "testDateRange", "testNumber" - }))); - } - +@RunWith(LuceneTestCase.LocalizedTestCaseRunner.class) +public class TestPrecedenceQueryParser extends LuceneTestCase { public static Analyzer qpAnalyzer = new QPTestAnalyzer(); public static final class QPTestFilter extends TokenFilter { @@ -129,7 +121,7 @@ private int originalMaxClauses; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); originalMaxClauses = BooleanQuery.getMaxClauseCount(); } @@ -726,7 +718,7 @@ @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { BooleanQuery.setMaxClauseCount(originalMaxClauses); super.tearDown(); } Index: lucene/contrib/db/bdb-je/src/test/org/apache/lucene/store/je/JEStoreTest.java =================================================================== --- lucene/contrib/db/bdb-je/src/test/org/apache/lucene/store/je/JEStoreTest.java (revision 996417) +++ lucene/contrib/db/bdb-je/src/test/org/apache/lucene/store/je/JEStoreTest.java (working copy) @@ -53,7 +53,7 @@ protected Database index, blocks; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); if (!dbHome.exists()) @@ -100,7 +100,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { if (index != null) index.close(); Index: lucene/contrib/db/bdb/src/test/org/apache/lucene/store/db/DbStoreTest.java =================================================================== --- lucene/contrib/db/bdb/src/test/org/apache/lucene/store/db/DbStoreTest.java (revision 996417) +++ lucene/contrib/db/bdb/src/test/org/apache/lucene/store/db/DbStoreTest.java (working copy) @@ -48,7 +48,7 @@ protected Database index, blocks; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); if (!dbHome.exists()) dbHome.mkdir(); @@ -100,7 +100,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { if (index != null) index.close(); if (blocks != null) Index: lucene/contrib/swing/src/test/org/apache/lucene/swing/models/TestSearchingList.java =================================================================== --- lucene/contrib/swing/src/test/org/apache/lucene/swing/models/TestSearchingList.java (revision 996417) +++ lucene/contrib/swing/src/test/org/apache/lucene/swing/models/TestSearchingList.java (working copy) @@ -27,7 +27,7 @@ private ListSearcher listSearcher; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); baseListModel = new BaseListModel(DataStore.getRestaurants()); listSearcher = new ListSearcher(baseListModel); Index: lucene/contrib/swing/src/test/org/apache/lucene/swing/models/TestUpdatingTable.java =================================================================== --- lucene/contrib/swing/src/test/org/apache/lucene/swing/models/TestUpdatingTable.java (revision 996417) +++ lucene/contrib/swing/src/test/org/apache/lucene/swing/models/TestUpdatingTable.java (working copy) @@ -26,7 +26,7 @@ RestaurantInfo infoToAdd1, infoToAdd2; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); baseTableModel = new BaseTableModel(DataStore.getRestaurants()); tableSearcher = new TableSearcher(baseTableModel); Index: lucene/contrib/swing/src/test/org/apache/lucene/swing/models/TestUpdatingList.java =================================================================== --- lucene/contrib/swing/src/test/org/apache/lucene/swing/models/TestUpdatingList.java (revision 996417) +++ lucene/contrib/swing/src/test/org/apache/lucene/swing/models/TestUpdatingList.java (working copy) @@ -26,7 +26,7 @@ RestaurantInfo infoToAdd1, infoToAdd2; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); baseListModel = new BaseListModel(DataStore.getRestaurants()); listSearcher = new ListSearcher(baseListModel); Index: lucene/contrib/swing/src/test/org/apache/lucene/swing/models/TestBasicTable.java =================================================================== --- lucene/contrib/swing/src/test/org/apache/lucene/swing/models/TestBasicTable.java (revision 996417) +++ lucene/contrib/swing/src/test/org/apache/lucene/swing/models/TestBasicTable.java (working copy) @@ -30,7 +30,7 @@ private List list; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); list = new ArrayList(); list.add(DataStore.canolis); Index: lucene/contrib/swing/src/test/org/apache/lucene/swing/models/TestSearchingTable.java =================================================================== --- lucene/contrib/swing/src/test/org/apache/lucene/swing/models/TestSearchingTable.java (revision 996417) +++ lucene/contrib/swing/src/test/org/apache/lucene/swing/models/TestSearchingTable.java (working copy) @@ -25,7 +25,7 @@ private TableSearcher tableSearcher; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); baseTableModel = new BaseTableModel(DataStore.getRestaurants()); tableSearcher = new TableSearcher(baseTableModel); Index: lucene/contrib/swing/src/test/org/apache/lucene/swing/models/TestBasicList.java =================================================================== --- lucene/contrib/swing/src/test/org/apache/lucene/swing/models/TestBasicList.java (revision 996417) +++ lucene/contrib/swing/src/test/org/apache/lucene/swing/models/TestBasicList.java (working copy) @@ -31,7 +31,7 @@ private List list; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); list = new ArrayList(); list.add(DataStore.canolis); Index: lucene/contrib/benchmark/src/test/org/apache/lucene/benchmark/quality/TestQualityRun.java =================================================================== --- lucene/contrib/benchmark/src/test/org/apache/lucene/benchmark/quality/TestQualityRun.java (revision 996417) +++ lucene/contrib/benchmark/src/test/org/apache/lucene/benchmark/quality/TestQualityRun.java (working copy) @@ -46,7 +46,7 @@ public class TestQualityRun extends BenchmarkTestCase { @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); copyToWorkDir("reuters.578.lines.txt.bz2"); } Index: lucene/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java =================================================================== --- lucene/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java (revision 996417) +++ lucene/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java (working copy) @@ -60,7 +60,7 @@ public class TestPerfTasksLogic extends BenchmarkTestCase { @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); copyToWorkDir("reuters.first20.lines.txt"); } Index: lucene/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksParse.java =================================================================== --- lucene/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksParse.java (revision 996417) +++ lucene/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksParse.java (working copy) @@ -37,10 +37,6 @@ INDENT + "print.props=false" + NEW_LINE ; - public TestPerfTasksParse(String name) { - super(name); - } - /** Test the repetiotion parsing for parallel tasks */ public void testParseParallelTaskSequenceRepetition() throws Exception { String taskStr = "AddDoc"; Index: lucene/contrib/misc/src/test/org/apache/lucene/index/TestMultiPassIndexSplitter.java =================================================================== --- lucene/contrib/misc/src/test/org/apache/lucene/index/TestMultiPassIndexSplitter.java (revision 996417) +++ lucene/contrib/misc/src/test/org/apache/lucene/index/TestMultiPassIndexSplitter.java (working copy) @@ -29,7 +29,7 @@ Directory dir; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); dir = newDirectory(); IndexWriter w = new IndexWriter(dir, newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer())); @@ -50,7 +50,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { input.close(); dir.close(); super.tearDown(); Index: lucene/contrib/misc/src/test/org/apache/lucene/index/TestFieldNormModifier.java =================================================================== --- lucene/contrib/misc/src/test/org/apache/lucene/index/TestFieldNormModifier.java (revision 996417) +++ lucene/contrib/misc/src/test/org/apache/lucene/index/TestFieldNormModifier.java (working copy) @@ -36,11 +36,6 @@ * Tests changing of field norms with a custom similarity and with fake norms. */ public class TestFieldNormModifier extends LuceneTestCase { - - public TestFieldNormModifier(String name) { - super(name); - } - public static int NUM_DOCS = 5; public Directory store; @@ -54,7 +49,7 @@ }; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); store = newDirectory(); IndexWriter writer = new IndexWriter(store, newIndexWriterConfig( @@ -76,7 +71,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { store.close(); super.tearDown(); } Index: lucene/contrib/misc/src/test/org/apache/lucene/misc/TestLengthNormModifier.java =================================================================== --- lucene/contrib/misc/src/test/org/apache/lucene/misc/TestLengthNormModifier.java (revision 996417) +++ lucene/contrib/misc/src/test/org/apache/lucene/misc/TestLengthNormModifier.java (working copy) @@ -39,11 +39,6 @@ * Tests changing the norms after changing the simularity */ public class TestLengthNormModifier extends LuceneTestCase { - - public TestLengthNormModifier(String name) { - super(name); - } - public static int NUM_DOCS = 5; public Directory store; @@ -57,7 +52,7 @@ }; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); store = newDirectory(); IndexWriter writer = new IndexWriter(store, newIndexWriterConfig( @@ -82,7 +77,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { store.close(); super.tearDown(); } Index: lucene/contrib/xml-query-parser/src/test/org/apache/lucene/xmlparser/TestParser.java =================================================================== --- lucene/contrib/xml-query-parser/src/test/org/apache/lucene/xmlparser/TestParser.java (revision 996417) +++ lucene/contrib/xml-query-parser/src/test/org/apache/lucene/xmlparser/TestParser.java (working copy) @@ -50,7 +50,7 @@ * @see TestCase#setUp() */ @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); //initialize the parser @@ -85,7 +85,7 @@ @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { reader.close(); searcher.close(); dir.close(); Index: lucene/contrib/xml-query-parser/src/test/org/apache/lucene/xmlparser/TestQueryTemplateManager.java =================================================================== --- lucene/contrib/xml-query-parser/src/test/org/apache/lucene/xmlparser/TestQueryTemplateManager.java (revision 996417) +++ lucene/contrib/xml-query-parser/src/test/org/apache/lucene/xmlparser/TestQueryTemplateManager.java (working copy) @@ -136,7 +136,7 @@ * @see TestCase#setUp() */ @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); @@ -158,7 +158,7 @@ @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { searcher.close(); dir.close(); super.tearDown(); Index: lucene/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestCartesian.java =================================================================== --- lucene/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestCartesian.java (revision 996417) +++ lucene/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestCartesian.java (working copy) @@ -67,7 +67,7 @@ @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); directory = newDirectory(); @@ -80,7 +80,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { directory.close(); super.tearDown(); } Index: lucene/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestDistance.java =================================================================== --- lucene/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestDistance.java (revision 996417) +++ lucene/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestDistance.java (working copy) @@ -41,7 +41,7 @@ private IndexWriter writer; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); directory = newDirectory(); writer = new IndexWriter(directory, newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer())); @@ -50,7 +50,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { writer.close(); directory.close(); super.tearDown(); Index: lucene/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java =================================================================== --- lucene/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java (revision 996417) +++ lucene/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java (working copy) @@ -106,15 +106,6 @@ "This text has a typo in referring to Keneddy", "wordx wordy wordz wordx wordy wordx worda wordb wordy wordc", "y z x y z a b", "lets is a the lets is a the lets is a the lets" }; - /** - * Constructor for HighlightExtractorTest. - * - * @param arg0 - */ - public HighlighterTest(String arg0) { - super(arg0); - } - public void testQueryScorerHits() throws Exception { Analyzer analyzer = new MockAnalyzer(MockTokenizer.SIMPLE, true); QueryParser qp = new QueryParser(TEST_VERSION_CURRENT, FIELD_NAME, analyzer); @@ -1719,7 +1710,7 @@ } @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); dir = newDirectory(); ramDir = newDirectory(); @@ -1755,7 +1746,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { if (searcher != null) searcher.close(); reader.close(); dir.close(); Index: lucene/contrib/highlighter/src/test/org/apache/lucene/search/vectorhighlight/AbstractTestCase.java =================================================================== --- lucene/contrib/highlighter/src/test/org/apache/lucene/search/vectorhighlight/AbstractTestCase.java (revision 996417) +++ lucene/contrib/highlighter/src/test/org/apache/lucene/search/vectorhighlight/AbstractTestCase.java (working copy) @@ -85,7 +85,7 @@ }; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); analyzerW = new MockAnalyzer(MockTokenizer.WHITESPACE, false); analyzerB = new BigramAnalyzer(); @@ -96,7 +96,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { if( reader != null ){ reader.close(); reader = null; Index: lucene/contrib/spellchecker/src/test/org/apache/lucene/search/spell/TestLuceneDictionary.java =================================================================== --- lucene/contrib/spellchecker/src/test/org/apache/lucene/search/spell/TestLuceneDictionary.java (revision 996417) +++ lucene/contrib/spellchecker/src/test/org/apache/lucene/search/spell/TestLuceneDictionary.java (working copy) @@ -43,7 +43,7 @@ private Iterator it; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); store = newDirectory(); IndexWriter writer = new IndexWriter(store, newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(MockTokenizer.WHITESPACE, false))); @@ -75,7 +75,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { if (indexReader != null) indexReader.close(); store.close(); Index: lucene/contrib/spellchecker/src/test/org/apache/lucene/search/spell/TestSpellChecker.java =================================================================== --- lucene/contrib/spellchecker/src/test/org/apache/lucene/search/spell/TestSpellChecker.java (revision 996417) +++ lucene/contrib/spellchecker/src/test/org/apache/lucene/search/spell/TestSpellChecker.java (working copy) @@ -48,7 +48,7 @@ private List searchers; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); //create a user index @@ -71,7 +71,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { userindex.close(); if (!spellChecker.isClosed()) spellChecker.close(); Index: lucene/contrib/queries/src/test/org/apache/lucene/search/similar/TestMoreLikeThis.java =================================================================== --- lucene/contrib/queries/src/test/org/apache/lucene/search/similar/TestMoreLikeThis.java (revision 996417) +++ lucene/contrib/queries/src/test/org/apache/lucene/search/similar/TestMoreLikeThis.java (working copy) @@ -42,7 +42,7 @@ private IndexSearcher searcher; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); directory = newDirectory(); RandomIndexWriter writer = new RandomIndexWriter(random, directory); @@ -57,7 +57,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { reader.close(); searcher.close(); directory.close(); Index: lucene/contrib/queries/src/test/org/apache/lucene/search/DuplicateFilterTest.java =================================================================== --- lucene/contrib/queries/src/test/org/apache/lucene/search/DuplicateFilterTest.java (revision 996417) +++ lucene/contrib/queries/src/test/org/apache/lucene/search/DuplicateFilterTest.java (working copy) @@ -39,7 +39,7 @@ private IndexSearcher searcher; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); directory = newDirectory(); RandomIndexWriter writer = new RandomIndexWriter(random, directory); @@ -65,7 +65,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { reader.close(); searcher.close(); directory.close(); Index: lucene/contrib/queries/src/test/org/apache/lucene/search/ChainedFilterTest.java =================================================================== --- lucene/contrib/queries/src/test/org/apache/lucene/search/ChainedFilterTest.java (revision 996417) +++ lucene/contrib/queries/src/test/org/apache/lucene/search/ChainedFilterTest.java (working copy) @@ -53,7 +53,7 @@ private QueryWrapperFilter sueFilter; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); directory = newDirectory(); RandomIndexWriter writer = new RandomIndexWriter(random, directory); Index: lucene/contrib/queries/src/test/org/apache/lucene/search/BooleanFilterTest.java =================================================================== --- lucene/contrib/queries/src/test/org/apache/lucene/search/BooleanFilterTest.java (revision 996417) +++ lucene/contrib/queries/src/test/org/apache/lucene/search/BooleanFilterTest.java (working copy) @@ -36,7 +36,7 @@ private IndexReader reader; @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); directory = newDirectory(); RandomIndexWriter writer = new RandomIndexWriter(random, directory, new MockAnalyzer(MockTokenizer.WHITESPACE, false)); @@ -53,7 +53,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { mainReader.close(); directory.close(); super.tearDown(); Index: lucene/contrib/queries/src/test/org/apache/lucene/search/regex/TestRegexQuery.java =================================================================== --- lucene/contrib/queries/src/test/org/apache/lucene/search/regex/TestRegexQuery.java (revision 996417) +++ lucene/contrib/queries/src/test/org/apache/lucene/search/regex/TestRegexQuery.java (working copy) @@ -38,7 +38,7 @@ @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); directory = newDirectory(); RandomIndexWriter writer = new RandomIndexWriter(random, directory); @@ -51,7 +51,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { searcher.close(); reader.close(); directory.close(); Index: lucene/contrib/queries/src/test/org/apache/lucene/search/FuzzyLikeThisQueryTest.java =================================================================== --- lucene/contrib/queries/src/test/org/apache/lucene/search/FuzzyLikeThisQueryTest.java (revision 996417) +++ lucene/contrib/queries/src/test/org/apache/lucene/search/FuzzyLikeThisQueryTest.java (working copy) @@ -37,7 +37,7 @@ private Analyzer analyzer=new MockAnalyzer(); @Override - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); directory = newDirectory(); RandomIndexWriter writer = new RandomIndexWriter(random, directory); @@ -55,7 +55,7 @@ } @Override - protected void tearDown() throws Exception { + public void tearDown() throws Exception { searcher.close(); reader.close(); directory.close();