HHH-6223 fix un-isolated test

This commit is contained in:
Strong Liu 2011-05-16 22:10:35 +08:00
parent eddd14b010
commit c6207be3b7
1 changed files with 4 additions and 3 deletions

View File

@ -158,6 +158,9 @@ public class QueryAndSQLTest extends TestCase {
}
public void testSQLQueryWithManyToOne() {
Statistics stats = getSessions().getStatistics();
stats.clear();
stats.setStatisticsEnabled( true );
Night n = new Night();
Calendar c = new GregorianCalendar();
c.set( 2000, 2, 2 );
@ -179,10 +182,8 @@ public class QueryAndSQLTest extends TestCase {
s.close();
s = openSession();
tx = s.beginTransaction();
Statistics stats = getSessions().getStatistics();
stats.setStatisticsEnabled( true );
Query q = s.getNamedQuery( "night&areaCached" );
List result = q.list();
List result = q.setCacheable( true ).list();
assertEquals( 1, result.size() );
assertEquals( 1, stats.getQueryCachePutCount() );
q.list();