@Immutable public final class PhlocTestUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
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 void |
testGetClone(ICloneable<?> aCloneable)
Test if the implementation
ICloneable is OK. |
static void |
testInParallel(int nCalls,
IThrowingRunnable aRunnable)
Run something in parallel
|
static void |
testInParallel(int nCalls,
Runnable aRunnable)
Run something in parallel
|
static void |
testMicroTypeConversion(Object aObj)
Test if the
MicroTypeConverter is OK. |
static <DATATYPE> void |
testToStringImplementation(DATATYPE aObject)
Test the toString implementation of the passed object.
|
public static <DATATYPE> void testToStringImplementation(@Nonnull DATATYPE aObject)
aObject - The object to be tested.public static <DATATYPE> void testDefaultImplementationWithEqualContentObject(@Nonnull DATATYPE aObject1, @Nonnull DATATYPE aObject2)
aObject1 - First object. May not be null.aObject2 - Second object. May not be null.public static <DATATYPE> void testDefaultImplementationWithDifferentContentObject(@Nonnull DATATYPE aObject1, @Nonnull DATATYPE aObject2)
aObject1 - 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 testMicroTypeConversion(@Nonnull Object aObj)
MicroTypeConverter is OK. It converts it to XML and
back and than uses
testDefaultImplementationWithEqualContentObject(Object, Object) to
check for equality.aObj - The object to testpublic static void testInParallel(@Nonnegative int nCalls, @Nonnull Runnable aRunnable)
nCalls - The number of invocations of the passed runnable. Must be ≥ 0.aRunnable - The runnable to execute. May not be null.public static void testInParallel(@Nonnegative int nCalls, @Nonnull IThrowingRunnable aRunnable)
nCalls - The number of invocations of the passed runnable. Must be ≥ 0.aRunnable - The runnable to execute. May not be null.Copyright © 2006–2014 phloc systems. All rights reserved.