LUCENE-5577: the cleanup code didn't cleanup after itself...

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1585053 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dawid Weiss 2014-04-05 11:45:22 +00:00
parent f8c0e119ba
commit a0e6d12d00
1 changed files with 35 additions and 25 deletions

View File

@ -2337,8 +2337,15 @@ public abstract class LuceneTestCase extends Assert {
}
private static class TemporaryFilesCleanupRule extends TestRuleAdapter {
@Override
protected void before() throws Throwable {
super.before();
assert tempDirBase == null;
}
@Override
protected void afterAlways(List<Throwable> errors) throws Throwable {
try {
if (LuceneTestCase.suiteFailureMarker.wasSuccessful()) {
synchronized (cleanupQueue) {
File [] everything = new File [cleanupQueue.size()];
@ -2368,6 +2375,9 @@ public abstract class LuceneTestCase extends Assert {
}
}
}
} finally {
tempDirBase = null;
}
}
}
}