alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Hibernate example source code file (EhcacheStatsImplTest.java)

This example Hibernate source code file (EhcacheStatsImplTest.java) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Hibernate tags/keywords

beforeclass, beforeclass, cachemanager, ehcachestatsimpl, ehcachestatsimpl, ehcachestatsimpltest, exception, exception, test, test

The Hibernate EhcacheStatsImplTest.java source code

package org.hibernate.test.cache;

import net.sf.ehcache.CacheManager;

import org.hibernate.cache.ehcache.management.impl.EhcacheStatsImpl;
import org.hibernate.cache.ehcache.management.impl.EhcacheStatsImpl;

import org.junit.BeforeClass;
import org.junit.Test;

import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;

/**
 * @author Alex Snaps
 */
public class EhcacheStatsImplTest {

	private static EhcacheStatsImpl stats;

	@BeforeClass
	public static void createCache() throws Exception {
		CacheManager manager = CacheManager.getInstance();
		stats = new EhcacheStatsImpl( manager );
	}

	@Test
	public void testIsRegionCacheOrphanEvictionEnabled() {
		assertThat( stats.isRegionCacheOrphanEvictionEnabled( "sampleCache1" ), is( false ) );
	}

	@Test
	public void testGetRegionCacheOrphanEvictionPeriod() {
		assertThat( stats.getRegionCacheOrphanEvictionPeriod( "sampleCache1" ), is( -1 ) );
	}
}

Other Hibernate examples (source code examples)

Here is a short list of links related to this Hibernate EhcacheStatsImplTest.java source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.