Fix broken functional tests
git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@14498 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
parent
77cdbee8c3
commit
8fadc62c64
|
@ -56,7 +56,7 @@ public abstract class AbstractEntityCacheFunctionalTestCase extends CacheTestCas
|
|||
getSessions().evictEntity(Item.class.getName());
|
||||
Statistics stats = getSessions().getStatistics();
|
||||
stats.clear();
|
||||
SecondLevelCacheStatistics statistics = stats.getSecondLevelCacheStatistics(Item.class.getName());
|
||||
SecondLevelCacheStatistics statistics = stats.getSecondLevelCacheStatistics(getPrefixedRegionName(Item.class.getName()));
|
||||
Map cacheEntries = statistics.getEntries();
|
||||
assertEquals(0, cacheEntries.size());
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ public abstract class AbstractEntityCacheFunctionalTestCase extends CacheTestCas
|
|||
|
||||
// check the version value in the cache...
|
||||
SecondLevelCacheStatistics slcs = sfi().getStatistics().getSecondLevelCacheStatistics(
|
||||
VersionedItem.class.getName());
|
||||
getPrefixedRegionName(VersionedItem.class.getName()));
|
||||
|
||||
Object entry = slcs.getEntries().get(item.getId());
|
||||
Long cachedVersionValue;
|
||||
|
|
|
@ -63,7 +63,7 @@ public abstract class AbstractQueryCacheFunctionalTestCase extends AbstractEntit
|
|||
s.close();
|
||||
|
||||
SecondLevelCacheStatistics slcs = s.getSessionFactory().getStatistics().getSecondLevelCacheStatistics(
|
||||
Item.class.getName());
|
||||
getPrefixedRegionName(Item.class.getName()));
|
||||
|
||||
assertEquals(slcs.getPutCount(), 1);
|
||||
assertEquals(slcs.getElementCountInMemory(), 1);
|
||||
|
|
|
@ -84,6 +84,12 @@ public abstract class CacheTestCaseBase extends FunctionalTestCase {
|
|||
return "test";
|
||||
}
|
||||
|
||||
protected String getPrefixedRegionName(String regionName)
|
||||
{
|
||||
String prefix = getRegionPrefix() == null ? "" : getRegionPrefix() + ".";
|
||||
return prefix + regionName;
|
||||
}
|
||||
|
||||
public String getCacheConcurrencyStrategy() {
|
||||
return "transactional";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue