LUCENE-1655: get unit tests back to 1.4 only

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@778024 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2009-05-23 21:00:03 +00:00
parent 28fe2523d9
commit 78659bb804
2 changed files with 21 additions and 5 deletions

View File

@ -23,7 +23,6 @@ import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.Random;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.lucene.analysis.WhitespaceAnalyzer;
import org.apache.lucene.document.Document;
@ -43,6 +42,24 @@ import org.apache.lucene.util._TestUtil;
public class TestIndexWriterReader extends LuceneTestCase {
static PrintStream infoStream;
private static class HeavyAtomicInt {
private int value;
public HeavyAtomicInt(int start) {
value = start;
}
public synchronized int addAndGet(int inc) {
value += inc;
return value;
}
public synchronized int incrementAndGet() {
value++;
return value;
}
public synchronized int intValue() {
return value;
}
}
public static int count(Term t, IndexReader r) throws IOException {
int count = 0;
TermDocs td = r.termDocs(t);
@ -259,7 +276,6 @@ public class TestIndexWriterReader extends LuceneTestCase {
final static int NUM_THREADS = 5;
final Thread[] threads = new Thread[NUM_THREADS];
IndexWriter mainWriter;
AtomicInteger delCount = new AtomicInteger();
List deletedTerms = new ArrayList();
LinkedList toDeleteTerms = new LinkedList();
Random random;
@ -329,8 +345,8 @@ public class TestIndexWriterReader extends LuceneTestCase {
final List failures = new ArrayList();
IndexReader[] readers;
boolean didClose = false;
AtomicInteger count = new AtomicInteger(0);
AtomicInteger numAddIndexesNoOptimize = new AtomicInteger(0);
HeavyAtomicInt count = new HeavyAtomicInt(0);
HeavyAtomicInt numAddIndexesNoOptimize = new HeavyAtomicInt(0);
public AddDirectoriesThreads(int numDirs, IndexWriter mainWriter) throws Throwable {
this.numDirs = numDirs;

View File

@ -929,7 +929,7 @@ public class TestSort extends LuceneTestCase implements Serializable {
TopDocsCollector tdc = TopFieldCollector.create(sort[i], 10,
tfcOptions[j][0], tfcOptions[j][1], tfcOptions[j][2], false);
assertEquals(actualTFCClasses[j], tdc.getClass().getSimpleName());
assertTrue(tdc.getClass().getName().endsWith("$"+actualTFCClasses[j]));
full.search(bq, tdc);