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

For getDefaultTableFacets(Object) and getDefaultDataGenerator(Object), the tested instance must define only one TableFacetsSource or DataGeneratorSource.
  • Method Details

    • loadFrom

      static <T extends TableFacet> DataGenContext<T> loadFrom(Class<?> testClass)
      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

      List<T> getTypedTableFacets(Class<? extends TableFacetsProvider<T>> clazz, Object testingInstance)
      Gets TableFacets by provider class.
      Parameters:
      clazz - The type of table facets provider
      testingInstance - The test instance to enclosing the provider class
      Returns:
      The initialized table facets
    • getNamedTableFacets

      List<T> getNamedTableFacets(String name, Object testingInstance)
      Gets named table facets from given test instance.
      Parameters:
      name - The name of table facets
      testingInstance - The test instance to grab from
      Returns:
      The grabbed table facets
    • getTypedDataGenerator

      DataGenerator<T> getTypedDataGenerator(Class<? extends DataGeneratorProvider<T>> clazz, Object testingInstance)
      Gets DataGenerators by provider class.
      Parameters:
      clazz - The type of provider of data generator
      testingInstance - The test instance to enclosing the provider class
      Returns:
      The initialized data generator
    • getNamedDataGenerator

      DataGenerator<T> getNamedDataGenerator(String name, Object testingInstance)
      Gets named data generator from given test instance.
      Parameters:
      name - The name of data generator
      testingInstance - The test instance to grab from
      Returns:
      The grabbed data generator
    • getDefaultTableFacets

      Optional<List<T>> getDefaultTableFacets(Object testingInstance)
      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

      Optional<DataGenerator<T>> getDefaultDataGenerator(Object testingInstance)
      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