Class

emblem.emblematic.traversors.sync

TestDataGenerator

Related Doc: package sync

Permalink

class TestDataGenerator extends Generator

generates test data for a pool of extractors, a pool of emblems, and some custom generators. you can generate any kind of data you like by providing the appropriate TypeKey to TestDataGenerator.generate. or you can use the provided methods for generating specific kinds of data. if the generator does not know how to generate for the type you requested, it will throw a emblem.exceptions.CouldNotGenerateException.

out of the box, a TestDataGenerator knows how to generate the following basic and collection types:

you can extend this behavior by supplying the generator with an Emblematic and custom generators.

Source
TestDataGenerator.scala
Linear Supertypes
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TestDataGenerator
  2. Generator
  3. AnyRef
  4. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new TestDataGenerator(emblematic: Emblematic = Emblematic.empty, customGeneratorPool: CustomGeneratorPool = CustomGeneratorPool.empty)

    Permalink

    emblematic

    the emblematic types to use to generate test data for. defaults to empty

    customGeneratorPool

    custom generation functions. defaults to empty. custom generators take precedence over all other generators

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from TestDataGenerator to any2stringadd[TestDataGenerator] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (TestDataGenerator, B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from TestDataGenerator to ArrowAssoc[TestDataGenerator] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def boolean: Boolean

    Permalink

    generates a boolean that is true around half the time

    generates a boolean that is true around half the time

    Definition Classes
    TestDataGeneratorGenerator
  8. def char: Char

    Permalink

    generates a char that is either a decimal digit or a letter (upper or lowercase) from the Roman alphabet

    generates a char that is either a decimal digit or a letter (upper or lowercase) from the Roman alphabet

    Definition Classes
    TestDataGeneratorGenerator
  9. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. def constituentTypeKey[A](union: Union[A])(implicit arg0: TypeKey[A]): TypeKey[_ <: A]

    Permalink

    generates a type key for the union constituent

    generates a type key for the union constituent

    A

    the type of the Union object to traverse

    union

    the union

    returns

    the constituent type key

    Attributes
    protected
    Definition Classes
    TestDataGeneratorGenerator
  11. val customGeneratorPool: CustomGeneratorPool

    Permalink

    custom generation functions.

    custom generation functions. defaults to empty. custom generators take precedence over all other generators

    Attributes
    protected
    Definition Classes
    TestDataGeneratorGenerator
  12. def dateTime: DateTime

    Permalink

    generates a date-time

    generates a date-time

    Definition Classes
    TestDataGeneratorGenerator
  13. def double: Double

    Permalink

    generates a double

    generates a double

    Definition Classes
    TestDataGeneratorGenerator
  14. val emblematic: Emblematic

    Permalink

    the emblematic types to use to generate test data for.

    the emblematic types to use to generate test data for. defaults to empty

    Attributes
    protected
    Definition Classes
    TestDataGeneratorGenerator
  15. def ensuring(cond: (TestDataGenerator) ⇒ Boolean, msg: ⇒ Any): TestDataGenerator

    Permalink
    Implicit information
    This member is added by an implicit conversion from TestDataGenerator to Ensuring[TestDataGenerator] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  16. def ensuring(cond: (TestDataGenerator) ⇒ Boolean): TestDataGenerator

    Permalink
    Implicit information
    This member is added by an implicit conversion from TestDataGenerator to Ensuring[TestDataGenerator] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  17. def ensuring(cond: Boolean, msg: ⇒ Any): TestDataGenerator

    Permalink
    Implicit information
    This member is added by an implicit conversion from TestDataGenerator to Ensuring[TestDataGenerator] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  18. def ensuring(cond: Boolean): TestDataGenerator

    Permalink
    Implicit information
    This member is added by an implicit conversion from TestDataGenerator to Ensuring[TestDataGenerator] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  19. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  20. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  21. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  22. def float: Float

    Permalink

    generates a float

    generates a float

    Definition Classes
    TestDataGeneratorGenerator
  23. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from TestDataGenerator to StringFormat[TestDataGenerator] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  24. def generate[A](implicit arg0: TypeKey[A]): A

    Permalink

    generates data for the specified type A

    generates data for the specified type A

    A

    the type of data to generate

    returns

    the generated data

    Definition Classes
    Generator
    Exceptions thrown

    emblem.exceptions.CouldNotGenerateException when we encounter a type in the recursive traversal that we don't know how to generate for

  25. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  26. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  27. def int: Int

    Permalink

    generates an int

    generates an int

    Definition Classes
    TestDataGeneratorGenerator
  28. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  29. def listSize[A](implicit arg0: TypeKey[A]): Int

    Permalink

    returns the size of the list to be generated.

    returns the size of the list to be generated. a negative return value will result in an empty list.

    A

    the type of the list elements

    Attributes
    protected
    Definition Classes
    TestDataGeneratorGenerator
  30. def long: Long

    Permalink

    generates a long

    generates a long

    Definition Classes
    TestDataGeneratorGenerator
  31. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  32. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  33. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  34. def optionSize[A](implicit arg0: TypeKey[A]): Int

    Permalink

    returns the size of the option to be generated.

    returns the size of the option to be generated. a return value of 0 will generate a None, and a return value of 1 (or anything other than 0) will generate a Some.

    A

    the type of the optional value

    Attributes
    protected
    Definition Classes
    TestDataGeneratorGenerator
  35. def setSize[A](implicit arg0: TypeKey[A]): Int

    Permalink

    returns the size of the set to be generated.

    returns the size of the set to be generated. a negative return value will result in an empty set.

    A

    the type of the set elements

    Attributes
    protected
    Definition Classes
    TestDataGeneratorGenerator
  36. def string(length: Int): String

    Permalink

    generates a string of the specified length

  37. def string: String

    Permalink

    generates a string of length 8

    generates a string of length 8

    Definition Classes
    TestDataGeneratorGenerator
  38. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  39. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  40. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  41. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  42. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  43. def [B](y: B): (TestDataGenerator, B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from TestDataGenerator to ArrowAssoc[TestDataGenerator] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from Generator

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from TestDataGenerator to any2stringadd[TestDataGenerator]

Inherited by implicit conversion StringFormat from TestDataGenerator to StringFormat[TestDataGenerator]

Inherited by implicit conversion Ensuring from TestDataGenerator to Ensuring[TestDataGenerator]

Inherited by implicit conversion ArrowAssoc from TestDataGenerator to ArrowAssoc[TestDataGenerator]

Ungrouped