[TEST] make LuceneTest extraFS proof
This commit is contained in:
parent
9e82d3e7b9
commit
fe7d018f0c
|
@ -144,8 +144,11 @@ public class LuceneTest extends ElasticsearchTestCase {
|
||||||
}
|
}
|
||||||
Lucene.cleanLuceneIndex(dir);
|
Lucene.cleanLuceneIndex(dir);
|
||||||
if (dir.listAll().length > 0) {
|
if (dir.listAll().length > 0) {
|
||||||
assertEquals(dir.listAll().length, 1);
|
for (String file : dir.listAll()) {
|
||||||
assertEquals(dir.listAll()[0], "write.lock");
|
if (file.startsWith("extra") == false) {
|
||||||
|
assertEquals(file, "write.lock");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
dir.close();
|
dir.close();
|
||||||
}
|
}
|
||||||
|
@ -200,7 +203,7 @@ public class LuceneTest extends ElasticsearchTestCase {
|
||||||
assertEquals(s.search(new TermQuery(new Term("id", "4")), 1).totalHits, 0);
|
assertEquals(s.search(new TermQuery(new Term("id", "4")), 1).totalHits, 0);
|
||||||
|
|
||||||
for (String file : dir.listAll()) {
|
for (String file : dir.listAll()) {
|
||||||
assertFalse("unexpected file: " + file, file.equals("segments_3") || file.startsWith("_2"));
|
assertFalse("unexpected file: " + file, file.equals("segments_3") || file.startsWith("_2") || file.startsWith("extra"));
|
||||||
}
|
}
|
||||||
open.close();
|
open.close();
|
||||||
dir.close();
|
dir.close();
|
||||||
|
|
Loading…
Reference in New Issue