diff --git a/src/test/org/apache/lucene/analysis/BaseTokenStreamTestCase.java b/src/test/org/apache/lucene/analysis/BaseTokenStreamTestCase.java index e814e60a8ba..1bd2c1099e9 100644 --- a/src/test/org/apache/lucene/analysis/BaseTokenStreamTestCase.java +++ b/src/test/org/apache/lucene/analysis/BaseTokenStreamTestCase.java @@ -58,6 +58,12 @@ public abstract class BaseTokenStreamTestCase extends LuceneTestCase { TokenStream.setOnlyUseNewAPI(onlyUseNewAPI); } + // @Override + protected void tearDown() throws Exception { + TokenStream.setOnlyUseNewAPI(false); + super.tearDown(); + } + // @Override public void runBare() throws Throwable { // Do the test with onlyUseNewAPI=false (default) @@ -65,7 +71,7 @@ public abstract class BaseTokenStreamTestCase extends LuceneTestCase { onlyUseNewAPI = false; super.runBare(); } catch (Throwable e) { - System.out.println("Test failure of "+getName()+" occurred with onlyUseNewAPI=false"); + System.out.println("Test failure of '"+getName()+"' occurred with onlyUseNewAPI=false"); throw e; } @@ -75,7 +81,7 @@ public abstract class BaseTokenStreamTestCase extends LuceneTestCase { onlyUseNewAPI = true; super.runBare(); } catch (Throwable e) { - System.out.println("Test failure of "+getName()+" occurred with onlyUseNewAPI=true"); + System.out.println("Test failure of '"+getName()+"' occurred with onlyUseNewAPI=true"); throw e; } }