LUCENE-2677: Tests failing when run with tests.iter > 1

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1003747 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Simon Willnauer 2010-10-02 05:55:46 +00:00
parent c040dcb6e7
commit 487b062389
1 changed files with 15 additions and 0 deletions

View File

@ -17,13 +17,17 @@ package org.apache.lucene.search;
* limitations under the License. * limitations under the License.
*/ */
import java.util.Map;
import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.document.Document; import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field; import org.apache.lucene.document.Field;
import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.Term; import org.apache.lucene.index.Term;
import org.apache.lucene.search.FilterManager.FilterItem;
import org.apache.lucene.store.Directory; import org.apache.lucene.store.Directory;
import org.junit.AfterClass; import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.Test; import org.junit.Test;
@ -58,6 +62,17 @@ public class TestRemoteCachingWrapperFilter extends RemoteTestCase {
local = new IndexSearcher(indexStore, true); local = new IndexSearcher(indexStore, true);
startServer(local); startServer(local);
} }
@Before
public void setUp () throws Exception {
super.setUp();
// to support test iteration > 1
Map<Integer, FilterItem> cache = FilterManager.getInstance().cache;
synchronized(cache){
cache.clear();
}
}
@AfterClass @AfterClass
public static void afterClass() throws Exception { public static void afterClass() throws Exception {