File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
hibernate-core/src/test/java/org/hibernate/orm/test/annotations/namingstrategy
hibernate-testing/src/main/java/org/hibernate/testing/orm/junit Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 1616import org .hibernate .service .ServiceRegistry ;
1717import org .hibernate .testing .ServiceRegistryBuilder ;
1818import org .hibernate .testing .orm .junit .BaseUnitTest ;
19- import org .junit .jupiter .api .AfterAll ;
20- import org .junit .jupiter .api .BeforeAll ;
19+ import org .junit .jupiter .api .AfterEach ;
20+ import org .junit .jupiter .api .BeforeEach ;
2121import org .junit .jupiter .api .Test ;
2222
2323import java .util .Locale ;
@@ -34,12 +34,12 @@ public class NamingStrategyTest {
3434
3535 private ServiceRegistry serviceRegistry ;
3636
37- @ BeforeAll
37+ @ BeforeEach
3838 public void setUp () {
3939 serviceRegistry = ServiceRegistryBuilder .buildServiceRegistry ( Environment .getProperties () );
4040 }
4141
42- @ AfterAll
42+ @ AfterEach
4343 public void tearDown () {
4444 if ( serviceRegistry != null ) {
4545 ServiceRegistryBuilder .destroy ( serviceRegistry );
Original file line number Diff line number Diff line change 2727import org .hibernate .query .sqm .mutation .internal .temptable .PersistentTableStrategy ;
2828
2929import org .hibernate .testing .util .ServiceRegistryUtil ;
30+ import org .junit .jupiter .api .AfterAll ;
3031import org .junit .jupiter .api .AfterEach ;
3132
3233import jakarta .persistence .EntityManager ;
@@ -276,6 +277,11 @@ public final void afterTest() {
276277 }
277278 }
278279
280+ @ AfterAll
281+ public final void afterAll () {
282+ entityManagerFactoryScope .getEntityManagerFactory ().close ();
283+ }
284+
279285 protected boolean isCleanupTestDataRequired () {
280286 return false ;
281287 }
You can’t perform that action at this time.
0 commit comments