public class TestRuleFieldCacheSanity extends Object implements org.junit.rules.TestRule
calling assertSaneFieldCaches here isn't as useful as having test classes call it directly from the scope where the index readers are used, because they could be gc'ed just before this tearDown method is called.
But it's better then nothing.
If you are testing functionality that you know for a fact "violates" FieldCache sanity, then you should either explicitly call purgeFieldCache at the end of your test method, or refactor your Test class so that the inconsistent FieldCache usages are isolated in distinct test methods
FieldCacheSanityChecker
Constructor and Description |
---|
TestRuleFieldCacheSanity() |
public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement s, Description d)
apply
in interface org.junit.rules.TestRule
Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.