nastra commented on code in PR #13244:
URL: https://github.com/apache/iceberg/pull/13244#discussion_r2131614012
##########
core/src/test/java/org/apache/iceberg/io/TestResolvingIO.java:
##########
@@ -43,53 +43,30 @@
import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
public class TestResolvingIO {
@TempDir private java.nio.file.Path temp;
- @Test
- public void testResolvingFileIOKryoSerialization() throws IOException {
- FileIO testResolvingFileIO = new ResolvingFileIO();
-
- // resolving fileIO should be serializable when properties are passed as
immutable map
- testResolvingFileIO.initialize(ImmutableMap.of("k1", "v1"));
- FileIO roundTripSerializedFileIO =
- TestHelpers.KryoHelpers.roundTripSerialize(testResolvingFileIO);
-
assertThat(roundTripSerializedFileIO.properties()).isEqualTo(testResolvingFileIO.properties());
- }
-
- @Test
- public void testResolvingFileIOWithHadoopFileIOKryoSerialization() throws
IOException {
- ResolvingFileIO resolvingFileIO = new ResolvingFileIO();
- Configuration conf = new Configuration();
- resolvingFileIO.setConf(conf);
- resolvingFileIO.initialize(ImmutableMap.of("k1", "v1"));
-
-
assertThat(resolvingFileIO.ioClass(temp.toString())).isEqualTo(HadoopFileIO.class);
- assertThat(resolvingFileIO.newInputFile(temp.toString())).isNotNull();
-
- ResolvingFileIO roundTripSerializedFileIO =
- TestHelpers.KryoHelpers.roundTripSerialize(resolvingFileIO);
- roundTripSerializedFileIO.setConf(conf);
-
assertThat(roundTripSerializedFileIO.properties()).isEqualTo(resolvingFileIO.properties());
-
-
assertThat(roundTripSerializedFileIO.ioClass(temp.toString())).isEqualTo(HadoopFileIO.class);
-
assertThat(roundTripSerializedFileIO.newInputFile(temp.toString())).isNotNull();
- }
-
- @Test
- public void testResolvingFileIOJavaSerialization() throws IOException,
ClassNotFoundException {
+ @ParameterizedTest
+ @MethodSource("org.apache.iceberg.TestHelpers#serializers")
+ public void testResolvingFileIOSerialization(
+ TestHelpers.RoundTripSerializer<FileIO> roundTripSerializer)
+ throws IOException, ClassNotFoundException {
FileIO testResolvingFileIO = new ResolvingFileIO();
// resolving fileIO should be serializable when properties are passed as
immutable map
testResolvingFileIO.initialize(ImmutableMap.of("k1", "v1"));
Review Comment:
please also update all the other places within the test files that are
currently scoped for this PR
--
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]