mirror of https://github.com/apache/lucene.git
LUCENE-5666: fix test to assert from raw reader
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene5666@1594258 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
1489085807
commit
c58788c27a
|
@ -129,7 +129,7 @@ public class TestNRTOpen extends SolrTestCaseJ4 {
|
|||
static void assertNRT(int maxDoc) {
|
||||
RefCounted<SolrIndexSearcher> searcher = h.getCore().getSearcher();
|
||||
try {
|
||||
DirectoryReader ir = searcher.get().getIndexReader();
|
||||
DirectoryReader ir = searcher.get().getRawReader();
|
||||
assertEquals(maxDoc, ir.maxDoc());
|
||||
assertTrue("expected NRT reader, got: " + ir, ir.toString().contains(":nrt"));
|
||||
} finally {
|
||||
|
@ -141,7 +141,7 @@ public class TestNRTOpen extends SolrTestCaseJ4 {
|
|||
RefCounted<SolrIndexSearcher> searcher = h.getCore().getSearcher();
|
||||
Set<Object> set = Collections.newSetFromMap(new IdentityHashMap<Object,Boolean>());
|
||||
try {
|
||||
DirectoryReader ir = searcher.get().getIndexReader();
|
||||
DirectoryReader ir = searcher.get().getRawReader();
|
||||
for (AtomicReaderContext context : ir.leaves()) {
|
||||
set.add(context.reader().getCoreCacheKey());
|
||||
}
|
||||
|
|
|
@ -138,7 +138,7 @@ public class TestNonNRTOpen extends SolrTestCaseJ4 {
|
|||
RefCounted<SolrIndexSearcher> searcher = core.getSearcher();
|
||||
try {
|
||||
SolrIndexSearcher s = searcher.get();
|
||||
DirectoryReader ir = s.getIndexReader();
|
||||
DirectoryReader ir = s.getRawReader();
|
||||
assertEquals("SOLR-5815? : wrong maxDoc: core=" + core.toString() +" searcher=" + s.toString(),
|
||||
maxDoc, ir.maxDoc());
|
||||
assertFalse("SOLR-5815? : expected non-NRT reader, got: " + ir, ir.toString().contains(":nrt"));
|
||||
|
@ -151,7 +151,7 @@ public class TestNonNRTOpen extends SolrTestCaseJ4 {
|
|||
RefCounted<SolrIndexSearcher> searcher = h.getCore().getSearcher();
|
||||
Set<Object> set = Collections.newSetFromMap(new IdentityHashMap<Object,Boolean>());
|
||||
try {
|
||||
DirectoryReader ir = searcher.get().getIndexReader();
|
||||
DirectoryReader ir = searcher.get().getRawReader();
|
||||
for (AtomicReaderContext context : ir.leaves()) {
|
||||
set.add(context.reader().getCoreCacheKey());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue