public final class DataConverter extends Object
DataDrivenTestRunner and DataContext classes to store the input test data in a
format that is easy to display to the user as well as easy to interpret.| Modifier and Type | Method and Description |
|---|---|
static Map<String,List<Map<String,Object>>> |
appendClassName(Map<String,List<Map<String,Object>>> from,
Class<?> currentTestClass)
Prepend the className to the name of the method
|
static Map<String,List<Map<String,Object>>> |
convert(Map<String,List<Map<String,Object>>> from,
Class<?> currentTestClass)
Converts/normalize the input test data such that the name of the method is: prepended with the name of the
Class that the method is associated with, and appended with the input test data that the method will take.
|
static String |
getFullyQualifiedTestName(String testMethod,
Class testClass)
Returns the fully qualified name of the test method such that: if the input testClass is null, return the
test method name, else prepend the test method name with the name of the class and return.
|
static String |
getTruncatedMethodName(String testMethod,
Class testClass)
Get truncated method name such that: if the testMethod name starts with the testClass name, remove the name
of the class and return the result, else return the test method
|
public static Map<String,List<Map<String,Object>>> convert(Map<String,List<Map<String,Object>>> from, Class<?> currentTestClass)
from - the original input test datacurrentTestClass - the class of the methods that this input test data belongs topublic static String getFullyQualifiedTestName(String testMethod, Class testClass)
testMethod - the name of the test method. Cannot be nulltestClass - the name of the test class, can be null.public static String getTruncatedMethodName(String testMethod, Class testClass)
testMethod - the name of the test method. Cannot be nulltestClass - the name of the test class, can be null.public static Map<String,List<Map<String,Object>>> appendClassName(Map<String,List<Map<String,Object>>> from, Class<?> currentTestClass)
from - the input test datacurrentTestClass - the currently executing test classCopyright © 2014. All rights reserved.