if classpath is wrong for preflex-rw, throw an exception up front

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1233520 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2012-01-19 18:33:56 +00:00
parent 3c6d62edbb
commit ab52c0d7ef
1 changed files with 2 additions and 1 deletions

View File

@ -283,7 +283,8 @@ public abstract class LuceneTestCase extends Assert {
int randomVal = random.nextInt(10);
if ("Lucene3x".equals(TEST_CODEC) || ("random".equals(TEST_CODEC) && randomVal < 2)) { // preflex-only setup
codec = new PreFlexRWCodec();
codec = Codec.forName("Lucene3x");
assert (codec instanceof PreFlexRWCodec) : "fix your classpath to have tests-framework.jar before lucene-core.jar";
PREFLEX_IMPERSONATION_IS_ACTIVE = true;
} else if ("SimpleText".equals(TEST_CODEC) || ("random".equals(TEST_CODEC) && randomVal == 9)) {
codec = new SimpleTextCodec();