@Immutable public final class CommonsTestHelper 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 int |
testIfAllSPIFilesAreValid(String sBaseDir,
boolean bContinueOnError) |
static int |
testIfAllSPIImplementationsAreValid() |
static int |
testIfAllSPIImplementationsAreValid(boolean bContinueOnError) |
static void |
testInParallel(int nCalls,
IThrowingRunnable<? extends Throwable> aRunnable)
Run something in parallel
|
static void |
testInParallel(int nCalls,
Runnable aRunnable)
Run something in parallel
|
static <T> T |
testMicroTypeConversion(T aObj)
Test if the
MicroTypeConverter is OK. |
static void |
testToStringImplementation(Object aObject)
Test the toString implementation of the passed object.
|
public static void testToStringImplementation(@Nonnull Object aObject)
aObject - The object to be tested.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 <T> T testMicroTypeConversion(@Nonnull T aObj)
MicroTypeConverter is OK. It converts it to XML and
back and than uses
testDefaultImplementationWithEqualContentObject(Object, Object) to
check for equality.T - The data type to be used and returnedaObj - 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<? extends Throwable> aRunnable)
nCalls - The number of invocations of the passed runnable. Must be ≥ 0.aRunnable - The runnable to execute. May not be null.@Nonnegative public static int testIfAllSPIFilesAreValid(@Nonnull String sBaseDir, boolean bContinueOnError) throws Exception
Exception@Nonnegative public static int testIfAllSPIImplementationsAreValid() throws Exception
Exception@Nonnegative public static int testIfAllSPIImplementationsAreValid(boolean bContinueOnError) throws Exception
ExceptionCopyright © 2014–2015 Philip Helger. All rights reserved.