sometimes wrap readers with slow/parallel/etc in TestDuelingCodecs

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1291718 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2012-02-21 11:34:49 +00:00
parent 546ec4b1be
commit 20be846536
1 changed files with 10 additions and 2 deletions

View File

@ -29,6 +29,7 @@ import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.codecs.Codec;
import org.apache.lucene.document.Document;
import org.apache.lucene.search.DocIdSetIterator;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.Bits;
import org.apache.lucene.util.BytesRef;
@ -96,9 +97,10 @@ public class TestDuelingCodecs extends LuceneTestCase {
createRandomIndex(numdocs, leftWriter, seed);
createRandomIndex(numdocs, rightWriter, seed);
leftReader = leftWriter.getReader();
// TODO: maybe we should do this wrapping in another test?
leftReader = maybeWrap(leftWriter.getReader());
leftWriter.close();
rightReader = rightWriter.getReader();
rightReader = maybeWrap(rightWriter.getReader());
rightWriter.close();
info = "left: " + leftCodec.toString() + " / right: " + rightCodec.toString();
@ -114,6 +116,12 @@ public class TestDuelingCodecs extends LuceneTestCase {
super.tearDown();
}
static IndexReader maybeWrap(IndexReader other) throws IOException {
// TODO: bogus how we do this
IndexSearcher is = newSearcher(other);
return is.getIndexReader();
}
/**
* populates a writer with random stuff. this must be fully reproducable with the seed!
*/