Package org.hibernate.cache

Examples of org.hibernate.cache.CacheDataDescription


       
        JBossCacheRegionFactory regionFactory = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
       
        TransactionalDataRegion region = (TransactionalDataRegion) createRegion(regionFactory, "test/test", cfg.getProperties(), 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());
       
    }
View Full Code Here


       
        JBossCacheRegionFactory regionFactory = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
       
        TransactionalDataRegion region = (TransactionalDataRegion) createRegion(regionFactory, "test/test", cfg.getProperties(), 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());
       
    }
View Full Code Here

   public void testGetCacheDataDescription() throws Exception {
      Configuration cfg = CacheTestUtil.buildConfiguration("test", InfinispanRegionFactory.class, true, false);
      InfinispanRegionFactory regionFactory = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
      TransactionalDataRegion region = (TransactionalDataRegion) createRegion(regionFactory, "test/test", cfg.getProperties(), 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());
   }
View Full Code Here

        new LocalRegionCache(CACHE_NAME, instance, null, false);
    }

    @Test
    public void testConstructorIgnoresVersionComparatorForUnversionedData() {
        CacheDataDescription description = mock(CacheDataDescription.class);
        doThrow(AssertionError.class).when(description).getVersionComparator(); // Will fail the test if called

        new LocalRegionCache(CACHE_NAME, null, description);
        verify(description).isVersioned(); // Verify that the versioned flag was checked
        verifyNoMoreInteractions(description);
View Full Code Here

    @Test
    public void testConstructorSetsVersionComparatorForVersionedData() {
        Comparator<?> comparator = mock(Comparator.class);

        CacheDataDescription description = mock(CacheDataDescription.class);
        when(description.getVersionComparator()).thenReturn(comparator);
        when(description.isVersioned()).thenReturn(true);

        new LocalRegionCache(CACHE_NAME, null, description);
        verify(description).getVersionComparator();
        verify(description).isVersioned();
    }
View Full Code Here

TOP

Related Classes of org.hibernate.cache.CacheDataDescription

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.