mirror of https://github.com/apache/lucene.git
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:
parent
28fe2523d9
commit
78659bb804
|
@ -23,7 +23,6 @@ import java.util.Collections;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
|
||||||
|
|
||||||
import org.apache.lucene.analysis.WhitespaceAnalyzer;
|
import org.apache.lucene.analysis.WhitespaceAnalyzer;
|
||||||
import org.apache.lucene.document.Document;
|
import org.apache.lucene.document.Document;
|
||||||
|
@ -42,6 +41,24 @@ import org.apache.lucene.util._TestUtil;
|
||||||
|
|
||||||
public class TestIndexWriterReader extends LuceneTestCase {
|
public class TestIndexWriterReader extends LuceneTestCase {
|
||||||
static PrintStream infoStream;
|
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 {
|
public static int count(Term t, IndexReader r) throws IOException {
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
@ -259,7 +276,6 @@ public class TestIndexWriterReader extends LuceneTestCase {
|
||||||
final static int NUM_THREADS = 5;
|
final static int NUM_THREADS = 5;
|
||||||
final Thread[] threads = new Thread[NUM_THREADS];
|
final Thread[] threads = new Thread[NUM_THREADS];
|
||||||
IndexWriter mainWriter;
|
IndexWriter mainWriter;
|
||||||
AtomicInteger delCount = new AtomicInteger();
|
|
||||||
List deletedTerms = new ArrayList();
|
List deletedTerms = new ArrayList();
|
||||||
LinkedList toDeleteTerms = new LinkedList();
|
LinkedList toDeleteTerms = new LinkedList();
|
||||||
Random random;
|
Random random;
|
||||||
|
@ -329,8 +345,8 @@ public class TestIndexWriterReader extends LuceneTestCase {
|
||||||
final List failures = new ArrayList();
|
final List failures = new ArrayList();
|
||||||
IndexReader[] readers;
|
IndexReader[] readers;
|
||||||
boolean didClose = false;
|
boolean didClose = false;
|
||||||
AtomicInteger count = new AtomicInteger(0);
|
HeavyAtomicInt count = new HeavyAtomicInt(0);
|
||||||
AtomicInteger numAddIndexesNoOptimize = new AtomicInteger(0);
|
HeavyAtomicInt numAddIndexesNoOptimize = new HeavyAtomicInt(0);
|
||||||
|
|
||||||
public AddDirectoriesThreads(int numDirs, IndexWriter mainWriter) throws Throwable {
|
public AddDirectoriesThreads(int numDirs, IndexWriter mainWriter) throws Throwable {
|
||||||
this.numDirs = numDirs;
|
this.numDirs = numDirs;
|
||||||
|
|
|
@ -929,7 +929,7 @@ public class TestSort extends LuceneTestCase implements Serializable {
|
||||||
TopDocsCollector tdc = TopFieldCollector.create(sort[i], 10,
|
TopDocsCollector tdc = TopFieldCollector.create(sort[i], 10,
|
||||||
tfcOptions[j][0], tfcOptions[j][1], tfcOptions[j][2], false);
|
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);
|
full.search(bq, tdc);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue