|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jtiger.assertion.Serialization
public final class Serialization
Provides the ability to make assertions regarding the serializability of objects.
Serializable
Method Summary | |
---|---|
static void |
assertNotSerializes(Serializable s,
Object... message)
Asserts that the given Serializable instance does not successfully (without exceptions) serialize
and deserialize. |
static void |
assertSerializes(Serializable s,
Object... message)
Asserts that the given Serializable instance successfully (without exceptions) serializes and
deserializes. |
static void |
assertSerializesEqual(Serializable s,
Object... message)
Asserts that the given Serializable instance serializes and deserializes to produce an instance that
is equal according to its equals method implementation. |
static void |
assertSerializesSame(Serializable s,
Object... message)
Asserts that the given Serializable instance serializes and deserializes to produce the same
instance. |
static void |
assertSerializesUnequal(Serializable s,
Object... message)
Asserts that the given Serializable instance serializes and deserializes to produce an instance that
is unequal according to its equals method implementation. |
static void |
assertSerializesUnsame(Serializable s,
Object... message)
Asserts that the given Serializable instance serializes and deserializes to produce a new
instance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void assertSerializes(Serializable s, Object... message) throws AssertionException
Serializable
instance successfully (without exceptions) serializes and
deserializes.
s
- The Serializable
instance to make the assertion on.message
- The assertion message.
AssertionException
- If the given Serializable
instance does not successfully
(without exceptions) serialize and deserialize.public static void assertNotSerializes(Serializable s, Object... message) throws AssertionException
Serializable
instance does not successfully (without exceptions) serialize
and deserialize.
s
- The Serializable
instance to make the assertion on.message
- The assertion message.
AssertionException
- If the given Serializable
instance successfully (without exceptions)
serializes and deserializes.public static void assertSerializesSame(Serializable s, Object... message) throws AssertionException
Serializable
instance serializes and deserializes to produce the same
instance. This can only be achieved by overriding the readResolve
method.
s
- The Serializable
instance to make the assertion on.message
- The assertion message.
AssertionException
- If the given Serializable
instance does not serialize and deserialize to
produce the same instance.public static void assertSerializesUnsame(Serializable s, Object... message) throws AssertionException
Serializable
instance serializes and deserializes to produce a new
instance.
s
- The Serializable
instance to make the assertion on.message
- The assertion message.
AssertionException
- If the given Serializable
instance does not serialize and deserialize to
produce a new instance.public static void assertSerializesEqual(Serializable s, Object... message) throws AssertionException
Serializable
instance serializes and deserializes to produce an instance that
is equal according to its equals method implementation.
s
- The Serializable
instance to make the assertion on.message
- The assertion message.
AssertionException
- If the given Serializable
instance does not serialize and deserialize to
produce an instance that is equal according to its equals method implementation.Object.equals(Object)
public static void assertSerializesUnequal(Serializable s, Object... message) throws AssertionException
Serializable
instance serializes and deserializes to produce an instance that
is unequal according to its equals method implementation.
s
- The Serializable
instance to make the assertion on.message
- The assertion message.
AssertionException
- If the given Serializable
instance does not serialize and deserialize to
produce an instance that is unequal according to its equals method implementation.Object.equals(Object)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |