Currently unit tests extending SingleCacheManagerTest or MultipleCacheManagerTest are
cleaned up either after every test method or after all of the test methods declared in a
test class, based on the value of the "cleanup" field which can be either
CleanupPhase.AFTER_TEST or CleanupPhase.AFTER_METHOD. This is typically set in the
constructor of a test class. E.g.,
http://fisheye.jboss.org/browse/Infinispan/branches/4.2.x/core/src/test/j...
To simplify this even further, I have added 2 annotations to the test framework:
@CleanupAfterTest and @CleanupAfterMethod. Instead of setting the "cleanup"
field in a constructor, you can now just annotate your test class accordingly. E.g.,
@Test (... )
@CleanupAfterMethod
public class MyTest extends SingleCacheManagerTest {
...
}
Note that the "old" pattern of setting "cleanup" will also work; using
the annotation just makes tests more concise and readable.
Enjoy
Manik
--
Manik Surtani
manik(a)jboss.org
Lead, Infinispan
Lead, JBoss Cache
http://www.infinispan.org
http://www.jbosscache.org