Class SerializationTestKit


  • public class SerializationTestKit
    extends java.lang.Object
    Utilities to test serialization.
    • Constructor Detail

      • SerializationTestKit

        public SerializationTestKit​(ActorSystem<?> system)
    • Method Detail

      • verifySerialization

        public <M> M verifySerialization​(M obj)
        Verify serialization roundtrip. Throws exception from serializer if obj can't be serialized and deserialized. Also tests that the deserialized object is equal to obj, and if not an AssertionError is thrown.

        Parameters:
        obj - the object to verify
        Returns:
        the deserialized object
      • verifySerialization

        public <M> M verifySerialization​(M obj,
                                         boolean assertEquality)
        Verify serialization roundtrip. Throws exception from serializer if obj can't be serialized and deserialized.

        Parameters:
        obj - the object to verify
        assertEquality - if true the deserialized object is verified to be equal to obj, and if not an AssertionError is thrown
        Returns:
        the deserialized object