Add assume to test since it only works with mmap directory

This commit is contained in:
Simon Willnauer 2019-03-21 14:20:23 +01:00
parent 6222abf448
commit 65e1b3ef2a
1 changed files with 3 additions and 1 deletions

View File

@ -40,6 +40,7 @@ import org.apache.lucene.index.LeafReaderContext;
import org.apache.lucene.index.Term;
import org.apache.lucene.store.ByteArrayDataInput;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.FSDirectory;
import org.apache.lucene.store.IOContext;
import org.apache.lucene.store.IndexInput;
import org.apache.lucene.store.IndexOutput;
@ -60,7 +61,8 @@ public class TestBlockPostingsFormat extends BasePostingsFormatTestCase {
public void testFstOffHeap() throws IOException {
Path tempDir = createTempDir();
try (Directory d = MMapDirectory.open(tempDir)) {
try (Directory d = FSDirectory.open(tempDir)) {
assumeTrue("only works with mmap directory", d instanceof MMapDirectory);
try (IndexWriter w = new IndexWriter(d, new IndexWriterConfig(new MockAnalyzer(random())))) {
DirectoryReader readerFromWriter = DirectoryReader.open(w);
for (int i = 0; i < 50; i++) {