Added DisposeAfterSuite/DisposeAfterTest feature to test framework #1096
+333
−265
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added DisposeAfterSuite/DisposeAfterTest feature to test framework
Fixes #1094
Description
This adds the
LuceneTestCase.DisposeAfterTest()
andLuceneTestCase.DisposeAfterSuite()
methods to the test framework that exist in Lucene 4.8.0.It also removes the
LuceneTestCase.SuiteFailureMarker
property that wasn't implemented. NUnit already tracks the result state of the tests inNUnit.Framework.Internal.TestExectionContext.CurrentContext.TestResult.ResultState
andNUnit.Framework.TestContext.CurrentContext.Result.Outcome
in a context-sensitive and thread safe manner, so there is no need to reinvent the wheel with this. For the same reason, we don't need theTestFailureMarker
property orTestRuleMarkFailure
class, which are all part of this feature.The new feature also revealed that there were some directories that were not being disposed in
Lucene.Net.Tests.Grouping
which were also addressed.For some reason
TestFsts.TestRealTerms()
does not reliably cleanup its line file docs temp file on Windows, so this adds the[SuppressTempFileChecks]
attribute to suppress the issue when it happens (for now). At some point we should have a look at this, but it is not a blocker for the release.