public final class TestUtilInternal extends Object
AbstractWidgetUnitTest,
AbstractActionUnitTest| Modifier and Type | Method and Description |
|---|---|
static Collection<Method> |
getAllMethods(Class<?> clazz,
boolean includeSuperTypes)
Helper method to fetch all the methods (public, private, protected, package) of a type with or without supertype
declared methods.
|
static boolean |
hasDefaultOrNoParameterConstructor(Class<?> clazz) |
static boolean |
isExtensible(Class<?> clazz,
int modifier) |
static boolean |
isNullsafe(Class<?> clazz) |
static boolean |
isNullsafe(Method method) |
static List<Object[]> |
prepareAllCombinations(Collection<? extends Collection<?>> possibleParams)
Returns a collection of all combinations of the given parameters.
|
static List<List<Object>> |
prepareMatchingParametersNullSafe(Method method,
Class<?> testClass) |
static String |
toSingleLine(String text) |
public static boolean isNullsafe(Class<?> clazz)
clazz - type to be checked if annotated with @NullSafeWidgetNullSafeWidgetpublic static boolean isNullsafe(Method method)
method - method to be checked if annotated with @NullSafeWidgetNullSafeWidgetpublic static boolean hasDefaultOrNoParameterConstructor(Class<?> clazz)
clazz - type to be checkedpublic static Collection<Method> getAllMethods(Class<?> clazz, boolean includeSuperTypes)
clazz - type to fetch its methodsincludeSuperTypes - if set to true methods from all the supertypes will be included.public static List<List<Object>> prepareMatchingParametersNullSafe(Method method, Class<?> testClass)
method - a method for which possible input parameters will be generatedtestClass - test class that implements the testpublic static List<Object[]> prepareAllCombinations(Collection<? extends Collection<?>> possibleParams)
[[A,B],[C,D,E],[F]]the result will be:
[[A,C,F],[A,D,F],[A,E,F],[B,C,F],[B,D,F],[B,E,F]]
public static boolean isExtensible(Class<?> clazz, int modifier)
clazz - class to check for com.hybris.cockpitng.testing.annotation.ExtensibleWidget annotationmodifier - expected level of extensibilityCopyright © 2018. All rights reserved.