HHH-11271 Fix hidden failure in InfinispanRegionFactoryTestCase#testTimestampValidation
(cherry picked from commit c308bcbe7d
)
Conflicts:
hibernate-infinispan/src/test/java/org/hibernate/test/cache/infinispan/InfinispanRegionFactoryTestCase.java
This commit is contained in:
parent
c84869bdac
commit
a6ea139539
|
@ -26,6 +26,7 @@ import org.hibernate.engine.transaction.jta.platform.internal.AbstractJtaPlatfor
|
||||||
import org.hibernate.engine.transaction.jta.platform.internal.JBossStandAloneJtaPlatform;
|
import org.hibernate.engine.transaction.jta.platform.internal.JBossStandAloneJtaPlatform;
|
||||||
import org.hibernate.service.ServiceRegistry;
|
import org.hibernate.service.ServiceRegistry;
|
||||||
|
|
||||||
|
import org.hibernate.test.cache.infinispan.util.CacheTestUtil;
|
||||||
import org.hibernate.test.cache.infinispan.util.InfinispanTestingSetup;
|
import org.hibernate.test.cache.infinispan.util.InfinispanTestingSetup;
|
||||||
import org.hibernate.test.cache.infinispan.util.TestInfinispanRegionFactory;
|
import org.hibernate.test.cache.infinispan.util.TestInfinispanRegionFactory;
|
||||||
import org.hibernate.testing.ServiceRegistryBuilder;
|
import org.hibernate.testing.ServiceRegistryBuilder;
|
||||||
|
@ -307,14 +308,16 @@ public class InfinispanRegionFactoryTestCase {
|
||||||
|
|
||||||
@Test(expected = CacheException.class)
|
@Test(expected = CacheException.class)
|
||||||
public void testTimestampValidation() {
|
public void testTimestampValidation() {
|
||||||
|
final String timestamps = "org.hibernate.cache.spi.UpdateTimestampsCache";
|
||||||
Properties p = createProperties();
|
Properties p = createProperties();
|
||||||
final DefaultCacheManager manager = new DefaultCacheManager(GlobalConfigurationBuilder.defaultClusteredBuilder().build());
|
final DefaultCacheManager manager = new DefaultCacheManager(GlobalConfigurationBuilder.defaultClusteredBuilder().build());
|
||||||
|
ConfigurationBuilder builder = new ConfigurationBuilder();
|
||||||
|
builder.clustering().cacheMode(CacheMode.INVALIDATION_SYNC);
|
||||||
|
manager.defineConfiguration( "timestamps", builder.build() );
|
||||||
try {
|
try {
|
||||||
InfinispanRegionFactory factory = createRegionFactory(manager, p);
|
InfinispanRegionFactory factory = createRegionFactory( manager, p );
|
||||||
ConfigurationBuilder builder = new ConfigurationBuilder();
|
factory.start( CacheTestUtil.sfOptionsForStart(), p );
|
||||||
builder.clustering().cacheMode(CacheMode.INVALIDATION_SYNC);
|
TimestampsRegionImpl region = (TimestampsRegionImpl) factory.buildTimestampsRegion( timestamps, p );
|
||||||
manager.defineConfiguration( "timestamps", builder.build() );
|
|
||||||
factory.start(null, p);
|
|
||||||
fail( "Should have failed saying that invalidation is not allowed for timestamp caches." );
|
fail( "Should have failed saying that invalidation is not allowed for timestamp caches." );
|
||||||
} finally {
|
} finally {
|
||||||
TestingUtil.killCacheManagers( manager );
|
TestingUtil.killCacheManagers( manager );
|
||||||
|
|
Loading…
Reference in New Issue