4545import org .apache .iceberg .ContentFile ;
4646import org .apache .iceberg .FileContent ;
4747import org .apache .iceberg .FileFormat ;
48+ import org .apache .iceberg .Parameter ;
49+ import org .apache .iceberg .ParameterizedTestExtension ;
50+ import org .apache .iceberg .Parameters ;
4851import org .apache .iceberg .PartitionSpec ;
4952import org .apache .iceberg .RowDelta ;
5053import org .apache .iceberg .Schema ;
5154import org .apache .iceberg .SerializableTable ;
5255import org .apache .iceberg .TableProperties ;
53- import org .apache .iceberg .TableTestBase ;
56+ import org .apache .iceberg .TestBase ;
5457import org .apache .iceberg .TestTables ;
5558import org .apache .iceberg .data .GenericRecord ;
5659import org .apache .iceberg .data .Record ;
6568import org .apache .iceberg .util .StructLikeSet ;
6669import org .assertj .core .api .Assertions ;
6770import org .junit .Assert ;
68- import org .junit .Before ;
69- import org .junit .Test ;
70- import org .junit .runner .RunWith ;
71- import org .junit .runners .Parameterized ;
72-
73- @ RunWith (Parameterized .class )
74- public class TestDeltaTaskWriter extends TableTestBase {
75- private static final int FORMAT_V2 = 2 ;
76-
77- private final FileFormat format ;
78-
79- @ Parameterized .Parameters (name = "FileFormat = {0}" )
80- public static Object [][] parameters () {
81- return new Object [][] {{"avro" }, {"orc" }, {"parquet" }};
82- }
83-
84- public TestDeltaTaskWriter (String fileFormat ) {
85- super (FORMAT_V2 );
86- this .format = FileFormat .fromString (fileFormat );
71+ import org .junit .jupiter .api .BeforeEach ;
72+ import org .junit .jupiter .api .TestTemplate ;
73+ import org .junit .jupiter .api .extension .ExtendWith ;
74+
75+ @ ExtendWith (ParameterizedTestExtension .class )
76+ public class TestDeltaTaskWriter extends TestBase {
77+
78+ @ Parameter (index = 1 )
79+ private FileFormat format ;
80+
81+ @ Parameters (name = "formatVersion = {0}, fileFormat = {1}" )
82+ protected static List <Object > parameters () {
83+ return Arrays .asList (
84+ new Object [] {2 , FileFormat .AVRO },
85+ new Object [] {2 , FileFormat .ORC },
86+ new Object [] {2 , FileFormat .PARQUET });
8787 }
8888
8989 @ Override
90- @ Before
90+ @ BeforeEach
9191 public void setupTable () throws IOException {
92- this .tableDir = temp . newFolder ();
92+ this .tableDir = Files . createTempDirectory ( temp , "junit" ). toFile ();
9393 Assert .assertTrue (tableDir .delete ()); // created by table create
9494
9595 this .metadataDir = new File (tableDir , "metadata" );
@@ -170,13 +170,13 @@ private void testCdcEvents(boolean partitioned) throws IOException {
170170 actualRowSet ("*" ));
171171 }
172172
173- @ Test
173+ @ TestTemplate
174174 public void testUnpartitioned () throws IOException {
175175 createAndInitTable (false );
176176 testCdcEvents (false );
177177 }
178178
179- @ Test
179+ @ TestTemplate
180180 public void testPartitioned () throws IOException {
181181 createAndInitTable (true );
182182 testCdcEvents (true );
@@ -201,12 +201,12 @@ private void testWritePureEqDeletes(boolean partitioned) throws IOException {
201201 Assert .assertEquals ("Should have no record" , expectedRowSet (), actualRowSet ("*" ));
202202 }
203203
204- @ Test
204+ @ TestTemplate
205205 public void testUnpartitionedPureEqDeletes () throws IOException {
206206 testWritePureEqDeletes (false );
207207 }
208208
209- @ Test
209+ @ TestTemplate
210210 public void testPartitionedPureEqDeletes () throws IOException {
211211 testWritePureEqDeletes (true );
212212 }
@@ -243,17 +243,17 @@ private void testAbort(boolean partitioned) throws IOException {
243243 }
244244 }
245245
246- @ Test
246+ @ TestTemplate
247247 public void testUnpartitionedAbort () throws IOException {
248248 testAbort (false );
249249 }
250250
251- @ Test
251+ @ TestTemplate
252252 public void testPartitionedAbort () throws IOException {
253253 testAbort (true );
254254 }
255255
256- @ Test
256+ @ TestTemplate
257257 public void testPartitionedTableWithDataAsKey () throws IOException {
258258 createAndInitTable (true );
259259 List <Integer > equalityFieldIds = Lists .newArrayList (dataFieldId ());
@@ -298,7 +298,7 @@ public void testPartitionedTableWithDataAsKey() throws IOException {
298298 actualRowSet ("*" ));
299299 }
300300
301- @ Test
301+ @ TestTemplate
302302 public void testPartitionedTableWithDataAndIdAsKey () throws IOException {
303303 createAndInitTable (true );
304304 List <Integer > equalityFieldIds = Lists .newArrayList (dataFieldId (), idFieldId ());
@@ -323,7 +323,7 @@ public void testPartitionedTableWithDataAndIdAsKey() throws IOException {
323323 "Should have expected records" , expectedRowSet (createRecord (1 , "aaa" )), actualRowSet ("*" ));
324324 }
325325
326- @ Test
326+ @ TestTemplate
327327 public void testEqualityColumnOnCustomPrecisionTSColumn () throws IOException {
328328 Schema tableSchema =
329329 new Schema (
0 commit comments