Package com.epam.reportportal.utils
Class TestCaseIdUtils
- java.lang.Object
-
- com.epam.reportportal.utils.TestCaseIdUtils
-
public class TestCaseIdUtils extends java.lang.ObjectA static class which contains methods to generate Test Case IDs and code references.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringgetCodeRef(java.lang.reflect.Executable executable)Generates a text code reference by consuming aExecutablestatic <T> java.lang.StringgetParametersForTestCaseId(java.lang.reflect.Executable executable, java.util.List<T> parameters)Returns a string of parameters values, separated by comma and embraced by '[]'.static <T> TestCaseIdEntrygetTestCaseId(TestCaseId annotation, java.lang.reflect.Executable executable, java.lang.String codRef, java.util.List<T> parameters)Generates aTestCaseIdEntrystatic <T> TestCaseIdEntrygetTestCaseId(TestCaseId annotation, java.lang.reflect.Executable executable, java.lang.String codRef, java.util.List<T> parameters, java.lang.Object testInstance)Generates aTestCaseIdEntrystatic <T> TestCaseIdEntrygetTestCaseId(TestCaseId annotation, java.lang.reflect.Executable executable, java.util.List<T> parameters)Generates aTestCaseIdEntrystatic <T> TestCaseIdEntrygetTestCaseId(java.lang.reflect.Executable executable, java.util.List<T> parameters)Generates Test Case ID based on an executable reference and a list of parametersstatic <T> TestCaseIdEntrygetTestCaseId(java.lang.String codeRef, java.util.List<T> parameters)Generates Test Case ID based on a code reference and a list of parametersstatic <T> TestCaseIdEntrygetTestCaseId(java.util.List<T> parameters)Generates Test Case ID based on a list of parameters
-
-
-
Method Detail
-
getCodeRef
@Nonnull public static java.lang.String getCodeRef(@Nonnull java.lang.reflect.Executable executable)Generates a text code reference by consuming aExecutable- Parameters:
executable- an executable or constructor, the value should not be null- Returns:
- a text code reference
-
getParametersForTestCaseId
@Nullable public static <T> java.lang.String getParametersForTestCaseId(java.lang.reflect.Executable executable, java.util.List<T> parameters)Returns a string of parameters values, separated by comma and embraced by '[]'.- Type Parameters:
T- a type of parameters- Parameters:
executable- a constructor or methodparameters- a list of parameter values- Returns:
- a string representation of parameters
-
getTestCaseId
@Nullable public static <T> TestCaseIdEntry getTestCaseId(@Nullable TestCaseId annotation, @Nullable java.lang.reflect.Executable executable, @Nullable java.util.List<T> parameters)
Generates aTestCaseIdEntry- Type Parameters:
T- a type of parameters- Parameters:
annotation- aTestCaseIdannotation instanceexecutable- a constructor or method forTestCaseIdKeyscanparameters- a list of parameter values- Returns:
- Test Case ID or null if not possible to generate (all parameters are nulls, empty, etc.)
-
getTestCaseId
@Nullable public static <T> TestCaseIdEntry getTestCaseId(@Nullable TestCaseId annotation, @Nullable java.lang.reflect.Executable executable, @Nullable java.lang.String codRef, @Nullable java.util.List<T> parameters)
Generates aTestCaseIdEntry- Type Parameters:
T- a type of parameters- Parameters:
annotation- aTestCaseIdannotation instanceexecutable- a constructor or method forTestCaseIdKeyscancodRef- a code reference to use to generate the IDparameters- a list of parameter values- Returns:
- Test Case ID or null if not possible to generate (all parameters are nulls, empty, etc.)
-
getTestCaseId
@Nullable public static <T> TestCaseIdEntry getTestCaseId(@Nullable TestCaseId annotation, @Nullable java.lang.reflect.Executable executable, @Nullable java.lang.String codRef, @Nullable java.util.List<T> parameters, @Nullable java.lang.Object testInstance)
Generates aTestCaseIdEntry- Type Parameters:
T- a type of parameters- Parameters:
annotation- aTestCaseIdannotation instanceexecutable- a constructor or method forTestCaseIdKeyscancodRef- a code reference to use to generate the IDparameters- a list of parameter valuestestInstance- an instance of the current test, used in template processing- Returns:
- Test Case ID or null if not possible to generate (all parameters are nulls, empty, etc.)
-
getTestCaseId
@Nullable public static <T> TestCaseIdEntry getTestCaseId(@Nullable java.lang.reflect.Executable executable, @Nullable java.util.List<T> parameters)
Generates Test Case ID based on an executable reference and a list of parameters- Type Parameters:
T- parameters type- Parameters:
executable- aExecutableobjectparameters- a list of parameters- Returns:
- a Test Case ID or null
-
getTestCaseId
@Nullable public static <T> TestCaseIdEntry getTestCaseId(@Nullable java.lang.String codeRef, @Nullable java.util.List<T> parameters)
Generates Test Case ID based on a code reference and a list of parameters- Type Parameters:
T- parameters type- Parameters:
codeRef- a code referenceparameters- a list of parameters- Returns:
- a Test Case ID or null
-
getTestCaseId
@Nullable public static <T> TestCaseIdEntry getTestCaseId(@Nullable java.util.List<T> parameters)
Generates Test Case ID based on a list of parameters- Type Parameters:
T- parameters type- Parameters:
parameters- a list of parameters- Returns:
- a Test Case ID or null
-
-