=act Test that serialization works instead of that the bytes match #21771

This commit is contained in:
Björn Antonsson 2016-10-31 15:40:47 +01:00
parent 61dd7f6e35
commit d2552128cb

View file

@ -339,8 +339,12 @@ class SerializationCompatibilitySpec extends AkkaSpec(SerializationTests.mostlyR
val ser = SerializationExtension(system)
"Cross-version serialization compatibility" must {
def verify(obj: SystemMessage, asExpected: String): Unit =
String.valueOf(ser.serialize(obj).map(encodeHex).get) should ===(asExpected)
def verify(obj: SystemMessage, asExpected: String): Unit = {
val bytes = javax.xml.bind.DatatypeConverter.parseHexBinary(asExpected)
val stream = new ObjectInputStream(new ByteArrayInputStream(bytes))
val read = stream.readObject()
read should ===(obj)
}
"be preserved for the Create SystemMessage" in {
// Using null as the cause to avoid a large serialized message and JDK differences