Package guru.mikelue.foxglove.annotation
Interface DataGenContext<T extends TableFacet>
- Type Parameters:
T- The type of table facet
- All Known Implementing Classes:
LayeredDataGenContext
public interface DataGenContext<T extends TableFacet>
Reflection information for named
TableFacetsSource and DataGeneratorSource objects.
This interface is usually used by processing engine of test framework.
Default methods
ForgetDefaultTableFacets(Object) and getDefaultDataGenerator(Object),
the tested instance must define only one TableFacetsSource or DataGeneratorSource.-
Method Summary
Modifier and TypeMethodDescriptiongetDefaultDataGenerator(Object testingInstance) Gets default data generator from given test instance.getDefaultTableFacets(Object testingInstance) Gets default table facets from given test instance.getNamedDataGenerator(String name, Object testingInstance) Gets named data generator from given test instance.getNamedTableFacets(String name, Object testingInstance) Gets named table facets from given test instance.getTypedDataGenerator(Class<? extends DataGeneratorProvider<T>> clazz, Object testingInstance) GetsDataGenerators by provider class.getTypedTableFacets(Class<? extends TableFacetsProvider<T>> clazz, Object testingInstance) GetsTableFacets by provider class.static <T extends TableFacet>
DataGenContext<T> Loads data generation context from given test class.
-
Method Details
-
loadFrom
Loads data generation context from given test class.- Type Parameters:
T- The type of table facet- Parameters:
testClass- The test class to load from- Returns:
- The loaded data generation context
-
getTypedTableFacets
GetsTableFacets by provider class.- Parameters:
clazz- The type of table facets providertestingInstance- The test instance to enclosing the provider class- Returns:
- The initialized table facets
-
getNamedTableFacets
Gets named table facets from given test instance.- Parameters:
name- The name of table facetstestingInstance- The test instance to grab from- Returns:
- The grabbed table facets
-
getTypedDataGenerator
DataGenerator<T> getTypedDataGenerator(Class<? extends DataGeneratorProvider<T>> clazz, Object testingInstance) GetsDataGenerators by provider class.- Parameters:
clazz- The type of provider of data generatortestingInstance- The test instance to enclosing the provider class- Returns:
- The initialized data generator
-
getNamedDataGenerator
Gets named data generator from given test instance.- Parameters:
name- The name of data generatortestingInstance- The test instance to grab from- Returns:
- The grabbed data generator
-
getDefaultTableFacets
Gets default table facets from given test instance.The tested instance must define only one
TableFacetsSource, otherwise exception is thrown.- Parameters:
testingInstance- The test instance to grab from- Returns:
- The grabbed table facets
-
getDefaultDataGenerator
Gets default data generator from given test instance.The tested instance must define only one
DataGeneratorSource, otherwise exception is thrown.- Parameters:
testingInstance- The test instance to grab from- Returns:
- The grabbed data generator
-