=act Test that serialization works instead of that the bytes match #21771
This commit is contained in:
parent
61dd7f6e35
commit
d2552128cb
1 changed files with 6 additions and 2 deletions
|
|
@ -339,8 +339,12 @@ class SerializationCompatibilitySpec extends AkkaSpec(SerializationTests.mostlyR
|
||||||
val ser = SerializationExtension(system)
|
val ser = SerializationExtension(system)
|
||||||
|
|
||||||
"Cross-version serialization compatibility" must {
|
"Cross-version serialization compatibility" must {
|
||||||
def verify(obj: SystemMessage, asExpected: String): Unit =
|
def verify(obj: SystemMessage, asExpected: String): Unit = {
|
||||||
String.valueOf(ser.serialize(obj).map(encodeHex).get) should ===(asExpected)
|
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 {
|
"be preserved for the Create SystemMessage" in {
|
||||||
// Using null as the cause to avoid a large serialized message and JDK differences
|
// Using null as the cause to avoid a large serialized message and JDK differences
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue