Package guru.mikelue.foxglove.annotation
Class GenDataProcessor
java.lang.Object
guru.mikelue.foxglove.annotation.GenDataProcessor
Worker class for test framework integration.
-
Constructor Summary
ConstructorsConstructorDescriptionGenDataProcessor(Object testingInstance, AnnotatedElement annotatedElement, Supplier<DataGenContext<TableFacet>> supplierOfDataGenContext, String name) Creates an instance ofGenDataProcessoron a tested method. -
Method Summary
Modifier and TypeMethodDescriptionprotected GenDataObjectFactorybuildObjectFactory(Object testingInstance, GenData genData, DataGenContext<TableFacet> dataGenContext, String name) Builds the instance ofGenDataObjectFactory.booleanIndicates whetherGenDatais present on tested method of current.intPerforms data generating action.
-
Constructor Details
-
GenDataProcessor
public GenDataProcessor(Object testingInstance, AnnotatedElement annotatedElement, Supplier<DataGenContext<TableFacet>> supplierOfDataGenContext, String name) Creates an instance ofGenDataProcessoron a tested method.- Parameters:
testingInstance- The instance of tested classannotatedElement- TheGenDataannotated element (class or method)supplierOfDataGenContext- The supplier of data generation contextname- The name of tested method or class
-
-
Method Details
-
hasDataGenerating
public boolean hasDataGenerating()Indicates whetherGenDatais present on tested method of current.- Returns:
- true if data generation is required; false otherwise
-
performGenerating
Performs data generating action.- Returns:
- The number of generated rows; -1 if no generation is performed
- Throws:
Exception- if any error is encountered during data generation
-
buildObjectFactory
protected GenDataObjectFactory buildObjectFactory(Object testingInstance, GenData genData, DataGenContext<TableFacet> dataGenContext, String name) Builds the instance ofGenDataObjectFactory.This method may be overridden by subclasses to provide customized factory of object.
- Parameters:
testingInstance- The instance of tested classgenData- The information ofGenDatadataGenContext- The context for data generatingname- The name of tested method or class- Returns:
- The instance of
GenDataObjectFactory
-