19
19
20
20
import jakarta .persistence .EntityManagerFactory ;
21
21
22
- import java .io .FileOutputStream ;
23
22
import java .io .IOException ;
24
23
import java .io .InputStreamReader ;
25
24
import java .io .Reader ;
26
25
import java .nio .charset .StandardCharsets ;
26
+ import java .nio .file .Files ;
27
27
import java .nio .file .Path ;
28
28
import java .util .Properties ;
29
29
30
30
import javax .sql .DataSource ;
31
31
32
32
import org .junit .jupiter .api .AfterAll ;
33
+ import org .junit .jupiter .api .BeforeAll ;
33
34
import org .junit .jupiter .api .BeforeEach ;
34
35
import org .junit .jupiter .api .Test ;
35
36
import org .junit .jupiter .api .extension .ExtendWith ;
58
59
import org .springframework .transaction .PlatformTransactionManager ;
59
60
import org .springframework .transaction .annotation .Transactional ;
60
61
import org .springframework .util .FileCopyUtils ;
61
- import org .springframework .util .FileSystemUtils ;
62
62
63
63
/**
64
64
* Verify that {@link Meta}-annotated methods properly embed comments into EclipseLink queries.
65
65
*
66
66
* @author Greg Turnquist
67
+ * @author Edoardo Patti
67
68
* @since 3.0
68
69
*/
69
70
@ ExtendWith (SpringExtension .class )
@@ -74,16 +75,12 @@ class EclipseLinkMetaAnnotatedQueryMethodIntegrationTests {
74
75
@ Autowired RoleRepositoryWithMeta repository ;
75
76
76
77
private static final ResourceLoader RESOURCE_LOADER = new DefaultResourceLoader ();
77
- private static final String LOG_FILE = "test-eclipselink-meta.log" ;
78
+ private static String LOG_FILE ;
78
79
79
- @ BeforeEach
80
- void cleanoutLogfile () throws IOException {
81
- new FileOutputStream (LOG_FILE ).close ();
82
- }
83
-
84
- @ AfterAll
85
- static void deleteLogfile () throws IOException {
86
- FileSystemUtils .deleteRecursively (Path .of (LOG_FILE ));
80
+ @ BeforeAll
81
+ static void createLogfile () throws IOException {
82
+ Path logFile = Files .createTempFile ("test-eclipselink-meta" , ".log" );
83
+ LOG_FILE = logFile .toAbsolutePath ().toString ();
87
84
}
88
85
89
86
@ Test // GH-775
0 commit comments