Nanook

Nanook

  • Docs
  • API
  • GitHub

›Data Generator

Logger

  • Logger Interface
  • Logger Memory

Model

  • Table Interface
  • Testcase Definition Interface
  • Todo Meta
  • Todo Static
  • Todo Generator
  • Todo Reference

Model Decision

  • Base Section Definition
  • Base Single Row Section Definition
  • Execute Section Definition
  • Never Execute Section Definition
  • Multiplicity Section Definition
  • Summary Section Definition
  • Field Section Definition
  • Field Sub Section Definition
  • Multi Row Section Definition
  • Tag Section Definition
  • Filter Section Definition
  • Generator Switch Section Definition
  • Testcase Definition Decision
  • Table Decision
  • Section Types
  • Validate Double
  • Validate Helper
  • Validate Missing

Model Matrix

  • Testcase Definition Matrix
  • Table Matrix

Importer xlsx

  • Importer xlsx

File Processor

  • Importer Interface
  • Parser Interface
  • Interface Filter
  • Simple Array Filter
  • Simple Array Ignore Filter
  • Parser Constants
  • Parser Decision Constants
  • Parser Decision
  • Parser Matrix Constants
  • Parser Matrix
  • Parser Specification Constants
  • Parser Specification
  • Parser Specification Converter

Data Generator

  • Data Generator Interface
  • Data Generator Base
  • Service Registry
  • Generator Faker

Processor

  • Interface Processor
  • Interface Writer
  • Node
  • Reference
  • Testcase Data
  • Processor
  • writeMetaData
  • writeStaticData
  • utilCartesian

Data Generator Interface

DataGeneratorInterface

The interface definition for all the data generators. The Processor uses the data generators to create the data.

Kind: global class

  • DataGeneratorInterface
    • .DataGeneratorInterface
      • new exports.DataGeneratorInterface(serviceRegistry, args)
    • .logger
    • .serviceRegistry
    • .unique
    • .maxUniqueTries
    • .uniqueSet
    • .instanceData
    • .varDir
    • .useStore
    • .name
    • .loadStore()
    • .saveStore()
    • .getGenerator(serviceName) ⇒ object
    • .clearContext()
    • .generate(instanceId, testcase, todoGenerator) ⇒ object
    • .createPostProcessTodos(instanceId, testcase, todoGenerator) ⇒ array
    • .postProcess(instanceId, testcase, todoGenerator)

dataGeneratorInterface.DataGeneratorInterface

Kind: instance class of DataGeneratorInterface

new exports.DataGeneratorInterface(serviceRegistry, args)

The service registry is used to make data generators available to other generators. If a generator does not need access to other generators the serviceRegistry my be left empty

ParamTypeDescription
serviceRegistryobjectThe service registry with all the registered generators.
argsobjectAny arguments to configure this generator.

dataGeneratorInterface.logger

The logger used for logging

Kind: instance property of DataGeneratorInterface

dataGeneratorInterface.serviceRegistry

The registry where all the available generators are registered

Kind: instance property of DataGeneratorInterface

dataGeneratorInterface.unique

If set to a true value the data generator should return unique values What unique means depends on the generator. If the generator create more than one field is up to the generator

Kind: instance property of DataGeneratorInterface

dataGeneratorInterface.maxUniqueTries

Defines how many tries the generator will do for getting a unique value until it throws an error

Kind: instance property of DataGeneratorInterface

dataGeneratorInterface.uniqueSet

Stores the data which needs to be unique

Kind: instance property of DataGeneratorInterface

dataGeneratorInterface.instanceData

Stores the data per testcase instance id

Kind: instance property of DataGeneratorInterface

dataGeneratorInterface.varDir

The directory used to store the unique data

Kind: instance property of DataGeneratorInterface

dataGeneratorInterface.useStore

Should this generator use a store

Kind: instance property of DataGeneratorInterface

dataGeneratorInterface.name

Is set when this generator is registered in the service registry

Kind: instance property of DataGeneratorInterface

dataGeneratorInterface.loadStore()

Loads the data from the file.

Kind: instance method of DataGeneratorInterface

dataGeneratorInterface.saveStore()

Saves the data to the store

Kind: instance method of DataGeneratorInterface

dataGeneratorInterface.getGenerator(serviceName) ⇒ object

Returns the Datagenerator registered under the given name. If the generator is not found an error will be thrown

Kind: instance method of DataGeneratorInterface
Returns: object - generator The generator

ParamTypeDescription
serviceNamestringThe name of the registered data generator

dataGeneratorInterface.clearContext()

Resets the context. The context stores the already generated data and is used also to check if data is unique.

Kind: instance method of DataGeneratorInterface

dataGeneratorInterface.generate(instanceId, testcase, todoGenerator) ⇒ object

Generates the value and saves it for the given instance.

Kind: instance method of DataGeneratorInterface
Returns: object - data The genrated data. If the data could not be generated because of missing data then the generator should return 'undefined'. So it could be called later. This may be the case if the generator needs referenced data which is not generated yet.

ParamTypeDescription
instanceIdstringThe testcase instance id. for the same instance id the same data object will be returned. If this is undefined then always a new value will be created.
testcaseobjectThe already generated testcase data object.
todoGeneratorobjectThe generator todo

dataGeneratorInterface.createPostProcessTodos(instanceId, testcase, todoGenerator) ⇒ array

Creates the postProcessTodos. Each generator could creates todos which will be executed later on. Sometimes a generator needs to wait for other generators created there data. This function is called after the 'generate' function

Kind: instance method of DataGeneratorInterface
Returns: array - todos The generated postProcessTodos

ParamTypeDescription
instanceIdstringThe testcase instance id. for the same instance id the same data object will be returned. If this is undefined then always a new value will be created.
testcaseobjectThe already generated testcase data object.
todoGeneratorobjectThe generator todo

dataGeneratorInterface.postProcess(instanceId, testcase, todoGenerator)

This method will be called after the generate method of all the generators are called. The order is the same as before. This method does not return any data. It could update the data directly if needed

Kind: instance method of DataGeneratorInterface

ParamTypeDescription
instanceIdstringThe testcase instance id. for the same instance id the same data object will be returned. If this is undefined then always a new value will be created.
testcaseobjectThe already generated testcase object.
todoGeneratorobjectThe todo action for the postprocessing
← Parser Specification ConverterData Generator Base →
  • DataGeneratorInterface
    • dataGeneratorInterface.DataGeneratorInterface
    • dataGeneratorInterface.logger
    • dataGeneratorInterface.serviceRegistry
    • dataGeneratorInterface.unique
    • dataGeneratorInterface.maxUniqueTries
    • dataGeneratorInterface.uniqueSet
    • dataGeneratorInterface.instanceData
    • dataGeneratorInterface.varDir
    • dataGeneratorInterface.useStore
    • dataGeneratorInterface.name
    • dataGeneratorInterface.loadStore()
    • dataGeneratorInterface.saveStore()
    • dataGeneratorInterface.getGenerator(serviceName) ⇒ object
    • dataGeneratorInterface.clearContext()
    • dataGeneratorInterface.generate(instanceId, testcase, todoGenerator) ⇒ object
    • dataGeneratorInterface.createPostProcessTodos(instanceId, testcase, todoGenerator) ⇒ array
    • dataGeneratorInterface.postProcess(instanceId, testcase, todoGenerator)
Nanook
Docs
TutorialsGuide
More
ImprintPrivacy PolicyGitHubStar
Copyright © 2022 Nanook.io