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
|
@Test
|
||||||
public void testEmptySecondLevelCacheEntry() throws Exception {
|
public void testEmptySecondLevelCacheEntry() throws Exception {
|
||||||
sessionFactory().getCache().evictEntityRegion( Item.class.getName() );
|
sessionFactory().getCache().evictCollectionRegion( Item.class.getName() + ".items" );
|
||||||
Statistics stats = sessionFactory().getStatistics();
|
Statistics stats = sessionFactory().getStatistics();
|
||||||
stats.clear();
|
stats.clear();
|
||||||
SecondLevelCacheStatistics statistics = stats.getSecondLevelCacheStatistics( Item.class.getName() + ".items" );
|
SecondLevelCacheStatistics statistics = stats.getSecondLevelCacheStatistics( Item.class.getName() + ".items" );
|
||||||
|
|
|
@ -433,7 +433,7 @@ public class BasicTransactionalTestCase extends SingleNodeTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testEmptySecondLevelCacheEntry() throws Exception {
|
public void testEmptySecondLevelCacheEntry() throws Exception {
|
||||||
sessionFactory().getCache().evictEntityRegion( Item.class.getName() );
|
sessionFactory().getCache().evictCollectionRegion( Item.class.getName() + ".items" );
|
||||||
Statistics stats = sessionFactory().getStatistics();
|
Statistics stats = sessionFactory().getStatistics();
|
||||||
stats.clear();
|
stats.clear();
|
||||||
SecondLevelCacheStatistics statistics = stats.getSecondLevelCacheStatistics( Item.class.getName() + ".items" );
|
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 javax.transaction.TransactionManager;
|
||||||
|
|
||||||
|
import org.hibernate.test.cache.infinispan.functional.Item;
|
||||||
import org.infinispan.Cache;
|
import org.infinispan.Cache;
|
||||||
import org.infinispan.manager.CacheContainer;
|
import org.infinispan.manager.CacheContainer;
|
||||||
import org.infinispan.manager.EmbeddedCacheManager;
|
import org.infinispan.manager.EmbeddedCacheManager;
|
||||||
|
@ -116,6 +117,8 @@ public class IsolatedClassLoaderTest extends DualNodeTestCase {
|
||||||
@Override
|
@Override
|
||||||
protected void cleanupTest() throws Exception {
|
protected void cleanupTest() throws Exception {
|
||||||
try {
|
try {
|
||||||
|
// Clear the local account cache
|
||||||
|
sessionFactory().getCache().evictEntityRegion(Account.class.getName());
|
||||||
if ( localQueryCache != null && localQueryListener != null ) {
|
if ( localQueryCache != null && localQueryListener != null ) {
|
||||||
localQueryCache.removeListener( localQueryListener );
|
localQueryCache.removeListener( localQueryListener );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue