diff --git a/lucene/contrib/ant/src/test/org/apache/lucene/ant/DocumentTestCase.java b/lucene/contrib/ant/src/test/org/apache/lucene/ant/DocumentTestCase.java index d7c5798d287..2ef623b8a15 100644 --- a/lucene/contrib/ant/src/test/org/apache/lucene/ant/DocumentTestCase.java +++ b/lucene/contrib/ant/src/test/org/apache/lucene/ant/DocumentTestCase.java @@ -21,9 +21,9 @@ import java.io.File; import java.io.IOException; import java.net.URLDecoder; -import junit.framework.TestCase; +import org.apache.lucene.util.LuceneTestCase; -public abstract class DocumentTestCase extends TestCase +public abstract class DocumentTestCase extends LuceneTestCase { public DocumentTestCase(String name) { super(name); diff --git a/lucene/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksParse.java b/lucene/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksParse.java index a6bd4885da7..ff514693558 100755 --- a/lucene/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksParse.java +++ b/lucene/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksParse.java @@ -19,14 +19,14 @@ package org.apache.lucene.benchmark.byTask; import java.io.StringReader; import java.util.ArrayList; -import junit.framework.TestCase; import org.apache.lucene.benchmark.byTask.tasks.PerfTask; import org.apache.lucene.benchmark.byTask.tasks.TaskSequence; import org.apache.lucene.benchmark.byTask.utils.Algorithm; +import org.apache.lucene.util.LuceneTestCase; /** Test very simply that perf tasks are parses as expected. */ -public class TestPerfTasksParse extends TestCase { +public class TestPerfTasksParse extends LuceneTestCase { static final String NEW_LINE = System.getProperty("line.separator"); static final String INDENT = " "; diff --git a/lucene/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/TrecContentSourceTest.java b/lucene/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/TrecContentSourceTest.java index 8540e14fd68..a178c6a6b1f 100644 --- a/lucene/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/TrecContentSourceTest.java +++ b/lucene/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/TrecContentSourceTest.java @@ -23,12 +23,11 @@ import java.io.StringReader; import java.text.ParseException; import java.util.Date; -import junit.framework.TestCase; - import org.apache.lucene.benchmark.byTask.utils.Config; import org.apache.lucene.document.DateTools; +import org.apache.lucene.util.LuceneTestCase; -public class TrecContentSourceTest extends TestCase { +public class TrecContentSourceTest extends LuceneTestCase { /** A TrecDocMaker which works on a String and not files. */ private static class StringableTrecSource extends TrecContentSource { diff --git a/lucene/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestRealTime.java b/lucene/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestRealTime.java index c3ed1ece26a..4e7c59f9e6a 100644 --- a/lucene/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestRealTime.java +++ b/lucene/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestRealTime.java @@ -15,7 +15,6 @@ */ package org.apache.lucene.store.instantiated; -import junit.framework.TestCase; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.Scorer; @@ -23,6 +22,7 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.Term; import org.apache.lucene.index.IndexReader; +import org.apache.lucene.util.LuceneTestCase; /** * Assert that the content of an index @@ -30,7 +30,7 @@ import org.apache.lucene.index.IndexReader; * for all open searchers * also after a commit. */ -public class TestRealTime extends TestCase { +public class TestRealTime extends LuceneTestCase { public void test() throws Exception { diff --git a/lucene/contrib/misc/src/test/org/apache/lucene/misc/SweetSpotSimilarityTest.java b/lucene/contrib/misc/src/test/org/apache/lucene/misc/SweetSpotSimilarityTest.java index 1830291f587..36450e23ae3 100644 --- a/lucene/contrib/misc/src/test/org/apache/lucene/misc/SweetSpotSimilarityTest.java +++ b/lucene/contrib/misc/src/test/org/apache/lucene/misc/SweetSpotSimilarityTest.java @@ -18,15 +18,14 @@ package org.apache.lucene.misc; -import junit.framework.TestCase; - import org.apache.lucene.search.DefaultSimilarity; import org.apache.lucene.search.Similarity; +import org.apache.lucene.util.LuceneTestCase; /** * Test of the SweetSpotSimilarity */ -public class SweetSpotSimilarityTest extends TestCase { +public class SweetSpotSimilarityTest extends LuceneTestCase { public void testSweetSpotLengthNorm() { diff --git a/lucene/contrib/queries/src/test/org/apache/lucene/search/BoostingQueryTest.java b/lucene/contrib/queries/src/test/org/apache/lucene/search/BoostingQueryTest.java index f2779939ca7..66e9282d6cd 100644 --- a/lucene/contrib/queries/src/test/org/apache/lucene/search/BoostingQueryTest.java +++ b/lucene/contrib/queries/src/test/org/apache/lucene/search/BoostingQueryTest.java @@ -18,10 +18,9 @@ package org.apache.lucene.search; */ import org.apache.lucene.index.Term; +import org.apache.lucene.util.LuceneTestCase; -import junit.framework.TestCase; - -public class BoostingQueryTest extends TestCase { +public class BoostingQueryTest extends LuceneTestCase { public void testBoostingQueryEquals() { TermQuery q1 = new TermQuery(new Term("subject:", "java")); TermQuery q2 = new TermQuery(new Term("subject:", "java")); diff --git a/lucene/contrib/queries/src/test/org/apache/lucene/search/regex/TestJakartaRegexpCapabilities.java b/lucene/contrib/queries/src/test/org/apache/lucene/search/regex/TestJakartaRegexpCapabilities.java index e9ca88dc9c0..b29ebbde932 100644 --- a/lucene/contrib/queries/src/test/org/apache/lucene/search/regex/TestJakartaRegexpCapabilities.java +++ b/lucene/contrib/queries/src/test/org/apache/lucene/search/regex/TestJakartaRegexpCapabilities.java @@ -17,12 +17,12 @@ package org.apache.lucene.search.regex; * limitations under the License. */ -import junit.framework.TestCase; +import org.apache.lucene.util.LuceneTestCase; /** * Testcase for {@link JakartaRegexpCapabilities} */ -public class TestJakartaRegexpCapabilities extends TestCase { +public class TestJakartaRegexpCapabilities extends LuceneTestCase { public void testGetPrefix(){ JakartaRegexpCapabilities cap = new JakartaRegexpCapabilities(); diff --git a/lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/spans/TestSpanQueryParser.java b/lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/spans/TestSpanQueryParser.java index 42580c7b096..7fb2d2ba735 100644 --- a/lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/spans/TestSpanQueryParser.java +++ b/lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/spans/TestSpanQueryParser.java @@ -17,10 +17,6 @@ package org.apache.lucene.queryParser.spans; * limitations under the License. */ -import javax.management.Query; - -import junit.framework.TestCase; - import org.apache.lucene.queryParser.core.QueryNodeException; import org.apache.lucene.queryParser.core.nodes.OrQueryNode; import org.apache.lucene.queryParser.core.nodes.QueryNode; @@ -31,6 +27,8 @@ import org.apache.lucene.queryParser.standard.processors.WildcardQueryNodeProces import org.apache.lucene.search.spans.SpanOrQuery; import org.apache.lucene.search.spans.SpanQuery; import org.apache.lucene.search.spans.SpanTermQuery; +import org.apache.lucene.search.Query; +import org.apache.lucene.util.LuceneTestCase; /** * This test case demonstrates how the new query parser can be used.
@@ -93,7 +91,7 @@ import org.apache.lucene.search.spans.SpanTermQuery; * @see UniqueFieldQueryNodeProcessor * @see UniqueFieldAttribute */ -public class TestSpanQueryParser extends TestCase { +public class TestSpanQueryParser extends LuceneTestCase { private QueryNodeProcessorPipeline spanProcessorPipeline; diff --git a/lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/surround/query/Test01Exceptions.java b/lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/surround/query/Test01Exceptions.java index bb4b97d9226..493658cb533 100644 --- a/lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/surround/query/Test01Exceptions.java +++ b/lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/surround/query/Test01Exceptions.java @@ -17,11 +17,12 @@ package org.apache.lucene.queryParser.surround.query; * limitations under the License. */ -import junit.framework.TestCase; import junit.framework.TestSuite; import junit.textui.TestRunner; -public class Test01Exceptions extends TestCase { +import org.apache.lucene.util.LuceneTestCase; + +public class Test01Exceptions extends LuceneTestCase { /** Main for running test case by itself. */ public static void main(String args[]) { TestRunner.run(new TestSuite(Test01Exceptions.class)); diff --git a/lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/surround/query/Test02Boolean.java b/lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/surround/query/Test02Boolean.java index 029437a2e20..c578fa3ede4 100644 --- a/lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/surround/query/Test02Boolean.java +++ b/lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/surround/query/Test02Boolean.java @@ -17,12 +17,12 @@ package org.apache.lucene.queryParser.surround.query; * limitations under the License. */ -import junit.framework.TestCase; import junit.framework.TestSuite; import junit.textui.TestRunner; +import org.apache.lucene.util.LuceneTestCase; -public class Test02Boolean extends TestCase { +public class Test02Boolean extends LuceneTestCase { public static void main(String args[]) { TestRunner.run(new TestSuite(Test02Boolean.class)); } diff --git a/lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/surround/query/Test03Distance.java b/lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/surround/query/Test03Distance.java index 8802d32a2c0..11226aebde0 100644 --- a/lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/surround/query/Test03Distance.java +++ b/lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/surround/query/Test03Distance.java @@ -17,11 +17,12 @@ package org.apache.lucene.queryParser.surround.query; * limitations under the License. */ -import junit.framework.TestCase; import junit.framework.TestSuite; import junit.textui.TestRunner; -public class Test03Distance extends TestCase { +import org.apache.lucene.util.LuceneTestCase; + +public class Test03Distance extends LuceneTestCase { public static void main(String args[]) { TestRunner.run(new TestSuite(Test03Distance.class)); } diff --git a/lucene/contrib/spatial/src/test/org/apache/lucene/spatial/DistanceUtilsTest.java b/lucene/contrib/spatial/src/test/org/apache/lucene/spatial/DistanceUtilsTest.java index f0e0e30336d..5452bed1502 100644 --- a/lucene/contrib/spatial/src/test/org/apache/lucene/spatial/DistanceUtilsTest.java +++ b/lucene/contrib/spatial/src/test/org/apache/lucene/spatial/DistanceUtilsTest.java @@ -1,8 +1,7 @@ package org.apache.lucene.spatial; -import junit.framework.TestCase; import org.apache.lucene.spatial.tier.InvalidGeoException; - +import org.apache.lucene.util.LuceneTestCase; /** * Licensed to the Apache Software Foundation (ASF) under one or more @@ -26,7 +25,7 @@ import org.apache.lucene.spatial.tier.InvalidGeoException; * * **/ -public class DistanceUtilsTest extends TestCase { +public class DistanceUtilsTest extends LuceneTestCase { public void testBoxCorner() throws Exception { double[] zero = new double[]{0, 0}; diff --git a/lucene/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestCartesianShapeFilter.java b/lucene/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestCartesianShapeFilter.java index c83289a99eb..55a941fedf5 100644 --- a/lucene/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestCartesianShapeFilter.java +++ b/lucene/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestCartesianShapeFilter.java @@ -21,13 +21,14 @@ import java.io.IOException; import java.io.NotSerializableException; import java.io.ObjectOutputStream; -import junit.framework.TestCase; +import org.apache.lucene.util.LuceneTestCase; + /** * * Test for {@link CartesianShapeFilter} * */ -public class TestCartesianShapeFilter extends TestCase { +public class TestCartesianShapeFilter extends LuceneTestCase { public void testSerializable() throws IOException { CartesianShapeFilter filter = new CartesianShapeFilter(new Shape("1"), diff --git a/lucene/contrib/spellchecker/src/test/org/apache/lucene/search/spell/TestJaroWinklerDistance.java b/lucene/contrib/spellchecker/src/test/org/apache/lucene/search/spell/TestJaroWinklerDistance.java index 3dfa63ce666..01aa3d10b68 100644 --- a/lucene/contrib/spellchecker/src/test/org/apache/lucene/search/spell/TestJaroWinklerDistance.java +++ b/lucene/contrib/spellchecker/src/test/org/apache/lucene/search/spell/TestJaroWinklerDistance.java @@ -17,9 +17,9 @@ package org.apache.lucene.search.spell; * limitations under the License. */ -import junit.framework.TestCase; +import org.apache.lucene.util.LuceneTestCase; -public class TestJaroWinklerDistance extends TestCase { +public class TestJaroWinklerDistance extends LuceneTestCase { private StringDistance sd = new JaroWinklerDistance(); diff --git a/lucene/contrib/spellchecker/src/test/org/apache/lucene/search/spell/TestLevenshteinDistance.java b/lucene/contrib/spellchecker/src/test/org/apache/lucene/search/spell/TestLevenshteinDistance.java index 58cefd9ee10..1a54d37b129 100644 --- a/lucene/contrib/spellchecker/src/test/org/apache/lucene/search/spell/TestLevenshteinDistance.java +++ b/lucene/contrib/spellchecker/src/test/org/apache/lucene/search/spell/TestLevenshteinDistance.java @@ -17,9 +17,9 @@ package org.apache.lucene.search.spell; * limitations under the License. */ -import junit.framework.TestCase; +import org.apache.lucene.util.LuceneTestCase; -public class TestLevenshteinDistance extends TestCase { +public class TestLevenshteinDistance extends LuceneTestCase { private StringDistance sd = new LevensteinDistance(); diff --git a/lucene/contrib/spellchecker/src/test/org/apache/lucene/search/spell/TestNGramDistance.java b/lucene/contrib/spellchecker/src/test/org/apache/lucene/search/spell/TestNGramDistance.java index 7f209e7bf62..9ca3b86ce54 100644 --- a/lucene/contrib/spellchecker/src/test/org/apache/lucene/search/spell/TestNGramDistance.java +++ b/lucene/contrib/spellchecker/src/test/org/apache/lucene/search/spell/TestNGramDistance.java @@ -17,9 +17,9 @@ package org.apache.lucene.search.spell; * limitations under the License. */ -import junit.framework.TestCase; +import org.apache.lucene.util.LuceneTestCase; -public class TestNGramDistance extends TestCase { +public class TestNGramDistance extends LuceneTestCase { diff --git a/lucene/contrib/spellchecker/src/test/org/apache/lucene/search/spell/TestPlainTextDictionary.java b/lucene/contrib/spellchecker/src/test/org/apache/lucene/search/spell/TestPlainTextDictionary.java index 4a2d1240bfa..2a8d2a8b672 100644 --- a/lucene/contrib/spellchecker/src/test/org/apache/lucene/search/spell/TestPlainTextDictionary.java +++ b/lucene/contrib/spellchecker/src/test/org/apache/lucene/search/spell/TestPlainTextDictionary.java @@ -20,15 +20,14 @@ package org.apache.lucene.search.spell; import java.io.IOException; import java.io.StringReader; -import junit.framework.TestCase; - import org.apache.lucene.store.RAMDirectory; +import org.apache.lucene.util.LuceneTestCase; /** * Test case for PlainTextDictionary * */ -public class TestPlainTextDictionary extends TestCase { +public class TestPlainTextDictionary extends LuceneTestCase { public void testBuild() throws IOException { final String LF = System.getProperty("line.separator"); diff --git a/lucene/contrib/swing/src/test/org/apache/lucene/swing/models/TestBasicList.java b/lucene/contrib/swing/src/test/org/apache/lucene/swing/models/TestBasicList.java index dafe8e898e7..61f3307cef8 100644 --- a/lucene/contrib/swing/src/test/org/apache/lucene/swing/models/TestBasicList.java +++ b/lucene/contrib/swing/src/test/org/apache/lucene/swing/models/TestBasicList.java @@ -21,17 +21,18 @@ import java.util.List; import javax.swing.ListModel; -import junit.framework.TestCase; +import org.apache.lucene.util.LuceneTestCase; /** **/ -public class TestBasicList extends TestCase { +public class TestBasicList extends LuceneTestCase { private ListModel baseListModel; private ListSearcher listSearcher; private List list; @Override protected void setUp() throws Exception { + super.setUp(); list = new ArrayList(); list.add(DataStore.canolis); list.add(DataStore.chris); @@ -40,7 +41,6 @@ public class TestBasicList extends TestCase { listSearcher = new ListSearcher(baseListModel); } - public void testRows(){ assertEquals(list.size(), listSearcher.getSize()); } diff --git a/lucene/contrib/swing/src/test/org/apache/lucene/swing/models/TestBasicTable.java b/lucene/contrib/swing/src/test/org/apache/lucene/swing/models/TestBasicTable.java index b346fa835ec..d889095b20c 100644 --- a/lucene/contrib/swing/src/test/org/apache/lucene/swing/models/TestBasicTable.java +++ b/lucene/contrib/swing/src/test/org/apache/lucene/swing/models/TestBasicTable.java @@ -21,16 +21,17 @@ import java.util.List; import javax.swing.table.TableModel; -import junit.framework.TestCase; +import org.apache.lucene.util.LuceneTestCase; -public class TestBasicTable extends TestCase { +public class TestBasicTable extends LuceneTestCase { private TableModel baseTableModel; private TableSearcher tableSearcher; private List list; @Override protected void setUp() throws Exception { + super.setUp(); list = new ArrayList(); list.add(DataStore.canolis); list.add(DataStore.chris); diff --git a/lucene/contrib/swing/src/test/org/apache/lucene/swing/models/TestSearchingList.java b/lucene/contrib/swing/src/test/org/apache/lucene/swing/models/TestSearchingList.java index adc52f57943..30890dd2202 100644 --- a/lucene/contrib/swing/src/test/org/apache/lucene/swing/models/TestSearchingList.java +++ b/lucene/contrib/swing/src/test/org/apache/lucene/swing/models/TestSearchingList.java @@ -18,16 +18,17 @@ package org.apache.lucene.swing.models; import javax.swing.ListModel; -import junit.framework.TestCase; +import org.apache.lucene.util.LuceneTestCase; -public class TestSearchingList extends TestCase { +public class TestSearchingList extends LuceneTestCase { private ListModel baseListModel; private ListSearcher listSearcher; @Override protected void setUp() throws Exception { + super.setUp(); baseListModel = new BaseListModel(DataStore.getRestaurants()); listSearcher = new ListSearcher(baseListModel); } diff --git a/lucene/contrib/swing/src/test/org/apache/lucene/swing/models/TestSearchingTable.java b/lucene/contrib/swing/src/test/org/apache/lucene/swing/models/TestSearchingTable.java index c06753faa5d..e16ca7ce24b 100644 --- a/lucene/contrib/swing/src/test/org/apache/lucene/swing/models/TestSearchingTable.java +++ b/lucene/contrib/swing/src/test/org/apache/lucene/swing/models/TestSearchingTable.java @@ -16,17 +16,17 @@ package org.apache.lucene.swing.models; * limitations under the License. */ -import junit.framework.TestCase; - import javax.swing.table.TableModel; +import org.apache.lucene.util.LuceneTestCase; -public class TestSearchingTable extends TestCase { +public class TestSearchingTable extends LuceneTestCase { private TableModel baseTableModel; private TableSearcher tableSearcher; @Override protected void setUp() throws Exception { + super.setUp(); baseTableModel = new BaseTableModel(DataStore.getRestaurants()); tableSearcher = new TableSearcher(baseTableModel); } diff --git a/lucene/contrib/swing/src/test/org/apache/lucene/swing/models/TestUpdatingList.java b/lucene/contrib/swing/src/test/org/apache/lucene/swing/models/TestUpdatingList.java index 42a853c8507..a86cc5689d7 100644 --- a/lucene/contrib/swing/src/test/org/apache/lucene/swing/models/TestUpdatingList.java +++ b/lucene/contrib/swing/src/test/org/apache/lucene/swing/models/TestUpdatingList.java @@ -16,10 +16,10 @@ package org.apache.lucene.swing.models; * limitations under the License. */ -import junit.framework.TestCase; +import org.apache.lucene.util.LuceneTestCase; -public class TestUpdatingList extends TestCase { +public class TestUpdatingList extends LuceneTestCase { private BaseListModel baseListModel; private ListSearcher listSearcher; @@ -27,6 +27,7 @@ public class TestUpdatingList extends TestCase { @Override protected void setUp() throws Exception { + super.setUp(); baseListModel = new BaseListModel(DataStore.getRestaurants()); listSearcher = new ListSearcher(baseListModel); diff --git a/lucene/contrib/swing/src/test/org/apache/lucene/swing/models/TestUpdatingTable.java b/lucene/contrib/swing/src/test/org/apache/lucene/swing/models/TestUpdatingTable.java index 2730a44ce35..a0fec80709a 100644 --- a/lucene/contrib/swing/src/test/org/apache/lucene/swing/models/TestUpdatingTable.java +++ b/lucene/contrib/swing/src/test/org/apache/lucene/swing/models/TestUpdatingTable.java @@ -16,10 +16,10 @@ package org.apache.lucene.swing.models; * limitations under the License. */ -import junit.framework.TestCase; +import org.apache.lucene.util.LuceneTestCase; -public class TestUpdatingTable extends TestCase { +public class TestUpdatingTable extends LuceneTestCase { private BaseTableModel baseTableModel; private TableSearcher tableSearcher; @@ -27,6 +27,7 @@ public class TestUpdatingTable extends TestCase { @Override protected void setUp() throws Exception { + super.setUp(); baseTableModel = new BaseTableModel(DataStore.getRestaurants()); tableSearcher = new TableSearcher(baseTableModel); diff --git a/lucene/src/test/org/apache/lucene/util/LuceneTestCase.java b/lucene/src/test/org/apache/lucene/util/LuceneTestCase.java index 1c8e2ece3f1..0cca68c66ef 100644 --- a/lucene/src/test/org/apache/lucene/util/LuceneTestCase.java +++ b/lucene/src/test/org/apache/lucene/util/LuceneTestCase.java @@ -334,8 +334,8 @@ public abstract class LuceneTestCase extends TestCase { 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")) - System.out.println("NOTE: random timezone of testcase '" + getName() + "' was: " + timeZone.getID()); + 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); } diff --git a/lucene/src/test/org/apache/lucene/util/LuceneTestCaseJ4.java b/lucene/src/test/org/apache/lucene/util/LuceneTestCaseJ4.java index 51206fd7fe1..c9293007ea5 100644 --- a/lucene/src/test/org/apache/lucene/util/LuceneTestCaseJ4.java +++ b/lucene/src/test/org/apache/lucene/util/LuceneTestCaseJ4.java @@ -582,8 +582,8 @@ public class LuceneTestCaseJ4 { 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")) - System.out.println("NOTE: random timezone of testcase '" + getName() + "' was: " + timeZone.getID()); + 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); } diff --git a/lucene/src/test/org/apache/lucene/util/TestRamUsageEstimator.java b/lucene/src/test/org/apache/lucene/util/TestRamUsageEstimator.java index aee49d7fed1..a64d0941b99 100644 --- a/lucene/src/test/org/apache/lucene/util/TestRamUsageEstimator.java +++ b/lucene/src/test/org/apache/lucene/util/TestRamUsageEstimator.java @@ -17,9 +17,9 @@ package org.apache.lucene.util; * limitations under the License. */ -import junit.framework.TestCase; +import org.apache.lucene.util.LuceneTestCase; -public class TestRamUsageEstimator extends TestCase { +public class TestRamUsageEstimator extends LuceneTestCase { public void testBasic() { RamUsageEstimator rue = new RamUsageEstimator(); diff --git a/modules/analysis/common/src/test/org/apache/lucene/analysis/charfilter/HTMLStripCharFilterTest.java b/modules/analysis/common/src/test/org/apache/lucene/analysis/charfilter/HTMLStripCharFilterTest.java index 7fb8096abbd..249e3e2d62c 100644 --- a/modules/analysis/common/src/test/org/apache/lucene/analysis/charfilter/HTMLStripCharFilterTest.java +++ b/modules/analysis/common/src/test/org/apache/lucene/analysis/charfilter/HTMLStripCharFilterTest.java @@ -30,20 +30,23 @@ import java.util.Set; import org.apache.lucene.analysis.CharReader; -import junit.framework.TestCase; +import org.apache.lucene.util.LuceneTestCase; -public class HTMLStripCharFilterTest extends TestCase { +public class HTMLStripCharFilterTest extends LuceneTestCase { public HTMLStripCharFilterTest(String s) { super(s); } - protected void setUp() { + @Override + protected void setUp() throws Exception { + super.setUp(); } - protected void tearDown() { - + @Override + protected 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 & // diff --git a/solr/src/test/org/apache/solr/SolrInfoMBeanTest.java b/solr/src/test/org/apache/solr/SolrInfoMBeanTest.java index b625a0e9d50..f9ce88d5af2 100644 --- a/solr/src/test/org/apache/solr/SolrInfoMBeanTest.java +++ b/solr/src/test/org/apache/solr/SolrInfoMBeanTest.java @@ -16,7 +16,7 @@ */ package org.apache.solr; -import junit.framework.TestCase; +import org.apache.lucene.util.LuceneTestCase; import org.apache.solr.core.SolrInfoMBean; import org.apache.solr.handler.StandardRequestHandler; import org.apache.solr.handler.admin.LukeRequestHandler; @@ -34,7 +34,7 @@ import java.util.List; /** * A simple test used to increase code coverage for some standard things... */ -public class SolrInfoMBeanTest extends TestCase +public class SolrInfoMBeanTest extends LuceneTestCase { /** * Gets a list of everything we can find in the classpath and makes sure it has diff --git a/solr/src/test/org/apache/solr/analysis/TestMappingCharFilterFactory.java b/solr/src/test/org/apache/solr/analysis/TestMappingCharFilterFactory.java index 36130fdb5dc..aff9861dcb5 100644 --- a/solr/src/test/org/apache/solr/analysis/TestMappingCharFilterFactory.java +++ b/solr/src/test/org/apache/solr/analysis/TestMappingCharFilterFactory.java @@ -17,9 +17,9 @@ package org.apache.solr.analysis; -import junit.framework.TestCase; +import org.apache.lucene.util.LuceneTestCase; -public class TestMappingCharFilterFactory extends TestCase { +public class TestMappingCharFilterFactory extends LuceneTestCase { public void testParseString() throws Exception { MappingCharFilterFactory f = new MappingCharFilterFactory(); diff --git a/solr/src/test/org/apache/solr/analysis/TestSynonymMap.java b/solr/src/test/org/apache/solr/analysis/TestSynonymMap.java index 65d555800fa..d13fc8d5381 100644 --- a/solr/src/test/org/apache/solr/analysis/TestSynonymMap.java +++ b/solr/src/test/org/apache/solr/analysis/TestSynonymMap.java @@ -22,12 +22,11 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import junit.framework.TestCase; - import org.apache.lucene.analysis.Token; import org.apache.lucene.analysis.synonym.SynonymMap; +import org.apache.lucene.util.LuceneTestCase; -public class TestSynonymMap extends TestCase { +public class TestSynonymMap extends LuceneTestCase { public void testInvalidMappingRules() throws Exception { SynonymMap synMap = new SynonymMap( true ); diff --git a/solr/src/test/org/apache/solr/client/solrj/SolrExceptionTest.java b/solr/src/test/org/apache/solr/client/solrj/SolrExceptionTest.java index 6b24748d1c1..dde373ad5e9 100644 --- a/solr/src/test/org/apache/solr/client/solrj/SolrExceptionTest.java +++ b/solr/src/test/org/apache/solr/client/solrj/SolrExceptionTest.java @@ -19,7 +19,7 @@ package org.apache.solr.client.solrj; import java.net.UnknownHostException; -import junit.framework.TestCase; +import org.apache.lucene.util.LuceneTestCase; import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager; @@ -32,7 +32,7 @@ import org.apache.solr.common.SolrException; * @version $Id$ * @since solr 1.3 */ -public class SolrExceptionTest extends TestCase { +public class SolrExceptionTest extends LuceneTestCase { public void testSolrException() throws Throwable { // test a connection to a solr server that probably doesn't exist diff --git a/solr/src/test/org/apache/solr/client/solrj/SolrQueryTest.java b/solr/src/test/org/apache/solr/client/solrj/SolrQueryTest.java index 27aea101d92..69d7d37bb75 100644 --- a/solr/src/test/org/apache/solr/client/solrj/SolrQueryTest.java +++ b/solr/src/test/org/apache/solr/client/solrj/SolrQueryTest.java @@ -17,17 +17,17 @@ package org.apache.solr.client.solrj; +import org.apache.lucene.util.LuceneTestCase; import org.apache.solr.common.params.FacetParams; import junit.framework.Assert; -import junit.framework.TestCase; /** * * @version $Id$ * @since solr 1.3 */ -public class SolrQueryTest extends TestCase { +public class SolrQueryTest extends LuceneTestCase { public void testSolrQueryMethods() { SolrQuery q = new SolrQuery("dog"); diff --git a/solr/src/test/org/apache/solr/client/solrj/TestLBHttpSolrServer.java b/solr/src/test/org/apache/solr/client/solrj/TestLBHttpSolrServer.java index a2c6097faba..f24329c87e2 100644 --- a/solr/src/test/org/apache/solr/client/solrj/TestLBHttpSolrServer.java +++ b/solr/src/test/org/apache/solr/client/solrj/TestLBHttpSolrServer.java @@ -17,10 +17,10 @@ package org.apache.solr.client.solrj; -import junit.framework.TestCase; import junit.framework.Assert; import org.apache.commons.httpclient.HttpClient; import org.apache.commons.io.FileUtils; +import org.apache.lucene.util.LuceneTestCase; import org.apache.solr.SolrTestCaseJ4; import org.apache.solr.client.solrj.embedded.JettySolrRunner; import org.apache.solr.client.solrj.impl.CommonsHttpSolrServer; @@ -43,7 +43,7 @@ import java.util.Set; * @version $Id$ * @since solr 1.4 */ -public class TestLBHttpSolrServer extends TestCase { +public class TestLBHttpSolrServer extends LuceneTestCase { SolrInstance[] solr = new SolrInstance[3]; HttpClient httpClient = new HttpClient(); @@ -223,7 +223,7 @@ public class TestLBHttpSolrServer extends TestCase { jetty.start(); int newPort = jetty.getLocalPort(); if (port != 0 && newPort != port) { - TestCase.fail("TESTING FAILURE: could not grab requested port."); + fail("TESTING FAILURE: could not grab requested port."); } this.port = newPort; // System.out.println("waiting........."); diff --git a/solr/src/test/org/apache/solr/client/solrj/beans/TestDocumentObjectBinder.java b/solr/src/test/org/apache/solr/client/solrj/beans/TestDocumentObjectBinder.java index 0e57f9068ee..7c86a3a05f7 100644 --- a/solr/src/test/org/apache/solr/client/solrj/beans/TestDocumentObjectBinder.java +++ b/solr/src/test/org/apache/solr/client/solrj/beans/TestDocumentObjectBinder.java @@ -16,7 +16,7 @@ */ package org.apache.solr.client.solrj.beans; -import junit.framework.TestCase; +import org.apache.lucene.util.LuceneTestCase; import org.apache.solr.client.solrj.impl.XMLResponseParser; import org.apache.solr.client.solrj.response.QueryResponse; @@ -36,7 +36,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -public class TestDocumentObjectBinder extends TestCase +public class TestDocumentObjectBinder extends LuceneTestCase { public void testSimple() throws Exception { DocumentObjectBinder binder = new DocumentObjectBinder(); diff --git a/solr/src/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.java b/solr/src/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.java index be998bb160b..4fcfa2729dc 100644 --- a/solr/src/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.java +++ b/solr/src/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.java @@ -21,7 +21,7 @@ import java.io.File; import java.net.URL; import java.util.Random; -import junit.framework.TestCase; +import org.apache.lucene.util.LuceneTestCase; import org.apache.commons.io.IOUtils; import org.apache.solr.SolrTestCaseJ4; @@ -35,7 +35,7 @@ import org.mortbay.jetty.webapp.WebAppContext; * @version $Id$ * @since solr 1.3 */ -public class JettyWebappTest extends TestCase +public class JettyWebappTest extends LuceneTestCase { int port = 0; static final String context = "/test"; diff --git a/solr/src/test/org/apache/solr/client/solrj/util/ClientUtilsTest.java b/solr/src/test/org/apache/solr/client/solrj/util/ClientUtilsTest.java index 77beeb35ce9..7d2c297c8de 100644 --- a/solr/src/test/org/apache/solr/client/solrj/util/ClientUtilsTest.java +++ b/solr/src/test/org/apache/solr/client/solrj/util/ClientUtilsTest.java @@ -17,14 +17,14 @@ package org.apache.solr.client.solrj.util; -import junit.framework.TestCase; +import org.apache.lucene.util.LuceneTestCase; /** * * @version $Id$ * @since solr 1.3 */ -public class ClientUtilsTest extends TestCase { +public class ClientUtilsTest extends LuceneTestCase { public void testEscapeQuery() { diff --git a/solr/src/test/org/apache/solr/common/SolrDocumentTest.java b/solr/src/test/org/apache/solr/common/SolrDocumentTest.java index 77cf8d51853..6e28c9b7032 100644 --- a/solr/src/test/org/apache/solr/common/SolrDocumentTest.java +++ b/solr/src/test/org/apache/solr/common/SolrDocumentTest.java @@ -24,14 +24,13 @@ import java.util.Iterator; import java.util.List; import java.util.Map; +import org.apache.lucene.util.LuceneTestCase; import org.apache.solr.common.SolrDocument; import org.apache.solr.common.SolrInputDocument; -import junit.framework.TestCase; - /** */ -public class SolrDocumentTest extends TestCase +public class SolrDocumentTest extends LuceneTestCase { public void testSimple() { diff --git a/solr/src/test/org/apache/solr/common/params/ModifiableSolrParamsTest.java b/solr/src/test/org/apache/solr/common/params/ModifiableSolrParamsTest.java index a86cadd42c7..0d156023f86 100644 --- a/solr/src/test/org/apache/solr/common/params/ModifiableSolrParamsTest.java +++ b/solr/src/test/org/apache/solr/common/params/ModifiableSolrParamsTest.java @@ -10,7 +10,7 @@ */ package org.apache.solr.common.params; -import junit.framework.TestCase; +import org.apache.lucene.util.LuceneTestCase; /** * Unit Test Case for {@link org.apache.solr.common.params.ModifiableSolrParams @@ -18,7 +18,7 @@ import junit.framework.TestCase; * * @author kkumar */ -public class ModifiableSolrParamsTest extends TestCase +public class ModifiableSolrParamsTest extends LuceneTestCase { @Override diff --git a/solr/src/test/org/apache/solr/common/params/SolrParamTest.java b/solr/src/test/org/apache/solr/common/params/SolrParamTest.java index 27be0731364..a52279055bd 100755 --- a/solr/src/test/org/apache/solr/common/params/SolrParamTest.java +++ b/solr/src/test/org/apache/solr/common/params/SolrParamTest.java @@ -17,11 +17,10 @@ package org.apache.solr.common.params; -import junit.framework.TestCase; - import java.util.HashMap; import java.util.Map; +import org.apache.lucene.util.LuceneTestCase; import org.apache.solr.common.SolrException; import org.apache.solr.common.params.DefaultSolrParams; import org.apache.solr.common.params.MapSolrParams; @@ -29,7 +28,7 @@ import org.apache.solr.common.params.SolrParams; /** */ -public class SolrParamTest extends TestCase +public class SolrParamTest extends LuceneTestCase { public void testGetParams() { Map pmap = new HashMap(); diff --git a/solr/src/test/org/apache/solr/common/util/ContentStreamTest.java b/solr/src/test/org/apache/solr/common/util/ContentStreamTest.java index de2c30dc12c..d3d1bcbe6a4 100755 --- a/solr/src/test/org/apache/solr/common/util/ContentStreamTest.java +++ b/solr/src/test/org/apache/solr/common/util/ContentStreamTest.java @@ -27,13 +27,12 @@ import java.io.StringReader; import java.net.URL; import org.apache.commons.io.IOUtils; +import org.apache.lucene.util.LuceneTestCase; import org.apache.solr.common.util.ContentStreamBase; -import junit.framework.TestCase; - /** */ -public class ContentStreamTest extends TestCase +public class ContentStreamTest extends LuceneTestCase { public void testStringStream() throws IOException { diff --git a/solr/src/test/org/apache/solr/common/util/DOMUtilTest.java b/solr/src/test/org/apache/solr/common/util/DOMUtilTest.java index 2596791a02a..87403355472 100644 --- a/solr/src/test/org/apache/solr/common/util/DOMUtilTest.java +++ b/solr/src/test/org/apache/solr/common/util/DOMUtilTest.java @@ -28,14 +28,16 @@ import javax.xml.xpath.XPathFactory; import org.w3c.dom.Document; import org.w3c.dom.Node; -import junit.framework.TestCase; +import org.apache.lucene.util.LuceneTestCase; -public class DOMUtilTest extends TestCase { +public class DOMUtilTest extends LuceneTestCase { private DocumentBuilder builder; private static final XPathFactory xpathFactory = XPathFactory.newInstance(); + @Override public void setUp() throws Exception { + super.setUp(); builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); } diff --git a/solr/src/test/org/apache/solr/common/util/FileUtilsTest.java b/solr/src/test/org/apache/solr/common/util/FileUtilsTest.java index e94c92802de..c96c204380a 100644 --- a/solr/src/test/org/apache/solr/common/util/FileUtilsTest.java +++ b/solr/src/test/org/apache/solr/common/util/FileUtilsTest.java @@ -20,9 +20,9 @@ package org.apache.solr.common.util; import java.io.File; import java.io.IOException; -import junit.framework.TestCase; +import org.apache.lucene.util.LuceneTestCase; -public class FileUtilsTest extends TestCase { +public class FileUtilsTest extends LuceneTestCase { public void testResolve() throws IOException { String cwd = new File(".").getAbsolutePath(); diff --git a/solr/src/test/org/apache/solr/common/util/IteratorChainTest.java b/solr/src/test/org/apache/solr/common/util/IteratorChainTest.java index bf2f2866b9f..9dd9ce937b0 100644 --- a/solr/src/test/org/apache/solr/common/util/IteratorChainTest.java +++ b/solr/src/test/org/apache/solr/common/util/IteratorChainTest.java @@ -21,11 +21,10 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; +import org.apache.lucene.util.LuceneTestCase; import org.apache.solr.common.util.IteratorChain; -import junit.framework.TestCase; - -public class IteratorChainTest extends TestCase { +public class IteratorChainTest extends LuceneTestCase { private Iterator makeIterator(String marker,int howMany) { final List c = new ArrayList(); diff --git a/solr/src/test/org/apache/solr/common/util/NamedListTest.java b/solr/src/test/org/apache/solr/common/util/NamedListTest.java index 98da79174c9..50275eb984b 100644 --- a/solr/src/test/org/apache/solr/common/util/NamedListTest.java +++ b/solr/src/test/org/apache/solr/common/util/NamedListTest.java @@ -17,9 +17,9 @@ package org.apache.solr.common.util; -import junit.framework.TestCase; +import org.apache.lucene.util.LuceneTestCase; -public class NamedListTest extends TestCase { +public class NamedListTest extends LuceneTestCase { public void testRemove() { NamedList nl = new NamedList(); nl.add("key1", "value1"); diff --git a/solr/src/test/org/apache/solr/common/util/TestHash.java b/solr/src/test/org/apache/solr/common/util/TestHash.java index 0f850281317..6cae6aac7cb 100755 --- a/solr/src/test/org/apache/solr/common/util/TestHash.java +++ b/solr/src/test/org/apache/solr/common/util/TestHash.java @@ -17,14 +17,14 @@ package org.apache.solr.common.util; * limitations under the License. */ -import junit.framework.TestCase; +import org.apache.lucene.util.LuceneTestCase; import java.util.Random; /** Tests for lookup3ycs hash functions * @author yonik */ -public class TestHash extends TestCase { +public class TestHash extends LuceneTestCase { // Test that the java version produces the same output as the C version public void testEqualsLOOKUP3() { diff --git a/solr/src/test/org/apache/solr/common/util/TestNamedListCodec.java b/solr/src/test/org/apache/solr/common/util/TestNamedListCodec.java index 70a5adf224a..0d95d9c95db 100755 --- a/solr/src/test/org/apache/solr/common/util/TestNamedListCodec.java +++ b/solr/src/test/org/apache/solr/common/util/TestNamedListCodec.java @@ -16,6 +16,7 @@ */ package org.apache.solr.common.util; +import org.apache.lucene.util.LuceneTestCase; import org.apache.solr.common.SolrDocument; import org.apache.solr.common.SolrDocumentList; import org.apache.solr.TestDistributedSearch; @@ -28,9 +29,7 @@ import java.util.ArrayList; import java.util.Map; import java.util.HashMap; -import junit.framework.TestCase; - -public class TestNamedListCodec extends TestCase { +public class TestNamedListCodec extends LuceneTestCase { public void testSimple() throws Exception{ ByteArrayOutputStream baos = new ByteArrayOutputStream(); NamedList nl = new NamedList(); @@ -252,7 +251,7 @@ public class TestNamedListCodec extends TestCase { if (cmp != null) { System.out.println(nl); System.out.println(res); - TestCase.fail(cmp); + fail(cmp); } } } diff --git a/solr/src/test/org/apache/solr/common/util/TestXMLEscaping.java b/solr/src/test/org/apache/solr/common/util/TestXMLEscaping.java index 7229f045742..0f0901bca9d 100644 --- a/solr/src/test/org/apache/solr/common/util/TestXMLEscaping.java +++ b/solr/src/test/org/apache/solr/common/util/TestXMLEscaping.java @@ -17,17 +17,16 @@ package org.apache.solr.common.util; -import junit.framework.TestCase; - import java.io.IOException; import java.io.StringWriter; +import org.apache.lucene.util.LuceneTestCase; import org.apache.solr.common.util.XML; /** Test (some of the) character escaping functions of the XML class * $Id$ */ -public class TestXMLEscaping extends TestCase { +public class TestXMLEscaping extends LuceneTestCase { private void doSimpleTest(String input,String expectedOutput) throws IOException { final StringWriter sw = new StringWriter(); XML.escapeCharData(input, sw); diff --git a/solr/src/test/org/apache/solr/core/RAMDirectoryFactoryTest.java b/solr/src/test/org/apache/solr/core/RAMDirectoryFactoryTest.java index c5090a24d72..7d630a8601b 100644 --- a/solr/src/test/org/apache/solr/core/RAMDirectoryFactoryTest.java +++ b/solr/src/test/org/apache/solr/core/RAMDirectoryFactoryTest.java @@ -17,9 +17,9 @@ package org.apache.solr.core; -import junit.framework.TestCase; import org.apache.lucene.store.Directory; import org.apache.lucene.store.RAMDirectory; +import org.apache.lucene.util.LuceneTestCase; import org.easymock.EasyMock; import java.io.IOException; @@ -28,7 +28,7 @@ import java.io.File; /** * Test-case for RAMDirectoryFactory */ -public class RAMDirectoryFactoryTest extends TestCase { +public class RAMDirectoryFactoryTest extends LuceneTestCase { public void testOpenReturnsTheSameForSamePath() throws IOException { final Directory directory = new RefCntRamDirectory(); RAMDirectoryFactory factory = new RAMDirectoryFactory() { diff --git a/solr/src/test/org/apache/solr/core/ResourceLoaderTest.java b/solr/src/test/org/apache/solr/core/ResourceLoaderTest.java index 6f350023e7f..4891c30d09a 100644 --- a/solr/src/test/org/apache/solr/core/ResourceLoaderTest.java +++ b/solr/src/test/org/apache/solr/core/ResourceLoaderTest.java @@ -18,8 +18,8 @@ package org.apache.solr.core; import junit.framework.Assert; -import junit.framework.TestCase; +import org.apache.lucene.util.LuceneTestCase; import org.apache.solr.analysis.KeywordTokenizerFactory; import org.apache.solr.analysis.NGramFilterFactory; import org.apache.solr.common.SolrException; @@ -35,7 +35,7 @@ import java.nio.charset.CharacterCodingException; import java.util.Arrays; import java.util.List; -public class ResourceLoaderTest extends TestCase +public class ResourceLoaderTest extends LuceneTestCase { public void testInstanceDir() throws Exception { SolrResourceLoader loader = new SolrResourceLoader(null); diff --git a/solr/src/test/org/apache/solr/handler/JsonLoaderTest.java b/solr/src/test/org/apache/solr/handler/JsonLoaderTest.java index c4d3f710d83..bdbdb2e404c 100644 --- a/solr/src/test/org/apache/solr/handler/JsonLoaderTest.java +++ b/solr/src/test/org/apache/solr/handler/JsonLoaderTest.java @@ -21,9 +21,8 @@ import java.io.*; import java.util.ArrayList; import java.util.List; -import junit.framework.TestCase; - import org.apache.noggit.JSONParser; +import org.apache.lucene.util.LuceneTestCase; import org.apache.solr.common.SolrInputDocument; import org.apache.solr.common.SolrInputField; import org.apache.solr.update.AddUpdateCommand; @@ -32,7 +31,7 @@ import org.apache.solr.update.DeleteUpdateCommand; import org.apache.solr.update.RollbackUpdateCommand; import org.apache.solr.update.processor.UpdateRequestProcessor; -public class JsonLoaderTest extends TestCase { +public class JsonLoaderTest extends LuceneTestCase { static String input = ("{\n" + "\n" + diff --git a/solr/src/test/org/apache/solr/handler/admin/SystemInfoHandlerTest.java b/solr/src/test/org/apache/solr/handler/admin/SystemInfoHandlerTest.java index 9bab324069a..d4be9c9ed16 100644 --- a/solr/src/test/org/apache/solr/handler/admin/SystemInfoHandlerTest.java +++ b/solr/src/test/org/apache/solr/handler/admin/SystemInfoHandlerTest.java @@ -20,12 +20,11 @@ package org.apache.solr.handler.admin; import java.lang.management.ManagementFactory; import java.lang.management.OperatingSystemMXBean; -import junit.framework.TestCase; - +import org.apache.lucene.util.LuceneTestCase; import org.apache.solr.common.util.SimpleOrderedMap; -public class SystemInfoHandlerTest extends TestCase { +public class SystemInfoHandlerTest extends LuceneTestCase { public void testMagickGetter() { diff --git a/solr/src/test/org/apache/solr/schema/LegacyDateFieldTest.java b/solr/src/test/org/apache/solr/schema/LegacyDateFieldTest.java index 4d3e6bb8420..a14c6a58d23 100644 --- a/solr/src/test/org/apache/solr/schema/LegacyDateFieldTest.java +++ b/solr/src/test/org/apache/solr/schema/LegacyDateFieldTest.java @@ -20,15 +20,14 @@ package org.apache.solr.schema; 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 java.util.Date; import java.util.TimeZone; import java.util.Locale; import java.text.DateFormat; -import junit.framework.TestCase; - -public class LegacyDateFieldTest extends TestCase { +public class LegacyDateFieldTest extends LocalizedTestCase { // if and when this class is removed, make sure to refactor all // appropriate code to DateFieldTest diff --git a/solr/src/test/org/apache/solr/schema/UUIDFieldTest.java b/solr/src/test/org/apache/solr/schema/UUIDFieldTest.java index 255e0d32b36..58fd090ad07 100644 --- a/solr/src/test/org/apache/solr/schema/UUIDFieldTest.java +++ b/solr/src/test/org/apache/solr/schema/UUIDFieldTest.java @@ -16,11 +16,10 @@ */ package org.apache.solr.schema; -import junit.framework.TestCase; - +import org.apache.lucene.util.LuceneTestCase; import org.apache.solr.common.SolrException; -public class UUIDFieldTest extends TestCase { +public class UUIDFieldTest extends LuceneTestCase { public void testToInternal() { boolean ok = false; UUIDField uuidfield = new UUIDField(); diff --git a/solr/src/test/org/apache/solr/search/TestDocSet.java b/solr/src/test/org/apache/solr/search/TestDocSet.java index 5d8638ce0a8..f37b34fc87f 100644 --- a/solr/src/test/org/apache/solr/search/TestDocSet.java +++ b/solr/src/test/org/apache/solr/search/TestDocSet.java @@ -17,12 +17,11 @@ package org.apache.solr.search; -import junit.framework.TestCase; - import java.util.Random; import java.util.Arrays; import java.io.IOException; +import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.OpenBitSet; import org.apache.lucene.util.OpenBitSetIterator; import org.apache.lucene.index.IndexReader; @@ -35,7 +34,7 @@ import org.apache.lucene.search.DocIdSetIterator; /** * @version $Id$ */ -public class TestDocSet extends TestCase { +public class TestDocSet extends LuceneTestCase { Random rand = new Random(); float loadfactor; diff --git a/solr/src/test/org/apache/solr/search/TestFastLRUCache.java b/solr/src/test/org/apache/solr/search/TestFastLRUCache.java index a77b027c404..5733bf2b295 100644 --- a/solr/src/test/org/apache/solr/search/TestFastLRUCache.java +++ b/solr/src/test/org/apache/solr/search/TestFastLRUCache.java @@ -16,7 +16,7 @@ */ package org.apache.solr.search; -import junit.framework.TestCase; +import org.apache.lucene.util.LuceneTestCase; import org.apache.solr.common.util.NamedList; import org.apache.solr.common.util.ConcurrentLRUCache; @@ -35,7 +35,7 @@ import java.util.concurrent.atomic.AtomicInteger; * @see org.apache.solr.search.FastLRUCache * @since solr 1.4 */ -public class TestFastLRUCache extends TestCase { +public class TestFastLRUCache extends LuceneTestCase { public void testPercentageAutowarm() throws IOException { FastLRUCache fastCache = new FastLRUCache(); diff --git a/solr/src/test/org/apache/solr/search/TestLRUCache.java b/solr/src/test/org/apache/solr/search/TestLRUCache.java index f8c7d8d9fed..7439704f075 100644 --- a/solr/src/test/org/apache/solr/search/TestLRUCache.java +++ b/solr/src/test/org/apache/solr/search/TestLRUCache.java @@ -5,14 +5,13 @@ import java.io.Serializable; import java.util.HashMap; import java.util.Map; -import junit.framework.TestCase; - +import org.apache.lucene.util.LuceneTestCase; import org.apache.solr.common.util.NamedList; /** * Test for org.apache.solr.search.LRUCache */ -public class TestLRUCache extends TestCase { +public class TestLRUCache extends LuceneTestCase { public void testFullAutowarm() throws IOException { LRUCache lruCache = new LRUCache(); diff --git a/solr/src/test/org/apache/solr/util/DateMathParserTest.java b/solr/src/test/org/apache/solr/util/DateMathParserTest.java index 007010db693..ff48840db01 100644 --- a/solr/src/test/org/apache/solr/util/DateMathParserTest.java +++ b/solr/src/test/org/apache/solr/util/DateMathParserTest.java @@ -17,9 +17,9 @@ package org.apache.solr.util; +import org.apache.lucene.util.LocalizedTestCase; import org.apache.solr.util.DateMathParser; -import junit.framework.TestCase; import java.text.SimpleDateFormat; import java.text.DateFormat; import java.util.Calendar; @@ -34,7 +34,7 @@ import java.text.ParseException; /** * Tests that the functions in DateMathParser */ -public class DateMathParserTest extends TestCase { +public class DateMathParserTest extends LocalizedTestCase { public static TimeZone UTC = TimeZone.getTimeZone("UTC"); diff --git a/solr/src/test/org/apache/solr/util/TestNumberUtils.java b/solr/src/test/org/apache/solr/util/TestNumberUtils.java index f6051980e87..8eb8df4f4d8 100644 --- a/solr/src/test/org/apache/solr/util/TestNumberUtils.java +++ b/solr/src/test/org/apache/solr/util/TestNumberUtils.java @@ -17,6 +17,7 @@ package org.apache.solr.util; +import org.apache.lucene.util.LuceneTestCase; import org.apache.solr.util.NumberUtils; import org.apache.solr.util.BCDUtils; import org.junit.Assert; @@ -25,9 +26,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Random; -import junit.framework.TestCase; - -public class TestNumberUtils extends TestCase { +public class TestNumberUtils extends LuceneTestCase { private static String arrstr(char[] arr, int start, int end) { String str="["; diff --git a/solr/src/test/org/apache/solr/util/TestOpenBitSet.java b/solr/src/test/org/apache/solr/util/TestOpenBitSet.java index 45a38be638f..01dd4bed325 100644 --- a/solr/src/test/org/apache/solr/util/TestOpenBitSet.java +++ b/solr/src/test/org/apache/solr/util/TestOpenBitSet.java @@ -17,11 +17,10 @@ package org.apache.solr.util; -import junit.framework.TestCase; - import java.util.Random; import java.util.BitSet; +import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.OpenBitSetIterator; import org.apache.lucene.search.DocIdSetIterator; @@ -29,7 +28,7 @@ import org.apache.lucene.search.DocIdSetIterator; * @deprecated * @version $Id$ */ -public class TestOpenBitSet extends TestCase { +public class TestOpenBitSet extends LuceneTestCase { static Random rand = new Random(); void doGet(BitSet a, OpenBitSet b) { diff --git a/solr/src/test/org/apache/solr/util/TestUtils.java b/solr/src/test/org/apache/solr/util/TestUtils.java index 1ee2c068cf8..5b9179c21f5 100755 --- a/solr/src/test/org/apache/solr/util/TestUtils.java +++ b/solr/src/test/org/apache/solr/util/TestUtils.java @@ -17,13 +17,12 @@ package org.apache.solr.util; -import junit.framework.TestCase; - import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; +import org.apache.lucene.util.LuceneTestCase; import org.apache.solr.common.util.SimpleOrderedMap; import org.apache.solr.common.util.StrUtils; import org.junit.Assert; @@ -31,7 +30,7 @@ import org.junit.Assert; /** * @version $Id$ */ -public class TestUtils extends TestCase { +public class TestUtils extends LuceneTestCase { public static void testSplitEscaping() { List arr = StrUtils.splitSmart("\\r\\n:\\t\\f\\b", ":", true); assertEquals(2,arr.size());