Skip to content

Fixes FileSystemException #3281

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@

import jakarta.persistence.EntityManagerFactory;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Properties;

import javax.sql.DataSource;

import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -58,12 +58,12 @@
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.FileCopyUtils;
import org.springframework.util.FileSystemUtils;

/**
* Verify that {@link Meta}-annotated methods properly embed comments into EclipseLink queries.
*
* @author Greg Turnquist
* @author Edoardo Patti
* @since 3.0
*/
@ExtendWith(SpringExtension.class)
Expand All @@ -74,16 +74,19 @@ class EclipseLinkMetaAnnotatedQueryMethodIntegrationTests {
@Autowired RoleRepositoryWithMeta repository;

private static final ResourceLoader RESOURCE_LOADER = new DefaultResourceLoader();
private static final String LOG_FILE = "test-eclipselink-meta.log";
private static String LOG_FILE;

@BeforeEach
void cleanoutLogfile() throws IOException {
new FileOutputStream(LOG_FILE).close();
private static Path logFile;

@BeforeAll
static void createLogfile() throws IOException {
logFile = Files.createTempFile("test-eclipselink-meta", ".log");
LOG_FILE = logFile.toAbsolutePath().toString();
}

@AfterAll
static void deleteLogfile() throws IOException {
FileSystemUtils.deleteRecursively(Path.of(LOG_FILE));
static void deleteLogFile(){
logFile.toFile().deleteOnExit();
}

@Test // GH-775
Expand Down