Skip to content

Commit c6207be

Browse files
committed
HHH-6223 fix un-isolated test
1 parent eddd14b commit c6207be

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

hibernate-testsuite/src/test/java/org/hibernate/test/annotations/query/QueryAndSQLTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@ public void testImportQueryFromMappedSuperclass() {
158158
}
159159

160160
public void testSQLQueryWithManyToOne() {
161+
Statistics stats = getSessions().getStatistics();
162+
stats.clear();
163+
stats.setStatisticsEnabled( true );
161164
Night n = new Night();
162165
Calendar c = new GregorianCalendar();
163166
c.set( 2000, 2, 2 );
@@ -179,10 +182,8 @@ public void testSQLQueryWithManyToOne() {
179182
s.close();
180183
s = openSession();
181184
tx = s.beginTransaction();
182-
Statistics stats = getSessions().getStatistics();
183-
stats.setStatisticsEnabled( true );
184185
Query q = s.getNamedQuery( "night&areaCached" );
185-
List result = q.list();
186+
List result = q.setCacheable( true ).list();
186187
assertEquals( 1, result.size() );
187188
assertEquals( 1, stats.getQueryCachePutCount() );
188189
q.list();

0 commit comments

Comments
 (0)