HHH-6015 - Investigate hibernate-infinispan test failures
Some tests were relying on empty caches at the start, so make sure these are clear.
This commit is contained in:
parent
29a90c3aa8
commit
5c8e4f195d
|
@ -121,7 +121,7 @@ public class BasicJdbcTransactionalTestCase extends SingleNodeTestCase {
|
|||
|
||||
@Test
|
||||
public void testEmptySecondLevelCacheEntry() throws Exception {
|
||||
sessionFactory().getCache().evictEntityRegion( Item.class.getName() );
|
||||
sessionFactory().getCache().evictCollectionRegion( Item.class.getName() + ".items" );
|
||||
Statistics stats = sessionFactory().getStatistics();
|
||||
stats.clear();
|
||||
SecondLevelCacheStatistics statistics = stats.getSecondLevelCacheStatistics( Item.class.getName() + ".items" );
|
||||
|
|
|
@ -433,7 +433,7 @@ public class BasicTransactionalTestCase extends SingleNodeTestCase {
|
|||
|
||||
@Test
|
||||
public void testEmptySecondLevelCacheEntry() throws Exception {
|
||||
sessionFactory().getCache().evictEntityRegion( Item.class.getName() );
|
||||
sessionFactory().getCache().evictCollectionRegion( Item.class.getName() + ".items" );
|
||||
Statistics stats = sessionFactory().getStatistics();
|
||||
stats.clear();
|
||||
SecondLevelCacheStatistics statistics = stats.getSecondLevelCacheStatistics( Item.class.getName() + ".items" );
|
||||
|
|
|
@ -25,6 +25,7 @@ package org.hibernate.test.cache.infinispan.functional.classloader;
|
|||
|
||||
import javax.transaction.TransactionManager;
|
||||
|
||||
import org.hibernate.test.cache.infinispan.functional.Item;
|
||||
import org.infinispan.Cache;
|
||||
import org.infinispan.manager.CacheContainer;
|
||||
import org.infinispan.manager.EmbeddedCacheManager;
|
||||
|
@ -116,6 +117,8 @@ public class IsolatedClassLoaderTest extends DualNodeTestCase {
|
|||
@Override
|
||||
protected void cleanupTest() throws Exception {
|
||||
try {
|
||||
// Clear the local account cache
|
||||
sessionFactory().getCache().evictEntityRegion(Account.class.getName());
|
||||
if ( localQueryCache != null && localQueryListener != null ) {
|
||||
localQueryCache.removeListener( localQueryListener );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue