mirror of https://github.com/apache/lucene.git
LUCENE-2858: fix more tests
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene2858@1237349 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
25cb7a77dd
commit
caa766b847
|
@ -128,7 +128,7 @@ public class TestRollingUpdates extends LuceneTestCase {
|
|||
|
||||
public void run() {
|
||||
try {
|
||||
IndexReader open = null;
|
||||
DirectoryReader open = null;
|
||||
for (int i = 0; i < num; i++) {
|
||||
Document doc = new Document();// docs.nextDoc();
|
||||
doc.add(newField("id", "test", StringField.TYPE_UNSTORED));
|
||||
|
@ -137,7 +137,7 @@ public class TestRollingUpdates extends LuceneTestCase {
|
|||
if (open == null) {
|
||||
open = IndexReader.open(writer, true);
|
||||
}
|
||||
IndexReader reader = IndexReader.openIfChanged(open);
|
||||
DirectoryReader reader = DirectoryReader.openIfChanged(open);
|
||||
if (reader != null) {
|
||||
open.close();
|
||||
open = reader;
|
||||
|
|
|
@ -40,7 +40,7 @@ import org.apache.lucene.util.LuceneTestCase;
|
|||
import org.apache.lucene.util._TestUtil;
|
||||
|
||||
public class TestStressNRT extends LuceneTestCase {
|
||||
volatile IndexReader reader;
|
||||
volatile DirectoryReader reader;
|
||||
|
||||
final ConcurrentHashMap<Integer,Long> model = new ConcurrentHashMap<Integer,Long>();
|
||||
Map<Integer,Long> committedModel = new HashMap<Integer,Long>();
|
||||
|
@ -125,7 +125,7 @@ public class TestStressNRT extends LuceneTestCase {
|
|||
if (numCommitting.incrementAndGet() <= maxConcurrentCommits) {
|
||||
Map<Integer,Long> newCommittedModel;
|
||||
long version;
|
||||
IndexReader oldReader;
|
||||
DirectoryReader oldReader;
|
||||
|
||||
synchronized(TestStressNRT.this) {
|
||||
newCommittedModel = new HashMap<Integer,Long>(model); // take a snapshot
|
||||
|
@ -134,7 +134,7 @@ public class TestStressNRT extends LuceneTestCase {
|
|||
oldReader.incRef(); // increment the reference since we will use this for reopening
|
||||
}
|
||||
|
||||
IndexReader newReader;
|
||||
DirectoryReader newReader;
|
||||
if (rand.nextInt(100) < softCommitPercent) {
|
||||
// assertU(h.commit("softCommit","true"));
|
||||
if (random.nextBoolean()) {
|
||||
|
@ -146,7 +146,7 @@ public class TestStressNRT extends LuceneTestCase {
|
|||
if (VERBOSE) {
|
||||
System.out.println("TEST: " + Thread.currentThread().getName() + ": reopen reader=" + oldReader + " version=" + version);
|
||||
}
|
||||
newReader = IndexReader.openIfChanged(oldReader, writer.w, true);
|
||||
newReader = DirectoryReader.openIfChanged(oldReader, writer.w, true);
|
||||
}
|
||||
} else {
|
||||
// assertU(commit());
|
||||
|
@ -157,7 +157,7 @@ public class TestStressNRT extends LuceneTestCase {
|
|||
if (VERBOSE) {
|
||||
System.out.println("TEST: " + Thread.currentThread().getName() + ": now reopen after commit");
|
||||
}
|
||||
newReader = IndexReader.openIfChanged(oldReader);
|
||||
newReader = DirectoryReader.openIfChanged(oldReader);
|
||||
}
|
||||
|
||||
// Code below assumes newReader comes w/
|
||||
|
@ -306,7 +306,7 @@ public class TestStressNRT extends LuceneTestCase {
|
|||
// so when querying, we should first check the model, and then the index
|
||||
|
||||
long val;
|
||||
IndexReader r;
|
||||
DirectoryReader r;
|
||||
synchronized(TestStressNRT.this) {
|
||||
val = committedModel.get(id);
|
||||
r = reader;
|
||||
|
|
Loading…
Reference in New Issue