From f07d442e2a484853ee1112fefbe8e54e15b9cc9c Mon Sep 17 00:00:00 2001 From: Hyunseok Seo Date: Fri, 21 Jun 2024 14:50:22 +0900 Subject: [PATCH] GH-42193: [Java] Update dependency to maintain JUnit 5 only (#42206) ### Rationale for this change We have completed migrating all unit test code from JUnit 4 to JUnit 5 for all Java modules. Now, we are removing the compatibility library `junit-vintage-engine` to maintain JUnit 5 only. ### What changes are included in this PR? - Removing JUnit 4 dependencies - Updating remaining `junit.framework.TestCase` imports - Updating excludes to prevent JUnit 4 dependencies ### Are these changes tested? Yes. ### Are there any user-facing changes? No. * GitHub Issue: #42193 Authored-by: Hyunseok Seo Signed-off-by: David Li --- .../arrow/adapter/avro/AvroLogicalTypesTest.java | 4 ++-- .../jdbc/h2/JdbcToArrowOptionalColumnsTest.java | 2 +- java/pom.xml | 16 +++------------- .../arrow/vector/util/TestMapWithOrdinal.java | 2 +- 4 files changed, 7 insertions(+), 17 deletions(-) diff --git a/java/adapter/avro/src/test/java/org/apache/arrow/adapter/avro/AvroLogicalTypesTest.java b/java/adapter/avro/src/test/java/org/apache/arrow/adapter/avro/AvroLogicalTypesTest.java index b114f2b00c9fa..173cc855b1eb1 100644 --- a/java/adapter/avro/src/test/java/org/apache/arrow/adapter/avro/AvroLogicalTypesTest.java +++ b/java/adapter/avro/src/test/java/org/apache/arrow/adapter/avro/AvroLogicalTypesTest.java @@ -16,9 +16,9 @@ */ package org.apache.arrow.adapter.avro; -import static junit.framework.TestCase.assertNull; -import static junit.framework.TestCase.assertTrue; +import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.math.BigDecimal; import java.nio.ByteBuffer; diff --git a/java/adapter/jdbc/src/test/java/org/apache/arrow/adapter/jdbc/h2/JdbcToArrowOptionalColumnsTest.java b/java/adapter/jdbc/src/test/java/org/apache/arrow/adapter/jdbc/h2/JdbcToArrowOptionalColumnsTest.java index f3fbf02910230..382d20f45d4b1 100644 --- a/java/adapter/jdbc/src/test/java/org/apache/arrow/adapter/jdbc/h2/JdbcToArrowOptionalColumnsTest.java +++ b/java/adapter/jdbc/src/test/java/org/apache/arrow/adapter/jdbc/h2/JdbcToArrowOptionalColumnsTest.java @@ -16,8 +16,8 @@ */ package org.apache.arrow.adapter.jdbc.h2; -import static junit.framework.TestCase.assertTrue; import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.IOException; import java.sql.SQLException; diff --git a/java/pom.xml b/java/pom.xml index 7c4683a7281db..0543bad008546 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -261,25 +261,12 @@ under the License. ${dep.junit.jupiter.version} test - - org.junit.vintage - junit-vintage-engine - ${dep.junit.jupiter.version} - test - org.junit.jupiter junit-jupiter-params ${dep.junit.jupiter.version} test - - - junit - junit - 4.13.2 - test - org.mockito mockito-junit-jupiter @@ -659,6 +646,9 @@ under the License. org.immutables:value org.checkerframework:checker + + junit:junit:4.* + org.junit.vintage:junit-vintage-engine diff --git a/java/vector/src/test/java/org/apache/arrow/vector/util/TestMapWithOrdinal.java b/java/vector/src/test/java/org/apache/arrow/vector/util/TestMapWithOrdinal.java index e55f9f31015de..f21dc70e6d7a8 100644 --- a/java/vector/src/test/java/org/apache/arrow/vector/util/TestMapWithOrdinal.java +++ b/java/vector/src/test/java/org/apache/arrow/vector/util/TestMapWithOrdinal.java @@ -16,9 +16,9 @@ */ package org.apache.arrow.vector.util; -import static junit.framework.TestCase.assertNull; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Collection;