Class QuickcheckArgumentsGeneratorFactory

java.lang.Object
edu.berkeley.cs.jqf.fuzz.junit.quickcheck.QuickcheckArgumentsGeneratorFactory
All Implemented Interfaces:
ArgumentsGeneratorFactory

public final class QuickcheckArgumentsGeneratorFactory extends Object implements ArgumentsGeneratorFactory
Builds junit-quickcheck-backed ArgumentsGenerators.

This is the reference generation provider. It resolves one Generator per parameter through a GeneratorRepository, honouring junit-quickcheck annotations such as @From, @Size, and @InRange. The repository uses a fixed seed so generator setup is reproducible; the per-trial randomness comes from the guided byte stream.

This class depends only on junit-quickcheck's generator API, not on its JUnit 4 runner, so it can serve both the JUnit 4 and JUnit 5 run paths.

  • Constructor Details

    • QuickcheckArgumentsGeneratorFactory

      public QuickcheckArgumentsGeneratorFactory()
      Creates a factory with its own generator repository, seeded for reproducible setup.
    • QuickcheckArgumentsGeneratorFactory

      public QuickcheckArgumentsGeneratorFactory(com.pholser.junit.quickcheck.internal.generator.GeneratorRepository repository)
      Creates a factory that resolves generators from the given repository.
      Parameters:
      repository - the generator repository to resolve parameters against
  • Method Details

    • create

      public ArgumentsGenerator create(Class<?> testClass, Method testMethod)
      Description copied from interface: ArgumentsGeneratorFactory
      Creates a generator bound to the given test method.
      Specified by:
      create in interface ArgumentsGeneratorFactory
      Parameters:
      testClass - the class declaring the test method
      testMethod - the test method whose arguments will be generated
      Returns:
      a generator for the method's parameters