Package org.hibernate.cache.jbc

Examples of org.hibernate.cache.jbc.JBossCacheRegionFactory


    }

    private void evictOrRemoveTest(String configName) throws Exception {
   
        Configuration cfg = createConfiguration(configName);
        JBossCacheRegionFactory regionFactory = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
        Cache localCache = getJBossCache(regionFactory);
        boolean invalidation = CacheHelper.isClusteredInvalidation(localCache);
       
        // Sleep a bit to avoid concurrent FLUSH problem
        avoidConcurrentFlush();
View Full Code Here


    }

    private void evictOrRemoveAllTest(String configName) throws Exception {
   
        Configuration cfg = createConfiguration(configName);
        JBossCacheRegionFactory regionFactory = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
        Cache localCache = getJBossCache(regionFactory);
        boolean optimistic = "OPTIMISTIC".equals(localCache.getConfiguration().getNodeLockingSchemeString());
        boolean invalidation = CacheHelper.isClusteredInvalidation(localCache);
       
        // Sleep a bit to avoid concurrent FLUSH problem
View Full Code Here

    public void testDefaultConfig() throws Exception {

        Configuration cfg = CacheTestUtil.buildConfiguration("", JBossCacheRegionFactory.class, true, true);
       
        JBossCacheRegionFactory regionFactory = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
       
        CacheInstanceManager mgr = regionFactory.getCacheInstanceManager();
        assertTrue("Correct default CacheInstanceManager type", mgr instanceof SharedCacheInstanceManager);
       
        Cache cache = mgr.getEntityCacheInstance();
        assertTrue("entity cache exists", cache != null);
        assertEquals("Used correct config", "TestSharedCache", cache.getConfiguration().getClusterName());
View Full Code Here

    public void testInjectedCacheInstanceManager() {

        Configuration cfg = CacheTestUtil.buildConfiguration("", JBossCacheRegionFactory.class, true, true);
       
        CacheInstanceManager cim = new MultiplexingCacheInstanceManager();
        JBossCacheRegionFactory regionFactory = new JBossCacheRegionFactory(cim);
       
        Settings settings = cfg.buildSettings();
        Properties properties = cfg.getProperties();
       
        regionFactory.start(settings, properties);       
        // Ensure we clean up
        registerFactory(regionFactory);
       
        assertEquals("Used injected CacheInstanceManager", cim, regionFactory.getCacheInstanceManager());
       
        CacheTestUtil.stopRegionFactory(regionFactory, getCacheTestSupport());
    }
View Full Code Here

    protected abstract Class getRegionFactoryClass();
   
    public void testUse2ndLevelCache() throws Exception {
        Configuration cfg = CacheTestUtil.buildConfiguration("", getRegionFactoryClass(), false, true);
       
        JBossCacheRegionFactory regionFactory = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
       
        CacheInstanceManager cim = regionFactory.getCacheInstanceManager();
       
        assertNull(cim.getCollectionCacheInstance());
        assertNull(cim.getEntityCacheInstance());
        assertNotNull(cim.getQueryCacheInstance());
        assertNotNull(cim.getTimestampsCacheInstance());
View Full Code Here

    }
   
    public void testUseQueryCache() throws Exception {
        Configuration cfg = CacheTestUtil.buildConfiguration("", getRegionFactoryClass(), true, false);
       
        JBossCacheRegionFactory regionFactory = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
       
        CacheInstanceManager cim = regionFactory.getCacheInstanceManager();
       
        assertNotNull(cim.getCollectionCacheInstance());
        assertNotNull(cim.getEntityCacheInstance());
        assertNull(cim.getQueryCacheInstance());
        assertNull(cim.getTimestampsCacheInstance());
View Full Code Here

       
        Configuration cfg = CacheTestUtil.buildConfiguration("test", MultiplexedJBossCacheRegionFactory.class, true, false);
        String entityCfg = optimistic ? "optimistic-entity" : "pessimistic-entity";
        cfg.setProperty(MultiplexingCacheInstanceManager.ENTITY_CACHE_RESOURCE_PROP, entityCfg);
       
        JBossCacheRegionFactory regionFactory = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
       
        supportedAccessTypeTest(regionFactory, cfg.getProperties());
    }
View Full Code Here

    public void testIsTransactionAware() throws Exception {
       
        Configuration cfg = CacheTestUtil.buildConfiguration("test", SharedJBossCacheRegionFactory.class, true, false);
        cfg.setProperty(SharedCacheInstanceManager.CACHE_RESOURCE_PROP, CacheTestUtil.LOCAL_PESSIMISTIC_CACHE);
       
        JBossCacheRegionFactory regionFactory = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
       
        TransactionalDataRegion region = (TransactionalDataRegion) createRegion(regionFactory, "test/test", cfg.getProperties(), getCacheDataDescription());
       
        assertTrue("Region is transaction-aware", region.isTransactionAware());
       
View Full Code Here

   
    public void testGetCacheDataDescription() throws Exception {
        Configuration cfg = CacheTestUtil.buildConfiguration("test", SharedJBossCacheRegionFactory.class, true, false);
        cfg.setProperty(SharedCacheInstanceManager.CACHE_RESOURCE_PROP, CacheTestUtil.LOCAL_PESSIMISTIC_CACHE);
       
        JBossCacheRegionFactory regionFactory = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
       
        TransactionalDataRegion region = (TransactionalDataRegion) createRegion(regionFactory, "test/test", cfg.getProperties(), getCacheDataDescription());
       
        CacheDataDescription cdd = region.getCacheDataDescription();
       
View Full Code Here

        Fqn regionFqn = getRegionFqn("test/test", "test");
       
        assertNull("No region node", remoteCache.getRoot().getChild( regionFqn ));
       
        Configuration cfg = CacheTestUtil.buildConfiguration("test", SharedJBossCacheRegionFactory.class, true, true);
        JBossCacheRegionFactory regionFactory = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
       
        Region region = createRegion(regionFactory, "test/test", cfg.getProperties(), getCacheDataDescription());
       
        Cache localCache = getJBossCache( regionFactory );
       
View Full Code Here

TOP

Related Classes of org.hibernate.cache.jbc.JBossCacheRegionFactory

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.