Apache Lucene open-source search software
Cleanup on tearDown to really reset the TokenStream API to the default
Uwe Schindler22311453db66
diff --git a/src/test/org/apache/lucene/analysis/BaseTokenStreamTestCase.java b/src/test/org/apache/lucene/analysis/BaseTokenStreamTestCase.javaindex 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();+ }+// @Overridepublic 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;}}