HHH-12508 : test cases
This commit is contained in:
parent
80ce45e86c
commit
66d7196168
27
hibernate-core/src/test/java/org/hibernate/test/cache/NoCachingRegionFactoryTest.java
vendored
Normal file
27
hibernate-core/src/test/java/org/hibernate/test/cache/NoCachingRegionFactoryTest.java
vendored
Normal file
|
@ -0,0 +1,27 @@
|
|||
package org.hibernate.test.cache;
|
||||
|
||||
import org.hibernate.cache.internal.NoCachingRegionFactory;
|
||||
import org.hibernate.cfg.AvailableSettings;
|
||||
import org.hibernate.cfg.Configuration;
|
||||
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
|
||||
/**
|
||||
* @author Gail Badner.
|
||||
*/
|
||||
public class NoCachingRegionFactoryTest extends BaseCoreFunctionalTestCase {
|
||||
@Override
|
||||
protected void configure(Configuration configuration) {
|
||||
configuration.setProperty( AvailableSettings.CACHE_REGION_FACTORY, NoCachingRegionFactory.class.getName() );
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestForIssue( jiraKey = "HHH-12508" )
|
||||
public void testSessionFactoryOptionsConsistent() {
|
||||
assertFalse( sessionFactory().getSessionFactoryOptions().isSecondLevelCacheEnabled() );
|
||||
}
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* Hibernate, Relational Persistence for Idiomatic Java
|
||||
*
|
||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||
*/
|
||||
package org.hibernate.test.stats;
|
||||
|
||||
import org.hibernate.cache.internal.NoCachingRegionFactory;
|
||||
import org.hibernate.cfg.AvailableSettings;
|
||||
import org.hibernate.cfg.Configuration;
|
||||
import org.hibernate.stat.Statistics;
|
||||
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* @author Gail Badner
|
||||
*/
|
||||
public class StatisticsWithNoCachingTest extends BaseCoreFunctionalTestCase {
|
||||
|
||||
@Override
|
||||
protected void configure(Configuration configuration) {
|
||||
configuration.setProperty( AvailableSettings.CACHE_REGION_FACTORY, NoCachingRegionFactory.class.getName() );
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestForIssue( jiraKey = "HHH-12508")
|
||||
public void testUncachedRegion() {
|
||||
final Statistics statistics = sessionFactory().getStatistics();
|
||||
statistics.getSecondLevelCacheStatistics( "hibernate.test.unknown" );
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue