From ab52c0d7ef6e66eb2a20d3542fb83ee4b0864d9c Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Thu, 19 Jan 2012 18:33:56 +0000 Subject: [PATCH] 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 --- .../java/org/apache/lucene/util/LuceneTestCase.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lucene/src/test-framework/java/org/apache/lucene/util/LuceneTestCase.java b/lucene/src/test-framework/java/org/apache/lucene/util/LuceneTestCase.java index 45ecb5c34bd..1b2aa3f4884 100644 --- a/lucene/src/test-framework/java/org/apache/lucene/util/LuceneTestCase.java +++ b/lucene/src/test-framework/java/org/apache/lucene/util/LuceneTestCase.java @@ -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();