llama90 commented on code in PR #42029:
URL: https://github.com/apache/arrow/pull/42029#discussion_r1631804997


##########
java/algorithm/src/test/java/org/apache/arrow/algorithm/sort/TestFixedWidthSorting.java:
##########
@@ -31,64 +31,47 @@
 import org.apache.arrow.vector.IntVector;
 import org.apache.arrow.vector.SmallIntVector;
 import org.apache.arrow.vector.TinyIntVector;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
 
 /**
  * Test sorting fixed width vectors with random data.
  */
-@RunWith(Parameterized.class)
 public class TestFixedWidthSorting<V extends BaseFixedWidthVector, U extends 
Comparable<U>> {
 
   static final int[] VECTOR_LENGTHS = new int[] {2, 5, 10, 50, 100, 1000, 
3000};
 
   static final double[] NULL_FRACTIONS = {0, 0.1, 0.3, 0.5, 0.7, 0.9, 1};
 
-  private final int length;
-
-  private final double nullFraction;
-
-  private final boolean inPlace;
-
-  private final Function<BufferAllocator, V> vectorGenerator;
-
-  private final TestSortingUtil.DataGenerator<V, U> dataGenerator;
-
   private BufferAllocator allocator;
 
-  @Before
+  @BeforeEach
   public void prepare() {
     allocator = new RootAllocator(Integer.MAX_VALUE);
   }
 
-  @After
+  @AfterEach
   public void shutdown() {
     allocator.close();
   }
 
-  public TestFixedWidthSorting(
-      int length, double nullFraction, boolean inPlace, String desc,
+  @ParameterizedTest(name = "in place = {0}, length = {1}, null fraction = 
{2}, desc = {3}, vector = {4}")
+  @MethodSource("getParameters")
+  public void testSort(
+      boolean inPlace, int length, double nullFraction, String desc,

Review Comment:
   Yes, the IDE gives a hint that `Parameter 'desc' is never used`. 
   
   However, I feel that `desc` might add some clarity. I'm not entirely sure 
whether it should be removed.
   
   ```java
             params.add(Arguments.of(
                 inPlace, length, nullFrac, "TinyIntVector",
                 (Function<BufferAllocator, TinyIntVector>) allocator -> new 
TinyIntVector("vector", allocator),
                 TestSortingUtil.TINY_INT_GENERATOR
             ));
   
             params.add(Arguments.of(
                 inPlace, length, nullFrac, "SmallIntVector",
                 (Function<BufferAllocator, SmallIntVector>) allocator -> new 
SmallIntVector("vector", allocator),
                 TestSortingUtil.SMALL_INT_GENERATOR
             ));
   
             params.add(Arguments.of(
                 inPlace, length, nullFrac, "IntVector",
                 (Function<BufferAllocator, IntVector>) allocator -> new 
IntVector("vector", allocator),
                 TestSortingUtil.INT_GENERATOR
             ));
   
             params.add(Arguments.of(
                 inPlace, length, nullFrac, "BigIntVector",
                 (Function<BufferAllocator, BigIntVector>) allocator -> new 
BigIntVector("vector", allocator),
                 TestSortingUtil.LONG_GENERATOR
             ));
   
             params.add(Arguments.of(
                 inPlace, length, nullFrac, "Float4Vector",
                 (Function<BufferAllocator, Float4Vector>) allocator -> new 
Float4Vector("vector", allocator),
                 TestSortingUtil.FLOAT_GENERATOR
             ));
   
             params.add(Arguments.of(
                 inPlace, length, nullFrac, "Float8Vector",
                 (Function<BufferAllocator, Float8Vector>) allocator -> new 
Float8Vector("vector", allocator),
                 TestSortingUtil.DOUBLE_GENERATOR
             ));
   
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to