mirror of https://github.com/apache/lucene.git
Move newDirectory() creation to before, otherwise if something happens prior to before/after rule being invoked, the directory wouldn't be closed/ cleaned up properly.
This commit is contained in:
parent
39c4cb3d92
commit
128fd9a4ff
|
@ -39,7 +39,7 @@ public class TestLazyDocument extends LuceneTestCase {
|
||||||
{ "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k" };
|
{ "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k" };
|
||||||
public final int NUM_VALUES = atLeast(100);
|
public final int NUM_VALUES = atLeast(100);
|
||||||
|
|
||||||
public Directory dir = newDirectory();
|
public Directory dir;
|
||||||
|
|
||||||
@After
|
@After
|
||||||
public void removeIndex() {
|
public void removeIndex() {
|
||||||
|
@ -53,6 +53,7 @@ public class TestLazyDocument extends LuceneTestCase {
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void createIndex() throws Exception {
|
public void createIndex() throws Exception {
|
||||||
|
dir = newDirectory();
|
||||||
|
|
||||||
Analyzer analyzer = new MockAnalyzer(random());
|
Analyzer analyzer = new MockAnalyzer(random());
|
||||||
IndexWriter writer = new IndexWriter
|
IndexWriter writer = new IndexWriter
|
||||||
|
|
Loading…
Reference in New Issue