[infinispan-dev] Test framework and cleanup

Vladimir Blagojevic vblagoje at redhat.com
Sat Oct 2 16:46:08 EDT 2010


Test suite fails now.

Test suite progress: tests succeeded: 133, failed: 1, skipped: 0.
[pool-2-thread-4] Test testWrongCacheModeConfiguration(org.infinispan.config.ConfigurationValidationTest) succeeded.
Test suite progress: tests succeeded: 134, failed: 1, skipped: 0.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!! (pool-2-thread-4) Exiting because config.ConfigurationValidationTest has NOT shut down all the cache managers it has started !!!!!!!
!!!!!! (pool-2-thread-4) The still-running cacheManager was created here: org.infinispan.config.ConfigurationValidationTest.testCacheModeConfiguration(ConfigurationValidationTest.java:57) !!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


On 2010-10-02, at 2:44 PM, Manik Surtani wrote:

> 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/java/org/infinispan/context/InvocationContextTest.java?r=1801#l48
> 
> 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 at jboss.org
> Lead, Infinispan
> Lead, JBoss Cache
> http://www.infinispan.org
> http://www.jbosscache.org
> 
> 
> 
> 
> 
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev

--
Vladimir Blagojevic
JBoss Clustering Team
JBoss, by Red Hat







More information about the infinispan-dev mailing list