nastra commented on code in PR #9380:
URL: https://github.com/apache/iceberg/pull/9380#discussion_r1445297500
##########
spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/source/TestPartitionValues.java:
##########
@@ -102,35 +105,33 @@ public static Object[][] parameters() {
private static SparkSession spark = null;
- @BeforeClass
+ @BeforeAll
public static void startSpark() {
TestPartitionValues.spark =
SparkSession.builder().master("local[2]").getOrCreate();
}
- @AfterClass
+ @AfterAll
public static void stopSpark() {
SparkSession currentSpark = TestPartitionValues.spark;
TestPartitionValues.spark = null;
currentSpark.stop();
}
- @Rule public TemporaryFolder temp = new TemporaryFolder();
+ @TempDir private Path temp;
- private final String format;
- private final boolean vectorized;
+ @Parameter(index = 0)
+ private String format;
- public TestPartitionValues(String format, boolean vectorized) {
- this.format = format;
- this.vectorized = vectorized;
- }
+ @Parameter(index = 1)
+ private boolean vectorized;
- @Test
+ @TestTemplate
public void testNullPartitionValue() throws Exception {
String desc = "null_part";
- File parent = temp.newFolder(desc);
+ File parent = new File(temp.toFile(), desc);
Review Comment:
should use same mechanism as other test classes in this PR to create a new
folder
##########
spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/source/TestPartitionValues.java:
##########
@@ -161,17 +162,17 @@ public void testNullPartitionValue() throws Exception {
List<SimpleRecord> actual =
result.orderBy("id").as(Encoders.bean(SimpleRecord.class)).collectAsList();
- Assert.assertEquals("Number of rows should match", expected.size(),
actual.size());
- Assert.assertEquals("Result rows should match", expected, actual);
+ assertThat(actual).as("Number of rows should
match").hasSameSizeAs(expected);
+ assertThat(actual).as("Result rows should match").isEqualTo(expected);
}
- @Test
+ @TestTemplate
public void testReorderedColumns() throws Exception {
String desc = "reorder_columns";
- File parent = temp.newFolder(desc);
+ File parent = new File(temp.toFile(), desc);
Review Comment:
same as above
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]