This is an automated email from the ASF dual-hosted git repository.
lidavidm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push:
new f07d442e2a GH-42193: [Java] Update dependency to maintain JUnit 5 only
(#42206)
f07d442e2a is described below
commit f07d442e2a484853ee1112fefbe8e54e15b9cc9c
Author: Hyunseok Seo <[email protected]>
AuthorDate: Fri Jun 21 14:50:22 2024 +0900
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 <[email protected]>
Signed-off-by: David Li <[email protected]>
---
.../apache/arrow/adapter/avro/AvroLogicalTypesTest.java | 4 ++--
.../adapter/jdbc/h2/JdbcToArrowOptionalColumnsTest.java | 2 +-
java/pom.xml | 16 +++-------------
.../org/apache/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 b114f2b00c..173cc855b1 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 f3fbf02910..382d20f45d 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 7c4683a728..0543bad008 100644
--- a/java/pom.xml
+++ b/java/pom.xml
@@ -261,25 +261,12 @@ under the License.
<version>${dep.junit.jupiter.version}</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.junit.vintage</groupId>
- <artifactId>junit-vintage-engine</artifactId>
- <version>${dep.junit.jupiter.version}</version>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>${dep.junit.jupiter.version}</version>
<scope>test</scope>
</dependency>
- <!-- Use to keep older tests running -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.13.2</version>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
@@ -659,6 +646,9 @@ under the License.
<!-- Do not include annotation processors. Use the
annotations-only artifacts -->
<exclude>org.immutables:value</exclude>
<exclude>org.checkerframework:checker</exclude>
+ <!-- Exclude all JUnit 4 dependencies -->
+ <exclude>junit:junit:4.*</exclude>
+ <exclude>org.junit.vintage:junit-vintage-engine</exclude>
</excludes>
</bannedDependencies>
</rules>
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 e55f9f3101..f21dc70e6d 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;