Class JUnitQuickcheck

java.lang.Object
org.junit.runner.Runner
org.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>
org.junit.runners.BlockJUnit4ClassRunner
com.pholser.junit.quickcheck.runner.JUnitQuickcheck
All Implemented Interfaces:
org.junit.runner.Describable, org.junit.runner.manipulation.Filterable, org.junit.runner.manipulation.Orderable, org.junit.runner.manipulation.Sortable

public class JUnitQuickcheck extends org.junit.runners.BlockJUnit4ClassRunner

JUnit test runner for junit-quickcheck property-based tests.

When this runner runs a given test class, it regards only public instance methods with a return type of void that are marked with either the Property annotation or the org.junit.Test annotation.

This runner honors Rule, Before, After, BeforeClass, and AfterClass. Their execution is wrapped around the verification of a property or execution of a test in the expected order.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final GeometricDistribution
     
    private final org.slf4j.Logger
     
    private final GeneratorRepository
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Invoked reflectively by JUnit.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected List<org.junit.runners.model.FrameworkMethod>
     
    org.junit.runners.model.Statement
    methodBlock(org.junit.runners.model.FrameworkMethod method)
     
    private void
     
    protected void
     

    Methods inherited from class org.junit.runners.BlockJUnit4ClassRunner

    collectInitializationErrors, createTest, createTest, describeChild, getChildren, getTestRules, isIgnored, methodInvoker, possiblyExpectingExceptions, rules, runChild, testName, validateConstructor, validateFields, validateInstanceMethods, validateNoNonStaticInnerClass, validateOnlyOneConstructor, validateZeroArgConstructor, withAfters, withBefores, withPotentialTimeout

    Methods inherited from class org.junit.runners.ParentRunner

    childrenInvoker, classBlock, classRules, createTestClass, filter, getDescription, getName, getRunnerAnnotations, getTestClass, order, run, runLeaf, setScheduler, sort, validatePublicVoidNoArgMethods, withAfterClasses, withBeforeClasses, withInterruptIsolation

    Methods inherited from class org.junit.runner.Runner

    testCount

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • JUnitQuickcheck

      public JUnitQuickcheck(Class<?> clazz) throws org.junit.runners.model.InitializationError
      Invoked reflectively by JUnit.
      Parameters:
      clazz - class containing properties to verify
      Throws:
      org.junit.runners.model.InitializationError - if there is a problem with the properties class
  • Method Details

    • validateTestMethods

      protected void validateTestMethods(List<Throwable> errors)
      Overrides:
      validateTestMethods in class org.junit.runners.BlockJUnit4ClassRunner
    • validatePropertyMethods

      private void validatePropertyMethods(List<Throwable> errors)
    • computeTestMethods

      protected List<org.junit.runners.model.FrameworkMethod> computeTestMethods()
      Overrides:
      computeTestMethods in class org.junit.runners.BlockJUnit4ClassRunner
    • methodBlock

      public org.junit.runners.model.Statement methodBlock(org.junit.runners.model.FrameworkMethod method)
      Overrides:
      methodBlock in class org.junit.runners.BlockJUnit4ClassRunner