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