mirror of https://github.com/apache/lucene.git
LUCENE-2652: remove obselete runners, they are inconsistent with @beforeClass and obselete in the build today
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1024219 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8a126cb9be
commit
41fe1b6d6a
|
@ -43,7 +43,6 @@ import org.apache.lucene.search.BooleanClause.Occur;
|
|||
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;
|
||||
|
@ -51,7 +50,6 @@ import java.text.DateFormat;
|
|||
import java.util.Calendar;
|
||||
import java.util.GregorianCalendar;
|
||||
|
||||
@RunWith(LuceneTestCase.LocalizedTestCaseRunner.class)
|
||||
public class TestPrecedenceQueryParser extends LuceneTestCase {
|
||||
public static Analyzer qpAnalyzer = new QPTestAnalyzer();
|
||||
|
||||
|
|
|
@ -76,7 +76,6 @@ 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
|
||||
|
@ -84,7 +83,6 @@ import org.junit.runner.RunWith;
|
|||
*
|
||||
* Tests QueryParser.
|
||||
*/
|
||||
@RunWith(LuceneTestCase.LocalizedTestCaseRunner.class)
|
||||
public class TestQPHelper extends LuceneTestCase {
|
||||
|
||||
public static Analyzer qpAnalyzer = new QPTestAnalyzer();
|
||||
|
|
|
@ -21,11 +21,9 @@ import java.io.IOException;
|
|||
import java.io.Reader;
|
||||
import java.text.Collator;
|
||||
import java.text.DateFormat;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
|
@ -72,7 +70,6 @@ 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
|
||||
|
@ -83,7 +80,6 @@ import org.junit.runner.RunWith;
|
|||
* @deprecated this entire test case tests QueryParserWrapper which is
|
||||
* deprecated. When QPW is gone, so will the test.
|
||||
*/
|
||||
@RunWith(LuceneTestCase.LocalizedTestCaseRunner.class)
|
||||
@Deprecated
|
||||
public class TestQueryParserWrapper extends LuceneTestCase {
|
||||
|
||||
|
|
|
@ -9,7 +9,6 @@ import java.util.TimeZone;
|
|||
import java.util.Locale;
|
||||
|
||||
import org.apache.lucene.util.LuceneTestCase;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -27,7 +26,6 @@ import org.junit.runner.RunWith;
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
@RunWith(LuceneTestCase.LocalizedTestCaseRunner.class)
|
||||
public class TestDateTools extends LuceneTestCase {
|
||||
|
||||
public void testStringToDate() throws ParseException {
|
||||
|
|
|
@ -41,7 +41,6 @@ import org.apache.lucene.store.Directory;
|
|||
import org.apache.lucene.util.BytesRef;
|
||||
import org.apache.lucene.util.LuceneTestCase;
|
||||
import org.apache.lucene.util.Version;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
// TODO: test multiple codecs here?
|
||||
|
||||
|
@ -60,7 +59,6 @@ import org.junit.runner.RunWith;
|
|||
// goes to 1 before next one known to exist
|
||||
// - skipTo(term)
|
||||
// - skipTo(doc)
|
||||
@RunWith(LuceneTestCase.MultiCodecTestCaseRunner.class)
|
||||
public class TestCodecs extends LuceneTestCase {
|
||||
private static String[] fieldNames = new String[] {"one", "two", "three", "four"};
|
||||
|
||||
|
|
|
@ -22,11 +22,9 @@ import org.apache.lucene.analysis.MockAnalyzer;
|
|||
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;
|
||||
|
||||
@RunWith(LuceneTestCase.MultiCodecTestCaseRunner.class)
|
||||
public class TestStressIndexing extends LuceneTestCase {
|
||||
private static abstract class TimedThread extends Thread {
|
||||
volatile boolean failed;
|
||||
|
|
|
@ -35,9 +35,7 @@ import org.apache.lucene.document.Fieldable;
|
|||
import org.apache.lucene.index.IndexWriterConfig.OpenMode;
|
||||
import org.apache.lucene.search.TermQuery;
|
||||
import org.apache.lucene.store.Directory;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
@RunWith(LuceneTestCase.MultiCodecTestCaseRunner.class)
|
||||
public class TestStressIndexing2 extends LuceneTestCase {
|
||||
static int maxFields=4;
|
||||
static int bigFieldSize=10;
|
||||
|
|
|
@ -20,11 +20,9 @@ package org.apache.lucene.messages;
|
|||
import java.util.Locale;
|
||||
|
||||
import org.apache.lucene.util.LuceneTestCase;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
/**
|
||||
*/
|
||||
@RunWith(LuceneTestCase.LocalizedTestCaseRunner.class)
|
||||
public class TestNLS extends LuceneTestCase {
|
||||
public void testMessageLoading() {
|
||||
Message invalidSyntax = new MessageImpl(
|
||||
|
|
|
@ -21,11 +21,9 @@ import java.io.IOException;
|
|||
import java.io.Reader;
|
||||
import java.text.Collator;
|
||||
import java.text.DateFormat;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.HashSet;
|
||||
import java.util.Locale;
|
||||
|
||||
import org.apache.lucene.analysis.Analyzer;
|
||||
|
@ -64,12 +62,10 @@ 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.
|
||||
*/
|
||||
@RunWith(LuceneTestCase.LocalizedTestCaseRunner.class)
|
||||
public class TestQueryParser extends LuceneTestCase {
|
||||
|
||||
public static Analyzer qpAnalyzer = new QPTestAnalyzer();
|
||||
|
|
|
@ -901,104 +901,4 @@ public abstract class LuceneTestCase extends Assert {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test runner for Lucene test classes that test Locale-sensitive behavior.
|
||||
* <p>
|
||||
* 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.
|
||||
* </p>
|
||||
*/
|
||||
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);
|
||||
}
|
||||
// FIXME see LUCENE-2652
|
||||
// @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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,16 +19,12 @@ 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.LuceneTestCase;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.TimeZone;
|
||||
import java.util.Locale;
|
||||
import java.text.DateFormat;
|
||||
|
||||
@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
|
||||
|
|
|
@ -19,7 +19,6 @@ package org.apache.solr.util;
|
|||
|
||||
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;
|
||||
|
@ -35,7 +34,6 @@ import java.text.ParseException;
|
|||
/**
|
||||
* Tests that the functions in DateMathParser
|
||||
*/
|
||||
@RunWith(LuceneTestCase.LocalizedTestCaseRunner.class)
|
||||
public class DateMathParserTest extends LuceneTestCase {
|
||||
|
||||
public static TimeZone UTC = TimeZone.getTimeZone("UTC");
|
||||
|
|
Loading…
Reference in New Issue