[infinispan-dev] Creating cache managers in your unit tests

Sanne Grinovero sanne.grinovero at gmail.com
Tue Dec 29 05:38:55 EST 2009


Thanks for looking into this, I was a bit worried about the testsuite
as I'm still unable to build properly.

The ChannelLookupTest mentioned before was always failing because the
testsuite was overriding the setTransportProperties,
I've changed the TestCacheManagerFactory.createCacheManager to add
transport properties instead of replacing them,
fixing the test.

I'm down to 1 build error now:
Failed tests:
  testTransactional(org.infinispan.distribution.rehash.ConcurrentJoinTest)

Tests run: 686, Failures: 1, Errors: 0, Skipped: 0

Cheers,
Sanne

2009/12/29 Vladimir Blagojevic <vblagoje at redhat.com>:
> The main problem remains unresolved: creating cache managers, using
> them, and not cleaning up. Have a look at ChannelLookupTest. Are you
> familiar with this one :)?
>
>
> On 09-12-24 3:18 PM, Manik Surtani wrote:
>> Guys,
>>
>> as far as possible, please extend either SingleCacheManagerTest [1] or MultipleCacheManagersTest [2]. and use the corresponding helper methods there to create a new CacheManager.  Alternatively, if you have a unit test that needs to create its own CacheManager directly, please use TestCacheManagerFactory [3].  Do *not* use "new DefaultCacheManager()" directly since this means the framework does not have a chance to alter config settings to work within the framework, including clustering settings to make sure the test does not interfere with other tests, threadpool settings to prevent unnecessary OOMs when running the entire suite with thousands of cache managers, etc.
>>
>> I have just fixed a bunch of offending tests [4], and updated the wiki page [5] on writing tests accordingly.  Please follow these guidelines.
>>
>> Cheers&  Happy X'mas!
>> Manik
>>
>> [1] http://fisheye.jboss.org/browse/Infinispan/trunk/core/src/test/java/org/infinispan/test/SingleCacheManagerTest.java?r=1216
>> [2] http://fisheye.jboss.org/browse/Infinispan/trunk/core/src/test/java/org/infinispan/test/MultipleCacheManagersTest.java?r=1216
>> [3] http://fisheye.jboss.org/browse/Infinispan/trunk/core/src/test/java/org/infinispan/test/fwk/TestCacheManagerFactory.java?r=1327
>> [4] http://fisheye.jboss.org/changelog/Infinispan/trunk?cs=1327
>> [5] http://community.jboss.org/wiki/ParallelTestSuite
>>
>>
>> --
>> 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
>>
>
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>




More information about the infinispan-dev mailing list