|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.qualitytest.CoverageForPrivateConstructor
public final class CoverageForPrivateConstructor
Code coverage often report missing line coverage if your utility classes contain private constructors. Still, it is good practice to assure that utility classes cannot be constructed. This utility class will execute a private default constructor in a class and therefore remove this noise from your code coverage reports.
Method Summary | |
---|---|
static void |
giveMeCoverage(Class<?> clazz)
Reduce noise in code coverage reports by executing the private default constructor of a utility class. |
protected static void |
giveMeCoverageInternal(Class<?> clazz)
Internal method which we can mock to simulate different exceptions. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void giveMeCoverage(@Nonnull Class<?> clazz)
clazz
- The private default constructor of this class is executed.protected static void giveMeCoverageInternal(@Nonnull Class<?> clazz) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException
clazz
-
NoSuchMethodException
InstantiationException
IllegalAccessException
InvocationTargetException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |