Skip to content
Merged
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
14 changes: 3 additions & 11 deletions core/src/test/java/org/apache/iceberg/TestTableMetadataParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
Expand All @@ -39,9 +38,9 @@
import org.apache.iceberg.io.OutputFile;
import org.apache.iceberg.relocated.com.google.common.collect.Maps;
import org.apache.iceberg.types.Types.BooleanType;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.TestTemplate;
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.jupiter.api.io.TempDir;

@ExtendWith(ParameterizedTestExtension.class)
public class TestTableMetadataParser {
Expand All @@ -56,10 +55,10 @@ private static List<Object> parameters() {
@Parameter private String codecName;

@TestTemplate
public void testGzipCompressionProperty() throws IOException {
public void testGzipCompressionProperty(@TempDir Path tempDir) throws IOException {
Codec codec = Codec.fromName(codecName);
String fileExtension = getFileExtension(codec);
String fileName = "v3" + fileExtension;
String fileName = tempDir + "/v3" + fileExtension;
OutputFile outputFile = Files.localOutput(fileName);
Map<String, String> properties = Maps.newHashMap();
properties.put(TableProperties.METADATA_COMPRESSION, codecName);
Expand All @@ -71,13 +70,6 @@ public void testGzipCompressionProperty() throws IOException {
verifyMetadata(metadata, actualMetadata);
}

@AfterEach
public void cleanup() throws IOException {
Codec codec = Codec.fromName(codecName);
Path metadataFilePath = Paths.get("v3" + getFileExtension(codec));
java.nio.file.Files.deleteIfExists(metadataFilePath);
}

private void verifyMetadata(TableMetadata expected, TableMetadata actual) {
assertThat(actual.schema().asStruct()).isEqualTo(expected.schema().asStruct());
assertThat(actual.location()).isEqualTo(expected.location());
Expand Down