diff --git a/lib/trino-hive-formats/pom.xml b/lib/trino-hive-formats/pom.xml index 9ed39d1fe241..44045573ba48 100644 --- a/lib/trino-hive-formats/pom.xml +++ b/lib/trino-hive-formats/pom.xml @@ -133,6 +133,12 @@ runtime + + io.airlift + junit-extensions + test + + io.airlift testing @@ -208,8 +214,8 @@ - org.testng - testng + org.junit.jupiter + junit-jupiter-api test diff --git a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/TestDataOutputStream.java b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/TestDataOutputStream.java index cf7d925d110b..beb78a9c6739 100644 --- a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/TestDataOutputStream.java +++ b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/TestDataOutputStream.java @@ -15,7 +15,7 @@ import io.airlift.slice.Slice; import io.airlift.slice.Slices; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; import java.io.ByteArrayOutputStream; import java.io.IOException; diff --git a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/TestHiveFormatUtils.java b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/TestHiveFormatUtils.java index 8755a3103ce6..dc74158c1cfa 100644 --- a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/TestHiveFormatUtils.java +++ b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/TestHiveFormatUtils.java @@ -13,7 +13,7 @@ */ package io.trino.hive.formats; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; import java.time.LocalDate; diff --git a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/TestReadWriteUtils.java b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/TestReadWriteUtils.java index 831b042754a0..b6be7b26d177 100644 --- a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/TestReadWriteUtils.java +++ b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/TestReadWriteUtils.java @@ -17,7 +17,7 @@ import io.airlift.slice.SliceOutput; import io.airlift.slice.Slices; import org.apache.hadoop.io.WritableUtils; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; import java.io.IOException; diff --git a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/TestTrinoDataInputStream.java b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/TestTrinoDataInputStream.java index 2d6f0841fd1e..d99a82a8f2f0 100644 --- a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/TestTrinoDataInputStream.java +++ b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/TestTrinoDataInputStream.java @@ -22,7 +22,7 @@ import io.trino.filesystem.TrinoInputFile; import io.trino.filesystem.TrinoInputStream; import io.trino.filesystem.memory.MemoryInputFile; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; import java.io.ByteArrayOutputStream; import java.io.EOFException; @@ -40,6 +40,7 @@ import static io.airlift.slice.SizeOf.sizeOfByteArray; import static java.nio.charset.StandardCharsets.UTF_8; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; @SuppressWarnings("resource") public class TestTrinoDataInputStream @@ -486,36 +487,44 @@ public void testEmptyRead() assertThat(input.read()).isEqualTo(-1); } - @Test(expectedExceptions = EOFException.class) + @Test public void testReadByteBeyondEnd() - throws Exception { - TrinoDataInputStream input = createTrinoDataInputStream(new byte[0]); - input.readByte(); + assertThatThrownBy(() -> { + TrinoDataInputStream input = createTrinoDataInputStream(new byte[0]); + input.readByte(); + }) + .isInstanceOf(EOFException.class); } - @Test(expectedExceptions = EOFException.class) + @Test public void testReadShortBeyondEnd() - throws Exception { - TrinoDataInputStream input = createTrinoDataInputStream(new byte[1]); - input.readShort(); + assertThatThrownBy(() -> { + TrinoDataInputStream input = createTrinoDataInputStream(new byte[1]); + input.readShort(); + }) + .isInstanceOf(EOFException.class); } - @Test(expectedExceptions = EOFException.class) + @Test public void testReadIntBeyondEnd() - throws Exception { - TrinoDataInputStream input = createTrinoDataInputStream(new byte[3]); - input.readInt(); + assertThatThrownBy(() -> { + TrinoDataInputStream input = createTrinoDataInputStream(new byte[3]); + input.readInt(); + }) + .isInstanceOf(EOFException.class); } - @Test(expectedExceptions = EOFException.class) + @Test public void testReadLongBeyondEnd() - throws Exception { - TrinoDataInputStream input = createTrinoDataInputStream(new byte[7]); - input.readLong(); + assertThatThrownBy(() -> { + TrinoDataInputStream input = createTrinoDataInputStream(new byte[7]); + input.readLong(); + }) + .isInstanceOf(EOFException.class); } @Test diff --git a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/avro/TestAvroBase.java b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/avro/TestAvroBase.java index 6bc7533a77ab..623761e79d76 100644 --- a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/avro/TestAvroBase.java +++ b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/avro/TestAvroBase.java @@ -53,9 +53,10 @@ import org.apache.avro.generic.GenericRecordBuilder; import org.apache.avro.util.RandomData; import org.apache.avro.util.Utf8; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; import java.io.IOException; import java.io.UncheckedIOException; @@ -83,7 +84,9 @@ import static java.lang.Float.floatToIntBits; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.within; +import static org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS; +@TestInstance(PER_CLASS) public abstract class TestAvroBase { protected static final TypeOperators TYPE_OPERATORS = new TypeOperators(); @@ -185,7 +188,7 @@ public abstract class TestAvroBase ALL_TYPES_PAGE = new Page(allTypeBlocks.build().toArray(Block[]::new)); } - @BeforeClass + @BeforeAll public void setup() { try { @@ -269,7 +272,7 @@ public void testSerdeCycles() } } - @AfterClass(alwaysRun = true) + @AfterAll public void cleanup() { try { diff --git a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/avro/TestAvroPageDataReaderWithAvroNativeTypeManagement.java b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/avro/TestAvroPageDataReaderWithAvroNativeTypeManagement.java index 8c7fc9db5479..b3131a2cd4d1 100644 --- a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/avro/TestAvroPageDataReaderWithAvroNativeTypeManagement.java +++ b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/avro/TestAvroPageDataReaderWithAvroNativeTypeManagement.java @@ -38,8 +38,9 @@ import org.apache.avro.SchemaBuilder; import org.apache.avro.generic.GenericData; import org.apache.avro.generic.GenericRecord; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; import java.io.IOException; import java.math.BigInteger; @@ -57,7 +58,9 @@ import static io.trino.hive.formats.avro.NativeLogicalTypesAvroTypeManager.padBigEndianToSize; import static io.trino.spi.type.Decimals.MAX_SHORT_PRECISION; import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS; +@TestInstance(PER_CLASS) public class TestAvroPageDataReaderWithAvroNativeTypeManagement extends TestAvroBase { @@ -166,7 +169,7 @@ public class TestAvroPageDataReaderWithAvroNativeTypeManagement ALL_SUPPORTED_PAGE = new Page(blocks.build().toArray(Block[]::new)); } - @BeforeClass + @BeforeAll public void testStatics() { // Identity diff --git a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/avro/TestAvroPageDataReaderWithoutTypeManager.java b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/avro/TestAvroPageDataReaderWithoutTypeManager.java index 1c62f57165ca..bcc88c9068b9 100644 --- a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/avro/TestAvroPageDataReaderWithoutTypeManager.java +++ b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/avro/TestAvroPageDataReaderWithoutTypeManager.java @@ -30,7 +30,7 @@ import org.apache.avro.generic.GenericData; import org.apache.avro.generic.GenericRecord; import org.apache.avro.util.RandomData; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.nio.charset.StandardCharsets; diff --git a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/avro/TestAvroPageDataWriterWithoutTypeManager.java b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/avro/TestAvroPageDataWriterWithoutTypeManager.java index 498b7b4391ea..f8c098dd6361 100644 --- a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/avro/TestAvroPageDataWriterWithoutTypeManager.java +++ b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/avro/TestAvroPageDataWriterWithoutTypeManager.java @@ -33,7 +33,7 @@ import org.apache.avro.file.DataFileReader; import org.apache.avro.generic.GenericDatumReader; import org.apache.avro.generic.GenericRecord; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; import java.io.IOException; diff --git a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/avro/TestLongFromBigEndian.java b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/avro/TestLongFromBigEndian.java index 7ab536ddb09a..542d61b11d98 100644 --- a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/avro/TestLongFromBigEndian.java +++ b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/avro/TestLongFromBigEndian.java @@ -15,7 +15,7 @@ import com.google.common.primitives.Longs; import io.trino.spi.type.Int128; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; import java.util.Arrays; import java.util.concurrent.ThreadLocalRandom; diff --git a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/compression/TestBufferedOutputStreamSliceOutput.java b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/compression/TestBufferedOutputStreamSliceOutput.java index 9b9a09b0db8e..da47ea0b1292 100644 --- a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/compression/TestBufferedOutputStreamSliceOutput.java +++ b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/compression/TestBufferedOutputStreamSliceOutput.java @@ -15,7 +15,7 @@ import io.airlift.slice.Slice; import io.airlift.slice.Slices; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; import java.io.ByteArrayOutputStream; diff --git a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/AbstractTestLineReaderWriter.java b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/AbstractTestLineReaderWriter.java index f1e7b5de39da..c1fbd158bd7c 100644 --- a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/AbstractTestLineReaderWriter.java +++ b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/AbstractTestLineReaderWriter.java @@ -17,7 +17,7 @@ import com.google.common.collect.DiscreteDomain; import com.google.common.collect.Range; import io.trino.hadoop.HadoopNative; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; import java.util.List; import java.util.Set; diff --git a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/TestFooterAwareLineReader.java b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/TestFooterAwareLineReader.java index d6f6c917a005..0137f6b0f357 100644 --- a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/TestFooterAwareLineReader.java +++ b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/TestFooterAwareLineReader.java @@ -14,7 +14,7 @@ package io.trino.hive.formats.line; import com.google.common.collect.ImmutableList; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.util.ArrayList; diff --git a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/TestLineBuffer.java b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/TestLineBuffer.java index 0a8140adc0a6..bab89518eeee 100644 --- a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/TestLineBuffer.java +++ b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/TestLineBuffer.java @@ -14,7 +14,7 @@ package io.trino.hive.formats.line; import com.google.common.primitives.Bytes; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.util.Arrays; diff --git a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/csv/TestCsvFormat.java b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/csv/TestCsvFormat.java index 093652020569..d0c469daef14 100644 --- a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/csv/TestCsvFormat.java +++ b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/csv/TestCsvFormat.java @@ -30,7 +30,7 @@ import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapred.JobConf; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.util.ArrayList; diff --git a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/json/TestJsonFormat.java b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/json/TestJsonFormat.java index 0a8347a876cb..947350f97b31 100644 --- a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/json/TestJsonFormat.java +++ b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/json/TestJsonFormat.java @@ -45,7 +45,7 @@ import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapred.JobConf; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.math.BigDecimal; diff --git a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/openxjson/TestJsonReader.java b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/openxjson/TestJsonReader.java index 86c4dac67469..676f709b5a1d 100644 --- a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/openxjson/TestJsonReader.java +++ b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/openxjson/TestJsonReader.java @@ -19,7 +19,7 @@ import io.starburst.openjson.JSONException; import io.starburst.openjson.JSONObject; import io.starburst.openjson.JSONTokener; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; import java.math.BigDecimal; import java.util.ArrayList; diff --git a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/openxjson/TestOpenxJsonFormat.java b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/openxjson/TestOpenxJsonFormat.java index 2c8ce232eb28..f7109e13de0a 100644 --- a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/openxjson/TestOpenxJsonFormat.java +++ b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/openxjson/TestOpenxJsonFormat.java @@ -52,8 +52,8 @@ import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapred.JobConf; +import org.junit.jupiter.api.Test; import org.openx.data.jsonserde.JsonSerDe; -import org.testng.annotations.Test; import java.io.IOException; import java.io.UncheckedIOException; diff --git a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/regex/TestRegexFormat.java b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/regex/TestRegexFormat.java index 2d64ada9f13e..f6006d0282f8 100644 --- a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/regex/TestRegexFormat.java +++ b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/regex/TestRegexFormat.java @@ -36,7 +36,7 @@ import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapred.JobConf; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.math.BigDecimal; diff --git a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/sequence/TestSequenceFileReaderWriter.java b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/sequence/TestSequenceFileReaderWriter.java index 7ee484d65d5e..d4bf748d52db 100644 --- a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/sequence/TestSequenceFileReaderWriter.java +++ b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/sequence/TestSequenceFileReaderWriter.java @@ -31,7 +31,7 @@ import org.apache.hadoop.io.SequenceFile; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapred.JobConf; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; import java.io.File; import java.io.FileInputStream; diff --git a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/sequence/TestSequenceFileWriterFactory.java b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/sequence/TestSequenceFileWriterFactory.java index 3be05624628c..ebde79117974 100644 --- a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/sequence/TestSequenceFileWriterFactory.java +++ b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/sequence/TestSequenceFileWriterFactory.java @@ -19,7 +19,7 @@ import io.trino.filesystem.memory.MemoryInputFile; import io.trino.hive.formats.line.LineBuffer; import io.trino.hive.formats.line.LineReader; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; import java.io.ByteArrayOutputStream; import java.nio.charset.StandardCharsets; diff --git a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/simple/TestSimpleFormat.java b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/simple/TestSimpleFormat.java index fd2f025232ee..df8f30eec918 100644 --- a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/simple/TestSimpleFormat.java +++ b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/simple/TestSimpleFormat.java @@ -48,7 +48,7 @@ import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapred.JobConf; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.math.BigDecimal; diff --git a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/text/TestLineReader.java b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/text/TestLineReader.java index 32ac962f8635..a1f37449b643 100644 --- a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/text/TestLineReader.java +++ b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/text/TestLineReader.java @@ -17,7 +17,7 @@ import com.google.common.collect.ImmutableSet; import io.trino.hive.formats.compression.CompressionKind; import io.trino.hive.formats.line.LineBuffer; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; diff --git a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/text/TestTextLineReaderFactory.java b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/text/TestTextLineReaderFactory.java index cdf0c5d49a92..00fb27ffab1f 100644 --- a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/text/TestTextLineReaderFactory.java +++ b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/line/text/TestTextLineReaderFactory.java @@ -18,7 +18,7 @@ import io.trino.filesystem.memory.MemoryInputFile; import io.trino.hive.formats.line.LineBuffer; import io.trino.hive.formats.line.LineReader; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; import java.nio.charset.StandardCharsets; diff --git a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/rcfile/AbstractTestRcFileReader.java b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/rcfile/AbstractTestRcFileReader.java index ae811a5c92b9..41476ba1a3ac 100644 --- a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/rcfile/AbstractTestRcFileReader.java +++ b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/rcfile/AbstractTestRcFileReader.java @@ -22,8 +22,9 @@ import io.trino.spi.type.SqlDecimal; import io.trino.spi.type.SqlVarbinary; import org.joda.time.DateTimeZone; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; import java.math.BigInteger; import java.util.ArrayList; @@ -49,7 +50,9 @@ import static java.util.Collections.nCopies; import static java.util.stream.Collectors.toList; import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS; +@TestInstance(PER_CLASS) public abstract class AbstractTestRcFileReader { private static final DecimalType DECIMAL_TYPE_PRECISION_2 = DecimalType.createDecimalType(2, 1); @@ -66,7 +69,7 @@ public AbstractTestRcFileReader(RcFileTester tester) this.tester = tester; } - @BeforeClass + @BeforeAll public void setUp() { assertThat(DateTimeZone.getDefault()).isEqualTo(RcFileTester.HIVE_STORAGE_TIME_ZONE); diff --git a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/rcfile/TestRcFileReaderManual.java b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/rcfile/TestRcFileReaderManual.java index 848cf81e2ce4..27b8ad29a6f6 100644 --- a/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/rcfile/TestRcFileReaderManual.java +++ b/lib/trino-hive-formats/src/test/java/io/trino/hive/formats/rcfile/TestRcFileReaderManual.java @@ -23,7 +23,7 @@ import io.trino.hive.formats.encodings.binary.BinaryColumnEncodingFactory; import io.trino.spi.block.Block; import org.joda.time.DateTimeZone; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.util.List;