|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.smartics.util.test.lang.LangTestUtils
public final class LangTestUtils
Provides utility functions on the language level.
Method Summary | |
---|---|
static Object |
createInstanceForPrivateNoArgsConstructor(Class<?> clazz) Creates an instance of the private no-args constructor. |
static String |
removeAllWhitespaces(String input) Removes all whitespaces from the input string. |
static void |
runPrivateConstructorTest(Class<?> clazz) Tests creating an instance for a private constructor. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Object createInstanceForPrivateNoArgsConstructor(Class<?> clazz) throws SecurityException, NoSuchMethodException, InstantiationException, InvocationTargetException, ExceptionInInitializerError, IllegalStateException
This is a kind of dysfunction to get rid of missing test coverage for private constructors of constant or utility classes. To keep the overhead for this dysfuntion small, this method is provided.
clazz
- the class to instantiate with the private no-args constructor.
NoSuchMethodException
- if there is no private no-args constructor.
SecurityException
- if the request to make the private constructor accessible is denied.
InstantiationException
- if the class that declares the underlying constructor represents an abstract class.
InvocationTargetException
- if the underlying constructor throws an exception.
ExceptionInInitializerError
- if the initialization provoked by this method fails.
IllegalStateException
- if something strange happens that we did not take into account.
runPrivateConstructorTest(Class)
public static void runPrivateConstructorTest(Class<?> clazz)
This is a kind of dysfunction to get rid of missing test coverage for private constructors of constant or utility classes. To keep the overhead for this dysfuntion small, this method is provided.
Example Usage
public void testPrivateConstructor() LangTestUtils.runPrivateConstructorTest(FileNameUtils.class);
clazz
- the class to instantiate with the private no-args constructor.
createInstanceForPrivateNoArgsConstructor(Class)
public static String removeAllWhitespaces(String input)
input
- the input string to remove all whitespaces.
null
if the input string is
null
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |