mirror of https://github.com/apache/lucene.git
don't use package private API to assert no unreferenced files
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1056409 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f70b9571a9
commit
602a4e906a
|
@ -981,6 +981,7 @@ public class TestIndexReader extends LuceneTestCase
|
|||
// new IndexFileDeleter, have it delete
|
||||
// unreferenced files, then verify that in fact
|
||||
// no files were deleted:
|
||||
IndexWriter.unlock(dir);
|
||||
TestIndexWriter.assertNoUnreferencedFiles(dir, "reader.close() failed to delete unreferenced files");
|
||||
|
||||
// Finally, verify index is not corrupt, and, if
|
||||
|
|
|
@ -43,7 +43,6 @@ import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
|
|||
import org.apache.lucene.document.Document;
|
||||
import org.apache.lucene.document.Field;
|
||||
import org.apache.lucene.document.Fieldable;
|
||||
import org.apache.lucene.index.codecs.CodecProvider;
|
||||
import org.apache.lucene.document.Field.Index;
|
||||
import org.apache.lucene.document.Field.Store;
|
||||
import org.apache.lucene.document.Field.TermVector;
|
||||
|
@ -157,7 +156,7 @@ public class TestIndexWriter extends LuceneTestCase {
|
|||
String[] startFiles = dir.listAll();
|
||||
SegmentInfos infos = new SegmentInfos();
|
||||
infos.read(dir);
|
||||
new IndexFileDeleter(dir, new KeepOnlyLastCommitDeletionPolicy(), infos, null, CodecProvider.getDefault());
|
||||
new IndexWriter(dir, new IndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer())).rollback();
|
||||
String[] endFiles = dir.listAll();
|
||||
|
||||
Arrays.sort(startFiles);
|
||||
|
|
|
@ -832,8 +832,8 @@ public class TestIndexWriterDelete extends LuceneTestCase {
|
|||
}
|
||||
}
|
||||
|
||||
TestIndexWriter.assertNoUnreferencedFiles(dir, "docsWriter.abort() failed to delete unreferenced files");
|
||||
modifier.close();
|
||||
TestIndexWriter.assertNoUnreferencedFiles(dir, "docsWriter.abort() failed to delete unreferenced files");
|
||||
dir.close();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue