@Immutable public final class CommonsTestHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> void |
_assertEquals(String sMsg,
T aObj1,
T aObj2) |
static void |
testClone(IExplicitlyCloneable aCloneable)
Test if the implementation
IExplicitlyCloneable is OK. |
static <DATATYPE> void |
testDefaultImplementationWithDifferentContentObject(DATATYPE aObject1,
DATATYPE aObject2)
Check if two different objects are different to each other.
|
static <DATATYPE> void |
testDefaultImplementationWithEqualContentObject(DATATYPE aObject1,
DATATYPE aObject2)
Check if two different objects (who may not be the same) are equal to each
other.
|
static <DATATYPE extends Serializable> |
testDefaultSerialization(DATATYPE aSerializable)
Test the serializability of objects.
|
static <DATATYPE> void |
testEqualsImplementationWithDifferentContentObject(DATATYPE aObject,
DATATYPE aObject2) |
static <DATATYPE> void |
testEqualsImplementationWithEqualContentObject(DATATYPE aObject,
DATATYPE aObject2) |
static void |
testGetClone(ICloneable<?> aCloneable)
Test if the implementation
ICloneable is OK. |
static <DATATYPE> void |
testHashcodeImplementationWithDifferentContentObject(DATATYPE aObject1,
DATATYPE aObject2) |
static <DATATYPE> void |
testHashcodeImplementationWithEqualContentObject(DATATYPE aObject,
DATATYPE aObject2) |
static void |
testInParallel(int nCalls,
IThrowingRunnable<? extends Exception> aRunnable)
Run something in parallel
|
static void |
testToStringImplementation(Object aObject)
Test the toString implementation of the passed object.
|
static <DATATYPE> void |
testToStringImplementationWithDifferentContentObject(DATATYPE aObject,
DATATYPE aObject2) |
static <DATATYPE> void |
testToStringImplementationWithEqualContentObject(DATATYPE aObject,
DATATYPE aObject2) |
public static <T> void _assertEquals(@Nonnull String sMsg, @Nullable T aObj1, @Nullable T aObj2)
public static <DATATYPE> void testEqualsImplementationWithEqualContentObject(@Nonnull DATATYPE aObject, @Nonnull DATATYPE aObject2)
public static <DATATYPE> void testEqualsImplementationWithDifferentContentObject(@Nonnull DATATYPE aObject, @Nonnull DATATYPE aObject2)
public static <DATATYPE> void testHashcodeImplementationWithEqualContentObject(@Nonnull DATATYPE aObject, @Nonnull DATATYPE aObject2)
public static <DATATYPE> void testHashcodeImplementationWithDifferentContentObject(@Nonnull DATATYPE aObject1, @Nonnull DATATYPE aObject2)
public static void testToStringImplementation(@Nonnull Object aObject)
aObject - The object to be tested.public static <DATATYPE> void testToStringImplementationWithEqualContentObject(@Nonnull DATATYPE aObject, @Nonnull DATATYPE aObject2)
public static <DATATYPE> void testToStringImplementationWithDifferentContentObject(@Nonnull DATATYPE aObject, @Nonnull DATATYPE aObject2)
public static <DATATYPE> void testDefaultImplementationWithEqualContentObject(@Nonnull DATATYPE aObject1, @Nonnull DATATYPE aObject2)
DATATYPE - The data type to be usedaObject1 - First object. May not be null.aObject2 - Second object. May not be null.public static <DATATYPE> void testDefaultImplementationWithDifferentContentObject(@Nonnull DATATYPE aObject1, @Nonnull DATATYPE aObject2)
DATATYPE - The data type to be usedaObject1 - First object. May not be null.aObject2 - Second object. May not be null.@Nonnull public static <DATATYPE extends Serializable> DATATYPE testDefaultSerialization(@Nonnull DATATYPE aSerializable)
testDefaultImplementationWithEqualContentObject(Object, Object)DATATYPE - The type of object to be serialized.aSerializable - The object to be written and readpublic static void testGetClone(@Nonnull ICloneable<?> aCloneable)
ICloneable is OK. It creates a clone and
than uses
testDefaultImplementationWithEqualContentObject(Object, Object) to
check for equality.aCloneable - The cloneable object to testpublic static void testClone(@Nonnull IExplicitlyCloneable aCloneable)
IExplicitlyCloneable is OK. It creates a
clone and than uses
testDefaultImplementationWithEqualContentObject(Object, Object) to
check for equality.aCloneable - The cloneable object to testpublic static void testInParallel(@Nonnegative int nCalls, @Nonnull IThrowingRunnable<? extends Exception> aRunnable)
nCalls - The number of invocations of the passed runnable. Must be ≥ 0.aRunnable - The runnable to execute. May not be null.Copyright © 2014–2022 Philip Helger. All rights reserved.