Class SerializableAssert


  • public final class SerializableAssert
    extends Object
    Assertions for serialization.
    Since:
    1.0.0
    Version:
    $Id$
    Author:
    tlerios@marketcetera.com
    • Constructor Detail

      • SerializableAssert

        private SerializableAssert()
        Constructor. It is private so that no instances can be created.
    • Method Detail

      • assertSerializable

        public static void assertSerializable​(String message,
                                              Serializable o)
        Asserts that the given object serializes correctly, i.e. the deserialized version of the object is equal to the original object. If the assertion does not hold, the AssertionError thrown starts with the given message, which may be null if no such custom message prefix is desired.
        Parameters:
        message - The message.
        o - The object.
      • assertSerializable

        public static void assertSerializable​(Serializable o)
        Asserts that the given object serializes correctly, i.e. the deserialized version of the object is equal to the original object.
        Parameters:
        o - The object.