llama90 commented on code in PR #42029:
URL: https://github.com/apache/arrow/pull/42029#discussion_r1631804163
##########
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:
I saw a warning message like this: `Class 'ComparatorType' is exposed
outside its defined visibility scope` from the IDE. We can actually ignore this
message.
I rolled back for consistency.
--
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]