Search in sources :

Example 1 with CacheDataDescription

use of org.hibernate.cache.spi.CacheDataDescription in project hibernate-orm by hibernate.

the class AbstractEntityCollectionRegionTest method testGetCacheDataDescription.

@Test
public void testGetCacheDataDescription() throws Exception {
    StandardServiceRegistryBuilder ssrb = CacheTestUtil.buildBaselineStandardServiceRegistryBuilder("test", InfinispanRegionFactory.class, true, false, jtaPlatform);
    final StandardServiceRegistry registry = ssrb.build();
    try {
        Properties properties = CacheTestUtil.toProperties(ssrb.getSettings());
        InfinispanRegionFactory regionFactory = CacheTestUtil.startRegionFactory(registry, getCacheTestSupport());
        TransactionalDataRegion region = (TransactionalDataRegion) createRegion(regionFactory, "test/test", properties, getCacheDataDescription());
        CacheDataDescription cdd = region.getCacheDataDescription();
        assertNotNull(cdd);
        CacheDataDescription expected = getCacheDataDescription();
        assertEquals(expected.isMutable(), cdd.isMutable());
        assertEquals(expected.isVersioned(), cdd.isVersioned());
        assertEquals(expected.getVersionComparator(), cdd.getVersionComparator());
    } finally {
        StandardServiceRegistryBuilder.destroy(registry);
    }
}
Also used : InfinispanRegionFactory(org.hibernate.cache.infinispan.InfinispanRegionFactory) CacheDataDescription(org.hibernate.cache.spi.CacheDataDescription) StandardServiceRegistryBuilder(org.hibernate.boot.registry.StandardServiceRegistryBuilder) TransactionalDataRegion(org.hibernate.cache.spi.TransactionalDataRegion) Properties(java.util.Properties) StandardServiceRegistry(org.hibernate.boot.registry.StandardServiceRegistry) Test(org.junit.Test)

Aggregations

Properties (java.util.Properties)1 StandardServiceRegistry (org.hibernate.boot.registry.StandardServiceRegistry)1 StandardServiceRegistryBuilder (org.hibernate.boot.registry.StandardServiceRegistryBuilder)1 InfinispanRegionFactory (org.hibernate.cache.infinispan.InfinispanRegionFactory)1 CacheDataDescription (org.hibernate.cache.spi.CacheDataDescription)1 TransactionalDataRegion (org.hibernate.cache.spi.TransactionalDataRegion)1 Test (org.junit.Test)1