diff --git a/entitymanager/src/test/java/org/hibernate/ejb/test/cacheable/annotation/ConfigurationTest.java b/entitymanager/src/test/java/org/hibernate/ejb/test/cacheable/annotation/ConfigurationTest.java index c518919303..f3d515ed6a 100644 --- a/entitymanager/src/test/java/org/hibernate/ejb/test/cacheable/annotation/ConfigurationTest.java +++ b/entitymanager/src/test/java/org/hibernate/ejb/test/cacheable/annotation/ConfigurationTest.java @@ -26,6 +26,9 @@ package org.hibernate.ejb.test.cacheable.annotation; import java.util.Properties; import javax.persistence.SharedCacheMode; +import org.hibernate.cache.access.AccessType; +import org.hibernate.cache.impl.NoCachingRegionFactory; +import org.hibernate.cfg.Environment; import org.hibernate.ejb.AvailableSettings; import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.junit.UnitTestCase; @@ -109,6 +112,7 @@ public class ConfigurationTest extends UnitTestCase { private Ejb3Configuration buildConfiguration(SharedCacheMode mode) { Properties properties = new Properties(); properties.put( AvailableSettings.SHARED_CACHE_MODE, mode ); + properties.put( Environment.CACHE_REGION_FACTORY, CustomRegionFactory.class.getName() ); Ejb3Configuration config = new Ejb3Configuration(); config.setProperties( properties ); config.addAnnotatedClass( ExplicitlyCacheableEntity.class ); @@ -117,4 +121,15 @@ public class ConfigurationTest extends UnitTestCase { config.buildMappings(); return config; } + + public static class CustomRegionFactory extends NoCachingRegionFactory { + public CustomRegionFactory(Properties properties) { + super( properties ); + } + + @Override + public AccessType getDefaultAccessType() { + return AccessType.READ_WRITE; + } + } }