Package es.bsc.dataclay.test
Class TestUtils
- java.lang.Object
- 
- es.bsc.dataclay.test.TestUtils
 
- 
 public final class TestUtils extends Object - Author:
- dgasull
 
- 
- 
Field SummaryFields Modifier and Type Field Description static StringGETTER_PREFFIXstatic StringSETTER_PREFFIX
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcleanDirectory(String dirName)static ObjectcreateInstance(Class<?> instanceClass)static voidcreateOrCleanDirectory(String dirName)static voiddeleteDirectory(String dirName)static voidgenerateFieldValuesRecursively(Object stubInstance, Object anotherStubInstance, boolean useSelfLoop)static Class<?>getClass(String clName, ClassLoader cl)static Class<?>getClassNonPrimitive(String clName, ClassLoader cl)static ObjectgetRandomValue(boolean first)static ObjectgetRandomValue(Class<?> classParam, boolean first)
 
- 
- 
- 
Field Detail- 
GETTER_PREFFIXpublic static final String GETTER_PREFFIX - See Also:
- Constant Field Values
 
 - 
SETTER_PREFFIXpublic static final String SETTER_PREFFIX - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getClasspublic static Class<?> getClass(String clName, ClassLoader cl) - Parameters:
- clName- Name of the class to load
- cl- Classloader containing the class
- Returns:
- The class with name provided in the classloader provided
 
 - 
getClassNonPrimitivepublic static Class<?> getClassNonPrimitive(String clName, ClassLoader cl) - Parameters:
- clName- Name of the class
- cl- ClassLoader containing the class
- Returns:
- The class with name provided in the classloader provided. If the class name indicates a primitive type, then the object class representing the primitive type is returned (Integer, Double,...)
 
 - 
getRandomValuepublic static Object getRandomValue(Class<?> classParam, boolean first) - Parameters:
- classParam- Class of the type to generate
- first- Must be true. Used in recursive calls.
- Returns:
- An object representing a random value of the class provided (including arrays of random values) or null if the class is not primitive.
 
 - 
getRandomValuepublic static Object getRandomValue(boolean first) 
 - 
generateFieldValuesRecursivelypublic static void generateFieldValuesRecursively(Object stubInstance, Object anotherStubInstance, boolean useSelfLoop) throws Exception - Parameters:
- stubInstance-
- anotherStubInstance-
- Throws:
- Exception
 
 - 
createInstancepublic static Object createInstance(Class<?> instanceClass) throws Exception - Throws:
- Exception
 
 - 
createOrCleanDirectorypublic static void createOrCleanDirectory(String dirName) 
 - 
cleanDirectorypublic static void cleanDirectory(String dirName) 
 - 
deleteDirectorypublic static void deleteDirectory(String dirName) 
 
- 
 
-