@@ -16,6 +16,7 @@ import java.io.{ByteArrayInputStream, ByteArrayOutputStream}
1616import java .net .URLClassLoader
1717import java .nio .file .{Files , Paths }
1818import java .util .UUID
19+ import java .io .FileInputStream
1920
2021class SerializerSnapshotTest extends AnyFlatSpec with Matchers {
2122
@@ -78,7 +79,7 @@ class SerializerSnapshotTest extends AnyFlatSpec with Matchers {
7879 }
7980 }
8081
81- ignore should " serialize old serialization with the old serializer snapshot " in {
82+ def serializeWithOldSerializer () = {
8283 val uuid = UUID .fromString(" 4daf2791-abbe-420f-9594-f57ded1fee8c" )
8384 val expectedData = OuterClass (Map (uuid -> List (SimpleClass2 (" a" , 1 ))))
8485 val outerClassSerializer = implicitly[TypeSerializer [OuterClass ]]
@@ -90,15 +91,18 @@ class SerializerSnapshotTest extends AnyFlatSpec with Matchers {
9091
9192 // Serialize the data
9293 outerClassSerializer.serialize(expectedData, out)
93- Files .write(Paths .get(" modules/flink-1-api/src/test/resources/old-serializer-snapshot.dat" ), out.getSharedBuffer)
94+ val path = Paths .get(" target/test/resources/old-serializer-snapshot.dat" )
95+ Files .createDirectories(path.getParent())
96+ Files .write(path, out.getSharedBuffer)
9497 }
9598
9699 it should " deserialize old serialization with the new serializer snapshot" in {
100+ serializeWithOldSerializer()
97101 val uuid = UUID .fromString(" 4daf2791-abbe-420f-9594-f57ded1fee8c" )
98102 val expectedData = OuterClass (Map (uuid -> List (SimpleClass2 (" a" , 1 ))))
99103
100104 // Deserialize the old serialization
101- val buffer = getClass.getResourceAsStream( " /old-serializer-snapshot.dat" ).readAllBytes()
105+ val buffer = new FileInputStream ( " target/test/resources /old-serializer-snapshot.dat" ).readAllBytes()
102106 val in = new DataInputDeserializer (buffer)
103107 val deserializedSnapshot = TypeSerializerSnapshot
104108 .readVersionedSnapshot[OuterClass ](in, getClass.getClassLoader) // Flink always calls this
0 commit comments