public final class DataLoaderUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
LOG
An instance of logger associated with the test framework.
|
| Constructor and Description |
|---|
DataLoaderUtil() |
| Modifier and Type | Method and Description |
|---|---|
static TestInfo |
determineLoader(DataLoader testData,
org.junit.runners.model.TestClass testClass)
Method that determines the right Loader and the right Data Files for the "write output data" functionality
supported by the EasyTest Framework.
|
static boolean |
isMethodDataLoaded(String methodName)
Check if the data for the given method is loaded or not.
|
static void |
loadData(Class<?> testClass,
org.junit.runners.model.FrameworkMethod method,
org.junit.runners.model.TestClass currentTestClass,
Map<String,List<Map<String,Object>>> writableData)
Load the Data for the given class or method.
|
protected static final org.slf4j.Logger LOG
public static TestInfo determineLoader(DataLoader testData, org.junit.runners.model.TestClass testClass)
testData - an instance of DataLoader that helps in identifying the right Loader to write the
data back to the file.testClass - the class that the TestInfo object will be associated withTestInfo an instance of TestInfo containing information about the currently executing
test.public static void loadData(Class<?> testClass, org.junit.runners.model.FrameworkMethod method, org.junit.runners.model.TestClass currentTestClass, Map<String,List<Map<String,Object>>> writableData)
DataLoader on either the class
level or the method level. In case the annotation is found, this method will load the data using the specified
loader class and then save it in the DataContext for further use by the system. We also create another copy of
the input test data that we store in the DataDrivenTestRunner.writableData field. This is done in order
to facilitate the writing of the data that might be returned by the test method.testClass - the class object, if any.method - current executing method, if any.currentTestClass - the currently executing test class. this is used to append in front of the method name to
get unique method names as there could be methods in different classes with the same name and thus we
want to avoid conflicts.writableData - The writable data that is used internally for reporting purposespublic static boolean isMethodDataLoaded(String methodName)
methodName - the name of the method whose data needs to be checked.Copyright © 2014. All rights reserved.