Class GenDataProcessor

java.lang.Object
guru.mikelue.foxglove.annotation.GenDataProcessor

public class GenDataProcessor extends Object
Worker class for test framework integration.
  • Constructor Details

    • GenDataProcessor

      public GenDataProcessor(Object testingInstance, AnnotatedElement annotatedElement, Supplier<DataGenContext<TableFacet>> supplierOfDataGenContext, String name)
      Creates an instance of GenDataProcessor on a tested method.
      Parameters:
      testingInstance - The instance of tested class
      annotatedElement - The GenData annotated element (class or method)
      supplierOfDataGenContext - The supplier of data generation context
      name - The name of tested method or class
  • Method Details

    • hasDataGenerating

      public boolean hasDataGenerating()
      Indicates whether GenData is present on tested method of current.
      Returns:
      true if data generation is required; false otherwise
    • performGenerating

      public int performGenerating() throws Exception
      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 of GenDataObjectFactory.

      This method may be overridden by subclasses to provide customized factory of object.

      Parameters:
      testingInstance - The instance of tested class
      genData - The information of GenData
      dataGenContext - The context for data generating
      name - The name of tested method or class
      Returns:
      The instance of GenDataObjectFactory