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:
Brian Stansberry 2008-04-08 02:33:26 +00:00
parent 77cdbee8c3
commit 8fadc62c64
3 changed files with 9 additions and 3 deletions

View File

@ -56,7 +56,7 @@ public abstract class AbstractEntityCacheFunctionalTestCase extends CacheTestCas
getSessions().evictEntity(Item.class.getName()); getSessions().evictEntity(Item.class.getName());
Statistics stats = getSessions().getStatistics(); Statistics stats = getSessions().getStatistics();
stats.clear(); stats.clear();
SecondLevelCacheStatistics statistics = stats.getSecondLevelCacheStatistics(Item.class.getName()); SecondLevelCacheStatistics statistics = stats.getSecondLevelCacheStatistics(getPrefixedRegionName(Item.class.getName()));
Map cacheEntries = statistics.getEntries(); Map cacheEntries = statistics.getEntries();
assertEquals(0, cacheEntries.size()); assertEquals(0, cacheEntries.size());
} }
@ -102,7 +102,7 @@ public abstract class AbstractEntityCacheFunctionalTestCase extends CacheTestCas
// check the version value in the cache... // check the version value in the cache...
SecondLevelCacheStatistics slcs = sfi().getStatistics().getSecondLevelCacheStatistics( SecondLevelCacheStatistics slcs = sfi().getStatistics().getSecondLevelCacheStatistics(
VersionedItem.class.getName()); getPrefixedRegionName(VersionedItem.class.getName()));
Object entry = slcs.getEntries().get(item.getId()); Object entry = slcs.getEntries().get(item.getId());
Long cachedVersionValue; Long cachedVersionValue;

View File

@ -63,7 +63,7 @@ public abstract class AbstractQueryCacheFunctionalTestCase extends AbstractEntit
s.close(); s.close();
SecondLevelCacheStatistics slcs = s.getSessionFactory().getStatistics().getSecondLevelCacheStatistics( SecondLevelCacheStatistics slcs = s.getSessionFactory().getStatistics().getSecondLevelCacheStatistics(
Item.class.getName()); getPrefixedRegionName(Item.class.getName()));
assertEquals(slcs.getPutCount(), 1); assertEquals(slcs.getPutCount(), 1);
assertEquals(slcs.getElementCountInMemory(), 1); assertEquals(slcs.getElementCountInMemory(), 1);

View File

@ -83,6 +83,12 @@ public abstract class CacheTestCaseBase extends FunctionalTestCase {
protected String getRegionPrefix() { protected String getRegionPrefix() {
return "test"; return "test";
} }
protected String getPrefixedRegionName(String regionName)
{
String prefix = getRegionPrefix() == null ? "" : getRegionPrefix() + ".";
return prefix + regionName;
}
public String getCacheConcurrencyStrategy() { public String getCacheConcurrencyStrategy() {
return "transactional"; return "transactional";