From dbcf41cf758299f3865529913c8068ffee1ebb8f Mon Sep 17 00:00:00 2001 From: Johannes Link Date: Fri, 29 May 2020 10:26:40 +0200 Subject: [PATCH] Release 1.3.0 --- TODO.md | 4 - build.gradle | 2 +- docs/_layouts/default.html | 2 +- docs/docs/1.3.0/javadoc/allclasses-frame.html | 209 + .../1.3.0/javadoc/allclasses-noframe.html | 209 + docs/docs/1.3.0/javadoc/constant-values.html | 230 + docs/docs/1.3.0/javadoc/deprecated-list.html | 145 + docs/docs/1.3.0/javadoc/help-doc.html | 222 + docs/docs/1.3.0/javadoc/index-all.html | 3008 ++++++++++++ docs/docs/1.3.0/javadoc/index.html | 75 + .../net/jqwik/api/AfterFailureMode.html | 402 ++ .../api/Arbitraries.ArbitrariesFacade.html | 666 +++ .../javadoc/net/jqwik/api/Arbitraries.html | 1265 +++++ .../jqwik/api/Arbitrary.ArbitraryFacade.html | 357 ++ .../javadoc/net/jqwik/api/Arbitrary.html | 916 ++++ .../1.3.0/javadoc/net/jqwik/api/Assume.html | 273 ++ .../api/CannotFindArbitraryException.html | 285 ++ .../api/Combinators.BuilderCombinator.html | 253 + .../api/Combinators.CombinableBuilder.html | 240 + .../jqwik/api/Combinators.Combinator2.html | 251 + .../jqwik/api/Combinators.Combinator3.html | 251 + .../jqwik/api/Combinators.Combinator4.html | 251 + .../jqwik/api/Combinators.Combinator5.html | 251 + .../jqwik/api/Combinators.Combinator6.html | 251 + .../jqwik/api/Combinators.Combinator7.html | 251 + .../jqwik/api/Combinators.Combinator8.html | 251 + .../api/Combinators.CombinatorsFacade.html | 307 ++ .../javadoc/net/jqwik/api/Combinators.F2.html | 232 + .../javadoc/net/jqwik/api/Combinators.F3.html | 234 + .../javadoc/net/jqwik/api/Combinators.F4.html | 236 + .../javadoc/net/jqwik/api/Combinators.F5.html | 238 + .../javadoc/net/jqwik/api/Combinators.F6.html | 240 + .../javadoc/net/jqwik/api/Combinators.F7.html | 242 + .../javadoc/net/jqwik/api/Combinators.F8.html | 244 + .../jqwik/api/Combinators.ListCombinator.html | 251 + .../javadoc/net/jqwik/api/Combinators.html | 577 +++ .../1.3.0/javadoc/net/jqwik/api/Data.html | 221 + .../1.3.0/javadoc/net/jqwik/api/Disabled.html | 226 + .../jqwik/api/EdgeCases.EdgeCasesFacade.html | 331 ++ .../javadoc/net/jqwik/api/EdgeCases.html | 435 ++ .../javadoc/net/jqwik/api/EdgeCasesMode.html | 425 ++ .../1.3.0/javadoc/net/jqwik/api/Example.html | 179 + ...veGenerator.ExhaustiveGeneratorFacade.html | 316 ++ .../net/jqwik/api/ExhaustiveGenerator.html | 347 ++ .../javadoc/net/jqwik/api/FacadeLoader.html | 283 ++ .../jqwik/api/FalsificationResult.Status.html | 354 ++ .../net/jqwik/api/FalsificationResult.html | 426 ++ .../javadoc/net/jqwik/api/Falsifier.html | 270 ++ .../1.3.0/javadoc/net/jqwik/api/ForAll.html | 266 ++ .../1.3.0/javadoc/net/jqwik/api/From.html | 222 + .../1.3.0/javadoc/net/jqwik/api/FromData.html | 223 + .../jqwik/api/Functions.FunctionWrapper.html | 255 + .../jqwik/api/Functions.FunctionsFacade.html | 288 ++ .../javadoc/net/jqwik/api/Functions.html | 274 ++ .../javadoc/net/jqwik/api/GenerationMode.html | 416 ++ .../1.3.0/javadoc/net/jqwik/api/Group.html | 166 + .../javadoc/net/jqwik/api/JqwikException.html | 288 ++ .../1.3.0/javadoc/net/jqwik/api/Label.html | 221 + .../1.3.0/javadoc/net/jqwik/api/Property.html | 485 ++ .../1.3.0/javadoc/net/jqwik/api/Provide.html | 221 + ...Distribution.RandomDistributionFacade.html | 299 ++ ...omDistribution.RandomNumericGenerator.html | 232 + .../net/jqwik/api/RandomDistribution.html | 373 ++ ...RandomGenerator.RandomGeneratorFacade.html | 371 ++ .../net/jqwik/api/RandomGenerator.html | 389 ++ .../1.3.0/javadoc/net/jqwik/api/Report.html | 219 + .../javadoc/net/jqwik/api/Reporting.html | 361 ++ .../api/Shrinkable.ShrinkableFacade.html | 326 ++ .../javadoc/net/jqwik/api/Shrinkable.html | 417 ++ .../net/jqwik/api/ShrinkingDistance.html | 435 ++ .../javadoc/net/jqwik/api/ShrinkingMode.html | 370 ++ ...nkingSequence.ShrinkingSequenceFacade.html | 333 ++ .../net/jqwik/api/ShrinkingSequence.html | 336 ++ .../1.3.0/javadoc/net/jqwik/api/Table.html | 385 ++ .../docs/1.3.0/javadoc/net/jqwik/api/Tag.html | 236 + .../1.3.0/javadoc/net/jqwik/api/TagList.html | 213 + .../api/TooManyFilterMissesException.html | 271 ++ .../javadoc/net/jqwik/api/Tuple.Tuple1.html | 358 ++ .../javadoc/net/jqwik/api/Tuple.Tuple2.html | 373 ++ .../javadoc/net/jqwik/api/Tuple.Tuple3.html | 385 ++ .../javadoc/net/jqwik/api/Tuple.Tuple4.html | 397 ++ .../javadoc/net/jqwik/api/Tuple.Tuple5.html | 409 ++ .../javadoc/net/jqwik/api/Tuple.Tuple6.html | 421 ++ .../javadoc/net/jqwik/api/Tuple.Tuple7.html | 433 ++ .../javadoc/net/jqwik/api/Tuple.Tuple8.html | 441 ++ .../1.3.0/javadoc/net/jqwik/api/Tuple.html | 465 ++ .../api/arbitraries/BigDecimalArbitrary.html | 419 ++ .../api/arbitraries/BigIntegerArbitrary.html | 310 ++ .../jqwik/api/arbitraries/ByteArbitrary.html | 310 ++ .../api/arbitraries/CharacterArbitrary.html | 391 ++ .../api/arbitraries/DoubleArbitrary.html | 417 ++ .../jqwik/api/arbitraries/FloatArbitrary.html | 413 ++ .../api/arbitraries/FunctionArbitrary.html | 265 ++ .../api/arbitraries/IntegerArbitrary.html | 310 ++ .../jqwik/api/arbitraries/LongArbitrary.html | 310 ++ .../api/arbitraries/NumericalArbitrary.html | 265 ++ .../jqwik/api/arbitraries/ShortArbitrary.html | 310 ++ .../api/arbitraries/SizableArbitrary.html | 287 ++ .../api/arbitraries/StreamableArbitrary.html | 327 ++ .../api/arbitraries/StringArbitrary.html | 453 ++ .../jqwik/api/arbitraries/TypeArbitrary.html | 408 ++ .../jqwik/api/arbitraries/package-frame.html | 33 + .../api/arbitraries/package-summary.html | 225 + .../jqwik/api/arbitraries/package-tree.html | 154 + .../ArbitraryConfigurationException.html | 231 + .../configurators/ArbitraryConfigurator.html | 287 ++ .../ArbitraryConfiguratorBase.html | 333 ++ .../SelfConfiguringArbitrary.html | 269 ++ .../api/configurators/package-frame.html | 28 + .../api/configurators/package-summary.html | 186 + .../jqwik/api/configurators/package-tree.html | 160 + .../net/jqwik/api/constraints/AlphaChars.html | 177 + .../net/jqwik/api/constraints/BigRange.html | 296 ++ .../net/jqwik/api/constraints/ByteRange.html | 250 + .../net/jqwik/api/constraints/CharRange.html | 262 ++ .../jqwik/api/constraints/CharRangeList.html | 213 + .../net/jqwik/api/constraints/Chars.html | 226 + .../net/jqwik/api/constraints/CharsList.html | 213 + .../jqwik/api/constraints/DoubleRange.html | 294 ++ .../net/jqwik/api/constraints/FloatRange.html | 290 ++ .../net/jqwik/api/constraints/IntRange.html | 250 + .../net/jqwik/api/constraints/LongRange.html | 250 + .../net/jqwik/api/constraints/LowerChars.html | 177 + .../net/jqwik/api/constraints/Negative.html | 173 + .../net/jqwik/api/constraints/NotEmpty.html | 177 + .../jqwik/api/constraints/NumericChars.html | 178 + .../net/jqwik/api/constraints/Positive.html | 173 + .../net/jqwik/api/constraints/Scale.html | 221 + .../net/jqwik/api/constraints/ShortRange.html | 250 + .../net/jqwik/api/constraints/Size.html | 264 ++ .../jqwik/api/constraints/StringLength.html | 264 ++ .../net/jqwik/api/constraints/Unique.html | 174 + .../net/jqwik/api/constraints/UpperChars.html | 179 + .../net/jqwik/api/constraints/UseType.html | 233 + .../jqwik/api/constraints/UseTypeMode.html | 379 ++ .../net/jqwik/api/constraints/Whitespace.html | 177 + .../net/jqwik/api/constraints/WithNull.html | 226 + .../jqwik/api/constraints/package-frame.html | 47 + .../api/constraints/package-summary.html | 299 ++ .../jqwik/api/constraints/package-tree.html | 166 + .../domains/AbstractDomainContextBase.html | 396 ++ .../javadoc/net/jqwik/api/domains/Domain.html | 296 ++ .../DomainContext.DomainContextFacade.html | 273 ++ .../api/domains/DomainContext.Global.html | 322 ++ .../net/jqwik/api/domains/DomainContext.html | 298 ++ .../net/jqwik/api/domains/DomainList.html | 213 + .../net/jqwik/api/domains/package-frame.html | 30 + .../jqwik/api/domains/package-summary.html | 193 + .../net/jqwik/api/domains/package-tree.html | 145 + .../jqwik/api/lifecycle/AddLifecycleHook.html | 269 ++ .../jqwik/api/lifecycle/AfterContainer.html | 181 + .../api/lifecycle/AfterContainerHook.html | 325 ++ .../net/jqwik/api/lifecycle/AfterExample.html | 170 + .../jqwik/api/lifecycle/AfterProperty.html | 185 + .../net/jqwik/api/lifecycle/AfterTry.html | 186 + .../api/lifecycle/AroundContainerHook.html | 387 ++ .../api/lifecycle/AroundPropertyHook.html | 338 ++ .../jqwik/api/lifecycle/AroundTryHook.html | 346 ++ .../jqwik/api/lifecycle/BeforeContainer.html | 181 + .../api/lifecycle/BeforeContainerHook.html | 330 ++ .../jqwik/api/lifecycle/BeforeExample.html | 170 + .../jqwik/api/lifecycle/BeforeProperty.html | 185 + .../net/jqwik/api/lifecycle/BeforeTry.html | 186 + .../lifecycle/CannotFindStoreException.html | 274 ++ .../CannotResolveParameterException.html | 290 ++ .../lifecycle/ContainerLifecycleContext.html | 193 + .../jqwik/api/lifecycle/LifecycleContext.html | 400 ++ .../jqwik/api/lifecycle/LifecycleHook.html | 278 ++ .../jqwik/api/lifecycle/LifecycleHooks.html | 213 + .../net/jqwik/api/lifecycle/Lifespan.html | 377 ++ .../lifecycle/ParameterResolutionContext.html | 247 + .../api/lifecycle/PerProperty.Lifecycle.html | 309 ++ .../PerProperty.PerPropertyHook.html | 408 ++ .../net/jqwik/api/lifecycle/PerProperty.html | 226 + .../jqwik/api/lifecycle/PropagationMode.html | 384 ++ .../PropertyExecutionResult.Status.html | 370 ++ .../lifecycle/PropertyExecutionResult.html | 485 ++ .../jqwik/api/lifecycle/PropertyExecutor.html | 231 + .../lifecycle/PropertyLifecycleContext.html | 308 ++ .../lifecycle/RegistrarHook.Registrar.html | 253 + .../jqwik/api/lifecycle/RegistrarHook.html | 269 ++ .../net/jqwik/api/lifecycle/Reporter.html | 245 + ...esolveParameterHook.ParameterSupplier.html | 242 + .../api/lifecycle/ResolveParameterHook.html | 322 ++ .../SkipExecutionHook.SkipResult.html | 326 ++ .../api/lifecycle/SkipExecutionHook.html | 307 ++ .../api/lifecycle/Store.StoreFacade.html | 290 ++ .../net/jqwik/api/lifecycle/Store.html | 382 ++ .../lifecycle/TryExecutionResult.Status.html | 364 ++ .../api/lifecycle/TryExecutionResult.html | 388 ++ .../net/jqwik/api/lifecycle/TryExecutor.html | 221 + .../api/lifecycle/TryLifecycleContext.html | 296 ++ .../jqwik/api/lifecycle/package-frame.html | 73 + .../jqwik/api/lifecycle/package-summary.html | 468 ++ .../net/jqwik/api/lifecycle/package-tree.html | 222 + .../javadoc/net/jqwik/api/package-frame.html | 106 + .../net/jqwik/api/package-summary.html | 530 +++ .../javadoc/net/jqwik/api/package-tree.html | 279 ++ .../ArbitraryProvider.SubtypeProvider.html | 253 + .../api/providers/ArbitraryProvider.html | 307 ++ .../providers/TypeUsage.TypeUsageFacade.html | 301 ++ .../net/jqwik/api/providers/TypeUsage.html | 676 +++ .../jqwik/api/providers/package-frame.html | 25 + .../jqwik/api/providers/package-summary.html | 167 + .../net/jqwik/api/providers/package-tree.html | 144 + .../net/jqwik/api/stateful/Action.html | 263 ++ .../api/stateful/ActionSequence.RunState.html | 366 ++ .../jqwik/api/stateful/ActionSequence.html | 364 ++ .../api/stateful/ActionSequenceArbitrary.html | 297 ++ .../net/jqwik/api/stateful/Invariant.html | 227 + .../net/jqwik/api/stateful/package-frame.html | 26 + .../jqwik/api/stateful/package-summary.html | 171 + .../net/jqwik/api/stateful/package-tree.html | 153 + .../api/statistics/Histogram.Bucket.html | 252 + .../net/jqwik/api/statistics/Histogram.html | 413 ++ .../api/statistics/NumberRangeHistogram.html | 408 ++ .../Statistics.StatisticsFacade.html | 285 ++ .../net/jqwik/api/statistics/Statistics.html | 362 ++ .../api/statistics/StatisticsCollector.html | 272 ++ .../StatisticsCoverage.CoverageChecker.html | 335 ++ .../api/statistics/StatisticsCoverage.html | 272 ++ .../jqwik/api/statistics/StatisticsEntry.html | 279 ++ .../api/statistics/StatisticsReport.None.html | 291 ++ ...StatisticsReport.StatisticsReportMode.html | 363 ++ .../api/statistics/StatisticsReport.html | 260 ++ .../statistics/StatisticsReportFormat.html | 245 + .../jqwik/api/statistics/package-frame.html | 40 + .../jqwik/api/statistics/package-summary.html | 241 + .../jqwik/api/statistics/package-tree.html | 166 + docs/docs/1.3.0/javadoc/overview-frame.html | 28 + docs/docs/1.3.0/javadoc/overview-summary.html | 167 + docs/docs/1.3.0/javadoc/overview-tree.html | 443 ++ docs/docs/1.3.0/javadoc/package-list | 9 + docs/docs/1.3.0/javadoc/script.js | 30 + docs/docs/1.3.0/javadoc/serialized-form.html | 301 ++ docs/docs/1.3.0/javadoc/stylesheet.css | 574 +++ docs/docs/1.3.0/user-guide.md | 4090 +++++++++++++++++ docs/docs/current/javadoc/index.html | 4 +- docs/docs/current/user-guide.md | 1366 ++++-- docs/release-notes.md | 16 +- documentation/src/docs/user-guide.template.md | 2 +- 241 files changed, 74429 insertions(+), 292 deletions(-) create mode 100644 docs/docs/1.3.0/javadoc/allclasses-frame.html create mode 100644 docs/docs/1.3.0/javadoc/allclasses-noframe.html create mode 100644 docs/docs/1.3.0/javadoc/constant-values.html create mode 100644 docs/docs/1.3.0/javadoc/deprecated-list.html create mode 100644 docs/docs/1.3.0/javadoc/help-doc.html create mode 100644 docs/docs/1.3.0/javadoc/index-all.html create mode 100644 docs/docs/1.3.0/javadoc/index.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/AfterFailureMode.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.ArbitrariesFacade.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.ArbitraryFacade.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Assume.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/CannotFindArbitraryException.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.BuilderCombinator.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.CombinableBuilder.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.Combinator2.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.Combinator3.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.Combinator4.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.Combinator5.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.Combinator6.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.Combinator7.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.Combinator8.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.CombinatorsFacade.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.F2.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.F3.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.F4.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.F5.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.F6.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.F7.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.F8.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.ListCombinator.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Data.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Disabled.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/EdgeCases.EdgeCasesFacade.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/EdgeCases.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/EdgeCasesMode.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Example.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/ExhaustiveGenerator.ExhaustiveGeneratorFacade.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/ExhaustiveGenerator.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/FacadeLoader.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/FalsificationResult.Status.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/FalsificationResult.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Falsifier.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/ForAll.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/From.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/FromData.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Functions.FunctionWrapper.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Functions.FunctionsFacade.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Functions.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/GenerationMode.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Group.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/JqwikException.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Label.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Property.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Provide.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/RandomDistribution.RandomDistributionFacade.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/RandomDistribution.RandomNumericGenerator.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/RandomDistribution.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/RandomGenerator.RandomGeneratorFacade.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/RandomGenerator.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Report.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Reporting.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Shrinkable.ShrinkableFacade.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Shrinkable.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/ShrinkingDistance.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/ShrinkingMode.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/ShrinkingSequence.ShrinkingSequenceFacade.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/ShrinkingSequence.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Table.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Tag.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/TagList.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/TooManyFilterMissesException.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Tuple.Tuple1.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Tuple.Tuple2.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Tuple.Tuple3.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Tuple.Tuple4.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Tuple.Tuple5.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Tuple.Tuple6.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Tuple.Tuple7.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Tuple.Tuple8.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/Tuple.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/BigDecimalArbitrary.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/BigIntegerArbitrary.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/ByteArbitrary.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/CharacterArbitrary.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/DoubleArbitrary.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/FloatArbitrary.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/FunctionArbitrary.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/IntegerArbitrary.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/LongArbitrary.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/NumericalArbitrary.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/ShortArbitrary.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/SizableArbitrary.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/StreamableArbitrary.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/StringArbitrary.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/TypeArbitrary.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/package-frame.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/package-summary.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/package-tree.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/configurators/ArbitraryConfigurationException.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/configurators/ArbitraryConfigurator.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/configurators/ArbitraryConfiguratorBase.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/configurators/SelfConfiguringArbitrary.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/configurators/package-frame.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/configurators/package-summary.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/configurators/package-tree.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/AlphaChars.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/BigRange.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/ByteRange.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/CharRange.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/CharRangeList.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/Chars.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/CharsList.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/DoubleRange.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/FloatRange.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/IntRange.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/LongRange.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/LowerChars.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/Negative.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/NotEmpty.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/NumericChars.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/Positive.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/Scale.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/ShortRange.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/Size.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/StringLength.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/Unique.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/UpperChars.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/UseType.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/UseTypeMode.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/Whitespace.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/WithNull.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/package-frame.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/package-summary.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/package-tree.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/domains/AbstractDomainContextBase.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/domains/Domain.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/domains/DomainContext.DomainContextFacade.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/domains/DomainContext.Global.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/domains/DomainContext.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/domains/DomainList.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/domains/package-frame.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/domains/package-summary.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/domains/package-tree.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AddLifecycleHook.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AfterContainer.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AfterContainerHook.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AfterExample.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AfterProperty.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AfterTry.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AroundContainerHook.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AroundPropertyHook.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AroundTryHook.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/BeforeContainer.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/BeforeContainerHook.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/BeforeExample.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/BeforeProperty.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/BeforeTry.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/CannotFindStoreException.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/CannotResolveParameterException.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/ContainerLifecycleContext.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/LifecycleContext.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/LifecycleHook.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/LifecycleHooks.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/Lifespan.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/ParameterResolutionContext.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/PerProperty.Lifecycle.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/PerProperty.PerPropertyHook.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/PerProperty.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/PropagationMode.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/PropertyExecutionResult.Status.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/PropertyExecutionResult.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/PropertyExecutor.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/PropertyLifecycleContext.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/RegistrarHook.Registrar.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/RegistrarHook.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/Reporter.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/ResolveParameterHook.ParameterSupplier.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/ResolveParameterHook.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/SkipExecutionHook.SkipResult.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/SkipExecutionHook.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/Store.StoreFacade.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/Store.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/TryExecutionResult.Status.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/TryExecutionResult.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/TryExecutor.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/TryLifecycleContext.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/package-frame.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/package-summary.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/package-tree.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/package-frame.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/package-summary.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/package-tree.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/providers/ArbitraryProvider.SubtypeProvider.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/providers/ArbitraryProvider.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/providers/TypeUsage.TypeUsageFacade.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/providers/TypeUsage.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/providers/package-frame.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/providers/package-summary.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/providers/package-tree.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/stateful/Action.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/stateful/ActionSequence.RunState.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/stateful/ActionSequence.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/stateful/ActionSequenceArbitrary.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/stateful/Invariant.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/stateful/package-frame.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/stateful/package-summary.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/stateful/package-tree.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/Histogram.Bucket.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/Histogram.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/NumberRangeHistogram.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/Statistics.StatisticsFacade.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/Statistics.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/StatisticsCollector.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/StatisticsCoverage.CoverageChecker.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/StatisticsCoverage.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/StatisticsEntry.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/StatisticsReport.None.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/StatisticsReport.StatisticsReportMode.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/StatisticsReport.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/StatisticsReportFormat.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/package-frame.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/package-summary.html create mode 100644 docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/package-tree.html create mode 100644 docs/docs/1.3.0/javadoc/overview-frame.html create mode 100644 docs/docs/1.3.0/javadoc/overview-summary.html create mode 100644 docs/docs/1.3.0/javadoc/overview-tree.html create mode 100644 docs/docs/1.3.0/javadoc/package-list create mode 100644 docs/docs/1.3.0/javadoc/script.js create mode 100644 docs/docs/1.3.0/javadoc/serialized-form.html create mode 100644 docs/docs/1.3.0/javadoc/stylesheet.css create mode 100644 docs/docs/1.3.0/user-guide.md diff --git a/TODO.md b/TODO.md index 6f144ae14..aeb4a6b8f 100644 --- a/TODO.md +++ b/TODO.md @@ -1,7 +1,3 @@ -- 1.3.0 - - - Documentation for lifecycle hooks API in user guide - - 1.3.x - Improve Sample Reporting diff --git a/build.gradle b/build.gradle index 853c09912..6a21e2f37 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ ext { assertJVersion = '3.15.0' mockitoVersion = '3.3.3' moduleName = 'net.jqwik' - jqwikVersion = '1.3.0-SNAPSHOT' + jqwikVersion = '1.3.0' isSnapshotRelease = isSnapshotRelease(jqwikVersion) } diff --git a/docs/_layouts/default.html b/docs/_layouts/default.html index d426f5095..1a2edd751 100644 --- a/docs/_layouts/default.html +++ b/docs/_layouts/default.html @@ -22,7 +22,7 @@ View on GitHub

{{ site.title | default: site.github.repository_name }} - Latest Release: 1.2.7 + Latest Release: 1.3.0

Property-Based Testing in Java

diff --git a/docs/docs/1.3.0/javadoc/allclasses-frame.html b/docs/docs/1.3.0/javadoc/allclasses-frame.html new file mode 100644 index 000000000..0e75ad31d --- /dev/null +++ b/docs/docs/1.3.0/javadoc/allclasses-frame.html @@ -0,0 +1,209 @@ + + + + + +All Classes (documentation 1.3.0 API) + + + + +

All Classes

+
+ +
+ + diff --git a/docs/docs/1.3.0/javadoc/allclasses-noframe.html b/docs/docs/1.3.0/javadoc/allclasses-noframe.html new file mode 100644 index 000000000..9cc2001e7 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/allclasses-noframe.html @@ -0,0 +1,209 @@ + + + + + +All Classes (documentation 1.3.0 API) + + + + +

All Classes

+
+ +
+ + diff --git a/docs/docs/1.3.0/javadoc/constant-values.html b/docs/docs/1.3.0/javadoc/constant-values.html new file mode 100644 index 000000000..d3055eb49 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/constant-values.html @@ -0,0 +1,230 @@ + + + + + +Constant Field Values (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + +
+

Constant Field Values

+

Contents

+ +
+
+ + +

net.jqwik.*

+ + +
+ +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/deprecated-list.html b/docs/docs/1.3.0/javadoc/deprecated-list.html new file mode 100644 index 000000000..b139aaad1 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/deprecated-list.html @@ -0,0 +1,145 @@ + + + + + +Deprecated List (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + +
+

Deprecated API

+

Contents

+ +
+
+ + + +
+ +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/help-doc.html b/docs/docs/1.3.0/javadoc/help-doc.html new file mode 100644 index 000000000..9c1dfd723 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/help-doc.html @@ -0,0 +1,222 @@ + + + + + +API Help (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + +
+

How This API Document Is Organized

+
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
+
+
+ +This help file applies to API documentation generated using the standard doclet.
+ +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/index-all.html b/docs/docs/1.3.0/javadoc/index-all.html new file mode 100644 index 000000000..269d218a2 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/index-all.html @@ -0,0 +1,3008 @@ + + + + + +Index (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I J L M N O P R S T U V W  + + +

A

+
+
AbstractDomainContextBase - Class in net.jqwik.api.domains
+
+
Subclass for easier implementation of DomainContext
+
+
AbstractDomainContextBase() - Constructor for class net.jqwik.api.domains.AbstractDomainContextBase
+
 
+
acceptTargetType(TypeUsage) - Method in class net.jqwik.api.configurators.ArbitraryConfiguratorBase
+
+
Override if configurator only works for certain types of domain objects
+
+
Action<S> - Interface in net.jqwik.api.stateful
+
+
An action class represents a state change that can be preformed + on a stateful S.
+
+
ActionSequence<M> - Interface in net.jqwik.api.stateful
+
+
A sequence of Actions that can be run with a model of type M
+
+
ActionSequence.RunState - Enum in net.jqwik.api.stateful
+
 
+
ActionSequenceArbitrary<M> - Interface in net.jqwik.api.stateful
+
 
+
activated() - Method in enum net.jqwik.api.EdgeCasesMode
+
 
+
AddLifecycleHook - Annotation Type in net.jqwik.api.lifecycle
+
+
Use to register a concrete lifecycle hook implementation + for a test element -- a container class or a property method.
+
+
after(PropertyExecutionResult) - Method in interface net.jqwik.api.lifecycle.PerProperty.Lifecycle
+
+
Override if you want to perform some work once after the annotated property (or example).
+
+
AfterContainer - Annotation Type in net.jqwik.api.lifecycle
+
+
Annotate static methods of a container class with @AfterContainer + to have them run exactly once after all of its properties or any lifecycle + methods from embedded containers have been run.
+
+
afterContainer(ContainerLifecycleContext) - Method in interface net.jqwik.api.lifecycle.AfterContainerHook
+
+
The code of this method will be run exactly once after all property methods and child containers.
+
+
afterContainer(ContainerLifecycleContext) - Method in interface net.jqwik.api.lifecycle.AroundContainerHook
+
 
+
AfterContainerHook - Interface in net.jqwik.api.lifecycle
+
+
Implement this hook to define behaviour for a container (class or whole test suite) + that should be run exactly once after of its property methods and child containers.
+
+
afterContainerProximity() - Method in interface net.jqwik.api.lifecycle.AfterContainerHook
+
+
The higher the value, the closer to the actual property methods, i.e. the earlier it will be run.
+
+
afterContainerProximity() - Method in interface net.jqwik.api.lifecycle.AroundContainerHook
+
 
+
AfterExample - Annotation Type in net.jqwik.api.lifecycle
+
+
This is an alias of AfterProperty
+
+
AfterFailureMode - Enum in net.jqwik.api
+
+
The after-failure mode determines how a property behaves after it has been falsified.
+
+
AfterProperty - Annotation Type in net.jqwik.api.lifecycle
+
+
Annotate methods of a container class with @AfterProperty + to have them run once after each property (or example) + including properties (or examples) of embedded containers.
+
+
AfterTry - Annotation Type in net.jqwik.api.lifecycle
+
+
Annotate methods of a container class with @AfterTry + to have them run once after each try - the actual invocation of the property + method with generated parameters - including properties of + embedded containers.
+
+
all() - Method in interface net.jqwik.api.arbitraries.CharacterArbitrary
+
+
Allow all unicode chars to show up in generated values.
+
+
all() - Method in interface net.jqwik.api.arbitraries.StringArbitrary
+
+
Allow all unicode chars even noncharacters and private use characters + but only in plane 0 (aka Basic Multilingual Plane)
+
+
allValues() - Method in interface net.jqwik.api.Arbitrary
+
+
Create optional stream of all possible values this arbitrary could generate.
+
+
alpha() - Method in interface net.jqwik.api.arbitraries.StringArbitrary
+
+
Allow all alpha chars to show up in generated strings.
+
+
AlphaChars - Annotation Type in net.jqwik.api.constraints
+
+
Constrain the chars used to generate Strings or Characters to upper and lower case chars.
+
+
andThen(Function<Shrinkable<T>, ShrinkingSequence<T>>) - Method in interface net.jqwik.api.ShrinkingSequence
+
 
+
andThen(ShrinkingSequence<T>, Function<Shrinkable<T>, ShrinkingSequence<T>>) - Method in class net.jqwik.api.ShrinkingSequence.ShrinkingSequenceFacade
+
 
+
append(ShrinkingDistance) - Method in class net.jqwik.api.ShrinkingDistance
+
 
+
appliesTo(Optional<AnnotatedElement>) - Method in interface net.jqwik.api.lifecycle.LifecycleHook
+
+
This method is called once per hook and potential element during lifecycle hooks registration.
+
+
apply(T1, T2) - Method in interface net.jqwik.api.Combinators.F2
+
 
+
apply(T1, T2, T3) - Method in interface net.jqwik.api.Combinators.F3
+
 
+
apply(T1, T2, T3, T4) - Method in interface net.jqwik.api.Combinators.F4
+
 
+
apply(T1, T2, T3, T4, T5) - Method in interface net.jqwik.api.Combinators.F5
+
 
+
apply(T1, T2, T3, T4, T5, T6) - Method in interface net.jqwik.api.Combinators.F6
+
 
+
apply(T1, T2, T3, T4, T5, T6, T7) - Method in interface net.jqwik.api.Combinators.F7
+
 
+
apply(T1, T2, T3, T4, T5, T6, T7, T8) - Method in interface net.jqwik.api.Combinators.F8
+
 
+
Arbitraries - Class in net.jqwik.api
+
 
+
Arbitraries.ArbitrariesFacade - Class in net.jqwik.api
+
 
+
ArbitrariesFacade() - Constructor for class net.jqwik.api.Arbitraries.ArbitrariesFacade
+
 
+
Arbitrary<T> - Interface in net.jqwik.api
+
+
The main interface for representing objects that can be generated and shrunk.
+
+
Arbitrary.ArbitraryFacade - Class in net.jqwik.api
+
 
+
ArbitraryConfigurationException - Exception in net.jqwik.api.configurators
+
 
+
ArbitraryConfigurator - Interface in net.jqwik.api.configurators
+
+
Implementors can modify any arbitrary before it's being used for value generation.
+
+
ArbitraryConfiguratorBase - Class in net.jqwik.api.configurators
+
+
Using this base class is the easiest way to make use of the configuration mechanism + described in ArbitraryConfigurator + + + Implementations must be registered in /META-INF/services/net.jqwik.api.configurators.ArbitraryConfigurator + so that they will be automatically considered for arbitrary configuration.
+
+
ArbitraryConfiguratorBase() - Constructor for class net.jqwik.api.configurators.ArbitraryConfiguratorBase
+
 
+
ArbitraryFacade() - Constructor for class net.jqwik.api.Arbitrary.ArbitraryFacade
+
 
+
ArbitraryProvider - Interface in net.jqwik.api.providers
+
+
Implementation of this class are used to provide default arbitraries to + ForAll parameters without an explicit provider reference.
+
+
ArbitraryProvider.SubtypeProvider - Interface in net.jqwik.api.providers
+
 
+
AroundContainerHook - Interface in net.jqwik.api.lifecycle
+
+
An aggregate interface of BeforeContainerHook and AfterContainerHook + for convenience.
+
+
aroundProperty(PropertyLifecycleContext, PropertyExecutor) - Method in interface net.jqwik.api.lifecycle.AroundPropertyHook
+
+
When you wrap a property you can do stuff before and/or after its execution.
+
+
aroundProperty(PropertyLifecycleContext, PropertyExecutor) - Method in class net.jqwik.api.lifecycle.PerProperty.PerPropertyHook
+
 
+
AroundPropertyHook - Interface in net.jqwik.api.lifecycle
+
+
Implement this hook to define behaviour that should "wrap" the execution of a property, + i.e., do something directly before or after running a property - or both.
+
+
aroundPropertyProximity() - Method in interface net.jqwik.api.lifecycle.AroundPropertyHook
+
+
The higher the value, the closer to the actual property method.
+
+
aroundPropertyProximity() - Method in class net.jqwik.api.lifecycle.PerProperty.PerPropertyHook
+
 
+
aroundTry(TryLifecycleContext, TryExecutor, List<Object>) - Method in interface net.jqwik.api.lifecycle.AroundTryHook
+
+
When you wrap a try you can do stuff before and/or after its execution.
+
+
AroundTryHook - Interface in net.jqwik.api.lifecycle
+
+
Implement this hook to define behaviour that should "wrap" the execution of a single try, + i.e., do something directly before or after executing a property method with a given list of parameters.
+
+
aroundTryProximity() - Method in interface net.jqwik.api.lifecycle.AroundTryHook
+
+
The higher the value, the closer to the actual property method.
+
+
array(Arbitrary<T>, Class<A>) - Method in class net.jqwik.api.Arbitrary.ArbitraryFacade
+
 
+
array(Class<A>) - Method in interface net.jqwik.api.Arbitrary
+
+
Create a new arbitrary of type T[] using the existing arbitrary for generating the elements of the array.
+
+
as(Combinators.F2<T1, T2, R>) - Method in class net.jqwik.api.Combinators.Combinator2
+
 
+
as(Combinators.F3<T1, T2, T3, R>) - Method in class net.jqwik.api.Combinators.Combinator3
+
 
+
as(Combinators.F4<T1, T2, T3, T4, R>) - Method in class net.jqwik.api.Combinators.Combinator4
+
 
+
as(Combinators.F5<T1, T2, T3, T4, T5, R>) - Method in class net.jqwik.api.Combinators.Combinator5
+
 
+
as(Combinators.F6<T1, T2, T3, T4, T5, T6, R>) - Method in class net.jqwik.api.Combinators.Combinator6
+
 
+
as(Combinators.F7<T1, T2, T3, T4, T5, T6, T7, R>) - Method in class net.jqwik.api.Combinators.Combinator7
+
 
+
as(Combinators.F8<T1, T2, T3, T4, T5, T6, T7, T8, R>) - Method in class net.jqwik.api.Combinators.Combinator8
+
 
+
as(Function<List<T>, R>) - Method in class net.jqwik.api.Combinators.ListCombinator
+
 
+
ascii() - Method in interface net.jqwik.api.arbitraries.CharacterArbitrary
+
+
Allow all ascii chars to show up in generated values.
+
+
ascii() - Method in interface net.jqwik.api.arbitraries.StringArbitrary
+
+
Allow all ascii chars to show up in generated strings.
+
+
asGeneric() - Method in interface net.jqwik.api.Arbitrary
+
+
Sometimes simplifies test writing
+
+
asGeneric() - Method in interface net.jqwik.api.Shrinkable
+
+
Sometimes simplifies test writing
+
+
Assume - Class in net.jqwik.api
+
 
+
+ + + +

B

+
+
BASE - Static variable in interface net.jqwik.api.lifecycle.AroundPropertyHook
+
 
+
BASE - Static variable in interface net.jqwik.api.lifecycle.AroundTryHook
+
 
+
before(PropertyLifecycleContext) - Method in interface net.jqwik.api.lifecycle.PerProperty.Lifecycle
+
+
Override if you want to perform some work once before the annotated property (or example).
+
+
beforeContainer(ContainerLifecycleContext) - Method in interface net.jqwik.api.lifecycle.AroundContainerHook
+
 
+
BeforeContainer - Annotation Type in net.jqwik.api.lifecycle
+
+
Annotate static methods of a container class with @BeforeContainer + to have them run exactly once before any of its properties or any lifecycle + methods from embedded containers will be run.
+
+
beforeContainer(ContainerLifecycleContext) - Method in interface net.jqwik.api.lifecycle.BeforeContainerHook
+
+
The code of this method will be run exactly once before any property method or child container.
+
+
BeforeContainerHook - Interface in net.jqwik.api.lifecycle
+
+
Implement this hook to define behaviour for a container (class or whole test suite) + that should be run exactly once before any of its property methods and child containers.
+
+
beforeContainerProximity() - Method in interface net.jqwik.api.lifecycle.AroundContainerHook
+
 
+
beforeContainerProximity() - Method in interface net.jqwik.api.lifecycle.BeforeContainerHook
+
+
The higher the value, the closer to the actual property methods, i.e. the later it will be run.
+
+
BeforeExample - Annotation Type in net.jqwik.api.lifecycle
+
+
This is an alias of BeforeProperty
+
+
BeforeProperty - Annotation Type in net.jqwik.api.lifecycle
+
+
Annotate methods of a container class with @BeforeProperty + to have them run once before each property (or example) + including properties (or examples) of embedded containers.
+
+
BeforeTry - Annotation Type in net.jqwik.api.lifecycle
+
+
Annotate methods of a container class with @BeforeTry + to have them run once before each try - the actual invocation of the property + method with generated parameters - including properties of + embedded containers.
+
+
between(BigDecimal, BigDecimal) - Method in interface net.jqwik.api.arbitraries.BigDecimalArbitrary
+
+
Set the allowed lower min (included) and upper max (included) border of generated numbers.
+
+
between(BigDecimal, boolean, BigDecimal, boolean) - Method in interface net.jqwik.api.arbitraries.BigDecimalArbitrary
+
+
Set the allowed lower min (included) and upper max (included) border of generated numbers.
+
+
between(BigInteger, BigInteger) - Method in interface net.jqwik.api.arbitraries.BigIntegerArbitrary
+
+
Set the allowed lower min (included) and upper max (included) bounder of generated numbers.
+
+
between(byte, byte) - Method in interface net.jqwik.api.arbitraries.ByteArbitrary
+
+
Set the allowed lower min (included) and upper max (included) bounds of generated numbers.
+
+
between(double, double) - Method in interface net.jqwik.api.arbitraries.DoubleArbitrary
+
+
Set the allowed lower min (included) and upper max (included) border of generated numbers.
+
+
between(double, boolean, double, boolean) - Method in interface net.jqwik.api.arbitraries.DoubleArbitrary
+
+
Set the allowed lower min (included) and upper max (included) border of generated numbers.
+
+
between(float, float) - Method in interface net.jqwik.api.arbitraries.FloatArbitrary
+
+
Set the allowed lower min (included) and upper max (included) border of generated numbers.
+
+
between(float, boolean, float, boolean) - Method in interface net.jqwik.api.arbitraries.FloatArbitrary
+
+
Set the allowed lower min (included) and upper max (included) border of generated numbers.
+
+
between(int, int) - Method in interface net.jqwik.api.arbitraries.IntegerArbitrary
+
+
Set the allowed lower min (included) and upper max (included) bounder of generated numbers.
+
+
between(long, long) - Method in interface net.jqwik.api.arbitraries.LongArbitrary
+
+
Set the allowed lower min (included) and upper max (included) bounds of generated numbers.
+
+
between(short, short) - Method in interface net.jqwik.api.arbitraries.ShortArbitrary
+
+
Set the allowed lower min (included) and upper max (included) bounder of generated numbers.
+
+
biased() - Static method in interface net.jqwik.api.RandomDistribution
+
+
A distribution that generates values closer to the center of a numerical range + with a higher probability.
+
+
biased() - Method in class net.jqwik.api.RandomDistribution.RandomDistributionFacade
+
 
+
BigDecimalArbitrary - Interface in net.jqwik.api.arbitraries
+
+
Fluent interface to configure the generation of BigDecimal values.
+
+
bigDecimals() - Method in class net.jqwik.api.Arbitraries.ArbitrariesFacade
+
 
+
bigDecimals() - Static method in class net.jqwik.api.Arbitraries
+
+
Create an arbitrary that generates values of type BigDecimal.
+
+
BigIntegerArbitrary - Interface in net.jqwik.api.arbitraries
+
+
Fluent interface to configure the generation of BigInteger values.
+
+
bigIntegers() - Method in class net.jqwik.api.Arbitraries.ArbitrariesFacade
+
 
+
bigIntegers() - Static method in class net.jqwik.api.Arbitraries
+
+
Create an arbitrary that generates values of type BigInteger.
+
+
BigRange - Annotation Type in net.jqwik.api.constraints
+
+
Constrain the range of a generated "Big" number.
+
+
Bucket(String) - Constructor for class net.jqwik.api.statistics.Histogram.Bucket
+
 
+
Bucket(String, int) - Constructor for class net.jqwik.api.statistics.Histogram.Bucket
+
 
+
buckets() - Method in class net.jqwik.api.statistics.NumberRangeHistogram
+
+
Determines the number of buckets into which the full range of collected + numbers will be clustered.
+
+
build(Function<B, T>) - Method in class net.jqwik.api.Combinators.BuilderCombinator
+
 
+
ByteArbitrary - Interface in net.jqwik.api.arbitraries
+
+
Fluent interface to configure the generation of Byte and byte values.
+
+
ByteRange - Annotation Type in net.jqwik.api.constraints
+
+
Constrain the range of a generated byte or Byte parameters.
+
+
bytes() - Method in class net.jqwik.api.Arbitraries.ArbitrariesFacade
+
 
+
bytes() - Static method in class net.jqwik.api.Arbitraries
+
+
Create an arbitrary that generates values of type Byte.
+
+
+ + + +

C

+
+
canBeAssignedTo(TypeUsage) - Method in interface net.jqwik.api.providers.TypeUsage
+
+
Check if an instance can be assigned to another TypeUsage instance.
+
+
CannotFindArbitraryException - Exception in net.jqwik.api
+
 
+
CannotFindArbitraryException(TypeUsage) - Constructor for exception net.jqwik.api.CannotFindArbitraryException
+
 
+
CannotFindArbitraryException(TypeUsage, ForAll) - Constructor for exception net.jqwik.api.CannotFindArbitraryException
+
 
+
CannotFindStoreException - Exception in net.jqwik.api.lifecycle
+
+
Experimental feature.
+
+
CannotFindStoreException(Object, String) - Constructor for exception net.jqwik.api.lifecycle.CannotFindStoreException
+
 
+
CannotResolveParameterException - Exception in net.jqwik.api.lifecycle
+
+
Experimental feature.
+
+
CannotResolveParameterException(ParameterResolutionContext, String) - Constructor for exception net.jqwik.api.lifecycle.CannotResolveParameterException
+
 
+
CannotResolveParameterException(Parameter, String) - Constructor for exception net.jqwik.api.lifecycle.CannotResolveParameterException
+
 
+
canProvideFor(TypeUsage) - Method in interface net.jqwik.api.providers.ArbitraryProvider
+
+
Return true if the provider is suitable for targetType
+
+
CharacterArbitrary - Interface in net.jqwik.api.arbitraries
+
+
Fluent interface to configure the generation of Character and char values.
+
+
CharRange - Annotation Type in net.jqwik.api.constraints
+
+
Constrain the chars used to generate Strings or Characters to chars in the range + from from to to.
+
+
CharRangeList - Annotation Type in net.jqwik.api.constraints
+
 
+
chars() - Method in class net.jqwik.api.Arbitraries.ArbitrariesFacade
+
 
+
chars() - Static method in class net.jqwik.api.Arbitraries
+
+
Create an arbitrary that generates values of type Character.
+
+
Chars - Annotation Type in net.jqwik.api.constraints
+
+
Constrain the chars used to generate Strings or Characters to chars + contained in value.
+
+
CharsList - Annotation Type in net.jqwik.api.constraints
+
 
+
check(T) - Method in interface net.jqwik.api.stateful.Invariant
+
 
+
check(Object...) - Method in interface net.jqwik.api.statistics.StatisticsCoverage
+
+
Select a specific values set for coverage checking.
+
+
checkQuery(Predicate<? extends List<?>>) - Method in interface net.jqwik.api.statistics.StatisticsCoverage
+
+
Execute a query for coverage checking.
+
+
cluster(List<StatisticsEntry>) - Method in class net.jqwik.api.statistics.Histogram
+
+
Cluster entries into buckets.
+
+
cluster(List<StatisticsEntry>) - Method in class net.jqwik.api.statistics.NumberRangeHistogram
+
+
Does not make sense to override because this has the number range functionality
+
+
collect(Predicate<List<T>>) - Method in interface net.jqwik.api.Arbitrary
+
+
Create a new arbitrary of type List<T> by adding elements of type T until condition until is fulfilled.
+
+
collect(Predicate<List<T>>) - Method in interface net.jqwik.api.RandomGenerator
+
 
+
collect(RandomGenerator<T>, Predicate<List<T>>) - Method in class net.jqwik.api.RandomGenerator.RandomGeneratorFacade
+
 
+
collect(Object...) - Static method in class net.jqwik.api.statistics.Statistics
+
+
Call this method to record an entry for statistical data about generated values.
+
+
collect(Object...) - Method in interface net.jqwik.api.statistics.StatisticsCollector
+
+
Call this method to record an entry for statistical data about generated values.
+
+
collectorByLabel(String) - Method in class net.jqwik.api.statistics.Statistics.StatisticsFacade
+
 
+
Combinators - Class in net.jqwik.api
+
 
+
Combinators.BuilderCombinator<B> - Class in net.jqwik.api
+
 
+
Combinators.CombinableBuilder<B,T> - Class in net.jqwik.api
+
 
+
Combinators.Combinator2<T1,T2> - Class in net.jqwik.api
+
 
+
Combinators.Combinator3<T1,T2,T3> - Class in net.jqwik.api
+
 
+
Combinators.Combinator4<T1,T2,T3,T4> - Class in net.jqwik.api
+
 
+
Combinators.Combinator5<T1,T2,T3,T4,T5> - Class in net.jqwik.api
+
 
+
Combinators.Combinator6<T1,T2,T3,T4,T5,T6> - Class in net.jqwik.api
+
 
+
Combinators.Combinator7<T1,T2,T3,T4,T5,T6,T7> - Class in net.jqwik.api
+
 
+
Combinators.Combinator8<T1,T2,T3,T4,T5,T6,T7,T8> - Class in net.jqwik.api
+
 
+
Combinators.CombinatorsFacade - Class in net.jqwik.api
+
 
+
Combinators.F2<T1,T2,R> - Interface in net.jqwik.api
+
 
+
Combinators.F3<T1,T2,T3,R> - Interface in net.jqwik.api
+
 
+
Combinators.F4<T1,T2,T3,T4,R> - Interface in net.jqwik.api
+
 
+
Combinators.F5<T1,T2,T3,T4,T5,R> - Interface in net.jqwik.api
+
 
+
Combinators.F6<T1,T2,T3,T4,T5,T6,R> - Interface in net.jqwik.api
+
 
+
Combinators.F7<T1,T2,T3,T4,T5,T6,T7,R> - Interface in net.jqwik.api
+
 
+
Combinators.F8<T1,T2,T3,T4,T5,T6,T7,T8,R> - Interface in net.jqwik.api
+
 
+
Combinators.ListCombinator<T> - Class in net.jqwik.api
+
 
+
CombinatorsFacade() - Constructor for class net.jqwik.api.Combinators.CombinatorsFacade
+
 
+
combine(Arbitrary<T1>, Arbitrary<T2>) - Static method in class net.jqwik.api.Combinators
+
+
Combine 2 arbitraries into one.
+
+
combine(Arbitrary<T1>, Arbitrary<T2>, Arbitrary<T3>) - Static method in class net.jqwik.api.Combinators
+
+
Combine 3 arbitraries into one.
+
+
combine(Arbitrary<T1>, Arbitrary<T2>, Arbitrary<T3>, Arbitrary<T4>) - Static method in class net.jqwik.api.Combinators
+
+
Combine 4 arbitraries into one.
+
+
combine(Arbitrary<T1>, Arbitrary<T2>, Arbitrary<T3>, Arbitrary<T4>, Arbitrary<T5>) - Static method in class net.jqwik.api.Combinators
+
+
Combine 5 arbitraries into one.
+
+
combine(Arbitrary<T1>, Arbitrary<T2>, Arbitrary<T3>, Arbitrary<T4>, Arbitrary<T5>, Arbitrary<T6>) - Static method in class net.jqwik.api.Combinators
+
+
Combine 6 arbitraries into one.
+
+
combine(Arbitrary<T1>, Arbitrary<T2>, Arbitrary<T3>, Arbitrary<T4>, Arbitrary<T5>, Arbitrary<T6>, Arbitrary<T7>) - Static method in class net.jqwik.api.Combinators
+
+
Combine 7 arbitraries into one.
+
+
combine(Arbitrary<T1>, Arbitrary<T2>, Arbitrary<T3>, Arbitrary<T4>, Arbitrary<T5>, Arbitrary<T6>, Arbitrary<T7>, Arbitrary<T8>) - Static method in class net.jqwik.api.Combinators
+
+
Combine 8 arbitraries into one.
+
+
combine(List<Arbitrary<T>>) - Static method in class net.jqwik.api.Combinators
+
+
Combine a list of arbitraries into one.
+
+
combine(List<Shrinkable<T>>) - Static method in class net.jqwik.api.ShrinkingDistance
+
 
+
combineEdgeCases(List<Arbitrary<Object>>, Function<List<Object>, R>) - Method in class net.jqwik.api.Combinators.CombinatorsFacade
+
 
+
combineExhaustive(List<Arbitrary<Object>>, Function<List<Object>, R>, long) - Method in class net.jqwik.api.Combinators.CombinatorsFacade
+
 
+
combineShrinkables(List<Shrinkable<Object>>, Function<List<Object>, R>) - Method in class net.jqwik.api.Combinators.CombinatorsFacade
+
 
+
comparator() - Method in class net.jqwik.api.statistics.Histogram
+
+
Determine how entries are being sorted from top to bottom.
+
+
comparator() - Method in class net.jqwik.api.statistics.NumberRangeHistogram
+
+
Does not make sense to override since order does not matter for clustering anyway
+
+
compareTo(ArbitraryConfigurator) - Method in interface net.jqwik.api.configurators.ArbitraryConfigurator
+
 
+
compareTo(FalsificationResult<T>) - Method in class net.jqwik.api.FalsificationResult
+
 
+
compareTo(AfterContainerHook) - Method in interface net.jqwik.api.lifecycle.AfterContainerHook
+
 
+
compareTo(AroundPropertyHook) - Method in interface net.jqwik.api.lifecycle.AroundPropertyHook
+
 
+
compareTo(AroundTryHook) - Method in interface net.jqwik.api.lifecycle.AroundTryHook
+
 
+
compareTo(BeforeContainerHook) - Method in interface net.jqwik.api.lifecycle.BeforeContainerHook
+
 
+
compareTo(Shrinkable<T>) - Method in interface net.jqwik.api.Shrinkable
+
 
+
compareTo(ShrinkingDistance) - Method in class net.jqwik.api.ShrinkingDistance
+
 
+
concat(EdgeCases<T>...) - Static method in interface net.jqwik.api.EdgeCases
+
 
+
concat(List<EdgeCases<T>>) - Static method in interface net.jqwik.api.EdgeCases
+
 
+
concat(List<EdgeCases<T>>) - Method in class net.jqwik.api.EdgeCases.EdgeCasesFacade
+
 
+
configure(Arbitrary<T>, TypeUsage) - Method in interface net.jqwik.api.configurators.ArbitraryConfigurator
+
+
Configure a given arbitrary and return the configured instance.
+
+
configure(Arbitrary<T>, TypeUsage) - Method in class net.jqwik.api.configurators.ArbitraryConfiguratorBase
+
 
+
configure(Arbitrary<T>, ArbitraryConfigurator, TypeUsage) - Static method in interface net.jqwik.api.configurators.SelfConfiguringArbitrary
+
+
If an arbitrary is self configuring use it, otherwise use default configurator
+
+
configure(ArbitraryConfigurator, TypeUsage) - Method in interface net.jqwik.api.configurators.SelfConfiguringArbitrary
+
+
Do all configuration yourself or delegate to ArbitraryConfigurator.configure(Arbitrary, TypeUsage) + of the configurator that's being handed in.
+
+
constant(T) - Static method in class net.jqwik.api.Arbitraries
+
+
Create an arbitrary that will always generate the same value.
+
+
containedIn(Reporting[]) - Method in enum net.jqwik.api.Reporting
+
 
+
containerClass() - Method in interface net.jqwik.api.lifecycle.PropertyLifecycleContext
+
+
The container class in which the current property method is running.
+
+
containerClass() - Method in interface net.jqwik.api.lifecycle.TryLifecycleContext
+
+
The container class in which the current property method is running.
+
+
ContainerLifecycleContext - Interface in net.jqwik.api.lifecycle
+
+
The context of a test container (a container class or the whole jqwik suite).
+
+
count(Predicate<Integer>) - Method in interface net.jqwik.api.statistics.StatisticsCoverage.CoverageChecker
+
+
Check the number of occurrences returning true (ok) or false (fail)
+
+
count(BiPredicate<Integer, Integer>) - Method in interface net.jqwik.api.statistics.StatisticsCoverage.CoverageChecker
+
+
Check the number of occurrences using one or more assertions.
+
+
count(Consumer<Integer>) - Method in interface net.jqwik.api.statistics.StatisticsCoverage.CoverageChecker
+
+
Check the number of occurrences returning true (ok) or false (fail).
+
+
count(BiConsumer<Integer, Integer>) - Method in interface net.jqwik.api.statistics.StatisticsCoverage.CoverageChecker
+
+
Check the number of occurrences using one or more assertions.
+
+
count() - Method in interface net.jqwik.api.statistics.StatisticsEntry
+
+
The number of times a certain value (set) has been collected
+
+
countChecks() - Method in interface net.jqwik.api.lifecycle.PropertyExecutionResult
+
+
The number of tries for which parameters were created + and the property method run.
+
+
countTries() - Method in interface net.jqwik.api.lifecycle.PropertyExecutionResult
+
+
The number of tries for which parameters were created and the property method run + and which were not aborted, e.g. through a failing assumption.
+
+
coverage(Consumer<StatisticsCoverage>) - Static method in class net.jqwik.api.statistics.Statistics
+
+
Perform coverage checking for successful property on statistics + for values collected with Statistics.collect(Object...)
+
+
coverage(Consumer<StatisticsCoverage>) - Method in interface net.jqwik.api.statistics.StatisticsCollector
+
+
Perform coverage checking for successful property on statistics.
+
+
create(Supplier<T>) - Static method in class net.jqwik.api.Arbitraries
+
+
Create an arbitrary that will use a supplier to generate a value.
+
+
create(Object, Lifespan, Supplier<T>) - Static method in interface net.jqwik.api.lifecycle.Store
+
+
Create a new store for storing and retrieving values and objects in lifecycle + hooks and lifecycle-dependent methods.
+
+
create(Object, Lifespan, Supplier<T>) - Method in class net.jqwik.api.lifecycle.Store.StoreFacade
+
 
+
createGenerator(int, BigInteger, BigInteger, BigInteger) - Method in interface net.jqwik.api.RandomDistribution
+
+
Return a generator that will generate value with the desired distribution
+
+
current() - Method in interface net.jqwik.api.ShrinkingSequence
+
 
+
+ + + +

D

+
+
Data - Annotation Type in net.jqwik.api
+
+
Used to annotate methods that can provide data points for property methods.
+
+
DEFAULT_STEREOTYPE - Static variable in annotation type net.jqwik.api.Property
+
 
+
defaultCollector() - Method in class net.jqwik.api.statistics.Statistics.StatisticsFacade
+
 
+
defaultFor(Class<T>, Class<?>[]) - Method in class net.jqwik.api.Arbitraries.ArbitrariesFacade
+
 
+
defaultFor(TypeUsage) - Method in class net.jqwik.api.Arbitraries.ArbitrariesFacade
+
 
+
defaultFor(Class<T>, Class<?>...) - Static method in class net.jqwik.api.Arbitraries
+
+
Find a registered arbitrary that will be used to generate values of type T.
+
+
defaultFor(TypeUsage) - Static method in class net.jqwik.api.Arbitraries
+
+
Find a registered arbitrary that will be used to generate values of type T.
+
+
digit() - Method in interface net.jqwik.api.arbitraries.CharacterArbitrary
+
+
Allow all numeric chars (digits) to show up in generated values.
+
+
dimensions() - Method in class net.jqwik.api.ShrinkingDistance
+
 
+
Disabled - Annotation Type in net.jqwik.api
+
+
Use @Disabled("reason to disable") to disable test container or test method + during normal test execution.
+
+
distance() - Method in class net.jqwik.api.FalsificationResult
+
 
+
distance() - Method in interface net.jqwik.api.Shrinkable
+
 
+
DO_NOT_RESOLVE - Static variable in interface net.jqwik.api.lifecycle.ResolveParameterHook
+
 
+
DO_NOT_SKIP - Static variable in interface net.jqwik.api.lifecycle.SkipExecutionHook
+
 
+
DO_NOTHING - Static variable in interface net.jqwik.api.lifecycle.AfterContainerHook
+
 
+
DO_NOTHING - Static variable in interface net.jqwik.api.lifecycle.BeforeContainerHook
+
 
+
Domain - Annotation Type in net.jqwik.api.domains
+
+
Use @Domain(MyDomainContext.class) to use only + arbitrary providers and + arbitrary configurators + defined in given context class + + You can have many domains on the same element.
+
+
DomainContext - Interface in net.jqwik.api.domains
+
+
Class that implement this interface are used to annotate property methods or containers like this: + Domain(MyDomainContext.class).
+
+
DomainContext.DomainContextFacade - Class in net.jqwik.api.domains
+
 
+
DomainContext.Global - Class in net.jqwik.api.domains
+
 
+
DomainContextFacade() - Constructor for class net.jqwik.api.domains.DomainContext.DomainContextFacade
+
 
+
DomainList - Annotation Type in net.jqwik.api.domains
+
 
+
doNotSkip() - Static method in class net.jqwik.api.lifecycle.SkipExecutionHook.SkipResult
+
+
Create instance of SkipExecutionHook.SkipResult to make the current element not being skipped.
+
+
dontShrink(Shrinkable<T>) - Static method in interface net.jqwik.api.ShrinkingSequence
+
 
+
dontShrink(Shrinkable<T>) - Method in class net.jqwik.api.ShrinkingSequence.ShrinkingSequenceFacade
+
 
+
DoubleArbitrary - Interface in net.jqwik.api.arbitraries
+
+
Fluent interface to configure the generation of Double and double values.
+
+
DoubleRange - Annotation Type in net.jqwik.api.constraints
+
+
Constrain the range of a generated double or Double parameters.
+
+
doubles() - Method in class net.jqwik.api.Arbitraries.ArbitrariesFacade
+
 
+
doubles() - Static method in class net.jqwik.api.Arbitraries
+
+
Create an arbitrary that generates values of type Double.
+
+
+ + + +

E

+
+
edgeCases() - Method in interface net.jqwik.api.Arbitrary
+
 
+
EdgeCases<T> - Interface in net.jqwik.api
+
 
+
EdgeCases.EdgeCasesFacade - Class in net.jqwik.api
+
 
+
edgeCasesChoose(List<T>) - Method in class net.jqwik.api.Arbitraries.ArbitrariesFacade
+
 
+
edgeCasesChoose(char[]) - Method in class net.jqwik.api.Arbitraries.ArbitrariesFacade
+
 
+
EdgeCasesFacade() - Constructor for class net.jqwik.api.EdgeCases.EdgeCasesFacade
+
 
+
EdgeCasesMode - Enum in net.jqwik.api
+
+
The edge-cases mode determines if and when combined edge-cases of all parameters will be explicitly generated.
+
+
ensureFunctionalType(Class<?>) - Method in class net.jqwik.api.Functions.FunctionsFacade
+
 
+
entries(Arbitrary<K>, Arbitrary<V>) - Method in class net.jqwik.api.Arbitraries.ArbitrariesFacade
+
 
+
entries(Arbitrary<K>, Arbitrary<V>) - Static method in class net.jqwik.api.Arbitraries
+
+
Create an arbitrary to create instances of Map.Entry.
+
+
equals(Object) - Method in class net.jqwik.api.ShrinkingDistance
+
 
+
equals(Object) - Method in class net.jqwik.api.Tuple.Tuple1
+
 
+
equals(Object) - Method in class net.jqwik.api.Tuple.Tuple2
+
 
+
equals(Object) - Method in class net.jqwik.api.Tuple.Tuple3
+
 
+
equals(Object) - Method in class net.jqwik.api.Tuple.Tuple4
+
 
+
equals(Object) - Method in class net.jqwik.api.Tuple.Tuple5
+
 
+
equals(Object) - Method in class net.jqwik.api.Tuple.Tuple6
+
 
+
equals(Object) - Method in class net.jqwik.api.Tuple.Tuple7
+
 
+
equals(Object) - Method in class net.jqwik.api.Tuple.Tuple8
+
 
+
Example - Annotation Type in net.jqwik.api
+
+
Use @Example to mark methods that are simple, example-based + test cases.
+
+
execute(T) - Method in interface net.jqwik.api.Falsifier
+
 
+
execute() - Method in interface net.jqwik.api.lifecycle.PropertyExecutor
+
+
Call to actually run the property, including all hooks that are "closer" + (have a higher proximity) than the current hook.
+
+
execute(List<Object>) - Method in interface net.jqwik.api.lifecycle.TryExecutor
+
 
+
exhaustive() - Method in interface net.jqwik.api.Arbitrary
+
+
Create the exhaustive generator for an arbitrary using the maximum allowed + number of generated samples.
+
+
exhaustive(long) - Method in interface net.jqwik.api.Arbitrary
+
+
Create the exhaustive generator for an arbitrary.
+
+
exhaustiveChoose(List<T>, long) - Method in class net.jqwik.api.Arbitraries.ArbitrariesFacade
+
 
+
exhaustiveChoose(char[], long) - Method in class net.jqwik.api.Arbitraries.ArbitrariesFacade
+
 
+
exhaustiveCreate(Supplier<T>, long) - Method in class net.jqwik.api.Arbitraries.ArbitrariesFacade
+
 
+
ExhaustiveGenerator<T> - Interface in net.jqwik.api
+
+
Used only internally to run and compute exhaustive generation of parameters
+
+
ExhaustiveGenerator.ExhaustiveGeneratorFacade - Class in net.jqwik.api
+
 
+
ExhaustiveGeneratorFacade() - Constructor for class net.jqwik.api.ExhaustiveGenerator.ExhaustiveGeneratorFacade
+
 
+
exhaustiveShuffle(List<T>, long) - Method in class net.jqwik.api.Arbitraries.ArbitrariesFacade
+
 
+
extendedLabel() - Method in interface net.jqwik.api.lifecycle.PropertyLifecycleContext
+
+
The extended label contains additional information about the current container class.
+
+
+ + + +

F

+
+
FacadeLoader - Class in net.jqwik.api
+
 
+
FacadeLoader() - Constructor for class net.jqwik.api.FacadeLoader
+
 
+
FalsificationResult<T> - Class in net.jqwik.api
+
 
+
FalsificationResult.Status - Enum in net.jqwik.api
+
 
+
falsified(Shrinkable<T>) - Static method in class net.jqwik.api.FalsificationResult
+
 
+
falsified(Shrinkable<T>, Throwable) - Static method in class net.jqwik.api.FalsificationResult
+
 
+
falsified(Throwable) - Static method in interface net.jqwik.api.lifecycle.TryExecutionResult
+
+
Create a result that falsified the current property and will immediately + finish this property as failed.
+
+
falsifiedSample() - Method in interface net.jqwik.api.lifecycle.PropertyExecutionResult
+
+
The potentially shrunk set of parameters that falsified this property.
+
+
Falsifier<T> - Interface in net.jqwik.api
+
 
+
falsify(Shrinkable<T>) - Method in interface net.jqwik.api.Falsifier
+
 
+
filter(Predicate<T>) - Method in interface net.jqwik.api.Arbitrary
+
+
Create a new arbitrary of the same type T that creates and shrinks the original arbitrary but only allows + values that are accepted by the filterPredicate.
+
+
filter(EdgeCases<T>, Predicate<T>) - Method in class net.jqwik.api.EdgeCases.EdgeCasesFacade
+
 
+
filter(Predicate<T>) - Method in interface net.jqwik.api.EdgeCases
+
 
+
filter(ExhaustiveGenerator<T>, Predicate<T>) - Method in class net.jqwik.api.ExhaustiveGenerator.ExhaustiveGeneratorFacade
+
 
+
filter(Predicate<T>) - Method in interface net.jqwik.api.ExhaustiveGenerator
+
 
+
filter(Predicate<T>) - Method in class net.jqwik.api.FalsificationResult
+
 
+
filter(Predicate<T>) - Method in interface net.jqwik.api.RandomGenerator
+
 
+
filter(RandomGenerator<T>, Predicate<T>) - Method in class net.jqwik.api.RandomGenerator.RandomGeneratorFacade
+
 
+
filter(Predicate<T>) - Method in interface net.jqwik.api.Shrinkable
+
 
+
filter(Shrinkable<T>, Predicate<T>) - Method in class net.jqwik.api.Shrinkable.ShrinkableFacade
+
 
+
filtered(Shrinkable<T>) - Static method in class net.jqwik.api.FalsificationResult
+
 
+
finalModel() - Method in interface net.jqwik.api.stateful.ActionSequence
+
 
+
findAnnotation(Class<T>) - Method in interface net.jqwik.api.lifecycle.LifecycleContext
+
+
Retrieve an annotation if present at the current test element.
+
+
findAnnotation(Class<A>) - Method in interface net.jqwik.api.providers.TypeUsage
+
+
Return an Optional of the first instance of a specific annotationType + if there is one (directly or indirectly through meta-annotations).
+
+
fixGenSize(int) - Method in interface net.jqwik.api.Arbitrary
+
+
Fix the genSize of an arbitrary so that it can no longer be influenced from outside
+
+
flatAs(Combinators.F2<T1, T2, Arbitrary<R>>) - Method in class net.jqwik.api.Combinators.Combinator2
+
 
+
flatAs(Combinators.F3<T1, T2, T3, Arbitrary<R>>) - Method in class net.jqwik.api.Combinators.Combinator3
+
 
+
flatAs(Combinators.F4<T1, T2, T3, T4, Arbitrary<R>>) - Method in class net.jqwik.api.Combinators.Combinator4
+
 
+
flatAs(Combinators.F5<T1, T2, T3, T4, T5, Arbitrary<R>>) - Method in class net.jqwik.api.Combinators.Combinator5
+
 
+
flatAs(Combinators.F6<T1, T2, T3, T4, T5, T6, Arbitrary<R>>) - Method in class net.jqwik.api.Combinators.Combinator6
+
 
+
flatAs(Combinators.F7<T1, T2, T3, T4, T5, T6, T7, Arbitrary<R>>) - Method in class net.jqwik.api.Combinators.Combinator7
+
 
+
flatAs(Combinators.F8<T1, T2, T3, T4, T5, T6, T7, T8, Arbitrary<R>>) - Method in class net.jqwik.api.Combinators.Combinator8
+
 
+
flatAs(Function<List<T>, Arbitrary<R>>) - Method in class net.jqwik.api.Combinators.ListCombinator
+
 
+
flatMap(Function<T, Arbitrary<U>>) - Method in interface net.jqwik.api.Arbitrary
+
+
Create a new arbitrary of type U that uses the values of the existing arbitrary to create a new arbitrary + using the mapper function.
+
+
flatMap(Function<T, RandomGenerator<U>>) - Method in interface net.jqwik.api.RandomGenerator
+
 
+
flatMap(Function<T, Arbitrary<U>>, int) - Method in interface net.jqwik.api.RandomGenerator
+
 
+
flatMap(Shrinkable<T>, Function<T, RandomGenerator<U>>, long) - Method in class net.jqwik.api.RandomGenerator.RandomGeneratorFacade
+
 
+
flatMap(Shrinkable<T>, Function<T, Arbitrary<U>>, int, long) - Method in class net.jqwik.api.RandomGenerator.RandomGeneratorFacade
+
 
+
flatMap(Function<T, Arbitrary<U>>, int, long) - Method in interface net.jqwik.api.Shrinkable
+
 
+
flatMap(Shrinkable<T>, Function<T, Arbitrary<U>>, int, long) - Method in class net.jqwik.api.Shrinkable.ShrinkableFacade
+
 
+
flatMapArbitrary(EdgeCases<T>, Function<T, Arbitrary<U>>) - Method in class net.jqwik.api.EdgeCases.EdgeCasesFacade
+
 
+
flatMapArbitrary(Function<T, Arbitrary<U>>) - Method in interface net.jqwik.api.EdgeCases
+
 
+
flatMapExhaustiveGenerator(ExhaustiveGenerator<T>, Function<T, Arbitrary<U>>, long) - Method in class net.jqwik.api.Arbitrary.ArbitraryFacade
+
 
+
FloatArbitrary - Interface in net.jqwik.api.arbitraries
+
+
Fluent interface to configure the generation of Float and float values.
+
+
FloatRange - Annotation Type in net.jqwik.api.constraints
+
+
Constrain the range of a generated float or Float parameters.
+
+
floats() - Method in class net.jqwik.api.Arbitraries.ArbitrariesFacade
+
 
+
floats() - Static method in class net.jqwik.api.Arbitraries
+
+
Create an arbitrary that generates values of type Float.
+
+
ForAll - Annotation Type in net.jqwik.api
+
+
Used to annotate method parameters that will be provided by jqwik.
+
+
forCollection(Collection<Shrinkable<T>>) - Static method in class net.jqwik.api.ShrinkingDistance
+
 
+
forEachValue(Consumer<? super T>) - Method in interface net.jqwik.api.Arbitrary
+
+
Iterate through each value this arbitrary can generate if - and only if - + exhaustive generation is possible.
+
+
formatReport(List<StatisticsEntry>) - Method in class net.jqwik.api.statistics.Histogram
+
 
+
formatReport(List<StatisticsEntry>) - Method in class net.jqwik.api.statistics.StatisticsReport.None
+
 
+
formatReport(List<StatisticsEntry>) - Method in interface net.jqwik.api.statistics.StatisticsReportFormat
+
+
Return a list of report lines.
+
+
forType(Class<T>) - Method in class net.jqwik.api.Arbitraries.ArbitrariesFacade
+
 
+
forType(Class<T>) - Static method in class net.jqwik.api.Arbitraries
+
+
Create an arbitrary for type T that will by default use the type's + public constructors and public factory methods.
+
+
forType(Type) - Static method in interface net.jqwik.api.providers.TypeUsage
+
 
+
forType(Type) - Method in class net.jqwik.api.providers.TypeUsage.TypeUsageFacade
+
 
+
frequency(Tuple.Tuple2<Integer, T>...) - Static method in class net.jqwik.api.Arbitraries
+
+
Create an arbitrary that will randomly choose between all given values of the same type T.
+
+
frequency(List<Tuple.Tuple2<Integer, T>>) - Static method in class net.jqwik.api.Arbitraries
+
+
Create an arbitrary that will randomly choose between all given values of the same type T.
+
+
frequencyOf(List<Tuple.Tuple2<Integer, Arbitrary<T>>>) - Method in class net.jqwik.api.Arbitraries.ArbitrariesFacade
+
 
+
frequencyOf(Tuple.Tuple2<Integer, Arbitrary<T>>...) - Static method in class net.jqwik.api.Arbitraries
+
+
Create an arbitrary that will randomly choose between all given arbitraries of the same type T.
+
+
frequencyOf(List<Tuple.Tuple2<Integer, Arbitrary<T>>>) - Static method in class net.jqwik.api.Arbitraries
+
+
Create an arbitrary that will randomly choose between all given arbitraries of the same type T.
+
+
From - Annotation Type in net.jqwik.api
+
+
Used to annotate type parameters within property parameters annotated with ForAll .
+
+
FromData - Annotation Type in net.jqwik.api
+
+
Used to annotate property methods.
+
+
fromGenerator(RandomGenerator<T>) - Static method in class net.jqwik.api.Arbitraries
+
+
Create an arbitrary of type T from a corresponding generator of type T.
+
+
fromShrinkables(List<Shrinkable<T>>) - Static method in interface net.jqwik.api.EdgeCases
+
 
+
fromSupplier(Supplier<Shrinkable<T>>) - Static method in interface net.jqwik.api.EdgeCases
+
 
+
fromSuppliers(List<Supplier<Shrinkable<T>>>) - Method in class net.jqwik.api.EdgeCases.EdgeCasesFacade
+
 
+
fromSuppliers(List<Supplier<Shrinkable<T>>>) - Static method in interface net.jqwik.api.EdgeCases
+
 
+
function(Class<?>) - Static method in class net.jqwik.api.Functions
+
+
Create a wrapper for functional types + i.e. types marked FunctionalInterface or representing a + SAM (single abstract method) type.
+
+
function(Class<?>, Arbitrary<R>) - Method in class net.jqwik.api.Functions.FunctionsFacade
+
 
+
FunctionArbitrary<F,R> - Interface in net.jqwik.api.arbitraries
+
+
Fluent interface to configure arbitraries that represent functional types
+
+
Functions - Class in net.jqwik.api
+
 
+
Functions.FunctionsFacade - Class in net.jqwik.api
+
 
+
Functions.FunctionWrapper - Class in net.jqwik.api
+
 
+
FunctionsFacade() - Constructor for class net.jqwik.api.Functions.FunctionsFacade
+
 
+
+ + + +

G

+
+
gaussian(double) - Static method in interface net.jqwik.api.RandomDistribution
+
+
A distribution that generates values with (potentially asymmetric) gaussian distribution + the mean of which is the specified center and the probability at the borders is + approximately borderSigma times standard deviation.
+
+
gaussian() - Static method in interface net.jqwik.api.RandomDistribution
+
+
A gaussian distribution with borderSigma of 3, + i.e. approximately 99.7% of values are within the borders.
+
+
gaussian(double) - Method in class net.jqwik.api.RandomDistribution.RandomDistributionFacade
+
 
+
generateFirst() - Method in enum net.jqwik.api.EdgeCasesMode
+
 
+
GenerationMode - Enum in net.jqwik.api
+
+
The generation mode defines the generation behaviour of a property.
+
+
generator(int) - Method in interface net.jqwik.api.Arbitrary
+
+
Create the random generator for an arbitrary
+
+
get(Optional<TryLifecycleContext>) - Method in interface net.jqwik.api.lifecycle.ResolveParameterHook.ParameterSupplier
+
+
Supply the requested parameter.
+
+
get() - Method in interface net.jqwik.api.lifecycle.Store
+
 
+
get(Object) - Static method in interface net.jqwik.api.lifecycle.Store
+
+
Retrieve a store that must be created somewhere else.
+
+
get(Object) - Method in class net.jqwik.api.lifecycle.Store.StoreFacade
+
 
+
get1() - Method in class net.jqwik.api.Tuple.Tuple1
+
 
+
get2() - Method in class net.jqwik.api.Tuple.Tuple2
+
 
+
get3() - Method in class net.jqwik.api.Tuple.Tuple3
+
 
+
get4() - Method in class net.jqwik.api.Tuple.Tuple4
+
 
+
get5() - Method in class net.jqwik.api.Tuple.Tuple5
+
 
+
get6() - Method in class net.jqwik.api.Tuple.Tuple6
+
 
+
get7() - Method in class net.jqwik.api.Tuple.Tuple7
+
 
+
get8() - Method in class net.jqwik.api.Tuple.Tuple8
+
 
+
getAnnotatedType() - Method in interface net.jqwik.api.providers.TypeUsage
+
 
+
getAnnotations() - Method in interface net.jqwik.api.providers.TypeUsage
+
+
Return all annotations of a parameter (or an annotated type argument).
+
+
getArbitraryConfigurators() - Method in class net.jqwik.api.domains.AbstractDomainContextBase
+
 
+
getArbitraryConfigurators() - Method in interface net.jqwik.api.domains.DomainContext
+
 
+
getArbitraryConfigurators() - Method in class net.jqwik.api.domains.DomainContext.Global
+
 
+
getArbitraryProviders() - Method in class net.jqwik.api.domains.AbstractDomainContextBase
+
 
+
getArbitraryProviders() - Method in interface net.jqwik.api.domains.DomainContext
+
 
+
getArbitraryProviders() - Method in class net.jqwik.api.domains.DomainContext.Global
+
 
+
getComponentType() - Method in interface net.jqwik.api.providers.TypeUsage
+
+
Return an Optional of an array's component type - if it is an array.
+
+
getInterfaces() - Method in interface net.jqwik.api.providers.TypeUsage
+
+
Return interfaces of this type.
+
+
getLowerBounds() - Method in interface net.jqwik.api.providers.TypeUsage
+
+
Return lower bounds if a generic type is a wildcard.
+
+
getOrCreate(Object, Lifespan, Supplier<T>) - Static method in interface net.jqwik.api.lifecycle.Store
+
+
Find an existing store or create a new one if it doesn't exist
+
+
getRawType() - Method in interface net.jqwik.api.providers.TypeUsage
+
+
Return the raw type which is usually the class or interface you see in a parameters or return values + specification.
+
+
getSuperclass() - Method in interface net.jqwik.api.providers.TypeUsage
+
+
Return superclass of this type.
+
+
getType() - Method in interface net.jqwik.api.providers.TypeUsage
+
 
+
getTypeArgument(int) - Method in interface net.jqwik.api.providers.TypeUsage
+
+
Return the type argument at a specific position.
+
+
getTypeArguments() - Method in interface net.jqwik.api.providers.TypeUsage
+
+
Return the type arguments of a generic type in the order of there appearance in a type's declaration.
+
+
getUpperBounds() - Method in interface net.jqwik.api.providers.TypeUsage
+
+
Return upper bounds if a generic type is a wildcard or type variable.
+
+
global() - Method in class net.jqwik.api.domains.DomainContext.DomainContextFacade
+
 
+
global() - Static method in interface net.jqwik.api.domains.DomainContext
+
 
+
Global() - Constructor for class net.jqwik.api.domains.DomainContext.Global
+
 
+
greaterOrEqual(BigDecimal) - Method in interface net.jqwik.api.arbitraries.BigDecimalArbitrary
+
+
Set the allowed lower min (included) border of generated numbers.
+
+
greaterOrEqual(BigInteger) - Method in interface net.jqwik.api.arbitraries.BigIntegerArbitrary
+
+
Set the allowed lower min (included) bounder of generated numbers.
+
+
greaterOrEqual(byte) - Method in interface net.jqwik.api.arbitraries.ByteArbitrary
+
+
Set the allowed lower min (included) bound of generated numbers.
+
+
greaterOrEqual(double) - Method in interface net.jqwik.api.arbitraries.DoubleArbitrary
+
+
Set the allowed lower min (included) border of generated numbers.
+
+
greaterOrEqual(float) - Method in interface net.jqwik.api.arbitraries.FloatArbitrary
+
+
Set the allowed lower min (included) border of generated numbers.
+
+
greaterOrEqual(int) - Method in interface net.jqwik.api.arbitraries.IntegerArbitrary
+
+
Set the allowed lower min (included) bounder of generated numbers.
+
+
greaterOrEqual(long) - Method in interface net.jqwik.api.arbitraries.LongArbitrary
+
+
Set the allowed lower min (included) bound of generated numbers.
+
+
greaterOrEqual(short) - Method in interface net.jqwik.api.arbitraries.ShortArbitrary
+
+
Set the allowed lower min (included) bounder of generated numbers.
+
+
greaterThan(BigDecimal) - Method in interface net.jqwik.api.arbitraries.BigDecimalArbitrary
+
+
Set the allowed lower min (excluded) border of generated numbers.
+
+
greaterThan(double) - Method in interface net.jqwik.api.arbitraries.DoubleArbitrary
+
+
Set the allowed lower min (excluded) border of generated numbers.
+
+
greaterThan(float) - Method in interface net.jqwik.api.arbitraries.FloatArbitrary
+
+
Set the allowed lower min (excluded) border of generated numbers.
+
+
Group - Annotation Type in net.jqwik.api
+
 
+
+ + + +

H

+
+
hashCode() - Method in class net.jqwik.api.ShrinkingDistance
+
 
+
hashCode() - Method in class net.jqwik.api.Tuple.Tuple1
+
 
+
hashCode() - Method in class net.jqwik.api.Tuple.Tuple2
+
 
+
hashCode() - Method in class net.jqwik.api.Tuple.Tuple3
+
 
+
hashCode() - Method in class net.jqwik.api.Tuple.Tuple4
+
 
+
hashCode() - Method in class net.jqwik.api.Tuple.Tuple5
+
 
+
hashCode() - Method in class net.jqwik.api.Tuple.Tuple6
+
 
+
hashCode() - Method in class net.jqwik.api.Tuple.Tuple7
+
 
+
hashCode() - Method in class net.jqwik.api.Tuple.Tuple8
+
 
+
Histogram - Class in net.jqwik.api.statistics
+
+
A statistics report format to display collected statistics entries as a histogram
+
+
Histogram() - Constructor for class net.jqwik.api.statistics.Histogram
+
 
+
Histogram.Bucket - Class in net.jqwik.api.statistics
+
 
+
+ + + +

I

+
+
in(Combinators.F2<B, T, C>) - Method in class net.jqwik.api.Combinators.CombinableBuilder
+
 
+
index() - Method in interface net.jqwik.api.lifecycle.ParameterResolutionContext
+
 
+
init(FalsificationResult<T>) - Method in interface net.jqwik.api.ShrinkingSequence
+
 
+
injectDuplicates(double) - Method in interface net.jqwik.api.Arbitrary
+
+
Create a new arbitrary of type Iterable<T> that will + inject duplicates of previously generated values with a probability of duplicateProbability.
+
+
injectDuplicates(double) - Method in interface net.jqwik.api.RandomGenerator
+
 
+
injectDuplicates(RandomGenerator<T>, double) - Method in class net.jqwik.api.RandomGenerator.RandomGeneratorFacade
+
 
+
injectNull(double) - Method in interface net.jqwik.api.Arbitrary
+
+
Create a new arbitrary of the same type but inject null values with a probability of nullProbability.
+
+
injectNull(ExhaustiveGenerator<T>) - Method in class net.jqwik.api.ExhaustiveGenerator.ExhaustiveGeneratorFacade
+
 
+
injectNull() - Method in interface net.jqwik.api.ExhaustiveGenerator
+
 
+
injectNull(double) - Method in interface net.jqwik.api.RandomGenerator
+
 
+
IntegerArbitrary - Interface in net.jqwik.api.arbitraries
+
+
Fluent interface to configure the generation of Integer and int values.
+
+
integers() - Method in class net.jqwik.api.Arbitraries.ArbitrariesFacade
+
 
+
integers() - Static method in class net.jqwik.api.Arbitraries
+
+
Create an arbitrary that generates values of type Integer.
+
+
IntRange - Annotation Type in net.jqwik.api.constraints
+
+
Constrain the range of a generated int or Integer parameters.
+
+
invalid() - Static method in interface net.jqwik.api.lifecycle.TryExecutionResult
+
+
Create a result that calls out the current parameter list as invalid.
+
+
Invariant<T> - Interface in net.jqwik.api.stateful
+
 
+
isAnnotated(Class<A>) - Method in interface net.jqwik.api.providers.TypeUsage
+
+
Return true if the current instance is annotated (directly or indirectly through meta-annotations) + with a specific annotationType.
+
+
isArray() - Method in interface net.jqwik.api.providers.TypeUsage
+
+
Return true if a type is an array type.
+
+
isAssignableFrom(Class<?>) - Method in interface net.jqwik.api.providers.TypeUsage
+
+
Check if a given providedClass is assignable from this generic type.
+
+
isEmpty() - Method in interface net.jqwik.api.EdgeCases
+
 
+
isEnum() - Method in interface net.jqwik.api.providers.TypeUsage
+
+
Return true if a type is an enum type.
+
+
isGeneric() - Method in interface net.jqwik.api.providers.TypeUsage
+
+
Return true if a type has any type arguments itself.
+
+
isOfType(Class<?>) - Method in interface net.jqwik.api.providers.TypeUsage
+
+
Check if an instance is of a specific raw type + + Most of the time this is what you want to do when checking for applicability of a + ArbitraryProvider.
+
+
isSatisfied() - Method in interface net.jqwik.api.lifecycle.TryExecutionResult
+
 
+
isSkipped() - Method in class net.jqwik.api.lifecycle.SkipExecutionHook.SkipResult
+
+
Whether execution of the context should be skipped.
+
+
isSmallerThan(Shrinkable<T>) - Method in interface net.jqwik.api.Shrinkable
+
 
+
isTypeVariable() - Method in interface net.jqwik.api.providers.TypeUsage
+
+
Return true if a generic type is a wildcard.
+
+
isTypeVariableOrWildcard() - Method in interface net.jqwik.api.providers.TypeUsage
+
+
Return true if a generic type is a type variable or a wildcard.
+
+
isUnique() - Method in interface net.jqwik.api.Arbitrary
+
+
All arbitraries whose base generator is supposed to produce no duplicates + should return true.
+
+
isVoid() - Method in interface net.jqwik.api.providers.TypeUsage
+
+
Return true if type is Void.
+
+
isWildcard() - Method in interface net.jqwik.api.providers.TypeUsage
+
+
Return true if a generic type is a wildcard.
+
+
items() - Method in interface net.jqwik.api.Tuple
+
 
+
items() - Method in class net.jqwik.api.Tuple.Tuple1
+
 
+
items() - Method in class net.jqwik.api.Tuple.Tuple2
+
 
+
items() - Method in class net.jqwik.api.Tuple.Tuple3
+
 
+
items() - Method in class net.jqwik.api.Tuple.Tuple4
+
 
+
items() - Method in class net.jqwik.api.Tuple.Tuple5
+
 
+
items() - Method in class net.jqwik.api.Tuple.Tuple6
+
 
+
items() - Method in class net.jqwik.api.Tuple.Tuple7
+
 
+
items() - Method in class net.jqwik.api.Tuple.Tuple8
+
 
+
iterator(Arbitrary<T>) - Method in class net.jqwik.api.Arbitrary.ArbitraryFacade
+
 
+
iterator() - Method in interface net.jqwik.api.Arbitrary
+
+
Create a new arbitrary of type Iterable<T> using the existing arbitrary for generating the elements of the + stream.
+
+
iterator() - Method in interface net.jqwik.api.EdgeCases
+
 
+
+ + + +

J

+
+
JqwikException - Exception in net.jqwik.api
+
+
Base exception for exceptions that are thrown during the discovery phase + and during setup of properties before they are actually run.
+
+
JqwikException(String) - Constructor for exception net.jqwik.api.JqwikException
+
 
+
JqwikException(String, Throwable) - Constructor for exception net.jqwik.api.JqwikException
+
 
+
+ + + +

L

+
+
Label - Annotation Type in net.jqwik.api
+
+
Use @Label("a descriptive name") to give test classes, groups and methods + a more readable label (aka display name).
+
+
label() - Method in interface net.jqwik.api.lifecycle.LifecycleContext
+
+
The elements label under which it shows up in test reports and IDEs.
+
+
label(StatisticsEntry) - Method in class net.jqwik.api.statistics.Histogram
+
+
Determine how entries are being labelled in the histogram.
+
+
label(StatisticsEntry) - Method in class net.jqwik.api.statistics.NumberRangeHistogram
+
+
Does not make sense to override since these labels won't be used anyway
+
+
label(String) - Static method in class net.jqwik.api.statistics.Statistics
+
+
Call this method to get a labeled instance of StatisticsCollector.
+
+
lazy(Supplier<Arbitrary<T>>) - Method in class net.jqwik.api.Arbitraries.ArbitrariesFacade
+
 
+
lazy(Supplier<Arbitrary<T>>) - Static method in class net.jqwik.api.Arbitraries
+
+
Create an arbitrary that will evaluate arbitrarySupplier as soon as it is used for generating values.
+
+
lessOrEqual(BigDecimal) - Method in interface net.jqwik.api.arbitraries.BigDecimalArbitrary
+
+
Set the allowed upper max (included) bounder of generated numbers.
+
+
lessOrEqual(BigInteger) - Method in interface net.jqwik.api.arbitraries.BigIntegerArbitrary
+
+
Set the allowed upper max (included) bounder of generated numbers.
+
+
lessOrEqual(byte) - Method in interface net.jqwik.api.arbitraries.ByteArbitrary
+
+
Set the allowed upper max (included) bound of generated numbers.
+
+
lessOrEqual(double) - Method in interface net.jqwik.api.arbitraries.DoubleArbitrary
+
+
Set the allowed upper max (included) border of generated numbers.
+
+
lessOrEqual(float) - Method in interface net.jqwik.api.arbitraries.FloatArbitrary
+
+
Set the allowed upper max (included) border of generated numbers.
+
+
lessOrEqual(int) - Method in interface net.jqwik.api.arbitraries.IntegerArbitrary
+
+
Set the allowed upper max (included) bounder of generated numbers.
+
+
lessOrEqual(long) - Method in interface net.jqwik.api.arbitraries.LongArbitrary
+
+
Set the allowed upper max (included) bound of generated numbers.
+
+
lessOrEqual(short) - Method in interface net.jqwik.api.arbitraries.ShortArbitrary
+
+
Set the allowed upper max (included) bounder of generated numbers.
+
+
lessThan(BigDecimal) - Method in interface net.jqwik.api.arbitraries.BigDecimalArbitrary
+
+
Set the allowed upper max (excluded) border of generated numbers.
+
+
lessThan(double) - Method in interface net.jqwik.api.arbitraries.DoubleArbitrary
+
+
Set the allowed upper max (excluded) border of generated numbers.
+
+
lessThan(float) - Method in interface net.jqwik.api.arbitraries.FloatArbitrary
+
+
Set the allowed upper max (excluded) border of generated numbers.
+
+
LifecycleContext - Interface in net.jqwik.api.lifecycle
+
+
Supertype of all lifecycle context interfaces.
+
+
LifecycleHook - Interface in net.jqwik.api.lifecycle
+
+
This is the supertype of all lifecycle hook interfaces.
+
+
LifecycleHooks - Annotation Type in net.jqwik.api.lifecycle
+
+
Experimental feature.
+
+
Lifespan - Enum in net.jqwik.api.lifecycle
+
+
Define how long a resource, + e.g. the value in a Store with the same identifier, + will live: + + + For the whole test run + For the currently running property + For the currently running try + + + Any hook or collection of hooks can use this enum to allow the specification + of the lifespan of resources from which it is abstracting.
+
+
lifespan() - Method in interface net.jqwik.api.lifecycle.Store
+
 
+
list(Arbitrary<T>) - Method in class net.jqwik.api.Arbitrary.ArbitraryFacade
+
 
+
list() - Method in interface net.jqwik.api.Arbitrary
+
+
Create a new arbitrary of type List<T> using the existing arbitrary for generating the elements of the list.
+
+
load(Class<T>) - Static method in class net.jqwik.api.FacadeLoader
+
+
Load single implementation of an API facade.
+
+
LongArbitrary - Interface in net.jqwik.api.arbitraries
+
+
Fluent interface to configure the generation of Long and long values.
+
+
LongRange - Annotation Type in net.jqwik.api.constraints
+
+
Constrain the range of a generated long or BigInteger parameters.
+
+
longs() - Method in class net.jqwik.api.Arbitraries.ArbitrariesFacade
+
 
+
longs() - Static method in class net.jqwik.api.Arbitraries
+
+
Create an arbitrary that generates values of type Long.
+
+
LowerChars - Annotation Type in net.jqwik.api.constraints
+
+
Constrain the chars used to generate Strings or Characters to lower case chars.
+
+
+ + + +

M

+
+
map(Function<T, U>) - Method in interface net.jqwik.api.Arbitrary
+
+
Create a new arbitrary of type U that maps the values of the original arbitrary using the mapper + function.
+
+
map(Function<T, U>) - Method in interface net.jqwik.api.EdgeCases
+
 
+
map(ExhaustiveGenerator<T>, Function<T, U>) - Method in class net.jqwik.api.ExhaustiveGenerator.ExhaustiveGeneratorFacade
+
 
+
map(Function<T, U>) - Method in interface net.jqwik.api.ExhaustiveGenerator
+
 
+
map(Function<Shrinkable<T>, Shrinkable<U>>) - Method in class net.jqwik.api.FalsificationResult
+
 
+
map(Function<T, U>) - Method in interface net.jqwik.api.RandomGenerator
+
 
+
map(Function<T, U>) - Method in interface net.jqwik.api.Shrinkable
+
 
+
map(Shrinkable<T>, Function<T, U>) - Method in class net.jqwik.api.Shrinkable.ShrinkableFacade
+
 
+
map(Function<FalsificationResult<T>, FalsificationResult<U>>) - Method in interface net.jqwik.api.ShrinkingSequence
+
 
+
map(ShrinkingSequence<T>, Function<FalsificationResult<T>, FalsificationResult<U>>) - Method in class net.jqwik.api.ShrinkingSequence.ShrinkingSequenceFacade
+
 
+
maps(Arbitrary<K>, Arbitrary<V>) - Method in class net.jqwik.api.Arbitraries.ArbitrariesFacade
+
 
+
maps(Arbitrary<K>, Arbitrary<V>) - Static method in class net.jqwik.api.Arbitraries
+
+
Create an arbitrary to create instances of Map.
+
+
mapShrinkable(EdgeCases<T>, Function<Shrinkable<T>, Shrinkable<U>>) - Method in class net.jqwik.api.EdgeCases.EdgeCasesFacade
+
 
+
mapShrinkable(Function<Shrinkable<T>, Shrinkable<U>>) - Method in interface net.jqwik.api.EdgeCases
+
 
+
mapTo(PropertyExecutionResult.Status, Throwable) - Method in interface net.jqwik.api.lifecycle.PropertyExecutionResult
+
+
Use to change the status of a property execution result in a + AroundPropertyHook.
+
+
mapToAborted(Throwable) - Method in interface net.jqwik.api.lifecycle.PropertyExecutionResult
+
+
Use to change the status of a property execution to PropertyExecutionResult.Status.ABORTED + in a AroundPropertyHook.
+
+
mapToFailed(Throwable) - Method in interface net.jqwik.api.lifecycle.PropertyExecutionResult
+
+
Use to change the status of a successful property execution to PropertyExecutionResult.Status.FAILED + in a AroundPropertyHook.
+
+
mapToFailed(String) - Method in interface net.jqwik.api.lifecycle.PropertyExecutionResult
+
+
Use to change the status of a successful property execution to PropertyExecutionResult.Status.FAILED + in a AroundPropertyHook.
+
+
mapToSuccessful() - Method in interface net.jqwik.api.lifecycle.PropertyExecutionResult
+
+
Use to change the status of a failed property to PropertyExecutionResult.Status.SUCCESSFUL + in a AroundPropertyHook.
+
+
mapValue(Function<T, U>) - Method in interface net.jqwik.api.ShrinkingSequence
+
 
+
mapValue(ShrinkingSequence<T>, Function<T, U>) - Method in class net.jqwik.api.ShrinkingSequence.ShrinkingSequenceFacade
+
 
+
MAX - Static variable in class net.jqwik.api.ShrinkingDistance
+
 
+
MAX_DISCARD_RATIO_NOT_SET - Static variable in annotation type net.jqwik.api.Property
+
 
+
maxCount() - Method in interface net.jqwik.api.ExhaustiveGenerator
+
 
+
maxDrawRange() - Method in class net.jqwik.api.statistics.Histogram
+
+
Determine how many block characters are maximally used to draw the distribution.
+
+
MAXIMUM_SAMPLES_TO_GENERATE - Static variable in interface net.jqwik.api.ExhaustiveGenerator
+
 
+
mixIn() - Method in enum net.jqwik.api.EdgeCasesMode
+
 
+
modify(TypeArbitrary<T>) - Method in enum net.jqwik.api.constraints.UseTypeMode
+
 
+
+ + + +

N

+
+
name() - Method in interface net.jqwik.api.statistics.StatisticsEntry
+
+
The name of an entry usually refers to the collected value(s)
+
+
Negative - Annotation Type in net.jqwik.api.constraints
+
+
Constrain the range of a generated number to be less than 0.
+
+
net.jqwik.api - package net.jqwik.api
+
 
+
net.jqwik.api.arbitraries - package net.jqwik.api.arbitraries
+
 
+
net.jqwik.api.configurators - package net.jqwik.api.configurators
+
 
+
net.jqwik.api.constraints - package net.jqwik.api.constraints
+
 
+
net.jqwik.api.domains - package net.jqwik.api.domains
+
 
+
net.jqwik.api.lifecycle - package net.jqwik.api.lifecycle
+
 
+
net.jqwik.api.providers - package net.jqwik.api.providers
+
 
+
net.jqwik.api.stateful - package net.jqwik.api.stateful
+
 
+
net.jqwik.api.statistics - package net.jqwik.api.statistics
+
 
+
newInstance(Class<T>) - Method in interface net.jqwik.api.lifecycle.LifecycleContext
+
+
Create a new instance of a clazz in the context of the property in which it + is running.
+
+
next(Random) - Method in interface net.jqwik.api.RandomDistribution.RandomNumericGenerator
+
+
Generate next random number within the specified range given on creation of the generator.
+
+
next(Random) - Method in interface net.jqwik.api.RandomGenerator
+
 
+
next(Runnable, Consumer<FalsificationResult<T>>) - Method in interface net.jqwik.api.ShrinkingSequence
+
 
+
NO_VALUE - Static variable in annotation type net.jqwik.api.ForAll
+
 
+
none() - Static method in interface net.jqwik.api.EdgeCases
+
 
+
None() - Constructor for class net.jqwik.api.statistics.StatisticsReport.None
+
 
+
NotEmpty - Annotation Type in net.jqwik.api.constraints
+
+
Constrain the size of generated "sizable" types to be at least 1.
+
+
notFalsified(Shrinkable<T>) - Static method in class net.jqwik.api.FalsificationResult
+
 
+
nothing() - Static method in class net.jqwik.api.Arbitraries
+
+
Create an arbitrary that never creates anything.
+
+
NumberRangeHistogram - Class in net.jqwik.api.statistics
+
+
A specialized type of Histogram to divide collected numbers + into range-based clusters for display in a histogram.
+
+
NumberRangeHistogram() - Constructor for class net.jqwik.api.statistics.NumberRangeHistogram
+
 
+
numeric() - Method in interface net.jqwik.api.arbitraries.StringArbitrary
+
+
Allow all numeric chars (digits) to show up in generated strings.
+
+
NumericalArbitrary<T,A extends NumericalArbitrary<T,A>> - Interface in net.jqwik.api.arbitraries
+
 
+
NumericChars - Annotation Type in net.jqwik.api.constraints
+
+
Constrain the chars used to generate Strings or Characters to digits.
+
+
+ + + +

O

+
+
of(T...) - Static method in class net.jqwik.api.Arbitraries
+
+
Create an arbitrary that will randomly choose from a given array of values.
+
+
of(List<T>) - Static method in class net.jqwik.api.Arbitraries
+
+
Create an arbitrary that will randomly choose from a given list of values.
+
+
of(char[]) - Static method in class net.jqwik.api.Arbitraries
+
+
Create an arbitrary of character values.
+
+
of(Class<T>) - Static method in class net.jqwik.api.Arbitraries
+
+
Create an arbitrary for enum values of type T.
+
+
of(Class<?>, TypeUsage...) - Static method in interface net.jqwik.api.providers.TypeUsage
+
 
+
of(Class<?>, TypeUsage...) - Method in class net.jqwik.api.providers.TypeUsage.TypeUsageFacade
+
 
+
of(long...) - Static method in class net.jqwik.api.ShrinkingDistance
+
 
+
of(E...) - Static method in class net.jqwik.api.Table
+
 
+
of(Tuple.Tuple1<T>...) - Static method in class net.jqwik.api.Table
+
 
+
of(Tuple.Tuple2<T1, T2>...) - Static method in class net.jqwik.api.Table
+
 
+
of(Tuple.Tuple3<T1, T2, T3>...) - Static method in class net.jqwik.api.Table
+
 
+
of(Tuple.Tuple4<T1, T2, T3, T4>...) - Static method in class net.jqwik.api.Table
+
 
+
of(Tuple.Tuple5<T1, T2, T3, T4, T5>...) - Static method in class net.jqwik.api.Table
+
 
+
of(Tuple.Tuple6<T1, T2, T3, T4, T5, T6>...) - Static method in class net.jqwik.api.Table
+
 
+
of(Tuple.Tuple7<T1, T2, T3, T4, T5, T6, T7>...) - Static method in class net.jqwik.api.Table
+
 
+
of(Tuple.Tuple8<T1, T2, T3, T4, T5, T6, T7, T8>...) - Static method in class net.jqwik.api.Table
+
 
+
of(T1) - Static method in interface net.jqwik.api.Tuple
+
 
+
of(T1, T2) - Static method in interface net.jqwik.api.Tuple
+
 
+
of(T1, T2, T3) - Static method in interface net.jqwik.api.Tuple
+
 
+
of(T1, T2, T3, T4) - Static method in interface net.jqwik.api.Tuple
+
 
+
of(T1, T2, T3, T4, T5) - Static method in interface net.jqwik.api.Tuple
+
 
+
of(T1, T2, T3, T4, T5, T6) - Static method in interface net.jqwik.api.Tuple
+
 
+
of(T1, T2, T3, T4, T5, T6, T7) - Static method in interface net.jqwik.api.Tuple
+
 
+
of(T1, T2, T3, T4, T5, T6, T7, T8) - Static method in interface net.jqwik.api.Tuple
+
 
+
ofLength(int) - Method in interface net.jqwik.api.arbitraries.StringArbitrary
+
+
Fix the length to length of generated strings.
+
+
ofMaxLength(int) - Method in interface net.jqwik.api.arbitraries.StringArbitrary
+
+
Set the maximum allowed length maxLength (included) of generated strings.
+
+
ofMaxSize(int) - Method in interface net.jqwik.api.arbitraries.SizableArbitrary
+
+
Set upper size boundary maxSize (included).
+
+
ofMaxSize(int) - Method in interface net.jqwik.api.arbitraries.StreamableArbitrary
+
+
Set upper size boundary maxSize (included).
+
+
ofMaxSize(int) - Method in interface net.jqwik.api.stateful.ActionSequenceArbitrary
+
 
+
ofMinLength(int) - Method in interface net.jqwik.api.arbitraries.StringArbitrary
+
+
Set the minimum allowed length mixLength (included) of generated strings.
+
+
ofMinSize(int) - Method in interface net.jqwik.api.arbitraries.SizableArbitrary
+
+
Set lower size boundary minSize (included).
+
+
ofMinSize(int) - Method in interface net.jqwik.api.arbitraries.StreamableArbitrary
+
+
Set lower size boundary minSize (included).
+
+
ofMinSize(int) - Method in interface net.jqwik.api.stateful.ActionSequenceArbitrary
+
 
+
ofScale(int) - Method in interface net.jqwik.api.arbitraries.BigDecimalArbitrary
+
+
Set the scale (maximum number of decimal places) to scale.
+
+
ofScale(int) - Method in interface net.jqwik.api.arbitraries.DoubleArbitrary
+
+
Set the scale (maximum number of decimal places) to scale.
+
+
ofScale(int) - Method in interface net.jqwik.api.arbitraries.FloatArbitrary
+
+
Set the scale (maximum number of decimal places) to scale.
+
+
ofSize(int) - Method in interface net.jqwik.api.arbitraries.SizableArbitrary
+
+
Fix the size to size.
+
+
ofSize(int) - Method in interface net.jqwik.api.arbitraries.StreamableArbitrary
+
+
Fix the size to size.
+
+
ofSize(int) - Method in interface net.jqwik.api.stateful.ActionSequenceArbitrary
+
 
+
ofSuppliers(Supplier<T>...) - Static method in class net.jqwik.api.Arbitraries
+
+
Create an arbitrary that will randomly choose from a given array of value suppliers + and then get the value from the supplier.
+
+
ofSuppliers(List<Supplier<T>>) - Static method in class net.jqwik.api.Arbitraries
+
+
Create an arbitrary that will randomly choose from a given array of value suppliers + and then get the value from the supplier.
+
+
onClose(Consumer<T>) - Method in interface net.jqwik.api.lifecycle.Store
+
 
+
oneOf(List<Arbitrary<T>>) - Method in class net.jqwik.api.Arbitraries.ArbitrariesFacade
+
 
+
oneOf(Arbitrary<? extends T>, Arbitrary<? extends T>...) - Static method in class net.jqwik.api.Arbitraries
+
+
Create an arbitrary that will randomly choose between all given arbitraries of the same type T.
+
+
oneOf(List<Arbitrary<T>>) - Static method in class net.jqwik.api.Arbitraries
+
+
Create an arbitrary that will randomly choose between all given arbitraries of the same type T.
+
+
onFailure(PropertyExecutionResult) - Method in interface net.jqwik.api.lifecycle.PerProperty.Lifecycle
+
+
Override if you want to perform some work or run assertions if - and only if - the property failed.
+
+
onSuccess() - Method in interface net.jqwik.api.lifecycle.PerProperty.Lifecycle
+
+
Override if you want to perform some work or run assertions if - and only if - the property succeeded.
+
+
optional() - Method in interface net.jqwik.api.Arbitrary
+
+
Create a new arbitrary of type Optional<T> using the existing arbitrary for generating the elements of the + stream.
+
+
optionalContainerClass() - Method in interface net.jqwik.api.lifecycle.LifecycleContext
+
+
If the context refers to a class or a method the class or the method's class + is returned, otherwise Optional.empty()
+
+
optionalElement() - Method in interface net.jqwik.api.lifecycle.LifecycleContext
+
+
If the context refers to a class or a method the class or method + is returned, otherwise Optional.empty()
+
+
order() - Method in interface net.jqwik.api.configurators.ArbitraryConfigurator
+
+
Determines the order in which a configurator will be applied in regards to other configurators.
+
+
+ + + +

P

+
+
parameter() - Method in interface net.jqwik.api.lifecycle.ParameterResolutionContext
+
 
+
ParameterResolutionContext - Interface in net.jqwik.api.lifecycle
+
+
Experimental feature.
+
+
peek(Consumer<M>) - Method in interface net.jqwik.api.stateful.ActionSequence
+
+
Peek into the model of a running sequence.
+
+
percentage(Predicate<Double>) - Method in interface net.jqwik.api.statistics.StatisticsCoverage.CoverageChecker
+
+
Check the percentage of occurrences returning true (ok) or false (fail)
+
+
percentage(Consumer<Double>) - Method in interface net.jqwik.api.statistics.StatisticsCoverage.CoverageChecker
+
+
Check the number of occurrences returning true (ok) or false (fail).
+
+
percentage() - Method in interface net.jqwik.api.statistics.StatisticsEntry
+
+
The percentage of times a certain value (set) has been collected
+
+
PerProperty - Annotation Type in net.jqwik.api.lifecycle
+
+
Annotate property methods of a container class with @PerProperty + if you want to have some lifecycle control over this property alone.
+
+
PerProperty.Lifecycle - Interface in net.jqwik.api.lifecycle
+
 
+
PerProperty.PerPropertyHook - Class in net.jqwik.api.lifecycle
+
 
+
PerPropertyHook() - Constructor for class net.jqwik.api.lifecycle.PerProperty.PerPropertyHook
+
 
+
plus(ShrinkingDistance) - Method in class net.jqwik.api.ShrinkingDistance
+
 
+
Positive - Annotation Type in net.jqwik.api.constraints
+
+
Constrain the range of a generated number to be greater than 0.
+
+
precondition(S) - Method in interface net.jqwik.api.stateful.Action
+
+
If this method returns false, the action will not be performed.
+
+
priority() - Method in interface net.jqwik.api.providers.ArbitraryProvider
+
+
Providers with higher priority will replace providers with lower priority.
+
+
PRIORITY_NOT_SET - Static variable in annotation type net.jqwik.api.domains.Domain
+
 
+
propagateTo() - Method in interface net.jqwik.api.lifecycle.LifecycleHook
+
+
Override this method if you want to change a concrete hook implementation's default + propagation behaviour: Do not use hook in child elements -- sub containers or properties.
+
+
PropagationMode - Enum in net.jqwik.api.lifecycle
+
+
Describes if and how a concrete registered hook is propagated to children of + the element where the hook has been registered.
+
+
Property - Annotation Type in net.jqwik.api
+
+
Use @Property to mark methods that serve as properties.
+
+
PropertyExecutionResult - Interface in net.jqwik.api.lifecycle
+
+
Represents the result of running a property.
+
+
PropertyExecutionResult.Status - Enum in net.jqwik.api.lifecycle
+
+
Status of executing a single test or container.
+
+
PropertyExecutor - Interface in net.jqwik.api.lifecycle
+
+
Objects of this class represent a property's execution.
+
+
PropertyLifecycleContext - Interface in net.jqwik.api.lifecycle
+
+
The context information of a property or example.
+
+
Provide - Annotation Type in net.jqwik.api
+
+
Used to annotate methods that can provide values for property method parameters.
+
+
provideFor(TypeUsage, ArbitraryProvider.SubtypeProvider) - Method in interface net.jqwik.api.providers.ArbitraryProvider
+
+
This is the method you must override in your own implementations of ArbitraryProvider.
+
+
proximity() - Method in interface net.jqwik.api.lifecycle.AroundContainerHook
+
+ +
+
publish(String, String) - Method in interface net.jqwik.api.lifecycle.Reporter
+
+
Publish some value under a given key.
+
+
+ + + +

R

+
+
randomChoose(List<T>) - Method in class net.jqwik.api.Arbitraries.ArbitrariesFacade
+
 
+
randomChoose(char[]) - Method in class net.jqwik.api.Arbitraries.ArbitrariesFacade
+
 
+
RandomDistribution - Interface in net.jqwik.api
+
+
Determines how generated numerical values are generated and distributed + across the allowed range and a center withing this range.
+
+
RandomDistribution.RandomDistributionFacade - Class in net.jqwik.api
+
 
+
RandomDistribution.RandomNumericGenerator - Interface in net.jqwik.api
+
+
Generator for BigInteger values which are behind all generated numeric values in jqwik.
+
+
RandomDistributionFacade() - Constructor for class net.jqwik.api.RandomDistribution.RandomDistributionFacade
+
 
+
randomFrequency(List<Tuple.Tuple2<Integer, T>>) - Method in class net.jqwik.api.Arbitraries.ArbitrariesFacade
+
 
+
RandomGenerator<T> - Interface in net.jqwik.api
+
 
+
RandomGenerator.RandomGeneratorFacade - Class in net.jqwik.api
+
 
+
RandomGeneratorFacade() - Constructor for class net.jqwik.api.RandomGenerator.RandomGeneratorFacade
+
 
+
randoms() - Static method in class net.jqwik.api.Arbitraries
+
+
Create an arbitrary for Random objects.
+
+
randomSamples(T[]) - Method in class net.jqwik.api.Arbitraries.ArbitrariesFacade
+
 
+
randomShuffle(List<T>) - Method in class net.jqwik.api.Arbitraries.ArbitrariesFacade
+
 
+
randomValue(Function<Random, T>) - Static method in class net.jqwik.api.Arbitraries
+
+
Create an arbitrary that will generate values of type T using a generator function.
+
+
range(char, char) - Method in interface net.jqwik.api.arbitraries.CharacterArbitrary
+
+
Allow all chars within min (included) and max (included) to show up in generated values.
+
+
rangeLabel(BigInteger, BigInteger, boolean) - Method in class net.jqwik.api.statistics.NumberRangeHistogram
+
+
Determines how a range of numbers is being displayed.
+
+
reason() - Method in class net.jqwik.api.lifecycle.SkipExecutionHook.SkipResult
+
+
Get the reason that execution of the context should be skipped, + if available.
+
+
recursive(Supplier<Arbitrary<T>>, Function<Arbitrary<T>, Arbitrary<T>>, int) - Static method in class net.jqwik.api.Arbitraries
+
+
Create an arbitrary by deterministic recursion.
+
+
reduce(R, BiFunction<R, T, R>) - Method in interface net.jqwik.api.arbitraries.StreamableArbitrary
+
+
Given an initial argument use accumulator to produce + the final result.
+
+
register(Class<? extends LifecycleHook>, PropagationMode) - Method in interface net.jqwik.api.lifecycle.RegistrarHook.Registrar
+
+
Register a concrete hook implementation.
+
+
register(Class<? extends LifecycleHook>) - Method in interface net.jqwik.api.lifecycle.RegistrarHook.Registrar
+
+
Register a concrete hook implementation with its default PropagationMode.
+
+
registerArbitrary(TypeUsage, Arbitrary<?>) - Method in class net.jqwik.api.domains.AbstractDomainContextBase
+
 
+
registerArbitrary(Class<T>, Arbitrary<T>) - Method in class net.jqwik.api.domains.AbstractDomainContextBase
+
 
+
registerConfigurator(ArbitraryConfigurator) - Method in class net.jqwik.api.domains.AbstractDomainContextBase
+
 
+
registerHooks(RegistrarHook.Registrar) - Method in interface net.jqwik.api.lifecycle.RegistrarHook
+
+
This method will be called during hook registration, i.e. before any test has been started.
+
+
registerProvider(ArbitraryProvider) - Method in class net.jqwik.api.domains.AbstractDomainContextBase
+
 
+
RegistrarHook - Interface in net.jqwik.api.lifecycle
+
+
Use this hook if you want to apply several hook implementations that belong + together but that cannot be implemented in a single class, e.g. because + the same hook type must be added with different proximity or different propagation.
+
+
RegistrarHook.Registrar - Interface in net.jqwik.api.lifecycle
+
+
A short-lived object used for registering concrete hook implementation classes.
+
+
Report - Annotation Type in net.jqwik.api
+
+
Use @Report to specify what additional things should be reported + when running a property.
+
+
reporter() - Method in interface net.jqwik.api.lifecycle.LifecycleContext
+
+
Get hold of test reporter for publishing additional information on a test container or method.
+
+
Reporter - Interface in net.jqwik.api.lifecycle
+
+
An interface that can be used to report additional information for a test element, + i.e. a test container or property.
+
+
Reporting - Enum in net.jqwik.api
+
 
+
reset() - Method in interface net.jqwik.api.lifecycle.Store
+
 
+
resolve(ParameterResolutionContext) - Method in interface net.jqwik.api.lifecycle.PerProperty.Lifecycle
+
+
Override if you want to provide parameters for this property.
+
+
resolve(ParameterResolutionContext, LifecycleContext) - Method in class net.jqwik.api.lifecycle.PerProperty.PerPropertyHook
+
 
+
resolve(ParameterResolutionContext, LifecycleContext) - Method in interface net.jqwik.api.lifecycle.ResolveParameterHook
+
+
This method will be called only once per property, whereas the returned supplier's get method + is usually invoked for each try - and potentially more often during shrinking or when resolving + parameters in before/after methods.
+
+
resolveAndCombine(TypeUsage...) - Method in interface net.jqwik.api.providers.ArbitraryProvider.SubtypeProvider
+
+
Resolve all typeUsages and return a stream of all possible arbitraries + combinations per type.
+
+
resolveParameter(Executable, int) - Method in interface net.jqwik.api.lifecycle.LifecycleContext
+
+
Resolve a parameter from a method in the context of the property in which it + is running.
+
+
ResolveParameterHook - Interface in net.jqwik.api.lifecycle
+
+
This hook type allows to provide parameters for property methods + but also to annotated lifecycle methods.
+
+
ResolveParameterHook.ParameterSupplier - Interface in net.jqwik.api.lifecycle
+
+
A functional interface specialized on providing parameters to property methods + and to annotated lifecycle methods.
+
+
returns(Arbitrary<R>) - Method in class net.jqwik.api.Functions.FunctionWrapper
+
+
Create an arbitrary to create instances of functions represented by this wrapper.
+
+
run(S) - Method in interface net.jqwik.api.stateful.Action
+
+
Perform an action on state S and return the same state (if it has state) + or a new one representing the new state.
+
+
run(M) - Method in interface net.jqwik.api.stateful.ActionSequence
+
 
+
runActions() - Method in interface net.jqwik.api.stateful.ActionSequence
+
 
+
runState() - Method in interface net.jqwik.api.stateful.ActionSequence
+
 
+
+ + + +

S

+
+
sample() - Method in interface net.jqwik.api.Arbitrary
+
+
Generate a single sample value using this arbitrary.
+
+
samples(T...) - Static method in class net.jqwik.api.Arbitraries
+
+
Deprecated. +
Use Arbitraries.of(Object[]) or move to data-driven properties if order is important. Will be removed in version 1.4.0
+
+
+
sampleStream(Arbitrary<T>) - Method in class net.jqwik.api.Arbitrary.ArbitraryFacade
+
 
+
sampleStream() - Method in interface net.jqwik.api.Arbitrary
+
+
Generate a stream of sample values using this arbitrary.
+
+
satisfied() - Static method in interface net.jqwik.api.lifecycle.TryExecutionResult
+
+
Create a result that satisfies the current property with the current parameter set.
+
+
satisfied(boolean) - Static method in interface net.jqwik.api.lifecycle.TryExecutionResult
+
+
Create a result that satisfies the current property and will immediately + finish this property as successful.
+
+
Scale - Annotation Type in net.jqwik.api.constraints
+
+
Use to constrain the maximum number of decimal places when generating decimal numbers.
+
+
seed() - Method in interface net.jqwik.api.lifecycle.PropertyExecutionResult
+
+
The seed used to generate randomized parameters.
+
+
SEED_NOT_SET - Static variable in annotation type net.jqwik.api.Property
+
 
+
SelfConfiguringArbitrary<T> - Interface in net.jqwik.api.configurators
+
+
An Arbitrary implementation can also implement this interface if it wants + to take over its own configuration which is usually being done by registered instances + of ArbitraryConfigurator.
+
+
sequences(Arbitrary<? extends Action<M>>) - Method in class net.jqwik.api.Arbitraries.ArbitrariesFacade
+
 
+
sequences(Arbitrary<? extends Action<M>>) - Static method in class net.jqwik.api.Arbitraries
+
+
Create an arbitrary to create a sequence of actions.
+
+
set(Arbitrary<T>) - Method in class net.jqwik.api.Arbitrary.ArbitraryFacade
+
 
+
set() - Method in interface net.jqwik.api.Arbitrary
+
+
Create a new arbitrary of type Set<T> using the existing arbitrary for generating the elements of the set.
+
+
setDefaultPriority(int) - Method in class net.jqwik.api.domains.AbstractDomainContextBase
+
 
+
setDefaultPriority(int) - Method in interface net.jqwik.api.domains.DomainContext
+
 
+
ShortArbitrary - Interface in net.jqwik.api.arbitraries
+
+
Fluent interface to configure the generation of Short and short values.
+
+
ShortRange - Annotation Type in net.jqwik.api.constraints
+
+
Constrain the range of a generated short or Short parameters.
+
+
shorts() - Method in class net.jqwik.api.Arbitraries.ArbitrariesFacade
+
 
+
shorts() - Static method in class net.jqwik.api.Arbitraries
+
+
Create an arbitrary that generates values of type Short.
+
+
shouldBeSkipped(LifecycleContext) - Method in interface net.jqwik.api.lifecycle.SkipExecutionHook
+
+
Determine if an annotated element should be skipped or not.
+
+
shouldPropertyFinishEarly() - Method in interface net.jqwik.api.lifecycle.TryExecutionResult
+
 
+
shrink(Falsifier<T>) - Method in interface net.jqwik.api.Shrinkable
+
 
+
shrinkable() - Method in class net.jqwik.api.FalsificationResult
+
 
+
Shrinkable<T> - Interface in net.jqwik.api
+
 
+
Shrinkable.ShrinkableFacade - Class in net.jqwik.api
+
 
+
ShrinkableFacade() - Constructor for class net.jqwik.api.Shrinkable.ShrinkableFacade
+
 
+
ShrinkingDistance - Class in net.jqwik.api
+
 
+
ShrinkingMode - Enum in net.jqwik.api
+
+
The shrinking mode defines the shrinking behaviour of a property.
+
+
ShrinkingSequence<T> - Interface in net.jqwik.api
+
 
+
ShrinkingSequence.ShrinkingSequenceFacade - Class in net.jqwik.api
+
 
+
ShrinkingSequenceFacade() - Constructor for class net.jqwik.api.ShrinkingSequence.ShrinkingSequenceFacade
+
 
+
shrinkingSuggestions() - Method in interface net.jqwik.api.Shrinkable
+
+
Used only when several shrinkables must be shrunk in synchronicity e.g. duplicate values.
+
+
shrinkTowards(BigDecimal) - Method in interface net.jqwik.api.arbitraries.BigDecimalArbitrary
+
+
Set shrinking target to target which must be between the allowed bounds.
+
+
shrinkTowards(BigInteger) - Method in interface net.jqwik.api.arbitraries.BigIntegerArbitrary
+
+
Set shrinking target to target which must be between the allowed bounds.
+
+
shrinkTowards(int) - Method in interface net.jqwik.api.arbitraries.ByteArbitrary
+
+
Set shrinking target to target which must be between the allowed bounds.
+
+
shrinkTowards(double) - Method in interface net.jqwik.api.arbitraries.DoubleArbitrary
+
+
Set shrinking target to target which must be between the allowed bounds.
+
+
shrinkTowards(float) - Method in interface net.jqwik.api.arbitraries.FloatArbitrary
+
+
Set shrinking target to target which must be between the allowed bounds.
+
+
shrinkTowards(int) - Method in interface net.jqwik.api.arbitraries.IntegerArbitrary
+
+
Set shrinking target to target which must be between the allowed bounds.
+
+
shrinkTowards(long) - Method in interface net.jqwik.api.arbitraries.LongArbitrary
+
+
Set shrinking target to target which must be between the allowed bounds.
+
+
shrinkTowards(short) - Method in interface net.jqwik.api.arbitraries.ShortArbitrary
+
+
Set shrinking target to target which must be between the allowed bounds.
+
+
shuffle(T...) - Static method in class net.jqwik.api.Arbitraries
+
+
Create an arbitrary that will always generate a list which is a + permutation of the values handed to it.
+
+
shuffle(List<T>) - Static method in class net.jqwik.api.Arbitraries
+
+
Create an arbitrary that will always generate a list which is a + permutation of the values handed to it.
+
+
SizableArbitrary<U> - Interface in net.jqwik.api.arbitraries
+
+
Fluent interface to configure arbitraries that have size constraints for generated values, e.g. collections and arrays.
+
+
Size - Annotation Type in net.jqwik.api.constraints
+
+
Constrain the size of generated "sizable" types.
+
+
size() - Method in interface net.jqwik.api.EdgeCases
+
 
+
size() - Method in class net.jqwik.api.ShrinkingDistance
+
 
+
size() - Method in interface net.jqwik.api.Tuple
+
 
+
size() - Method in class net.jqwik.api.Tuple.Tuple1
+
 
+
size() - Method in class net.jqwik.api.Tuple.Tuple2
+
 
+
size() - Method in class net.jqwik.api.Tuple.Tuple3
+
 
+
size() - Method in class net.jqwik.api.Tuple.Tuple4
+
 
+
size() - Method in class net.jqwik.api.Tuple.Tuple5
+
 
+
size() - Method in class net.jqwik.api.Tuple.Tuple6
+
 
+
size() - Method in class net.jqwik.api.Tuple.Tuple7
+
 
+
size() - Method in class net.jqwik.api.Tuple.Tuple8
+
 
+
skip(String) - Static method in class net.jqwik.api.lifecycle.SkipExecutionHook.SkipResult
+
+
Create instance of SkipExecutionHook.SkipResult to make the current element being skipped.
+
+
SkipExecutionHook - Interface in net.jqwik.api.lifecycle
+
+
Use this hook to determine if an annotated element should be skipped during + a test run or not.
+
+
SkipExecutionHook.SkipResult - Class in net.jqwik.api.lifecycle
+
 
+
startWith(Shrinkable<T>, Falsifier<T>) - Method in class net.jqwik.api.ShrinkingSequence.ShrinkingSequenceFacade
+
 
+
startWith(Shrinkable<T>, Falsifier<T>) - Static method in interface net.jqwik.api.ShrinkingSequence
+
 
+
Statistics - Class in net.jqwik.api.statistics
+
+
This class serves as a container for static methods to collect statistical + data about generated values within a property method and to check coverage + of that data.
+
+
Statistics.StatisticsFacade - Class in net.jqwik.api.statistics
+
 
+
StatisticsCollector - Interface in net.jqwik.api.statistics
+
+
This class serves as an interface to collect statistical + data about generated values within a property method.
+
+
StatisticsCoverage - Interface in net.jqwik.api.statistics
+
+
Intermediate object to provide statistics coverage checking capabilities
+
+
StatisticsCoverage.CoverageChecker - Interface in net.jqwik.api.statistics
+
 
+
StatisticsEntry - Interface in net.jqwik.api.statistics
+
+
Describes an entry for a given statistics selector.
+
+
StatisticsFacade() - Constructor for class net.jqwik.api.statistics.Statistics.StatisticsFacade
+
 
+
StatisticsReport - Annotation Type in net.jqwik.api.statistics
+
+
This annotation can be used to influence statistics reporting.
+
+
StatisticsReport.None - Class in net.jqwik.api.statistics
+
 
+
StatisticsReport.StatisticsReportMode - Enum in net.jqwik.api.statistics
+
 
+
StatisticsReportFormat - Interface in net.jqwik.api.statistics
+
+
An implementation of this interface is responsible for creating + a formatted statistics report.
+
+
status() - Method in class net.jqwik.api.FalsificationResult
+
 
+
status() - Method in interface net.jqwik.api.lifecycle.PropertyExecutionResult
+
+
The final status of this property
+
+
status() - Method in interface net.jqwik.api.lifecycle.TryExecutionResult
+
 
+
Store<T> - Interface in net.jqwik.api.lifecycle
+
+
Experimental feature.
+
+
Store.StoreFacade - Class in net.jqwik.api.lifecycle
+
 
+
StoreFacade() - Constructor for class net.jqwik.api.lifecycle.Store.StoreFacade
+
 
+
stream(Arbitrary<T>) - Method in class net.jqwik.api.Arbitrary.ArbitraryFacade
+
 
+
stream() - Method in interface net.jqwik.api.Arbitrary
+
+
Create a new arbitrary of type Stream<T> using the existing arbitrary for generating the elements of the + stream.
+
+
stream(Random) - Method in interface net.jqwik.api.RandomGenerator
+
 
+
StreamableArbitrary<T,U> - Interface in net.jqwik.api.arbitraries
+
+
Fluent interface to add functionality to arbitraries whose generation artefacts + can be streamed, e.g.
+
+
StringArbitrary - Interface in net.jqwik.api.arbitraries
+
+
Fluent interface to configure arbitraries that generate String values.
+
+
StringLength - Annotation Type in net.jqwik.api.constraints
+
+
Constrain the length of generated Strings.
+
+
strings() - Method in class net.jqwik.api.Arbitraries.ArbitrariesFacade
+
 
+
strings() - Static method in class net.jqwik.api.Arbitraries
+
+
Create an arbitrary that generates values of type String.
+
+
suppliers() - Method in interface net.jqwik.api.EdgeCases
+
 
+
+ + + +

T

+
+
Table - Class in net.jqwik.api
+
 
+
Table() - Constructor for class net.jqwik.api.Table
+
 
+
Tag - Annotation Type in net.jqwik.api
+
+
Use @Tag("a tag") to give test classes, groups and methods an (additional) tag + which can later be used to select the set of tests to execute.
+
+
TagList - Annotation Type in net.jqwik.api
+
 
+
targetMethod() - Method in interface net.jqwik.api.lifecycle.PropertyLifecycleContext
+
+
The method that defines the current property or example.
+
+
targetMethod() - Method in interface net.jqwik.api.lifecycle.TryLifecycleContext
+
+
The method that defines the current property or example.
+
+
testInstance() - Method in interface net.jqwik.api.lifecycle.PropertyLifecycleContext
+
+
The current instance of the property's container class.
+
+
testInstance() - Method in interface net.jqwik.api.lifecycle.TryLifecycleContext
+
+
The current instance of the property's container class.
+
+
that(boolean) - Static method in class net.jqwik.api.Assume
+
+
If condition does not hold, the current property method will be aborted, + i.e., it will not be executed but not counted as a try.
+
+
that(Supplier<Boolean>) - Static method in class net.jqwik.api.Assume
+
+
If condition provided by conditionSupplier does not hold, the current property method will be aborted, + i.e., it will not be executed but not counted as a try.
+
+
throwable() - Method in class net.jqwik.api.FalsificationResult
+
 
+
throwable() - Method in interface net.jqwik.api.lifecycle.PropertyExecutionResult
+
+
Will return Optional.empty() if status is anything but FAILED.
+
+
throwable() - Method in interface net.jqwik.api.lifecycle.TryExecutionResult
+
+
Will return Optional.empty() if status is anything but TryExecutionResult.Status.FALSIFIED.
+
+
TooManyFilterMissesException - Exception in net.jqwik.api
+
 
+
TooManyFilterMissesException(String) - Constructor for exception net.jqwik.api.TooManyFilterMissesException
+
 
+
toString() - Method in class net.jqwik.api.FalsificationResult
+
 
+
toString() - Method in class net.jqwik.api.lifecycle.SkipExecutionHook.SkipResult
+
 
+
toString() - Method in class net.jqwik.api.ShrinkingDistance
+
 
+
toString() - Method in class net.jqwik.api.Tuple.Tuple1
+
 
+
toString() - Method in class net.jqwik.api.Tuple.Tuple2
+
 
+
toString() - Method in class net.jqwik.api.Tuple.Tuple3
+
 
+
toString() - Method in class net.jqwik.api.Tuple.Tuple4
+
 
+
toString() - Method in class net.jqwik.api.Tuple.Tuple5
+
 
+
toString() - Method in class net.jqwik.api.Tuple.Tuple6
+
 
+
toString() - Method in class net.jqwik.api.Tuple.Tuple7
+
 
+
toString() - Method in class net.jqwik.api.Tuple.Tuple8
+
 
+
TRIES_NOT_SET - Static variable in annotation type net.jqwik.api.Property
+
 
+
TryExecutionResult - Interface in net.jqwik.api.lifecycle
+
+
Represents the result of calling a property method with a list of parameters.
+
+
TryExecutionResult.Status - Enum in net.jqwik.api.lifecycle
+
+
Status of running a single try.
+
+
TryExecutor - Interface in net.jqwik.api.lifecycle
+
+
Experimental feature.
+
+
TryLifecycleContext - Interface in net.jqwik.api.lifecycle
+
+
The context information of a single try of a property.
+
+
Tuple - Interface in net.jqwik.api
+
 
+
Tuple.Tuple1<T1> - Class in net.jqwik.api
+
 
+
Tuple.Tuple2<T1,T2> - Class in net.jqwik.api
+
 
+
Tuple.Tuple3<T1,T2,T3> - Class in net.jqwik.api
+
 
+
Tuple.Tuple4<T1,T2,T3,T4> - Class in net.jqwik.api
+
 
+
Tuple.Tuple5<T1,T2,T3,T4,T5> - Class in net.jqwik.api
+
 
+
Tuple.Tuple6<T1,T2,T3,T4,T5,T6> - Class in net.jqwik.api
+
 
+
Tuple.Tuple7<T1,T2,T3,T4,T5,T6,T7> - Class in net.jqwik.api
+
 
+
Tuple.Tuple8<T1,T2,T3,T4,T5,T6,T7,T8> - Class in net.jqwik.api
+
 
+
tuple1() - Method in interface net.jqwik.api.Arbitrary
+
+
Create a new arbitrary of type Tuple.Tuple1<T> that will use the underlying + arbitrary to create the tuple value;
+
+
tuple2() - Method in interface net.jqwik.api.Arbitrary
+
+
Create a new arbitrary of type Tuple.Tuple2<T, T> that will use the underlying + arbitrary to create the tuple values;
+
+
tuple3() - Method in interface net.jqwik.api.Arbitrary
+
+
Create a new arbitrary of type Tuple.Tuple3<T, T, T> that will use the underlying + arbitrary to create the tuple values;
+
+
tuple4() - Method in interface net.jqwik.api.Arbitrary
+
+
Create a new arbitrary of type Tuple.Tuple4<T, T, T, T> that will use the underlying + arbitrary to create the tuple values;
+
+
TypeArbitrary<T> - Interface in net.jqwik.api.arbitraries
+
+
Fluent interface to configure arbitraries that try to generate instances + of a given type T from the type's available constructors and factory methods.
+
+
typeUsage() - Method in interface net.jqwik.api.lifecycle.ParameterResolutionContext
+
 
+
TypeUsage - Interface in net.jqwik.api.providers
+
+
An instance of TypeUsage describes the information available for parameter or return types.
+
+
TypeUsage.TypeUsageFacade - Class in net.jqwik.api.providers
+
 
+
TypeUsageFacade() - Constructor for class net.jqwik.api.providers.TypeUsage.TypeUsageFacade
+
 
+
+ + + +

U

+
+
uniform() - Method in class net.jqwik.api.RandomDistribution.RandomDistributionFacade
+
 
+
uniform() - Static method in interface net.jqwik.api.RandomDistribution
+
+
A distribution that generates values across the allowed range + with a uniform probability distribution.
+
+
unique() - Method in interface net.jqwik.api.Arbitrary
+
+
Create a new arbitrary of the same type T that creates and shrinks the original arbitrary but will + never generate the same value twice.
+
+
Unique - Annotation Type in net.jqwik.api.constraints
+
+
Make a generated value to be unique withing the same try.
+
+
unique(ExhaustiveGenerator<T>) - Method in class net.jqwik.api.ExhaustiveGenerator.ExhaustiveGeneratorFacade
+
 
+
unique() - Method in interface net.jqwik.api.ExhaustiveGenerator
+
 
+
unique(RandomGenerator<T>) - Method in class net.jqwik.api.RandomGenerator.RandomGeneratorFacade
+
 
+
unique() - Method in interface net.jqwik.api.RandomGenerator
+
 
+
unshrinkable(T, ShrinkingDistance) - Method in class net.jqwik.api.Shrinkable.ShrinkableFacade
+
 
+
unshrinkable(T) - Static method in interface net.jqwik.api.Shrinkable
+
 
+
unshrinkable(T, ShrinkingDistance) - Static method in interface net.jqwik.api.Shrinkable
+
 
+
update(Function<T, T>) - Method in interface net.jqwik.api.lifecycle.Store
+
 
+
UpperChars - Annotation Type in net.jqwik.api.constraints
+
+
Constrain the chars used to generate Strings or Characters to upper and lower case chars.
+
+
use(Executable) - Method in interface net.jqwik.api.arbitraries.TypeArbitrary
+
+
Add another creator (function or constructor) to be used + for generating values of type T
+
+
use(Arbitrary<T>) - Method in class net.jqwik.api.Combinators.BuilderCombinator
+
 
+
useAllConstructors() - Method in interface net.jqwik.api.arbitraries.TypeArbitrary
+
+
Add all constructors (public, private or package scope) of class T to be used + for generating values of type T
+
+
useAllFactoryMethods() - Method in interface net.jqwik.api.arbitraries.TypeArbitrary
+
+
Add all factory methods (static methods with return type T) + of class T to be used for generating values of type T
+
+
useConstructors(Predicate<? super Constructor<?>>) - Method in interface net.jqwik.api.arbitraries.TypeArbitrary
+
+
Add all constructors (public, private or package scope) of class T to be used + for generating values of type T
+
+
useFactoryMethods(Predicate<Method>) - Method in interface net.jqwik.api.arbitraries.TypeArbitrary
+
+
Add all factory methods (static methods with return type T) + of class T to be used for generating values of type T
+
+
usePublicConstructors() - Method in interface net.jqwik.api.arbitraries.TypeArbitrary
+
+
Add public constructors of class T to be used + for generating values of type T
+
+
usePublicFactoryMethods() - Method in interface net.jqwik.api.arbitraries.TypeArbitrary
+
+
Add public factory methods (static methods with return type T) + of class T to be used for generating values of type T
+
+
UseType - Annotation Type in net.jqwik.api.constraints
+
+
Generate a value from the annotated class' or type's constructors or factory methods.
+
+
UseTypeMode - Enum in net.jqwik.api.constraints
+
 
+
+ + + +

V

+
+
value() - Method in class net.jqwik.api.FalsificationResult
+
 
+
value() - Method in interface net.jqwik.api.Shrinkable
+
 
+
valueOf(String) - Static method in enum net.jqwik.api.AfterFailureMode
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum net.jqwik.api.constraints.UseTypeMode
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum net.jqwik.api.EdgeCasesMode
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum net.jqwik.api.FalsificationResult.Status
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum net.jqwik.api.GenerationMode
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum net.jqwik.api.lifecycle.Lifespan
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum net.jqwik.api.lifecycle.PropagationMode
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum net.jqwik.api.lifecycle.PropertyExecutionResult.Status
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum net.jqwik.api.lifecycle.TryExecutionResult.Status
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum net.jqwik.api.Reporting
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum net.jqwik.api.ShrinkingMode
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum net.jqwik.api.stateful.ActionSequence.RunState
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum net.jqwik.api.statistics.StatisticsReport.StatisticsReportMode
+
+
Returns the enum constant of this type with the specified name.
+
+
values() - Static method in enum net.jqwik.api.AfterFailureMode
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum net.jqwik.api.constraints.UseTypeMode
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum net.jqwik.api.EdgeCasesMode
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum net.jqwik.api.FalsificationResult.Status
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum net.jqwik.api.GenerationMode
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum net.jqwik.api.lifecycle.Lifespan
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum net.jqwik.api.lifecycle.PropagationMode
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum net.jqwik.api.lifecycle.PropertyExecutionResult.Status
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum net.jqwik.api.lifecycle.TryExecutionResult.Status
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum net.jqwik.api.Reporting
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum net.jqwik.api.ShrinkingMode
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum net.jqwik.api.stateful.ActionSequence.RunState
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Method in interface net.jqwik.api.statistics.StatisticsEntry
+
+
The values collected during Statistics.collect(Object...)
+
+
values() - Static method in enum net.jqwik.api.statistics.StatisticsReport.StatisticsReportMode
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
+ + + +

W

+
+
when(Predicate<List<Object>>, Function<List<Object>, R>) - Method in interface net.jqwik.api.arbitraries.FunctionArbitrary
+
 
+
whitespace() - Method in interface net.jqwik.api.arbitraries.CharacterArbitrary
+
+
Allow all whitespace chars to show up in generated values.
+
+
whitespace() - Method in interface net.jqwik.api.arbitraries.StringArbitrary
+
+
Allow all chars that will return true for + Character.isWhitespace(char).
+
+
Whitespace - Annotation Type in net.jqwik.api.constraints
+
+
Constrain the chars used to generate Strings or Characters to chars + that will return true for Character.isWhitespace(char).
+
+
wildcard(TypeUsage) - Method in class net.jqwik.api.providers.TypeUsage.TypeUsageFacade
+
 
+
wildcard(TypeUsage) - Static method in interface net.jqwik.api.providers.TypeUsage
+
 
+
with(char...) - Method in interface net.jqwik.api.arbitraries.CharacterArbitrary
+
+
Allow all chars in allowedChars show up in generated values.
+
+
with(Arbitrary<Character>) - Method in interface net.jqwik.api.arbitraries.CharacterArbitrary
+
+
Allow all chars generated by characterArbitrary.
+
+
with(CharSequence) - Method in interface net.jqwik.api.arbitraries.CharacterArbitrary
+
+
Allow all chars in allowedChars show up in generated values.
+
+
withBuilder(Supplier<B>) - Static method in class net.jqwik.api.Combinators
+
+
Combine Arbitraries by means of a builder.
+
+
withBuilder(Arbitrary<B>) - Static method in class net.jqwik.api.Combinators
+
+
Combine Arbitraries by means of a builder.
+
+
withCharRange(char, char) - Method in interface net.jqwik.api.arbitraries.StringArbitrary
+
+
Allow all chars within from (included) and to (included) to show up in generated strings.
+
+
withChars(char...) - Method in interface net.jqwik.api.arbitraries.StringArbitrary
+
+
Allow all chars in chars to show up in generated strings.
+
+
withChars(CharSequence) - Method in interface net.jqwik.api.arbitraries.StringArbitrary
+
+
Allow all chars in chars to show up in generated strings.
+
+
withChars(Arbitrary<Character>) - Method in interface net.jqwik.api.arbitraries.StringArbitrary
+
+
Allow all chars generated by characterArbitrary.
+
+
withDistribution(RandomDistribution) - Method in interface net.jqwik.api.arbitraries.NumericalArbitrary
+
+
Set the distribution to use when generating random numerical values.
+
+
withEdgeCases(RandomGenerator<T>, int, EdgeCases<T>) - Method in class net.jqwik.api.RandomGenerator.RandomGeneratorFacade
+
 
+
withEdgeCases(int, EdgeCases<T>) - Method in interface net.jqwik.api.RandomGenerator
+
 
+
withFilter(Predicate<T>) - Method in interface net.jqwik.api.Falsifier
+
 
+
withInvariant(Invariant<M>) - Method in interface net.jqwik.api.stateful.ActionSequence
+
+
Add an unlabelled invariant to a sequence.
+
+
withInvariant(String, Invariant<M>) - Method in interface net.jqwik.api.stateful.ActionSequence
+
+
Add a labelled invariant to a sequence.
+
+
WithNull - Annotation Type in net.jqwik.api.constraints
+
+
Allows jqwik to inject null parameters into generated values.
+
+
withPostFilter(Predicate<T>) - Method in interface net.jqwik.api.Falsifier
+
 
+
+A B C D E F G H I J L M N O P R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/index.html b/docs/docs/1.3.0/javadoc/index.html new file mode 100644 index 000000000..d2f721086 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/index.html @@ -0,0 +1,75 @@ + + + + + +documentation 1.3.0 API + + + + + + + + + +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<h2>Frame Alert</h2> +<p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to <a href="overview-summary.html">Non-frame version</a>.</p> + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/AfterFailureMode.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/AfterFailureMode.html new file mode 100644 index 000000000..e781a96d2 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/AfterFailureMode.html @@ -0,0 +1,402 @@ + + + + + +AfterFailureMode (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Enum AfterFailureMode

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, java.lang.Comparable<AfterFailureMode>
    +
    +
    +
    +
    @API(status=MAINTAINED,
    +     since="1.0")
    +public enum AfterFailureMode
    +extends java.lang.Enum<AfterFailureMode>
    +
    The after-failure mode determines how a property behaves after it has been falsified. + It can be set in Property.afterFailure() for any property method; default is PREVIOUS_SEED.
    +
    +
    See Also:
    +
    Property
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Enum Constant Summary

      + + + + + + + + + + + + + + + + + + + + +
      Enum Constants 
      Enum Constant and Description
      NOT_SET 
      PREVIOUS_SEED +
      Use the previous random seed that already detected a failure.
      +
      RANDOM_SEED +
      Use new random seed.
      +
      SAMPLE_FIRST +
      Run the property with just the previous falsified and shrunk sample first, + if that succeeds run property default behaviour, i.e. data-driven or random seed.
      +
      SAMPLE_ONLY +
      Run the property with just the previous falsified and shrunk sample.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static AfterFailureModevalueOf(java.lang.String name) +
      Returns the enum constant of this type with the specified name.
      +
      static AfterFailureMode[]values() +
      Returns an array containing the constants of this enum type, in +the order they are declared.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Enum

        +clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +getClass, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Enum Constant Detail

      + + + +
        +
      • +

        RANDOM_SEED

        +
        public static final AfterFailureMode RANDOM_SEED
        +
        Use new random seed.
        +
      • +
      + + + +
        +
      • +

        PREVIOUS_SEED

        +
        public static final AfterFailureMode PREVIOUS_SEED
        +
        Use the previous random seed that already detected a failure.
        +
      • +
      + + + +
        +
      • +

        SAMPLE_ONLY

        +
        public static final AfterFailureMode SAMPLE_ONLY
        +
        Run the property with just the previous falsified and shrunk sample. + + Only works if sample data could be serialized. + Will use previous seed otherwise.
        +
      • +
      + + + +
        +
      • +

        SAMPLE_FIRST

        +
        public static final AfterFailureMode SAMPLE_FIRST
        +
        Run the property with just the previous falsified and shrunk sample first, + if that succeeds run property default behaviour, i.e. data-driven or random seed. + + Only works if sample data could be serialized. + Will use previous seed otherwise.
        +
      • +
      + + + + +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static AfterFailureMode[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (AfterFailureMode c : AfterFailureMode.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static AfterFailureMode valueOf(java.lang.String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        +
        java.lang.NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.ArbitrariesFacade.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.ArbitrariesFacade.html new file mode 100644 index 000000000..9e26192a9 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.ArbitrariesFacade.html @@ -0,0 +1,666 @@ + + + + + +Arbitraries.ArbitrariesFacade (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Class Arbitraries.ArbitrariesFacade

+
+
+ +
+
    +
  • +
    +
    Enclosing class:
    +
    Arbitraries
    +
    +
    +
    +
    @API(status=INTERNAL)
    +public abstract static class Arbitraries.ArbitrariesFacade
    +extends java.lang.Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ArbitrariesFacade

        +
        public ArbitrariesFacade()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        edgeCasesChoose

        +
        public abstract <T> EdgeCases<T> edgeCasesChoose(java.util.List<T> values)
        +
      • +
      + + + +
        +
      • +

        edgeCasesChoose

        +
        public abstract <T> EdgeCases<T> edgeCasesChoose(char[] validChars)
        +
      • +
      + + + +
        +
      • +

        exhaustiveChoose

        +
        public abstract <T> java.util.Optional<ExhaustiveGenerator<T>> exhaustiveChoose(java.util.List<T> values,
        +                                                                                long maxNumberOfSamples)
        +
      • +
      + + + +
        +
      • +

        exhaustiveCreate

        +
        public abstract <T> java.util.Optional<ExhaustiveGenerator<T>> exhaustiveCreate(java.util.function.Supplier<T> supplier,
        +                                                                                long maxNumberOfSamples)
        +
      • +
      + + + +
        +
      • +

        exhaustiveChoose

        +
        public abstract java.util.Optional<ExhaustiveGenerator<java.lang.Character>> exhaustiveChoose(char[] values,
        +                                                                                              long maxNumberOfSamples)
        +
      • +
      + + + +
        +
      • +

        exhaustiveShuffle

        +
        public abstract <T> java.util.Optional<ExhaustiveGenerator<java.util.List<T>>> exhaustiveShuffle(java.util.List<T> values,
        +                                                                                                 long maxNumberOfSamples)
        +
      • +
      + + + +
        +
      • +

        randomChoose

        +
        public abstract <T> RandomGenerator<T> randomChoose(java.util.List<T> values)
        +
      • +
      + + + +
        +
      • +

        randomChoose

        +
        public abstract RandomGenerator<java.lang.Character> randomChoose(char[] values)
        +
      • +
      + + + +
        +
      • +

        oneOf

        +
        public abstract <T> Arbitrary<T> oneOf(java.util.List<Arbitrary<T>> all)
        +
      • +
      + + + +
        +
      • +

        randomFrequency

        +
        public abstract <T> RandomGenerator<T> randomFrequency(java.util.List<Tuple.Tuple2<java.lang.Integer,T>> frequencies)
        +
      • +
      + + + + + +
        +
      • +

        randomSamples

        +
        public abstract <T> RandomGenerator<T> randomSamples(T[] samples)
        +
      • +
      + + + +
        +
      • +

        randomShuffle

        +
        public abstract <T> RandomGenerator<java.util.List<T>> randomShuffle(java.util.List<T> values)
        +
      • +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        +
      • +

        defaultFor

        +
        public abstract <T> Arbitrary<T> defaultFor(java.lang.Class<T> type,
        +                                            java.lang.Class<?>[] typeParameters)
        +
      • +
      + + + + + + + +
        +
      • +

        lazy

        +
        public abstract <T> Arbitrary<T> lazy(java.util.function.Supplier<Arbitrary<T>> arbitrarySupplier)
        +
      • +
      + + + +
        +
      • +

        forType

        +
        public abstract <T> TypeArbitrary<T> forType(java.lang.Class<T> targetType)
        +
      • +
      + + + + + + + +
        +
      • +

        entries

        +
        public abstract <K,V> Arbitrary<java.util.Map.Entry<K,V>> entries(Arbitrary<K> keysArbitrary,
        +                                                                  Arbitrary<V> valuesArbitrary)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html new file mode 100644 index 000000000..c9bd62f66 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html @@ -0,0 +1,1265 @@ + + + + + +Arbitraries (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Class Arbitraries

+
+
+ +
+
    +
  • +
    +
    +
    @API(status=STABLE,
    +     since="1.0")
    +public class Arbitraries
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and TypeMethod and Description
      static BigDecimalArbitrarybigDecimals() +
      Create an arbitrary that generates values of type BigDecimal.
      +
      static BigIntegerArbitrarybigIntegers() +
      Create an arbitrary that generates values of type BigInteger.
      +
      static ByteArbitrarybytes() +
      Create an arbitrary that generates values of type Byte.
      +
      static CharacterArbitrarychars() +
      Create an arbitrary that generates values of type Character.
      +
      static <T> Arbitrary<T>constant(T value) +
      Create an arbitrary that will always generate the same value.
      +
      static <T> Arbitrary<T>create(java.util.function.Supplier<T> supplier) +
      Create an arbitrary that will use a supplier to generate a value.
      +
      static <T> Arbitrary<T>defaultFor(java.lang.Class<T> type, + java.lang.Class<?>... typeParameters) +
      Find a registered arbitrary that will be used to generate values of type T.
      +
      static <T> Arbitrary<T>defaultFor(TypeUsage typeUsage) +
      Find a registered arbitrary that will be used to generate values of type T.
      +
      static DoubleArbitrarydoubles() +
      Create an arbitrary that generates values of type Double.
      +
      static <K,V> Arbitrary<java.util.Map.Entry<K,V>>entries(Arbitrary<K> keysArbitrary, + Arbitrary<V> valuesArbitrary) +
      Create an arbitrary to create instances of Map.Entry.
      +
      static FloatArbitraryfloats() +
      Create an arbitrary that generates values of type Float.
      +
      static <T> TypeArbitrary<T>forType(java.lang.Class<T> targetType) +
      Create an arbitrary for type T that will by default use the type's + public constructors and public factory methods.
      +
      static <T> Arbitrary<T>frequency(java.util.List<Tuple.Tuple2<java.lang.Integer,T>> frequencies) +
      Create an arbitrary that will randomly choose between all given values of the same type T.
      +
      static <T> Arbitrary<T>frequency(Tuple.Tuple2<java.lang.Integer,T>... frequencies) +
      Create an arbitrary that will randomly choose between all given values of the same type T.
      +
      static <T> Arbitrary<T>frequencyOf(java.util.List<Tuple.Tuple2<java.lang.Integer,Arbitrary<T>>> frequencies) +
      Create an arbitrary that will randomly choose between all given arbitraries of the same type T.
      +
      static <T> Arbitrary<T>frequencyOf(Tuple.Tuple2<java.lang.Integer,Arbitrary<T>>... frequencies) +
      Create an arbitrary that will randomly choose between all given arbitraries of the same type T.
      +
      static <T> Arbitrary<T>fromGenerator(RandomGenerator<T> generator) +
      Create an arbitrary of type T from a corresponding generator of type T.
      +
      static IntegerArbitraryintegers() +
      Create an arbitrary that generates values of type Integer.
      +
      static <T> Arbitrary<T>lazy(java.util.function.Supplier<Arbitrary<T>> arbitrarySupplier) +
      Create an arbitrary that will evaluate arbitrarySupplier as soon as it is used for generating values.
      +
      static LongArbitrarylongs() +
      Create an arbitrary that generates values of type Long.
      +
      static <K,V> SizableArbitrary<java.util.Map<K,V>>maps(Arbitrary<K> keysArbitrary, + Arbitrary<V> valuesArbitrary) +
      Create an arbitrary to create instances of Map.
      +
      static Arbitrary<java.lang.Void>nothing() +
      Create an arbitrary that never creates anything.
      +
      static Arbitrary<java.lang.Character>of(char[] values) +
      Create an arbitrary of character values.
      +
      static <T extends java.lang.Enum<T>>
      Arbitrary<T>
      of(java.lang.Class<T> enumClass) +
      Create an arbitrary for enum values of type T.
      +
      static <T> Arbitrary<T>of(java.util.List<T> values) +
      Create an arbitrary that will randomly choose from a given list of values.
      +
      static <T> Arbitrary<T>of(T... values) +
      Create an arbitrary that will randomly choose from a given array of values.
      +
      static <T> Arbitrary<T>ofSuppliers(java.util.List<java.util.function.Supplier<T>> valueSuppliers) +
      Create an arbitrary that will randomly choose from a given array of value suppliers + and then get the value from the supplier.
      +
      static <T> Arbitrary<T>ofSuppliers(java.util.function.Supplier<T>... valueSuppliers) +
      Create an arbitrary that will randomly choose from a given array of value suppliers + and then get the value from the supplier.
      +
      static <T> Arbitrary<T>oneOf(Arbitrary<? extends T> first, + Arbitrary<? extends T>... rest) +
      Create an arbitrary that will randomly choose between all given arbitraries of the same type T.
      +
      static <T> Arbitrary<T>oneOf(java.util.List<Arbitrary<T>> all) +
      Create an arbitrary that will randomly choose between all given arbitraries of the same type T.
      +
      static Arbitrary<java.util.Random>randoms() +
      Create an arbitrary for Random objects.
      +
      static <T> Arbitrary<T>randomValue(java.util.function.Function<java.util.Random,T> generator) +
      Create an arbitrary that will generate values of type T using a generator function.
      +
      static <T> Arbitrary<T>recursive(java.util.function.Supplier<Arbitrary<T>> base, + java.util.function.Function<Arbitrary<T>,Arbitrary<T>> recur, + int depth) +
      Create an arbitrary by deterministic recursion.
      +
      static <T> Arbitrary<T>samples(T... samples) +
      Deprecated.  +
      Use of(Object[]) or move to data-driven properties if order is important. Will be removed in version 1.4.0
      +
      +
      static <M> ActionSequenceArbitrary<M>sequences(Arbitrary<? extends Action<M>> actionArbitrary) +
      Create an arbitrary to create a sequence of actions.
      +
      static ShortArbitraryshorts() +
      Create an arbitrary that generates values of type Short.
      +
      static <T> Arbitrary<java.util.List<T>>shuffle(java.util.List<T> values) +
      Create an arbitrary that will always generate a list which is a + permutation of the values handed to it.
      +
      static <T> Arbitrary<java.util.List<T>>shuffle(T... values) +
      Create an arbitrary that will always generate a list which is a + permutation of the values handed to it.
      +
      static StringArbitrarystrings() +
      Create an arbitrary that generates values of type String.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        fromGenerator

        +
        public static <T> Arbitrary<T> fromGenerator(RandomGenerator<T> generator)
        +
        Create an arbitrary of type T from a corresponding generator of type T.
        +
        +
        Type Parameters:
        +
        T - The type of values to generate
        +
        Parameters:
        +
        generator - The generator to be used for generating the values
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        randomValue

        +
        public static <T> Arbitrary<T> randomValue(java.util.function.Function<java.util.Random,T> generator)
        +
        Create an arbitrary that will generate values of type T using a generator function. + The generated values are unshrinkable.
        +
        +
        Type Parameters:
        +
        T - The type of values to generate
        +
        Parameters:
        +
        generator - The generator function to be used for generating the values
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        randoms

        +
        public static Arbitrary<java.util.Random> randoms()
        +
        Create an arbitrary for Random objects.
        +
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + + + +
        +
      • +

        of

        +
        @SafeVarargs
        +public static <T> Arbitrary<T> of(T... values)
        +
        Create an arbitrary that will randomly choose from a given array of values. + A generated value will be shrunk towards the start of the array. + +

        + Use this method only for immutable values, because changing the value will change + subsequent generated values as well. + For mutable values use ofSuppliers(Supplier[]) instead.

        +
        +
        Type Parameters:
        +
        T - The type of values to generate
        +
        Parameters:
        +
        values - The array of values to choose from
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        of

        +
        public static <T> Arbitrary<T> of(java.util.List<T> values)
        +
        Create an arbitrary that will randomly choose from a given list of values. + A generated value will be shrunk towards the start of the list. + +

        + Use this method only for immutable values, because changing the value will change + subsequent generated values as well. + For mutable values use ofSuppliers(List) instead.

        +
        +
        Type Parameters:
        +
        T - The type of values to generate
        +
        Parameters:
        +
        values - The list of values to choose from
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        ofSuppliers

        +
        @API(status=MAINTAINED,
        +     since="1.3.0")
        + @SafeVarargs
        +public static <T> Arbitrary<T> ofSuppliers(java.util.function.Supplier<T>... valueSuppliers)
        +
        Create an arbitrary that will randomly choose from a given array of value suppliers + and then get the value from the supplier. + A generated value will be shrunk towards the start of the array. + +

        + Use this method instead of of(Object[]) for mutable objects + to make sure that changing a generated object will not influence other generated + objects.

        +
        +
        Type Parameters:
        +
        T - The type of values to generate
        +
        Parameters:
        +
        valueSuppliers - The array of values to choose from
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        ofSuppliers

        +
        @API(status=MAINTAINED,
        +     since="1.3.0")
        +public static <T> Arbitrary<T> ofSuppliers(java.util.List<java.util.function.Supplier<T>> valueSuppliers)
        +
        Create an arbitrary that will randomly choose from a given array of value suppliers + and then get the value from the supplier. + A generated value will be shrunk towards the start of the array. + +

        + Use this method instead of of(List) for mutable objects + to make sure that changing a generated object will not influence other generated + objects.

        +
        +
        Type Parameters:
        +
        T - The type of values to generate
        +
        Parameters:
        +
        valueSuppliers - The list of values to choose from
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        of

        +
        public static Arbitrary<java.lang.Character> of(char[] values)
        +
        Create an arbitrary of character values.
        +
        +
        Parameters:
        +
        values - The array of characters to choose from.
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        of

        +
        public static <T extends java.lang.Enum<T>> Arbitrary<T> of(java.lang.Class<T> enumClass)
        +
        Create an arbitrary for enum values of type T.
        +
        +
        Type Parameters:
        +
        T - The type of values to generate
        +
        Parameters:
        +
        enumClass - The enum class.
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        oneOf

        +
        @SafeVarargs
        +public static <T> Arbitrary<T> oneOf(Arbitrary<? extends T> first,
        +                                                  Arbitrary<? extends T>... rest)
        +
        Create an arbitrary that will randomly choose between all given arbitraries of the same type T.
        +
        +
        Type Parameters:
        +
        T - The type of values to generate
        +
        Parameters:
        +
        first - The first arbitrary to choose form
        +
        rest - An array of arbitraries to choose from
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        oneOf

        +
        public static <T> Arbitrary<T> oneOf(java.util.List<Arbitrary<T>> all)
        +
        Create an arbitrary that will randomly choose between all given arbitraries of the same type T.
        +
        +
        Type Parameters:
        +
        T - The type of values to generate
        +
        Parameters:
        +
        all - A list of arbitraries to choose from
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        frequency

        +
        @SafeVarargs
        +public static <T> Arbitrary<T> frequency(Tuple.Tuple2<java.lang.Integer,T>... frequencies)
        +
        Create an arbitrary that will randomly choose between all given values of the same type T. + The probability distribution is weighted with the first parameter of the tuple.
        +
        +
        Type Parameters:
        +
        T - The type of values to generate
        +
        Parameters:
        +
        frequencies - An array of tuples of which the first parameter gives the weight and the second the value.
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        frequency

        +
        public static <T> Arbitrary<T> frequency(java.util.List<Tuple.Tuple2<java.lang.Integer,T>> frequencies)
        +
        Create an arbitrary that will randomly choose between all given values of the same type T. + The probability distribution is weighted with the first parameter of the tuple.
        +
        +
        Type Parameters:
        +
        T - The type of values to generate
        +
        Parameters:
        +
        frequencies - A list of tuples of which the first parameter gives the weight and the second the value.
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        frequencyOf

        +
        @SafeVarargs
        +public static <T> Arbitrary<T> frequencyOf(Tuple.Tuple2<java.lang.Integer,Arbitrary<T>>... frequencies)
        +
        Create an arbitrary that will randomly choose between all given arbitraries of the same type T. + The probability distribution is weighted with the first parameter of the tuple.
        +
        +
        Type Parameters:
        +
        T - The type of values to generate
        +
        Parameters:
        +
        frequencies - An array of tuples of which the first parameter gives the weight and the second the arbitrary.
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        frequencyOf

        +
        public static <T> Arbitrary<T> frequencyOf(java.util.List<Tuple.Tuple2<java.lang.Integer,Arbitrary<T>>> frequencies)
        +
        Create an arbitrary that will randomly choose between all given arbitraries of the same type T. + The probability distribution is weighted with the first parameter of the tuple.
        +
        +
        Type Parameters:
        +
        T - The type of values to generate
        +
        Parameters:
        +
        frequencies - A list of tuples of which the first parameter gives the weight and the second the arbitrary.
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        integers

        +
        public static IntegerArbitrary integers()
        +
        Create an arbitrary that generates values of type Integer.
        +
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        longs

        +
        public static LongArbitrary longs()
        +
        Create an arbitrary that generates values of type Long.
        +
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        bigIntegers

        +
        public static BigIntegerArbitrary bigIntegers()
        +
        Create an arbitrary that generates values of type BigInteger.
        +
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        floats

        +
        public static FloatArbitrary floats()
        +
        Create an arbitrary that generates values of type Float.
        +
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        bigDecimals

        +
        public static BigDecimalArbitrary bigDecimals()
        +
        Create an arbitrary that generates values of type BigDecimal.
        +
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        doubles

        +
        public static DoubleArbitrary doubles()
        +
        Create an arbitrary that generates values of type Double.
        +
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        bytes

        +
        public static ByteArbitrary bytes()
        +
        Create an arbitrary that generates values of type Byte.
        +
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        shorts

        +
        public static ShortArbitrary shorts()
        +
        Create an arbitrary that generates values of type Short.
        +
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        strings

        +
        public static StringArbitrary strings()
        +
        Create an arbitrary that generates values of type String.
        +
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        chars

        +
        public static CharacterArbitrary chars()
        +
        Create an arbitrary that generates values of type Character.
        +
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + + + +
        +
      • +

        samples

        +
        @SafeVarargs
        + @Deprecated
        + @API(status=DEPRECATED,
        +     since="1.3.0")
        +public static <T> Arbitrary<T> samples(T... samples)
        +
        Deprecated. Use of(Object[]) or move to data-driven properties if order is important. Will be removed in version 1.4.0
        +
        Create an arbitrary that will provide the sample values from first to last + and then start again at the beginning. Shrinking of samples is tried + towards the start of the samples. + +

        + Attention: If you want to randomly choose between samples + you must use of(Object[]) +

        +
        +
        Type Parameters:
        +
        T - The type of values to generate
        +
        Parameters:
        +
        samples - The array of sample values
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + + + +
        +
      • +

        constant

        +
        public static <T> Arbitrary<T> constant(T value)
        +
        Create an arbitrary that will always generate the same value.
        +
        +
        Type Parameters:
        +
        T - The type of values to generate
        +
        Parameters:
        +
        value - The value to "generate"
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        create

        +
        @API(status=MAINTAINED,
        +     since="1.1.1")
        +public static <T> Arbitrary<T> create(java.util.function.Supplier<T> supplier)
        +
        Create an arbitrary that will use a supplier to generate a value. + The difference to constant(Object) is that the value + is freshly generated for each try of a property. +

        + For exhaustive shrinking all generated values are supposed to have identical behaviour, + i.e. that means that only one value is generated per combination.

        +
        +
        Type Parameters:
        +
        T - The type of values to generate
        +
        Parameters:
        +
        supplier - The supplier use to generate a value
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + + + +
        +
      • +

        shuffle

        +
        @SafeVarargs
        +public static <T> Arbitrary<java.util.List<T>> shuffle(T... values)
        +
        Create an arbitrary that will always generate a list which is a + permutation of the values handed to it. Permutations will + not be shrunk.
        +
        +
        Type Parameters:
        +
        T - The type of values to generate
        +
        Parameters:
        +
        values - The values to permute
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        shuffle

        +
        public static <T> Arbitrary<java.util.List<T>> shuffle(java.util.List<T> values)
        +
        Create an arbitrary that will always generate a list which is a + permutation of the values handed to it. Permutations will + not be shrunk.
        +
        +
        Type Parameters:
        +
        T - The type of values to generate
        +
        Parameters:
        +
        values - The values to permute
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        defaultFor

        +
        public static <T> Arbitrary<T> defaultFor(java.lang.Class<T> type,
        +                                          java.lang.Class<?>... typeParameters)
        +
        Find a registered arbitrary that will be used to generate values of type T. + All default arbitrary providers and all registered arbitrary providers are considered. + This is more or less the same mechanism that jqwik uses to find arbitraries for + property method parameters.
        +
        +
        Type Parameters:
        +
        T - The type of values to generate
        +
        Parameters:
        +
        type - The type of the value to find an arbitrary for
        +
        typeParameters - The type parameters if type is a generic type
        +
        Returns:
        +
        a new arbitrary instance
        +
        Throws:
        +
        CannotFindArbitraryException - if there is no registered arbitrary provider to serve this type
        +
        +
      • +
      + + + +
        +
      • +

        defaultFor

        +
        @API(status=MAINTAINED,
        +     since="1.1")
        +public static <T> Arbitrary<T> defaultFor(TypeUsage typeUsage)
        +
        Find a registered arbitrary that will be used to generate values of type T. + All default arbitrary providers and all registered arbitrary providers are considered. + This is more or less the same mechanism that jqwik uses to find arbitraries for + property method parameters.
        +
        +
        Type Parameters:
        +
        T - The type of values to generate
        +
        Parameters:
        +
        typeUsage - The type of the value to find an arbitrary for
        +
        Returns:
        +
        a new arbitrary instance
        +
        Throws:
        +
        CannotFindArbitraryException - if there is no registered arbitrary provider to serve this type
        +
        +
      • +
      + + + +
        +
      • +

        forType

        +
        @API(status=MAINTAINED,
        +     since="1.2.0")
        +public static <T> TypeArbitrary<T> forType(java.lang.Class<T> targetType)
        +
        Create an arbitrary for type T that will by default use the type's + public constructors and public factory methods.
        +
        +
        Type Parameters:
        +
        T - The type of values to generate
        +
        Parameters:
        +
        targetType - The class of the type to create an arbitrary for
        +
        Returns:
        +
        a new arbitrary instance
        +
        See Also:
        +
        TypeArbitrary
        +
        +
      • +
      + + + +
        +
      • +

        lazy

        +
        public static <T> Arbitrary<T> lazy(java.util.function.Supplier<Arbitrary<T>> arbitrarySupplier)
        +
        Create an arbitrary that will evaluate arbitrarySupplier as soon as it is used for generating values. +

        + This is useful (and necessary) when arbitrary providing functions use other arbitrary providing functions + in a recursive way. Without the use of lazy() this would result in a stack overflow.

        +
        +
        Type Parameters:
        +
        T - The type of values to generate
        +
        Parameters:
        +
        arbitrarySupplier - The supplier function being used to generate an arbitrary
        +
        Returns:
        +
        a new arbitrary instance
        +
        See Also:
        +
        recursive(Supplier, Function, int)
        +
        +
      • +
      + + + +
        +
      • +

        recursive

        +
        public static <T> Arbitrary<T> recursive(java.util.function.Supplier<Arbitrary<T>> base,
        +                                         java.util.function.Function<Arbitrary<T>,Arbitrary<T>> recur,
        +                                         int depth)
        +
        Create an arbitrary by deterministic recursion. +

        + Mind that the arbitrary will be created by invoking recursion at arbitrary creation time. + Using lazy(Supplier) instead will recur at value generation time.

        +
        +
        Type Parameters:
        +
        T - The type of values to generate
        +
        Parameters:
        +
        base - The supplier returning the recursion's base case
        +
        recur - The function to extend the base case
        +
        depth - The number of times to invoke recursion
        +
        Returns:
        +
        a new arbitrary instance
        +
        See Also:
        +
        lazy(Supplier)
        +
        +
      • +
      + + + +
        +
      • +

        sequences

        +
        @API(status=MAINTAINED,
        +     since="1.0")
        +public static <M> ActionSequenceArbitrary<M> sequences(Arbitrary<? extends Action<M>> actionArbitrary)
        +
        Create an arbitrary to create a sequence of actions. Useful for stateful testing.
        +
        +
        Type Parameters:
        +
        M - The type of actions to generate
        +
        Parameters:
        +
        actionArbitrary - The arbitrary to generate individual actions.
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        maps

        +
        @API(status=MAINTAINED,
        +     since="1.1.6")
        +public static <K,V> SizableArbitrary<java.util.Map<K,V>> maps(Arbitrary<K> keysArbitrary,
        +                                                                                                          Arbitrary<V> valuesArbitrary)
        +
        Create an arbitrary to create instances of Map. + The generated maps are mutable.
        +
        +
        Type Parameters:
        +
        K - type of keys
        +
        V - type of values
        +
        Parameters:
        +
        keysArbitrary - The arbitrary to generate the keys
        +
        valuesArbitrary - The arbitrary to generate the values
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        entries

        +
        @API(status=MAINTAINED,
        +     since="1.2.0")
        +public static <K,V> Arbitrary<java.util.Map.Entry<K,V>> entries(Arbitrary<K> keysArbitrary,
        +                                                                                                            Arbitrary<V> valuesArbitrary)
        +
        Create an arbitrary to create instances of Map.Entry. + The generated entries are mutable.
        +
        +
        Type Parameters:
        +
        K - type of keys
        +
        V - type of values
        +
        Parameters:
        +
        keysArbitrary - The arbitrary to generate the keys
        +
        valuesArbitrary - The arbitrary to generate the values
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        nothing

        +
        @API(status=MAINTAINED,
        +     since="1.3.0")
        +public static Arbitrary<java.lang.Void> nothing()
        +
        Create an arbitrary that never creates anything. Sometimes useful + when generating arbitraries of "functions" that have void as return type.
        +
        +
        Returns:
        +
        arbitrary instance that will generate nothing
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.ArbitraryFacade.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.ArbitraryFacade.html new file mode 100644 index 000000000..8193f879c --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.ArbitraryFacade.html @@ -0,0 +1,357 @@ + + + + + +Arbitrary.ArbitraryFacade (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Class Arbitrary.ArbitraryFacade

+
+
+ +
+
    +
  • +
    +
    Enclosing interface:
    +
    Arbitrary<T>
    +
    +
    +
    +
    @API(status=INTERNAL)
    +public abstract static class Arbitrary.ArbitraryFacade
    +extends java.lang.Object
    +
  • +
+
+
+ +
+
+ +
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html new file mode 100644 index 000000000..4da3ff6b5 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html @@ -0,0 +1,916 @@ + + + + + +Arbitrary (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Interface Arbitrary<T>

+
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      + + + + + + + + + + +
      Nested Classes 
      Modifier and TypeInterface and Description
      static class Arbitrary.ArbitraryFacade 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and TypeMethod and Description
      default java.util.Optional<java.util.stream.Stream<T>>allValues() +
      Create optional stream of all possible values this arbitrary could generate.
      +
      default <A> StreamableArbitrary<T,A>array(java.lang.Class<A> arrayClass) +
      Create a new arbitrary of type T[] using the existing arbitrary for generating the elements of the array.
      +
      default Arbitrary<java.lang.Object>asGeneric() +
      Sometimes simplifies test writing
      +
      default Arbitrary<java.util.List<T>>collect(java.util.function.Predicate<java.util.List<T>> until) +
      Create a new arbitrary of type List<T> by adding elements of type T until condition until is fulfilled.
      +
      EdgeCases<T>edgeCases() 
      default java.util.Optional<ExhaustiveGenerator<T>>exhaustive() +
      Create the exhaustive generator for an arbitrary using the maximum allowed + number of generated samples.
      +
      default java.util.Optional<ExhaustiveGenerator<T>>exhaustive(long maxNumberOfSamples) +
      Create the exhaustive generator for an arbitrary.
      +
      default Arbitrary<T>filter(java.util.function.Predicate<T> filterPredicate) +
      Create a new arbitrary of the same type T that creates and shrinks the original arbitrary but only allows + values that are accepted by the filterPredicate.
      +
      default Arbitrary<T>fixGenSize(int genSize) +
      Fix the genSize of an arbitrary so that it can no longer be influenced from outside
      +
      default <U> Arbitrary<U>flatMap(java.util.function.Function<T,Arbitrary<U>> mapper) +
      Create a new arbitrary of type U that uses the values of the existing arbitrary to create a new arbitrary + using the mapper function.
      +
      default voidforEachValue(java.util.function.Consumer<? super T> action) +
      Iterate through each value this arbitrary can generate if - and only if - + exhaustive generation is possible.
      +
      RandomGenerator<T>generator(int genSize) +
      Create the random generator for an arbitrary
      +
      default Arbitrary<T>injectDuplicates(double duplicateProbability) +
      Create a new arbitrary of type Iterable<T> that will + inject duplicates of previously generated values with a probability of duplicateProbability.
      +
      default Arbitrary<T>injectNull(double nullProbability) +
      Create a new arbitrary of the same type but inject null values with a probability of nullProbability.
      +
      default booleanisUnique() +
      All arbitraries whose base generator is supposed to produce no duplicates + should return true.
      +
      default StreamableArbitrary<T,java.util.Iterator<T>>iterator() +
      Create a new arbitrary of type Iterable<T> using the existing arbitrary for generating the elements of the + stream.
      +
      default StreamableArbitrary<T,java.util.List<T>>list() +
      Create a new arbitrary of type List<T> using the existing arbitrary for generating the elements of the list.
      +
      default <U> Arbitrary<U>map(java.util.function.Function<T,U> mapper) +
      Create a new arbitrary of type U that maps the values of the original arbitrary using the mapper + function.
      +
      default Arbitrary<java.util.Optional<T>>optional() +
      Create a new arbitrary of type Optional<T> using the existing arbitrary for generating the elements of the + stream.
      +
      default Tsample() +
      Generate a single sample value using this arbitrary.
      +
      default java.util.stream.Stream<T>sampleStream() +
      Generate a stream of sample values using this arbitrary.
      +
      default StreamableArbitrary<T,java.util.Set<T>>set() +
      Create a new arbitrary of type Set<T> using the existing arbitrary for generating the elements of the set.
      +
      default StreamableArbitrary<T,java.util.stream.Stream<T>>stream() +
      Create a new arbitrary of type Stream<T> using the existing arbitrary for generating the elements of the + stream.
      +
      default Arbitrary<Tuple.Tuple1<T>>tuple1() +
      Create a new arbitrary of type Tuple.Tuple1<T> that will use the underlying + arbitrary to create the tuple value;
      +
      default Arbitrary<Tuple.Tuple2<T,T>>tuple2() +
      Create a new arbitrary of type Tuple.Tuple2<T, T> that will use the underlying + arbitrary to create the tuple values;
      +
      default Arbitrary<Tuple.Tuple3<T,T,T>>tuple3() +
      Create a new arbitrary of type Tuple.Tuple3<T, T, T> that will use the underlying + arbitrary to create the tuple values;
      +
      default Arbitrary<Tuple.Tuple4<T,T,T,T>>tuple4() +
      Create a new arbitrary of type Tuple.Tuple4<T, T, T, T> that will use the underlying + arbitrary to create the tuple values;
      +
      default Arbitrary<T>unique() +
      Create a new arbitrary of the same type T that creates and shrinks the original arbitrary but will + never generate the same value twice.
      +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        generator

        +
        RandomGenerator<T> generator(int genSize)
        +
        Create the random generator for an arbitrary
        +
        +
        Parameters:
        +
        genSize - a very unspecific configuration parameter that can be used + to influence the configuration and behaviour of a random generator + if and only if the generator wants to be influenced. + Many generators are independent of genSize. +

        + The default value of genSize is the number of tries configured + for a property. Use fixGenSize(int) to fix + the parameter for a given arbitrary.

        +
        Returns:
        +
        a new random generator instance
        +
        +
      • +
      + + + +
        +
      • +

        asGeneric

        +
        @API(status=INTERNAL)
        +default Arbitrary<java.lang.Object> asGeneric()
        +
        Sometimes simplifies test writing
        +
      • +
      + + + +
        +
      • +

        isUnique

        +
        @API(status=INTERNAL)
        +default boolean isUnique()
        +
        All arbitraries whose base generator is supposed to produce no duplicates + should return true.
        +
        +
        Returns:
        +
        true if base genator is supposed to produce no duplicates
        +
        +
      • +
      + + + +
        +
      • +

        exhaustive

        +
        @API(status=INTERNAL)
        +default java.util.Optional<ExhaustiveGenerator<T>> exhaustive()
        +
        Create the exhaustive generator for an arbitrary using the maximum allowed + number of generated samples. Just trying to find out if such a generator + exists might take a long time. This method should never be overridden.
        +
        +
        Returns:
        +
        a new exhaustive generator or Optional.empty() if it cannot be created.
        +
        +
      • +
      + + + +
        +
      • +

        exhaustive

        +
        @API(status=INTERNAL)
        +default java.util.Optional<ExhaustiveGenerator<T>> exhaustive(long maxNumberOfSamples)
        +
        Create the exhaustive generator for an arbitrary. Depending on + maxNumberOfSamples this can take a long time. + This method must be overridden in all arbitraries that support exhaustive + generation.
        +
        +
        Parameters:
        +
        maxNumberOfSamples - The maximum number of samples considered. + If during generation it becomes clear that this + number will be exceeded generation stops.
        +
        Returns:
        +
        a new exhaustive generator or Optional.empty() if it cannot be created.
        +
        +
      • +
      + + + +
        +
      • +

        edgeCases

        +
        @API(status=EXPERIMENTAL,
        +     since="1.3.0")
        +EdgeCases<T> edgeCases()
        +
      • +
      + + + +
        +
      • +

        allValues

        +
        default java.util.Optional<java.util.stream.Stream<T>> allValues()
        +
        Create optional stream of all possible values this arbitrary could generate. + This is only possible if the arbitrary is available for exhaustive generation.
        +
        +
        Returns:
        +
        optional stream of all possible values
        +
        +
      • +
      + + + +
        +
      • +

        forEachValue

        +
        @API(status=MAINTAINED,
        +     since="1.1.2")
        +default void forEachValue(java.util.function.Consumer<? super T> action)
        +
        Iterate through each value this arbitrary can generate if - and only if - + exhaustive generation is possible. This method can be used for example + to make assertions about a set of values described by an arbitrary.
        +
        +
        Parameters:
        +
        action - the consumer function to be invoked for each value
        +
        Throws:
        +
        java.lang.AssertionError - if exhaustive generation is not possible
        +
        +
      • +
      + + + +
        +
      • +

        filter

        +
        default Arbitrary<T> filter(java.util.function.Predicate<T> filterPredicate)
        +
        Create a new arbitrary of the same type T that creates and shrinks the original arbitrary but only allows + values that are accepted by the filterPredicate.
        +
        +
        Returns:
        +
        a new arbitrary instance
        +
        Throws:
        +
        JqwikException - if filtering will fail to come up with a value after 10000 tries
        +
        +
      • +
      + + + +
        +
      • +

        map

        +
        default <U> Arbitrary<U> map(java.util.function.Function<T,U> mapper)
        +
        Create a new arbitrary of type U that maps the values of the original arbitrary using the mapper + function.
        +
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        flatMap

        +
        default <U> Arbitrary<U> flatMap(java.util.function.Function<T,Arbitrary<U>> mapper)
        +
        Create a new arbitrary of type U that uses the values of the existing arbitrary to create a new arbitrary + using the mapper function.
        +
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        injectNull

        +
        default Arbitrary<T> injectNull(double nullProbability)
        +
        Create a new arbitrary of the same type but inject null values with a probability of nullProbability.
        +
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        unique

        +
        default Arbitrary<T> unique()
        +
        Create a new arbitrary of the same type T that creates and shrinks the original arbitrary but will + never generate the same value twice.
        +
        +
        Returns:
        +
        a new arbitrary instance
        +
        Throws:
        +
        JqwikException - if filtering will fail to come up with a value after 10000 tries
        +
        +
      • +
      + + + +
        +
      • +

        fixGenSize

        +
        @API(status=MAINTAINED,
        +     since="1.2.0")
        +default Arbitrary<T> fixGenSize(int genSize)
        +
        Fix the genSize of an arbitrary so that it can no longer be influenced from outside
        +
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        list

        +
        default StreamableArbitrary<T,java.util.List<T>> list()
        +
        Create a new arbitrary of type List<T> using the existing arbitrary for generating the elements of the list.
        +
      • +
      + + + +
        +
      • +

        set

        +
        default StreamableArbitrary<T,java.util.Set<T>> set()
        +
        Create a new arbitrary of type Set<T> using the existing arbitrary for generating the elements of the set.
        +
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        stream

        +
        default StreamableArbitrary<T,java.util.stream.Stream<T>> stream()
        +
        Create a new arbitrary of type Stream<T> using the existing arbitrary for generating the elements of the + stream.
        +
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        iterator

        +
        default StreamableArbitrary<T,java.util.Iterator<T>> iterator()
        +
        Create a new arbitrary of type Iterable<T> using the existing arbitrary for generating the elements of the + stream.
        +
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        array

        +
        default <A> StreamableArbitrary<T,A> array(java.lang.Class<A> arrayClass)
        +
        Create a new arbitrary of type T[] using the existing arbitrary for generating the elements of the array.
        +
        +
        Parameters:
        +
        arrayClass - The arrays class to create, e.g. String[].class. This is required due to limitations in Java's + reflection capabilities.
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        optional

        +
        default Arbitrary<java.util.Optional<T>> optional()
        +
        Create a new arbitrary of type Optional<T> using the existing arbitrary for generating the elements of the + stream. + +

        + The new arbitrary also generates Optional.empty() values with a probability of 0.05 (i.e. 1 in 20). +

        +
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        collect

        +
        @API(status=MAINTAINED,
        +     since="1.3.0")
        +default Arbitrary<java.util.List<T>> collect(java.util.function.Predicate<java.util.List<T>> until)
        +
        Create a new arbitrary of type List<T> by adding elements of type T until condition until is fulfilled.
        +
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        sampleStream

        +
        @API(status=MAINTAINED,
        +     since="1.3.0")
        +default java.util.stream.Stream<T> sampleStream()
        +
        Generate a stream of sample values using this arbitrary. + This can be useful for +
          +
        • Testing arbitraries
        • +
        • Playing around with arbitraries in jshell
        • +
        • Using arbitraries independently from jqwik, e.g. to feed test data builders
        • +
        + +

        + The underlying generator is created with size 1000. + Outside a property a new instance of Random will be created + to feed the generator. +

        + +

        + Using this method within a property does not break reproducibility of results, + i.e. rerunning it with same seed will also generate the same values. +

        +
        +
        Returns:
        +
        a stream of newly generated values
        +
        +
      • +
      + + + +
        +
      • +

        sample

        +
        @API(status=MAINTAINED,
        +     since="1.3.0")
        +default T sample()
        +
        Generate a single sample value using this arbitrary. + This can be useful for +
          +
        • Testing arbitraries
        • +
        • Playing around with arbitraries in jshell
        • +
        • Using arbitraries independently from jqwik, e.g. to feed test data builders
        • +
        +

        + Some additional things to be aware of: +

          +
        • + If you feel the need to use this method for real generation, e.g. in a provider method + you are most probably doing it wrong. You might want to use flatMap(Function). +
        • +
        • + The underlying generator is created with size 1000. + Outside a property a new instance of Random will be created + to feed the generator.
        • +
        • + Using this method within a property does not break reproducibility of results, + i.e. rerunning it with same seed will also generate the same value. +
        • +
        +
        +
        Returns:
        +
        a newly generated value
        +
        +
      • +
      + + + +
        +
      • +

        injectDuplicates

        +
        @API(status=MAINTAINED,
        +     since="1.3.0")
        +default Arbitrary<T> injectDuplicates(double duplicateProbability)
        +
        Create a new arbitrary of type Iterable<T> that will + inject duplicates of previously generated values with a probability of duplicateProbability. + +

        + Shrinking behavior for duplicate values + -- if duplication is required for falsification -- is poor, + i.e. those duplicate values cannot be shrunk to "smaller" duplicate values. +

        +
        +
        Parameters:
        +
        duplicateProbability - The probability with which a previous value will be generated
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        tuple1

        +
        @API(status=MAINTAINED,
        +     since="1.3.0")
        +default Arbitrary<Tuple.Tuple1<T>> tuple1()
        +
        Create a new arbitrary of type Tuple.Tuple1<T> that will use the underlying + arbitrary to create the tuple value;
        +
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        tuple2

        +
        @API(status=MAINTAINED,
        +     since="1.3.0")
        +default Arbitrary<Tuple.Tuple2<T,T>> tuple2()
        +
        Create a new arbitrary of type Tuple.Tuple2<T, T> that will use the underlying + arbitrary to create the tuple values;
        +
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        tuple3

        +
        @API(status=MAINTAINED,
        +     since="1.3.0")
        +default Arbitrary<Tuple.Tuple3<T,T,T>> tuple3()
        +
        Create a new arbitrary of type Tuple.Tuple3<T, T, T> that will use the underlying + arbitrary to create the tuple values;
        +
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        tuple4

        +
        @API(status=MAINTAINED,
        +     since="1.3.0")
        +default Arbitrary<Tuple.Tuple4<T,T,T,T>> tuple4()
        +
        Create a new arbitrary of type Tuple.Tuple4<T, T, T, T> that will use the underlying + arbitrary to create the tuple values;
        +
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Assume.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Assume.html new file mode 100644 index 000000000..1dab38be7 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Assume.html @@ -0,0 +1,273 @@ + + + + + +Assume (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Class Assume

+
+
+ +
+
    +
  • +
    +
    +
    @API(status=STABLE,
    +     since="1.0")
    +public class Assume
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static voidthat(boolean condition) +
      If condition does not hold, the current property method will be aborted, + i.e., it will not be executed but not counted as a try.
      +
      static voidthat(java.util.function.Supplier<java.lang.Boolean> conditionSupplier) +
      If condition provided by conditionSupplier does not hold, the current property method will be aborted, + i.e., it will not be executed but not counted as a try.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        that

        +
        public static void that(boolean condition)
        +
        If condition does not hold, the current property method will be aborted, + i.e., it will not be executed but not counted as a try. + +

        + Assumptions are typically positioned at the beginning of a property method.

        +
        +
        Parameters:
        +
        condition - Condition to make the assumption true
        +
        +
      • +
      + + + +
        +
      • +

        that

        +
        public static void that(java.util.function.Supplier<java.lang.Boolean> conditionSupplier)
        +
        If condition provided by conditionSupplier does not hold, the current property method will be aborted, + i.e., it will not be executed but not counted as a try. + +

        + Assumptions are typically positioned at the beginning of a property method.

        +
        +
        Parameters:
        +
        conditionSupplier - supplier for condition to make assumption true
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/CannotFindArbitraryException.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/CannotFindArbitraryException.html new file mode 100644 index 000000000..96247c3a7 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/CannotFindArbitraryException.html @@ -0,0 +1,285 @@ + + + + + +CannotFindArbitraryException (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Class CannotFindArbitraryException

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable
    +
    +
    +
    +
    @API(status=MAINTAINED,
    +     since="1.0")
    +public class CannotFindArbitraryException
    +extends JqwikException
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Throwable

        +addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CannotFindArbitraryException

        +
        public CannotFindArbitraryException(TypeUsage typeUsage)
        +
      • +
      + + + +
        +
      • +

        CannotFindArbitraryException

        +
        public CannotFindArbitraryException(TypeUsage typeUsage,
        +                                    ForAll forAll)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.BuilderCombinator.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.BuilderCombinator.html new file mode 100644 index 000000000..2a4ff0ce5 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.BuilderCombinator.html @@ -0,0 +1,253 @@ + + + + + +Combinators.BuilderCombinator (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Class Combinators.BuilderCombinator<B>

+
+
+ +
+
    +
  • +
    +
    Enclosing class:
    +
    Combinators
    +
    +
    +
    +
    @API(status=MAINTAINED,
    +     since="1.2.0")
    +public static class Combinators.BuilderCombinator<B>
    +extends java.lang.Object
    +
  • +
+
+
+ +
+
+ +
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.CombinableBuilder.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.CombinableBuilder.html new file mode 100644 index 000000000..30ce1a8c3 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.CombinableBuilder.html @@ -0,0 +1,240 @@ + + + + + +Combinators.CombinableBuilder (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Class Combinators.CombinableBuilder<B,T>

+
+
+ +
+
    +
  • +
    +
    Enclosing class:
    +
    Combinators
    +
    +
    +
    +
    @API(status=MAINTAINED,
    +     since="1.2.0")
    +public static class Combinators.CombinableBuilder<B,T>
    +extends java.lang.Object
    +
  • +
+
+
+ +
+
+ +
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.Combinator2.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.Combinator2.html new file mode 100644 index 000000000..ad4874db4 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.Combinator2.html @@ -0,0 +1,251 @@ + + + + + +Combinators.Combinator2 (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Class Combinators.Combinator2<T1,T2>

+
+
+ +
+
    +
  • +
    +
    Enclosing class:
    +
    Combinators
    +
    +
    +
    +
    public static class Combinators.Combinator2<T1,T2>
    +extends java.lang.Object
    +
  • +
+
+
+ +
+
+ +
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.Combinator3.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.Combinator3.html new file mode 100644 index 000000000..33ad82cf0 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.Combinator3.html @@ -0,0 +1,251 @@ + + + + + +Combinators.Combinator3 (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Class Combinators.Combinator3<T1,T2,T3>

+
+
+ +
+
    +
  • +
    +
    Enclosing class:
    +
    Combinators
    +
    +
    +
    +
    public static class Combinators.Combinator3<T1,T2,T3>
    +extends java.lang.Object
    +
  • +
+
+
+ +
+
+ +
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.Combinator4.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.Combinator4.html new file mode 100644 index 000000000..1efae1b7a --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.Combinator4.html @@ -0,0 +1,251 @@ + + + + + +Combinators.Combinator4 (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Class Combinators.Combinator4<T1,T2,T3,T4>

+
+
+ +
+
    +
  • +
    +
    Enclosing class:
    +
    Combinators
    +
    +
    +
    +
    public static class Combinators.Combinator4<T1,T2,T3,T4>
    +extends java.lang.Object
    +
  • +
+
+
+ +
+
+ +
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.Combinator5.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.Combinator5.html new file mode 100644 index 000000000..e799833e6 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.Combinator5.html @@ -0,0 +1,251 @@ + + + + + +Combinators.Combinator5 (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Class Combinators.Combinator5<T1,T2,T3,T4,T5>

+
+
+ +
+
    +
  • +
    +
    Enclosing class:
    +
    Combinators
    +
    +
    +
    +
    public static class Combinators.Combinator5<T1,T2,T3,T4,T5>
    +extends java.lang.Object
    +
  • +
+
+
+ +
+
+ +
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.Combinator6.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.Combinator6.html new file mode 100644 index 000000000..14564d493 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.Combinator6.html @@ -0,0 +1,251 @@ + + + + + +Combinators.Combinator6 (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Class Combinators.Combinator6<T1,T2,T3,T4,T5,T6>

+
+
+ +
+
    +
  • +
    +
    Enclosing class:
    +
    Combinators
    +
    +
    +
    +
    public static class Combinators.Combinator6<T1,T2,T3,T4,T5,T6>
    +extends java.lang.Object
    +
  • +
+
+
+ +
+
+ +
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.Combinator7.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.Combinator7.html new file mode 100644 index 000000000..a39f287a2 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.Combinator7.html @@ -0,0 +1,251 @@ + + + + + +Combinators.Combinator7 (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Class Combinators.Combinator7<T1,T2,T3,T4,T5,T6,T7>

+
+
+ +
+
    +
  • +
    +
    Enclosing class:
    +
    Combinators
    +
    +
    +
    +
    public static class Combinators.Combinator7<T1,T2,T3,T4,T5,T6,T7>
    +extends java.lang.Object
    +
  • +
+
+
+ +
+
+ +
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.Combinator8.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.Combinator8.html new file mode 100644 index 000000000..df312da05 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.Combinator8.html @@ -0,0 +1,251 @@ + + + + + +Combinators.Combinator8 (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Class Combinators.Combinator8<T1,T2,T3,T4,T5,T6,T7,T8>

+
+
+ +
+
    +
  • +
    +
    Enclosing class:
    +
    Combinators
    +
    +
    +
    +
    public static class Combinators.Combinator8<T1,T2,T3,T4,T5,T6,T7,T8>
    +extends java.lang.Object
    +
  • +
+
+
+ +
+
+ +
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.CombinatorsFacade.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.CombinatorsFacade.html new file mode 100644 index 000000000..52a87b04e --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.CombinatorsFacade.html @@ -0,0 +1,307 @@ + + + + + +Combinators.CombinatorsFacade (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Class Combinators.CombinatorsFacade

+
+
+ +
+
    +
  • +
    +
    Enclosing class:
    +
    Combinators
    +
    +
    +
    +
    @API(status=INTERNAL)
    +public abstract static class Combinators.CombinatorsFacade
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      CombinatorsFacade() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethod and Description
      abstract <R> EdgeCases<R>combineEdgeCases(java.util.List<Arbitrary<java.lang.Object>> arbitraries, + java.util.function.Function<java.util.List<java.lang.Object>,R> combineFunction) 
      abstract <R> java.util.Optional<ExhaustiveGenerator<R>>combineExhaustive(java.util.List<Arbitrary<java.lang.Object>> arbitraries, + java.util.function.Function<java.util.List<java.lang.Object>,R> combineFunction, + long maxNumberOfSamples) 
      abstract <R> Shrinkable<R>combineShrinkables(java.util.List<Shrinkable<java.lang.Object>> shrinkables, + java.util.function.Function<java.util.List<java.lang.Object>,R> combineFunction) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CombinatorsFacade

        +
        public CombinatorsFacade()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        combineShrinkables

        +
        public abstract <R> Shrinkable<R> combineShrinkables(java.util.List<Shrinkable<java.lang.Object>> shrinkables,
        +                                                     java.util.function.Function<java.util.List<java.lang.Object>,R> combineFunction)
        +
      • +
      + + + +
        +
      • +

        combineExhaustive

        +
        public abstract <R> java.util.Optional<ExhaustiveGenerator<R>> combineExhaustive(java.util.List<Arbitrary<java.lang.Object>> arbitraries,
        +                                                                                 java.util.function.Function<java.util.List<java.lang.Object>,R> combineFunction,
        +                                                                                 long maxNumberOfSamples)
        +
      • +
      + + + +
        +
      • +

        combineEdgeCases

        +
        public abstract <R> EdgeCases<R> combineEdgeCases(java.util.List<Arbitrary<java.lang.Object>> arbitraries,
        +                                                  java.util.function.Function<java.util.List<java.lang.Object>,R> combineFunction)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.F2.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.F2.html new file mode 100644 index 000000000..5b1b78ed5 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.F2.html @@ -0,0 +1,232 @@ + + + + + +Combinators.F2 (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Interface Combinators.F2<T1,T2,R>

+
+
+
+
    +
  • +
    +
    Enclosing class:
    +
    Combinators
    +
    +
    +
    Functional Interface:
    +
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
    +
    +
    +
    +
    @FunctionalInterface
    + @API(status=INTERNAL)
    +public static interface Combinators.F2<T1,T2,R>
    +
  • +
+
+
+ +
+
+
    +
  • + + +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.F3.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.F3.html new file mode 100644 index 000000000..43f9bee35 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.F3.html @@ -0,0 +1,234 @@ + + + + + +Combinators.F3 (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Interface Combinators.F3<T1,T2,T3,R>

+
+
+
+
    +
  • +
    +
    Enclosing class:
    +
    Combinators
    +
    +
    +
    Functional Interface:
    +
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
    +
    +
    +
    +
    @FunctionalInterface
    + @API(status=INTERNAL)
    +public static interface Combinators.F3<T1,T2,T3,R>
    +
  • +
+
+
+ +
+
+
    +
  • + + +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.F4.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.F4.html new file mode 100644 index 000000000..b1325d77c --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.F4.html @@ -0,0 +1,236 @@ + + + + + +Combinators.F4 (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Interface Combinators.F4<T1,T2,T3,T4,R>

+
+
+
+
    +
  • +
    +
    Enclosing class:
    +
    Combinators
    +
    +
    +
    Functional Interface:
    +
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
    +
    +
    +
    +
    @FunctionalInterface
    + @API(status=INTERNAL)
    +public static interface Combinators.F4<T1,T2,T3,T4,R>
    +
  • +
+
+
+ +
+
+
    +
  • + + +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.F5.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.F5.html new file mode 100644 index 000000000..1fbc42a2a --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.F5.html @@ -0,0 +1,238 @@ + + + + + +Combinators.F5 (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Interface Combinators.F5<T1,T2,T3,T4,T5,R>

+
+
+
+
    +
  • +
    +
    Enclosing class:
    +
    Combinators
    +
    +
    +
    Functional Interface:
    +
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
    +
    +
    +
    +
    @FunctionalInterface
    + @API(status=INTERNAL)
    +public static interface Combinators.F5<T1,T2,T3,T4,T5,R>
    +
  • +
+
+
+ +
+
+
    +
  • + + +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.F6.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.F6.html new file mode 100644 index 000000000..21796c17d --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.F6.html @@ -0,0 +1,240 @@ + + + + + +Combinators.F6 (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Interface Combinators.F6<T1,T2,T3,T4,T5,T6,R>

+
+
+
+
    +
  • +
    +
    Enclosing class:
    +
    Combinators
    +
    +
    +
    Functional Interface:
    +
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
    +
    +
    +
    +
    @FunctionalInterface
    + @API(status=INTERNAL)
    +public static interface Combinators.F6<T1,T2,T3,T4,T5,T6,R>
    +
  • +
+
+
+ +
+
+
    +
  • + + +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.F7.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.F7.html new file mode 100644 index 000000000..b02235d56 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.F7.html @@ -0,0 +1,242 @@ + + + + + +Combinators.F7 (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Interface Combinators.F7<T1,T2,T3,T4,T5,T6,T7,R>

+
+
+
+
    +
  • +
    +
    Enclosing class:
    +
    Combinators
    +
    +
    +
    Functional Interface:
    +
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
    +
    +
    +
    +
    @FunctionalInterface
    + @API(status=INTERNAL)
    +public static interface Combinators.F7<T1,T2,T3,T4,T5,T6,T7,R>
    +
  • +
+
+
+ +
+
+
    +
  • + + +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.F8.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.F8.html new file mode 100644 index 000000000..88732d728 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.F8.html @@ -0,0 +1,244 @@ + + + + + +Combinators.F8 (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Interface Combinators.F8<T1,T2,T3,T4,T5,T6,T7,T8,R>

+
+
+
+
    +
  • +
    +
    Enclosing class:
    +
    Combinators
    +
    +
    +
    Functional Interface:
    +
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
    +
    +
    +
    +
    @FunctionalInterface
    + @API(status=INTERNAL)
    +public static interface Combinators.F8<T1,T2,T3,T4,T5,T6,T7,T8,R>
    +
  • +
+
+
+ +
+
+
    +
  • + + +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.ListCombinator.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.ListCombinator.html new file mode 100644 index 000000000..7fda254b5 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.ListCombinator.html @@ -0,0 +1,251 @@ + + + + + +Combinators.ListCombinator (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Class Combinators.ListCombinator<T>

+
+
+ +
+
    +
  • +
    +
    Enclosing class:
    +
    Combinators
    +
    +
    +
    +
    public static class Combinators.ListCombinator<T>
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      <R> Arbitrary<R>as(java.util.function.Function<java.util.List<T>,R> combinator) 
      <R> Arbitrary<R>flatAs(java.util.function.Function<java.util.List<T>,Arbitrary<R>> flatCombinator) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        as

        +
        public <R> Arbitrary<R> as(java.util.function.Function<java.util.List<T>,R> combinator)
        +
      • +
      + + + +
        +
      • +

        flatAs

        +
        public <R> Arbitrary<R> flatAs(java.util.function.Function<java.util.List<T>,Arbitrary<R>> flatCombinator)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.html new file mode 100644 index 000000000..a1b1779b4 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Combinators.html @@ -0,0 +1,577 @@ + + + + + +Combinators (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Class Combinators

+
+
+ +
+
    +
  • +
    +
    +
    @API(status=MAINTAINED,
    +     since="1.0")
    +public class Combinators
    +extends java.lang.Object
    +
  • +
+
+
+ +
+
+ +
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Data.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Data.html new file mode 100644 index 000000000..34621c2be --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Data.html @@ -0,0 +1,221 @@ + + + + + +Data (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Annotation Type Data

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,METHOD})
    + @Retention(value=RUNTIME)
    + @Documented
    + @API(status=MAINTAINED,
    +     since="1.0")
    +public @interface Data
    +
    Used to annotate methods that can provide data points for property methods. + Those methods must return an instance of Iterable. + + value is used as reference name. If it is not specified, the method's name is used instead.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Optional Element Summary

      + + + + + + + + + + +
      Optional Elements 
      Modifier and TypeOptional Element and Description
      java.lang.Stringvalue 
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Element Detail

      + + + +
        +
      • +

        value

        +
        public abstract java.lang.String value
        +
        +
        Default:
        +
        ""
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Disabled.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Disabled.html new file mode 100644 index 000000000..2e4604a34 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Disabled.html @@ -0,0 +1,226 @@ + + + + + +Disabled (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Annotation Type Disabled

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,TYPE,METHOD})
    + @Retention(value=RUNTIME)
    + @Documented
    + @API(status=MAINTAINED,
    +     since="1.0")
    +public @interface Disabled
    +
    Use @Disabled("reason to disable") to disable test container or test method + during normal test execution.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Optional Element Summary

      + + + + + + + + + + +
      Optional Elements 
      Modifier and TypeOptional Element and Description
      java.lang.Stringvalue +
      The reason this annotated test container or test method is disabled.
      +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Element Detail

      + + + +
        +
      • +

        value

        +
        public abstract java.lang.String value
        +
        The reason this annotated test container or test method is disabled.
        +
        +
        Returns:
        +
        reason for disabling test or test container
        +
        +
        +
        Default:
        +
        ""
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/EdgeCases.EdgeCasesFacade.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/EdgeCases.EdgeCasesFacade.html new file mode 100644 index 000000000..fba444bd6 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/EdgeCases.EdgeCasesFacade.html @@ -0,0 +1,331 @@ + + + + + +EdgeCases.EdgeCasesFacade (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Class EdgeCases.EdgeCasesFacade

+
+
+ +
+
    +
  • +
    +
    Enclosing interface:
    +
    EdgeCases<T>
    +
    +
    +
    +
    @API(status=INTERNAL)
    +public abstract static class EdgeCases.EdgeCasesFacade
    +extends java.lang.Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        EdgeCasesFacade

        +
        public EdgeCasesFacade()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        fromSuppliers

        +
        public abstract <T> EdgeCases<T> fromSuppliers(java.util.List<java.util.function.Supplier<Shrinkable<T>>> suppliers)
        +
      • +
      + + + +
        +
      • +

        concat

        +
        public abstract <T> EdgeCases<T> concat(java.util.List<EdgeCases<T>> edgeCases)
        +
      • +
      + + + + + + + +
        +
      • +

        flatMapArbitrary

        +
        public abstract <T,U> EdgeCases<U> flatMapArbitrary(EdgeCases<T> self,
        +                                                    java.util.function.Function<T,Arbitrary<U>> mapper)
        +
      • +
      + + + +
        +
      • +

        filter

        +
        public abstract <T> EdgeCases<T> filter(EdgeCases<T> self,
        +                                        java.util.function.Predicate<T> filterPredicate)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/EdgeCases.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/EdgeCases.html new file mode 100644 index 000000000..97d0a1c1c --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/EdgeCases.html @@ -0,0 +1,435 @@ + + + + + +EdgeCases (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Interface EdgeCases<T>

+
+
+
+
    +
  • +
    +
    All Superinterfaces:
    +
    java.lang.Iterable<Shrinkable<T>>
    +
    +
    +
    +
    @API(status=EXPERIMENTAL,
    +     since="1.3.0")
    +public interface EdgeCases<T>
    +extends java.lang.Iterable<Shrinkable<T>>
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        suppliers

        +
        java.util.List<java.util.function.Supplier<Shrinkable<T>>> suppliers()
        +
      • +
      + + + +
        +
      • +

        size

        +
        default int size()
        +
      • +
      + + + +
        +
      • +

        isEmpty

        +
        default boolean isEmpty()
        +
      • +
      + + + +
        +
      • +

        iterator

        +
        default java.util.Iterator<Shrinkable<T>> iterator()
        +
        +
        Specified by:
        +
        iterator in interface java.lang.Iterable<Shrinkable<T>>
        +
        +
      • +
      + + + +
        +
      • +

        fromSuppliers

        +
        @API(status=INTERNAL)
        +static <T> EdgeCases<T> fromSuppliers(java.util.List<java.util.function.Supplier<Shrinkable<T>>> suppliers)
        +
      • +
      + + + +
        +
      • +

        none

        +
        @API(status=INTERNAL)
        +static <T> EdgeCases<T> none()
        +
      • +
      + + + +
        +
      • +

        fromSupplier

        +
        @API(status=INTERNAL)
        +static <T> EdgeCases<T> fromSupplier(java.util.function.Supplier<Shrinkable<T>> supplier)
        +
      • +
      + + + +
        +
      • +

        concat

        +
        @SafeVarargs
        + @API(status=INTERNAL)
        +static <T> EdgeCases<T> concat(EdgeCases<T>... rest)
        +
      • +
      + + + +
        +
      • +

        concat

        +
        @API(status=INTERNAL)
        +static <T> EdgeCases<T> concat(java.util.List<EdgeCases<T>> edgeCases)
        +
      • +
      + + + +
        +
      • +

        fromShrinkables

        +
        @API(status=INTERNAL)
        +static <T> EdgeCases<T> fromShrinkables(java.util.List<Shrinkable<T>> shrinkables)
        +
      • +
      + + + +
        +
      • +

        map

        +
        @API(status=INTERNAL)
        +default <U> EdgeCases<U> map(java.util.function.Function<T,U> mapper)
        +
      • +
      + + + +
        +
      • +

        mapShrinkable

        +
        @API(status=INTERNAL)
        +default <U> EdgeCases<U> mapShrinkable(java.util.function.Function<Shrinkable<T>,Shrinkable<U>> mapper)
        +
      • +
      + + + +
        +
      • +

        filter

        +
        @API(status=INTERNAL)
        +default EdgeCases<T> filter(java.util.function.Predicate<T> filterPredicate)
        +
      • +
      + + + +
        +
      • +

        flatMapArbitrary

        +
        @API(status=INTERNAL)
        +default <U> EdgeCases<U> flatMapArbitrary(java.util.function.Function<T,Arbitrary<U>> mapper)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/EdgeCasesMode.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/EdgeCasesMode.html new file mode 100644 index 000000000..1d2d80e42 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/EdgeCasesMode.html @@ -0,0 +1,425 @@ + + + + + +EdgeCasesMode (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Enum EdgeCasesMode

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, java.lang.Comparable<EdgeCasesMode>
    +
    +
    +
    +
    @API(status=EXPERIMENTAL,
    +     since="1.3.0")
    +public enum EdgeCasesMode
    +extends java.lang.Enum<EdgeCasesMode>
    +
    The edge-cases mode determines if and when combined edge-cases of all parameters will be explicitly generated. + It can be set in Property.edgeCases() for any property method. + +

    + If it is not set explicitly mode MIXIN will be used unless the property has + only a single parameter. Then NONE applies.

    +
    +
    See Also:
    +
    Property
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Enum Constant Summary

      + + + + + + + + + + + + + + + + + +
      Enum Constants 
      Enum Constant and Description
      FIRST +
      Generate edge cases first.
      +
      MIXIN +
      Mix edge cases into random generation.
      +
      NONE +
      Do not _explicitly_ generate edge cases.
      +
      NOT_SET 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      booleanactivated() 
      booleangenerateFirst() 
      booleanmixIn() 
      static EdgeCasesModevalueOf(java.lang.String name) +
      Returns the enum constant of this type with the specified name.
      +
      static EdgeCasesMode[]values() +
      Returns an array containing the constants of this enum type, in +the order they are declared.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Enum

        +clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +getClass, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Enum Constant Detail

      + + + +
        +
      • +

        FIRST

        +
        public static final EdgeCasesMode FIRST
        +
        Generate edge cases first.
        +
      • +
      + + + +
        +
      • +

        MIXIN

        +
        public static final EdgeCasesMode MIXIN
        +
        Mix edge cases into random generation.
        +
      • +
      + + + +
        +
      • +

        NONE

        +
        public static final EdgeCasesMode NONE
        +
        Do not _explicitly_ generate edge cases. They might be generated randomly though.
        +
      • +
      + + + + +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static EdgeCasesMode[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (EdgeCasesMode c : EdgeCasesMode.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static EdgeCasesMode valueOf(java.lang.String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        +
        java.lang.NullPointerException - if the argument is null
        +
        +
      • +
      + + + +
        +
      • +

        generateFirst

        +
        @API(status=INTERNAL)
        +public boolean generateFirst()
        +
      • +
      + + + +
        +
      • +

        mixIn

        +
        @API(status=INTERNAL)
        +public boolean mixIn()
        +
      • +
      + + + +
        +
      • +

        activated

        +
        @API(status=INTERNAL)
        +public boolean activated()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Example.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Example.html new file mode 100644 index 000000000..abd221f3d --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Example.html @@ -0,0 +1,179 @@ + + + + + +Example (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Annotation Type Example

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,METHOD})
    + @Retention(value=RUNTIME)
    + @Documented
    + @Property(tries=1,
    +          shrinking=OFF,
    +          stereotype="Example")
    + @API(status=STABLE,
    +     since="1.0")
    +public @interface Example
    +
    Use @Example to mark methods that are simple, example-based + test cases. Those methods usually don't have any ForAll parameters. + They are executed only once. + + Just like methods annotated with Property example, annotated methods + must not be private. They can either return Boolean, boolean + or void.
    +
    +
    See Also:
    +
    Property
    +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/ExhaustiveGenerator.ExhaustiveGeneratorFacade.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/ExhaustiveGenerator.ExhaustiveGeneratorFacade.html new file mode 100644 index 000000000..95310c85a --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/ExhaustiveGenerator.ExhaustiveGeneratorFacade.html @@ -0,0 +1,316 @@ + + + + + +ExhaustiveGenerator.ExhaustiveGeneratorFacade (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Class ExhaustiveGenerator.ExhaustiveGeneratorFacade

+
+
+ +
+
    +
  • +
    +
    Enclosing interface:
    +
    ExhaustiveGenerator<T>
    +
    +
    +
    +
    @API(status=INTERNAL)
    +public abstract static class ExhaustiveGenerator.ExhaustiveGeneratorFacade
    +extends java.lang.Object
    +
  • +
+
+
+ +
+
+ +
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/ExhaustiveGenerator.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/ExhaustiveGenerator.html new file mode 100644 index 000000000..db3a9fe25 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/ExhaustiveGenerator.html @@ -0,0 +1,347 @@ + + + + + +ExhaustiveGenerator (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Interface ExhaustiveGenerator<T>

+
+
+
+
    +
  • +
    +
    All Superinterfaces:
    +
    java.lang.Iterable<T>
    +
    +
    +
    +
    @API(status=INTERNAL)
    +public interface ExhaustiveGenerator<T>
    +extends java.lang.Iterable<T>
    +
    Used only internally to run and compute exhaustive generation of parameters
    +
  • +
+
+
+ +
+
+ +
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/FacadeLoader.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/FacadeLoader.html new file mode 100644 index 000000000..2d4221509 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/FacadeLoader.html @@ -0,0 +1,283 @@ + + + + + +FacadeLoader (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Class FacadeLoader

+
+
+ +
+
    +
  • +
    +
    +
    @API(status=INTERNAL)
    +public class FacadeLoader
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      FacadeLoader() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static <T> Tload(java.lang.Class<T> facadeClass) +
      Load single implementation of an API facade.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        FacadeLoader

        +
        public FacadeLoader()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        load

        +
        public static <T> T load(java.lang.Class<T> facadeClass)
        +
        Load single implementation of an API facade. This should be registered as + service provider in the jqwik engine module. There must be exactly + one facade registered otherwise null will be returned and a severe error + is logged.
        +
        +
        Type Parameters:
        +
        T - the facade type
        +
        Parameters:
        +
        facadeClass - The facade type to load
        +
        Returns:
        +
        instance of facade
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/FalsificationResult.Status.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/FalsificationResult.Status.html new file mode 100644 index 000000000..356104a64 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/FalsificationResult.Status.html @@ -0,0 +1,354 @@ + + + + + +FalsificationResult.Status (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Enum FalsificationResult.Status

+
+
+ +
+ +
+
+
    +
  • + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static FalsificationResult.StatusvalueOf(java.lang.String name) +
      Returns the enum constant of this type with the specified name.
      +
      static FalsificationResult.Status[]values() +
      Returns an array containing the constants of this enum type, in +the order they are declared.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Enum

        +clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +getClass, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static FalsificationResult.Status[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (FalsificationResult.Status c : FalsificationResult.Status.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static FalsificationResult.Status valueOf(java.lang.String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        +
        java.lang.NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/FalsificationResult.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/FalsificationResult.html new file mode 100644 index 000000000..7bf94ba46 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/FalsificationResult.html @@ -0,0 +1,426 @@ + + + + + +FalsificationResult (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Class FalsificationResult<T>

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.lang.Comparable<FalsificationResult<T>>
    +
    +
    +
    +
    @API(status=MAINTAINED,
    +     since="1.0")
    +public class FalsificationResult<T>
    +extends java.lang.Object
    +implements java.lang.Comparable<FalsificationResult<T>>
    +
  • +
+
+
+ +
+
+ +
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Falsifier.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Falsifier.html new file mode 100644 index 000000000..0aa87e35f --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Falsifier.html @@ -0,0 +1,270 @@ + + + + + +Falsifier (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Interface Falsifier<T>

+
+
+
+
    +
  • +
    +
    Functional Interface:
    +
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
    +
    +
    +
    +
    @FunctionalInterface
    + @API(status=STABLE,
    +     since="1.0")
    +public interface Falsifier<T>
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + + + + + + + + + + + +
        +
      • +

        withFilter

        +
        @API(status=INTERNAL)
        +default Falsifier<T> withFilter(java.util.function.Predicate<T> filter)
        +
      • +
      + + + +
        +
      • +

        withPostFilter

        +
        @API(status=INTERNAL)
        +default Falsifier<T> withPostFilter(java.util.function.Predicate<T> filter)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/ForAll.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/ForAll.html new file mode 100644 index 000000000..bb393f6b7 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/ForAll.html @@ -0,0 +1,266 @@ + + + + + +ForAll (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Annotation Type ForAll

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,PARAMETER})
    + @Retention(value=RUNTIME)
    + @Documented
    + @API(status=STABLE,
    +     since="1.0")
    +public @interface ForAll
    +
    Used to annotate method parameters that will be provided by jqwik. + + Only works on methods annotated with @Property + + value is used as reference name to a method annotated with @Provide. + If it is not specified, only default providers are considered.
    +
    +
    See Also:
    +
    Property, +Provide
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      + + + + + + + + + + +
      Fields 
      Modifier and TypeFields and Description
      static java.lang.StringNO_VALUE 
      +
    • +
    + +
      +
    • + + +

      Optional Element Summary

      + + + + + + + + + + +
      Optional Elements 
      Modifier and TypeOptional Element and Description
      java.lang.Stringvalue 
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        NO_VALUE

        +
        @API(status=INTERNAL,
        +     since="1.2.0")
        +public static final java.lang.String NO_VALUE
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Element Detail

      + + + +
        +
      • +

        value

        +
        public abstract java.lang.String value
        +
        +
        Default:
        +
        ""
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/From.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/From.html new file mode 100644 index 000000000..bd2352eee --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/From.html @@ -0,0 +1,222 @@ + + + + + +From (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Annotation Type From

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,PARAMETER,TYPE_USE})
    + @Retention(value=RUNTIME)
    + @Documented
    + @API(status=MAINTAINED,
    +     since="1.3.0")
    +public @interface From
    +
    Used to annotate type parameters within property parameters annotated with ForAll . + + value is used as reference name to a method annotated with @Provide. + If it is not specified, only default providers are considered.
    +
    +
    See Also:
    +
    ForAll, +Provide
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Required Element Summary

      + + + + + + + + + + +
      Required Elements 
      Modifier and TypeRequired Element and Description
      java.lang.Stringvalue 
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Element Detail

      + + + +
        +
      • +

        value

        +
        public abstract java.lang.String value
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/FromData.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/FromData.html new file mode 100644 index 000000000..a5bcb96ff --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/FromData.html @@ -0,0 +1,223 @@ + + + + + +FromData (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Annotation Type FromData

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,METHOD})
    + @Retention(value=RUNTIME)
    + @Documented
    + @API(status=MAINTAINED,
    +     since="1.0")
    +public @interface FromData
    +
    Used to annotate property methods. + + Only works on methods annotated with @Property + + value is used as reference name to a method annotated with @Data.
    +
    +
    See Also:
    +
    Property, +Data
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Required Element Summary

      + + + + + + + + + + +
      Required Elements 
      Modifier and TypeRequired Element and Description
      java.lang.Stringvalue 
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Element Detail

      + + + +
        +
      • +

        value

        +
        public abstract java.lang.String value
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Functions.FunctionWrapper.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Functions.FunctionWrapper.html new file mode 100644 index 000000000..d4a9127ee --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Functions.FunctionWrapper.html @@ -0,0 +1,255 @@ + + + + + +Functions.FunctionWrapper (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Class Functions.FunctionWrapper

+
+
+ +
+
    +
  • +
    +
    Enclosing class:
    +
    Functions
    +
    +
    +
    +
    public static class Functions.FunctionWrapper
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      <F,R> FunctionArbitrary<F,R>returns(Arbitrary<R> resultArbitrary) +
      Create an arbitrary to create instances of functions represented by this wrapper.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        returns

        +
        public <F,R> FunctionArbitrary<F,R> returns(Arbitrary<R> resultArbitrary)
        +
        Create an arbitrary to create instances of functions represented by this wrapper. + + The generated functions are guaranteed to return the same result + given the same input values. + + Shrinking will consider constant functions.
        +
        +
        Type Parameters:
        +
        F - The exact functional type to generate
        +
        R - The return type of the functional interface
        +
        Parameters:
        +
        resultArbitrary - The arbitrary used to generate return values
        +
        Returns:
        +
        a new arbitrary instance
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Functions.FunctionsFacade.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Functions.FunctionsFacade.html new file mode 100644 index 000000000..3f936f07d --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Functions.FunctionsFacade.html @@ -0,0 +1,288 @@ + + + + + +Functions.FunctionsFacade (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Class Functions.FunctionsFacade

+
+
+ +
+
    +
  • +
    +
    Enclosing class:
    +
    Functions
    +
    +
    +
    +
    @API(status=INTERNAL)
    +public abstract static class Functions.FunctionsFacade
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      FunctionsFacade() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethod and Description
      abstract voidensureFunctionalType(java.lang.Class<?> functionalType) 
      abstract <F,R> FunctionArbitrary<F,R>function(java.lang.Class<?> functionalType, + Arbitrary<R> resultArbitrary) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        FunctionsFacade

        +
        public FunctionsFacade()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        ensureFunctionalType

        +
        public abstract void ensureFunctionalType(java.lang.Class<?> functionalType)
        +
      • +
      + + + +
        +
      • +

        function

        +
        public abstract <F,R> FunctionArbitrary<F,R> function(java.lang.Class<?> functionalType,
        +                                                      Arbitrary<R> resultArbitrary)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Functions.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Functions.html new file mode 100644 index 000000000..90073744a --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Functions.html @@ -0,0 +1,274 @@ + + + + + +Functions (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Class Functions

+
+
+ +
+
    +
  • +
    +
    +
    @API(status=MAINTAINED,
    +     since="1.3.0")
    +public class Functions
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static Functions.FunctionWrapperfunction(java.lang.Class<?> functionalType) +
      Create a wrapper for functional types + i.e. types marked FunctionalInterface or representing a + SAM (single abstract method) type.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        function

        +
        public static Functions.FunctionWrapper function(java.lang.Class<?> functionalType)
        +
        Create a wrapper for functional types + i.e. types marked FunctionalInterface or representing a + SAM (single abstract method) type.
        +
        +
        Parameters:
        +
        functionalType - The class object of the functional type to generate
        +
        Returns:
        +
        a new function wrapper instance
        +
        Throws:
        +
        JqwikException - if functionalType is not a functional type
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/GenerationMode.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/GenerationMode.html new file mode 100644 index 000000000..f08d90e34 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/GenerationMode.html @@ -0,0 +1,416 @@ + + + + + +GenerationMode (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Enum GenerationMode

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, java.lang.Comparable<GenerationMode>
    +
    +
    +
    +
    @API(status=MAINTAINED,
    +     since="1.0")
    +public enum GenerationMode
    +extends java.lang.Enum<GenerationMode>
    +
    The generation mode defines the generation behaviour of a property. + It can be set in Property.generation() for any property method; default is AUTO.
    +
    +
    See Also:
    +
    Property, +FromData
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Enum Constant Summary

      + + + + + + + + + + + + + + + + + + + + +
      Enum Constants 
      Enum Constant and Description
      AUTO +
      Let jqwik choose which generation mode it prefers: + + If all arbitraries provide exhaustive generators and + if the multiplication of all maxCount() values is ≤ + Property.tries() use EXHAUSTIVE + + If the property has a FromData annotation + use DATA_DRIVEN + + In all other cases use RANDOMIZED +
      +
      DATA_DRIVEN +
      Use data specified in FromData annotation
      +
      EXHAUSTIVE +
      Use exhaustive generation.
      +
      NOT_SET 
      RANDOMIZED +
      Use randomized value generation.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static GenerationModevalueOf(java.lang.String name) +
      Returns the enum constant of this type with the specified name.
      +
      static GenerationMode[]values() +
      Returns an array containing the constants of this enum type, in +the order they are declared.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Enum

        +clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +getClass, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Enum Constant Detail

      + + + +
        +
      • +

        RANDOMIZED

        +
        public static final GenerationMode RANDOMIZED
        +
        Use randomized value generation.
        +
      • +
      + + + +
        +
      • +

        EXHAUSTIVE

        +
        public static final GenerationMode EXHAUSTIVE
        +
        Use exhaustive generation. Only possible if all used arbitraries can + provide exhaustive generators.
        +
      • +
      + + + +
        +
      • +

        DATA_DRIVEN

        +
        public static final GenerationMode DATA_DRIVEN
        +
        Use data specified in FromData annotation
        +
      • +
      + + + +
        +
      • +

        AUTO

        +
        public static final GenerationMode AUTO
        +
        Let jqwik choose which generation mode it prefers: +
        +
      • +
      + + + + +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static GenerationMode[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (GenerationMode c : GenerationMode.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static GenerationMode valueOf(java.lang.String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        +
        java.lang.NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Group.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Group.html new file mode 100644 index 000000000..8b6d847f4 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Group.html @@ -0,0 +1,166 @@ + + + + + +Group (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Annotation Type Group

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,TYPE})
    + @Retention(value=RUNTIME)
    + @Documented
    + @Testable
    + @API(status=STABLE,
    +     since="1.0")
    +public @interface Group
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/JqwikException.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/JqwikException.html new file mode 100644 index 000000000..a2f7de1ce --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/JqwikException.html @@ -0,0 +1,288 @@ + + + + + +JqwikException (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Class JqwikException

+
+
+ +
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      JqwikException(java.lang.String message) 
      JqwikException(java.lang.String message, + java.lang.Throwable cause) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Throwable

        +addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        JqwikException

        +
        public JqwikException(java.lang.String message)
        +
      • +
      + + + +
        +
      • +

        JqwikException

        +
        public JqwikException(java.lang.String message,
        +                      java.lang.Throwable cause)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Label.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Label.html new file mode 100644 index 000000000..22b70c9c8 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Label.html @@ -0,0 +1,221 @@ + + + + + +Label (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Annotation Type Label

+
+
+
+
    +
  • +
    +
    +
    @Target(value={METHOD,TYPE,ANNOTATION_TYPE})
    + @Retention(value=RUNTIME)
    + @Documented
    + @Testable
    + @API(status=STABLE,
    +     since="1.0")
    +public @interface Label
    +
    Use @Label("a descriptive name") to give test classes, groups and methods + a more readable label (aka display name).
    +
    +
    See Also:
    +
    Property, +Group
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Required Element Summary

      + + + + + + + + + + +
      Required Elements 
      Modifier and TypeRequired Element and Description
      java.lang.Stringvalue 
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Element Detail

      + + + +
        +
      • +

        value

        +
        public abstract java.lang.String value
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Property.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Property.html new file mode 100644 index 000000000..78e118d86 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Property.html @@ -0,0 +1,485 @@ + + + + + +Property (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Annotation Type Property

+
+
+
+
    +
  • +
    +
    +
    @Target(value={METHOD,ANNOTATION_TYPE})
    + @Retention(value=RUNTIME)
    + @Documented
    + @Testable
    + @API(status=STABLE,
    +     since="1.0")
    +public @interface Property
    +
    Use @Property to mark methods that serve as properties. + Those methods usually have one or more parameters annotated with ForAll. +

    + They are executed (tried) several times, + either until they fail or until the configured number of tries() has been reached. +

    + Just like methods annotated with Example example, annotated methods + must not be private. They can either return Boolean, boolean + or void. +

    + For more info, you can have a look at the user guide, + optional-property-parameters.

    +
    +
    See Also:
    +
    Example, +ShrinkingMode, +GenerationMode, +AfterFailureMode, +EdgeCasesMode, +Data
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        TRIES_NOT_SET

        +
        public static final int TRIES_NOT_SET
        +
      • +
      +
    • +
    +
      +
    • + + +
        +
      • +

        MAX_DISCARD_RATIO_NOT_SET

        +
        public static final int MAX_DISCARD_RATIO_NOT_SET
        +
      • +
      +
    • +
    +
      +
    • + + +
        +
      • +

        SEED_NOT_SET

        +
        public static final java.lang.String SEED_NOT_SET
        +
      • +
      +
    • +
    +
      +
    • + + +
        +
      • +

        DEFAULT_STEREOTYPE

        +
        public static final java.lang.String DEFAULT_STEREOTYPE
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Element Detail

      + + + +
        +
      • +

        tries

        +
        public abstract int tries
        +
        Number of tries (test runs with different parameters). By default it is 1000. You can override globally in the property file + (see jqwik.properties, or here, in Property + annotation.
        +
        +
        Default:
        +
        0
        +
        +
      • +
      +
    • +
    +
      +
    • + + +
        +
      • +

        maxDiscardRatio

        +
        public abstract int maxDiscardRatio
        +
        The maximal number of tried versus actually checked property runs in case you are using Assumptions. If the ratio is exceeded jqwik + will report this property as a failure. +

        + The default is 5 which can be overridden in jqwik.properties.

        +
        +
        Default:
        +
        0
        +
        +
      • +
      +
    • +
    +
      +
    • + + +
        +
      • +

        seed

        +
        public abstract java.lang.String seed
        +
        +
        Default:
        +
        ""
        +
        +
      • +
      +
    • +
    +
      +
    • + + +
        +
      • +

        shrinking

        +
        public abstract ShrinkingMode shrinking
        +
        Controls how shrinking is done when falsified property is found. +

        + Default value is ShrinkingMode.BOUNDED, i.e. shrinking is tried to a depth of 1000 steps maximum per value.

        +
        +
        Default:
        +
        net.jqwik.api.ShrinkingMode.BOUNDED
        +
        +
      • +
      +
    • +
    +
      +
    • + + +
        +
      • +

        stereotype

        +
        public abstract java.lang.String stereotype
        +
        +
        Default:
        +
        "Property"
        +
        +
      • +
      +
    • +
    +
      +
    • + + +
        +
      • +

        generation

        +
        @API(status=MAINTAINED,
        +     since="1.0")
        +public abstract GenerationMode generation
        +
        +
        Default:
        +
        net.jqwik.api.GenerationMode.NOT_SET
        +
        +
      • +
      +
    • +
    +
      +
    • + + +
        +
      • +

        afterFailure

        +
        @API(status=MAINTAINED,
        +     since="1.0")
        +public abstract AfterFailureMode afterFailure
        +
        +
        Default:
        +
        net.jqwik.api.AfterFailureMode.NOT_SET
        +
        +
      • +
      +
    • +
    +
      +
    • + + +
        +
      • +

        edgeCases

        +
        @API(status=EXPERIMENTAL,
        +     since="1.3.0")
        +public abstract EdgeCasesMode edgeCases
        +
        +
        Default:
        +
        net.jqwik.api.EdgeCasesMode.NOT_SET
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Provide.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Provide.html new file mode 100644 index 000000000..34a04d921 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Provide.html @@ -0,0 +1,221 @@ + + + + + +Provide (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Annotation Type Provide

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,METHOD})
    + @Retention(value=RUNTIME)
    + @Documented
    + @API(status=STABLE,
    +     since="1.0")
    +public @interface Provide
    +
    Used to annotate methods that can provide values for property method parameters. Those methods must return an + instance of Arbitrary. + + value is used as reference name. If it is not specified, the method's name is used instead.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Optional Element Summary

      + + + + + + + + + + +
      Optional Elements 
      Modifier and TypeOptional Element and Description
      java.lang.Stringvalue 
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Element Detail

      + + + +
        +
      • +

        value

        +
        public abstract java.lang.String value
        +
        +
        Default:
        +
        ""
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/RandomDistribution.RandomDistributionFacade.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/RandomDistribution.RandomDistributionFacade.html new file mode 100644 index 000000000..10b510a09 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/RandomDistribution.RandomDistributionFacade.html @@ -0,0 +1,299 @@ + + + + + +RandomDistribution.RandomDistributionFacade (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Class RandomDistribution.RandomDistributionFacade

+
+
+ +
+
    +
  • +
    +
    Enclosing interface:
    +
    RandomDistribution
    +
    +
    +
    +
    @API(status=INTERNAL)
    +public abstract static class RandomDistribution.RandomDistributionFacade
    +extends java.lang.Object
    +
  • +
+
+
+ +
+
+ +
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/RandomDistribution.RandomNumericGenerator.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/RandomDistribution.RandomNumericGenerator.html new file mode 100644 index 000000000..9e046313a --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/RandomDistribution.RandomNumericGenerator.html @@ -0,0 +1,232 @@ + + + + + +RandomDistribution.RandomNumericGenerator (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Interface RandomDistribution.RandomNumericGenerator

+
+
+
+
    +
  • +
    +
    Enclosing interface:
    +
    RandomDistribution
    +
    +
    +
    +
    public static interface RandomDistribution.RandomNumericGenerator
    +
    Generator for BigInteger values which are behind all generated numeric values in jqwik.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethod and Description
      java.math.BigIntegernext(java.util.Random random) +
      Generate next random number within the specified range given on creation of the generator.
      +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        next

        +
        java.math.BigInteger next(java.util.Random random)
        +
        Generate next random number within the specified range given on creation of the generator.
        +
        +
        Parameters:
        +
        random - A random value to use for random generation
        +
        Returns:
        +
        an instance of BigInteger. Never null.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/RandomDistribution.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/RandomDistribution.html new file mode 100644 index 000000000..7581ea6cb --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/RandomDistribution.html @@ -0,0 +1,373 @@ + + + + + +RandomDistribution (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Interface RandomDistribution

+
+
+
+
    +
  • +
    +
    +
    @API(status=EXPERIMENTAL,
    +     since="1.3.0")
    +public interface RandomDistribution
    +
    Determines how generated numerical values are generated and distributed + across the allowed range and a center withing this range. + +

    + Since all random numeric value generation is going back to + BigDecimal generation this interfaces uses only values + of type BigDecimal. +

    + +

    + The generation of an arbitrary's edge cases is not influenced by the distribution. +

    +
    +
    See Also:
    +
    BigIntegerArbitrary, +IntegerArbitrary, +LongArbitrary, +ShortArbitrary, +ByteArbitrary, +BigDecimalArbitrary, +DoubleArbitrary, +FloatArbitrary
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        biased

        +
        static RandomDistribution biased()
        +
        A distribution that generates values closer to the center of a numerical range + with a higher probability. The bigger the range the stronger the bias.
        +
      • +
      + + + +
        +
      • +

        uniform

        +
        static RandomDistribution uniform()
        +
        A distribution that generates values across the allowed range + with a uniform probability distribution.
        +
      • +
      + + + +
        +
      • +

        gaussian

        +
        static RandomDistribution gaussian(double borderSigma)
        +
        A distribution that generates values with (potentially asymmetric) gaussian distribution + the mean of which is the specified center and the probability at the borders is + approximately borderSigma times standard deviation. + +

        + Gaussian generation is approximately 10 times slower than biased() or uniform() + generation. But still, except in rare cases this will not make a noticeable difference in the runtime + of your properties.

        +
        +
        Parameters:
        +
        borderSigma - The approximate factor of standard deviation at the border(s)
        +
        +
      • +
      + + + +
        +
      • +

        gaussian

        +
        static RandomDistribution gaussian()
        +
        A gaussian distribution with borderSigma of 3, + i.e. approximately 99.7% of values are within the borders.
        +
        +
        See Also:
        +
        gaussian(double)
        +
        +
      • +
      + + + +
        +
      • +

        createGenerator

        +
        RandomDistribution.RandomNumericGenerator createGenerator(int genSize,
        +                                                          java.math.BigInteger min,
        +                                                          java.math.BigInteger max,
        +                                                          java.math.BigInteger center)
        +
        Return a generator that will generate value with the desired distribution
        +
        +
        Parameters:
        +
        genSize - The approximate number of values to generate. Can be influenced by callers.
        +
        min - The minimum allowed value (included)
        +
        max - The maximum allowed value (included)
        +
        center - The center for the distribution. Must be within min and max.
        +
        Returns:
        +
        generator for randomly generated BigInteger values
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/RandomGenerator.RandomGeneratorFacade.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/RandomGenerator.RandomGeneratorFacade.html new file mode 100644 index 000000000..9575b293d --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/RandomGenerator.RandomGeneratorFacade.html @@ -0,0 +1,371 @@ + + + + + +RandomGenerator.RandomGeneratorFacade (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Class RandomGenerator.RandomGeneratorFacade

+
+
+ +
+
    +
  • +
    +
    Enclosing interface:
    +
    RandomGenerator<T>
    +
    +
    +
    +
    @API(status=INTERNAL)
    +public abstract static class RandomGenerator.RandomGeneratorFacade
    +extends java.lang.Object
    +
  • +
+
+
+ +
+
+ +
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/RandomGenerator.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/RandomGenerator.html new file mode 100644 index 000000000..aefb4c097 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/RandomGenerator.html @@ -0,0 +1,389 @@ + + + + + +RandomGenerator (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Interface RandomGenerator<T>

+
+
+
+
    +
  • +
    +
    +
    @API(status=STABLE,
    +     since="1.0")
    +public interface RandomGenerator<T>
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        next

        +
        Shrinkable<T> next(java.util.Random random)
        +
        +
        Parameters:
        +
        random - the source of randomness. Injected by jqwik itself.
        +
        Returns:
        +
        the next generated value wrapped within the Shrinkable interface. The method must ALWAYS return a next value.
        +
        +
      • +
      + + + +
        +
      • +

        map

        +
        @API(status=INTERNAL)
        +default <U> RandomGenerator<U> map(java.util.function.Function<T,U> mapper)
        +
      • +
      + + + + + + + +
        +
      • +

        flatMap

        +
        @API(status=INTERNAL)
        +default <U> RandomGenerator<U> flatMap(java.util.function.Function<T,Arbitrary<U>> mapper,
        +                                                             int genSize)
        +
      • +
      + + + +
        +
      • +

        filter

        +
        @API(status=INTERNAL)
        +default RandomGenerator<T> filter(java.util.function.Predicate<T> filterPredicate)
        +
      • +
      + + + +
        +
      • +

        injectNull

        +
        @API(status=INTERNAL)
        +default RandomGenerator<T> injectNull(double nullProbability)
        +
      • +
      + + + + + + + + + + + +
        +
      • +

        stream

        +
        @API(status=INTERNAL)
        +default java.util.stream.Stream<Shrinkable<T>> stream(java.util.Random random)
        +
      • +
      + + + +
        +
      • +

        collect

        +
        @API(status=INTERNAL)
        +default RandomGenerator<java.util.List<T>> collect(java.util.function.Predicate<java.util.List<T>> until)
        +
      • +
      + + + +
        +
      • +

        injectDuplicates

        +
        @API(status=INTERNAL)
        +default RandomGenerator<T> injectDuplicates(double duplicateProbability)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Report.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Report.html new file mode 100644 index 000000000..7c018351a --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Report.html @@ -0,0 +1,219 @@ + + + + + +Report (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Annotation Type Report

+
+
+
+
    +
  • +
    +
    +
    @Target(value={METHOD,ANNOTATION_TYPE})
    + @Retention(value=RUNTIME)
    + @Documented
    + @API(status=MAINTAINED,
    +     since="1.0")
    +public @interface Report
    +
    Use @Report to specify what additional things should be reported + when running a property.
    +
    +
    See Also:
    +
    Property
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Required Element Summary

      + + + + + + + + + + +
      Required Elements 
      Modifier and TypeRequired Element and Description
      Reporting[]value 
      +
    • +
    +
  • +
+
+
+
    +
  • + + +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Reporting.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Reporting.html new file mode 100644 index 000000000..1ffb15abb --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Reporting.html @@ -0,0 +1,361 @@ + + + + + +Reporting (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Enum Reporting

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, java.lang.Comparable<Reporting>
    +
    +
    +
    +
    @API(status=MAINTAINED,
    +     since="1.0")
    +public enum Reporting
    +extends java.lang.Enum<Reporting>
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Enum Constant Summary

      + + + + + + + + + + + +
      Enum Constants 
      Enum Constant and Description
      FALSIFIED +
      FALSIFIED will report each set of parameters that is falsified during shrinking.
      +
      GENERATED +
      GENERATED will report each generated set of the parameters.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      booleancontainedIn(Reporting[] reporting) 
      static ReportingvalueOf(java.lang.String name) +
      Returns the enum constant of this type with the specified name.
      +
      static Reporting[]values() +
      Returns an array containing the constants of this enum type, in +the order they are declared.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Enum

        +clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +getClass, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Enum Constant Detail

      + + + +
        +
      • +

        GENERATED

        +
        public static final Reporting GENERATED
        +
        GENERATED will report each generated set of the parameters. + This means that after each property test, summary table will be printed.
        +
      • +
      + + + +
        +
      • +

        FALSIFIED

        +
        public static final Reporting FALSIFIED
        +
        FALSIFIED will report each set of parameters that is falsified during shrinking. + i.e., report "table" will be printed only when some test fails.
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static Reporting[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (Reporting c : Reporting.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static Reporting valueOf(java.lang.String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        +
        java.lang.NullPointerException - if the argument is null
        +
        +
      • +
      + + + +
        +
      • +

        containedIn

        +
        public boolean containedIn(Reporting[] reporting)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Shrinkable.ShrinkableFacade.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Shrinkable.ShrinkableFacade.html new file mode 100644 index 000000000..dcbc5b6cd --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Shrinkable.ShrinkableFacade.html @@ -0,0 +1,326 @@ + + + + + +Shrinkable.ShrinkableFacade (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Class Shrinkable.ShrinkableFacade

+
+
+ +
+
    +
  • +
    +
    Enclosing interface:
    +
    Shrinkable<T>
    +
    +
    +
    +
    @API(status=INTERNAL)
    +public abstract static class Shrinkable.ShrinkableFacade
    +extends java.lang.Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ShrinkableFacade

        +
        public ShrinkableFacade()
        +
      • +
      +
    • +
    + + +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Shrinkable.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Shrinkable.html new file mode 100644 index 000000000..5a2324d42 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Shrinkable.html @@ -0,0 +1,417 @@ + + + + + +Shrinkable (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Interface Shrinkable<T>

+
+
+
+
    +
  • +
    +
    All Superinterfaces:
    +
    java.lang.Comparable<Shrinkable<T>>
    +
    +
    +
    +
    @API(status=STABLE,
    +     since="1.0")
    +public interface Shrinkable<T>
    +extends java.lang.Comparable<Shrinkable<T>>
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + + + +
        +
      • +

        unshrinkable

        +
        static <T> Shrinkable<T> unshrinkable(T value)
        +
      • +
      + + + + + + + + + +
        +
      • +

        value

        +
        T value()
        +
      • +
      + + + + + + + + + + + +
        +
      • +

        asGeneric

        +
        @API(status=INTERNAL,
        +     since="1.2.4")
        +default Shrinkable<java.lang.Object> asGeneric()
        +
        Sometimes simplifies test writing
        +
        +
        Returns:
        +
        generic version of a shrinkable
        +
        +
      • +
      + + + +
        +
      • +

        map

        +
        default <U> Shrinkable<U> map(java.util.function.Function<T,U> mapper)
        +
      • +
      + + + +
        +
      • +

        filter

        +
        default Shrinkable<T> filter(java.util.function.Predicate<T> filter)
        +
      • +
      + + + +
        +
      • +

        flatMap

        +
        default <U> Shrinkable<U> flatMap(java.util.function.Function<T,Arbitrary<U>> flatMapper,
        +                                  int tries,
        +                                  long randomSeed)
        +
      • +
      + + + +
        +
      • +

        compareTo

        +
        @API(status=INTERNAL)
        +default int compareTo(Shrinkable<T> other)
        +
        +
        Specified by:
        +
        compareTo in interface java.lang.Comparable<Shrinkable<T>>
        +
        +
      • +
      + + + +
        +
      • +

        isSmallerThan

        +
        @API(status=INTERNAL)
        +default boolean isSmallerThan(Shrinkable<T> other)
        +
      • +
      + + + +
        +
      • +

        shrinkingSuggestions

        +
        @API(status=INTERNAL)
        +default java.util.List<Shrinkable<T>> shrinkingSuggestions()
        +
        Used only when several shrinkables must be shrunk in synchronicity e.g. duplicate values. + Override in mostly all implementations since the default produces only a few values.
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/ShrinkingDistance.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/ShrinkingDistance.html new file mode 100644 index 000000000..4f08e0cfa --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/ShrinkingDistance.html @@ -0,0 +1,435 @@ + + + + + +ShrinkingDistance (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Class ShrinkingDistance

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.lang.Comparable<ShrinkingDistance>
    +
    +
    +
    +
    @API(status=STABLE,
    +     since="1.0")
    +public class ShrinkingDistance
    +extends java.lang.Object
    +implements java.lang.Comparable<ShrinkingDistance>
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        MAX

        +
        @API(status=MAINTAINED,
        +     since="1.2.0")
        +public static final ShrinkingDistance MAX
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        of

        +
        @API(status=MAINTAINED,
        +     since="1.0")
        +public static ShrinkingDistance of(long... distances)
        +
      • +
      + + + +
        +
      • +

        forCollection

        +
        @API(status=MAINTAINED,
        +     since="1.0")
        +public static <T> ShrinkingDistance forCollection(java.util.Collection<Shrinkable<T>> elements)
        +
      • +
      + + + +
        +
      • +

        combine

        +
        @API(status=MAINTAINED,
        +     since="1.0")
        +public static <T> ShrinkingDistance combine(java.util.List<Shrinkable<T>> shrinkables)
        +
      • +
      + + + +
        +
      • +

        equals

        +
        public boolean equals(java.lang.Object o)
        +
        +
        Overrides:
        +
        equals in class java.lang.Object
        +
        +
      • +
      + + + +
        +
      • +

        hashCode

        +
        public int hashCode()
        +
        +
        Overrides:
        +
        hashCode in class java.lang.Object
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public java.lang.String toString()
        +
        +
        Overrides:
        +
        toString in class java.lang.Object
        +
        +
      • +
      + + + + + + + +
        +
      • +

        dimensions

        +
        @API(status=INTERNAL)
        +public java.util.List<ShrinkingDistance> dimensions()
        +
      • +
      + + + +
        +
      • +

        size

        +
        @API(status=INTERNAL)
        +public int size()
        +
      • +
      + + + + + + + + +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/ShrinkingMode.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/ShrinkingMode.html new file mode 100644 index 000000000..aa7fed8f9 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/ShrinkingMode.html @@ -0,0 +1,370 @@ + + + + + +ShrinkingMode (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Enum ShrinkingMode

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, java.lang.Comparable<ShrinkingMode>
    +
    +
    +
    +
    @API(status=MAINTAINED,
    +     since="1.0")
    +public enum ShrinkingMode
    +extends java.lang.Enum<ShrinkingMode>
    +
    The shrinking mode defines the shrinking behaviour of a property. + It can be set in Property.shrinking() for any property method; default is BOUNDED.
    +
    +
    See Also:
    +
    Property
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Enum Constant Summary

      + + + + + + + + + + + + + + +
      Enum Constants 
      Enum Constant and Description
      BOUNDED +
      Shrinking is tried to a depth of 1000 steps maximum per value.
      +
      FULL +
      Shrinking continues until no smaller value can be found that also falsifies the property.
      +
      OFF +
      No shrinking for falsified values.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static ShrinkingModevalueOf(java.lang.String name) +
      Returns the enum constant of this type with the specified name.
      +
      static ShrinkingMode[]values() +
      Returns an array containing the constants of this enum type, in +the order they are declared.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Enum

        +clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +getClass, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Enum Constant Detail

      + + + +
        +
      • +

        OFF

        +
        public static final ShrinkingMode OFF
        +
        No shrinking for falsified values.
        +
      • +
      + + + +
        +
      • +

        BOUNDED

        +
        public static final ShrinkingMode BOUNDED
        +
        Shrinking is tried to a depth of 1000 steps maximum per value. + If shrinking has not finished by then, the best found value is taken and + bounded shrinking is reported through JUnit's reporting mechanism.
        +
      • +
      + + + +
        +
      • +

        FULL

        +
        public static final ShrinkingMode FULL
        +
        Shrinking continues until no smaller value can be found that also falsifies the property. + This might take very long or not end at all in rare cases.
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static ShrinkingMode[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (ShrinkingMode c : ShrinkingMode.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static ShrinkingMode valueOf(java.lang.String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        +
        java.lang.NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/ShrinkingSequence.ShrinkingSequenceFacade.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/ShrinkingSequence.ShrinkingSequenceFacade.html new file mode 100644 index 000000000..ae48adf04 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/ShrinkingSequence.ShrinkingSequenceFacade.html @@ -0,0 +1,333 @@ + + + + + +ShrinkingSequence.ShrinkingSequenceFacade (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Class ShrinkingSequence.ShrinkingSequenceFacade

+
+
+ +
+
    +
  • +
    +
    Enclosing interface:
    +
    ShrinkingSequence<T>
    +
    +
    +
    +
    @API(status=INTERNAL)
    +public abstract static class ShrinkingSequence.ShrinkingSequenceFacade
    +extends java.lang.Object
    +
  • +
+
+
+ +
+
+ +
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/ShrinkingSequence.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/ShrinkingSequence.html new file mode 100644 index 000000000..54b23c1a2 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/ShrinkingSequence.html @@ -0,0 +1,336 @@ + + + + + +ShrinkingSequence (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Interface ShrinkingSequence<T>

+
+
+
+
    +
  • +
    +
    +
    @API(status=MAINTAINED,
    +     since="1.0")
    +public interface ShrinkingSequence<T>
    +
  • +
+
+
+ +
+
+ +
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Table.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Table.html new file mode 100644 index 000000000..a64143ef1 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Table.html @@ -0,0 +1,385 @@ + + + + + +Table (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Class Table

+
+
+ +
+
    +
  • +
    +
    +
    @API(status=MAINTAINED,
    +     since="1.0")
    +public class Table
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      Table() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static <E> java.lang.Iterable<Tuple.Tuple1<E>>of(E... elements) 
      static <T> java.lang.Iterable<Tuple.Tuple1<T>>of(Tuple.Tuple1<T>... tuples) 
      static <T1,T2> java.lang.Iterable<Tuple.Tuple2<T1,T2>>of(Tuple.Tuple2<T1,T2>... tuples) 
      static <T1,T2,T3> java.lang.Iterable<Tuple.Tuple3<T1,T2,T3>>of(Tuple.Tuple3<T1,T2,T3>... tuples) 
      static <T1,T2,T3,T4>
      java.lang.Iterable<Tuple.Tuple4<T1,T2,T3,T4>>
      of(Tuple.Tuple4<T1,T2,T3,T4>... tuples) 
      static <T1,T2,T3,T4,T5>
      java.lang.Iterable<Tuple.Tuple5<T1,T2,T3,T4,T5>>
      of(Tuple.Tuple5<T1,T2,T3,T4,T5>... tuples) 
      static <T1,T2,T3,T4,T5,T6>
      java.lang.Iterable<Tuple.Tuple6<T1,T2,T3,T4,T5,T6>>
      of(Tuple.Tuple6<T1,T2,T3,T4,T5,T6>... tuples) 
      static <T1,T2,T3,T4,T5,T6,T7>
      java.lang.Iterable<Tuple.Tuple7<T1,T2,T3,T4,T5,T6,T7>>
      of(Tuple.Tuple7<T1,T2,T3,T4,T5,T6,T7>... tuples) 
      static <T1,T2,T3,T4,T5,T6,T7,T8>
      java.lang.Iterable<Tuple.Tuple8<T1,T2,T3,T4,T5,T6,T7,T8>>
      of(Tuple.Tuple8<T1,T2,T3,T4,T5,T6,T7,T8>... tuples) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Table

        +
        public Table()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + + + +
        +
      • +

        of

        +
        @SafeVarargs
        +public static <E> java.lang.Iterable<Tuple.Tuple1<E>> of(E... elements)
        +
      • +
      + + + + + + + +
        +
      • +

        of

        +
        @SafeVarargs
        +public static <T1,T2> java.lang.Iterable<Tuple.Tuple2<T1,T2>> of(Tuple.Tuple2<T1,T2>... tuples)
        +
      • +
      + + + +
        +
      • +

        of

        +
        @SafeVarargs
        +public static <T1,T2,T3> java.lang.Iterable<Tuple.Tuple3<T1,T2,T3>> of(Tuple.Tuple3<T1,T2,T3>... tuples)
        +
      • +
      + + + +
        +
      • +

        of

        +
        @SafeVarargs
        +public static <T1,T2,T3,T4> java.lang.Iterable<Tuple.Tuple4<T1,T2,T3,T4>> of(Tuple.Tuple4<T1,T2,T3,T4>... tuples)
        +
      • +
      + + + +
        +
      • +

        of

        +
        @SafeVarargs
        +public static <T1,T2,T3,T4,T5> java.lang.Iterable<Tuple.Tuple5<T1,T2,T3,T4,T5>> of(Tuple.Tuple5<T1,T2,T3,T4,T5>... tuples)
        +
      • +
      + + + +
        +
      • +

        of

        +
        @SafeVarargs
        +public static <T1,T2,T3,T4,T5,T6> java.lang.Iterable<Tuple.Tuple6<T1,T2,T3,T4,T5,T6>> of(Tuple.Tuple6<T1,T2,T3,T4,T5,T6>... tuples)
        +
      • +
      + + + +
        +
      • +

        of

        +
        @SafeVarargs
        +public static <T1,T2,T3,T4,T5,T6,T7> java.lang.Iterable<Tuple.Tuple7<T1,T2,T3,T4,T5,T6,T7>> of(Tuple.Tuple7<T1,T2,T3,T4,T5,T6,T7>... tuples)
        +
      • +
      + + + +
        +
      • +

        of

        +
        @SafeVarargs
        +public static <T1,T2,T3,T4,T5,T6,T7,T8> java.lang.Iterable<Tuple.Tuple8<T1,T2,T3,T4,T5,T6,T7,T8>> of(Tuple.Tuple8<T1,T2,T3,T4,T5,T6,T7,T8>... tuples)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Tag.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Tag.html new file mode 100644 index 000000000..7fa76c5cc --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Tag.html @@ -0,0 +1,236 @@ + + + + + +Tag (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Annotation Type Tag

+
+
+
+
    +
  • +
    +
    +
    @Target(value={METHOD,TYPE,ANNOTATION_TYPE})
    + @Retention(value=RUNTIME)
    + @Documented
    + @Repeatable(value=TagList.class)
    + @API(status=STABLE,
    +     since="1.0")
    +public @interface Tag
    +
    Use @Tag("a tag") to give test classes, groups and methods an (additional) tag + which can later be used to select the set of tests to execute. +

    + You can have many tags on the same element. +

    + Tags on the JUnit platform must obey a few rules: +

      +
    • A tag must not be blank.
    • +
    • A trimmed tag must not contain whitespace.
    • +
    • A trimmed tag must not contain ISO control characters.
    • +
    • A trimmed tag must not contain any of the following + reserved characters. +
        +
      • ,: comma
      • +
      • (: left parenthesis
      • +
      • ): right parenthesis
      • +
      • &: ampersand
      • +
      • |: vertical bar
      • +
      • !: exclamation point
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Required Element Summary

      + + + + + + + + + + +
      Required Elements 
      Modifier and TypeRequired Element and Description
      java.lang.Stringvalue 
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Element Detail

      + + + +
        +
      • +

        value

        +
        public abstract java.lang.String value
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/TagList.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/TagList.html new file mode 100644 index 000000000..d96dfa84d --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/TagList.html @@ -0,0 +1,213 @@ + + + + + +TagList (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Annotation Type TagList

+
+
+
+
    +
  • +
    +
    +
    @Target(value={METHOD,TYPE,ANNOTATION_TYPE})
    + @Retention(value=RUNTIME)
    + @Documented
    + @API(status=STABLE,
    +     since="1.0")
    +public @interface TagList
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Required Element Summary

      + + + + + + + + + + +
      Required Elements 
      Modifier and TypeRequired Element and Description
      Tag[]value 
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Element Detail

      + + + +
        +
      • +

        value

        +
        public abstract Tag[] value
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/TooManyFilterMissesException.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/TooManyFilterMissesException.html new file mode 100644 index 000000000..8cbc0ce8c --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/TooManyFilterMissesException.html @@ -0,0 +1,271 @@ + + + + + +TooManyFilterMissesException (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Class TooManyFilterMissesException

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable
    +
    +
    +
    +
    @API(status=MAINTAINED,
    +     since="1.0")
    +public class TooManyFilterMissesException
    +extends JqwikException
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Throwable

        +addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        TooManyFilterMissesException

        +
        public TooManyFilterMissesException(java.lang.String message)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Tuple.Tuple1.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Tuple.Tuple1.html new file mode 100644 index 000000000..5dd17e752 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Tuple.Tuple1.html @@ -0,0 +1,358 @@ + + + + + +Tuple.Tuple1 (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Class Tuple.Tuple1<T1>

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, java.lang.Cloneable, Tuple
    +
    +
    +
    Direct Known Subclasses:
    +
    Tuple.Tuple2
    +
    +
    +
    Enclosing interface:
    +
    Tuple
    +
    +
    +
    +
    public static class Tuple.Tuple1<T1>
    +extends java.lang.Object
    +implements Tuple
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        size

        +
        public int size()
        +
        +
        Specified by:
        +
        size in interface Tuple
        +
        +
      • +
      + + + +
        +
      • +

        get1

        +
        public T1 get1()
        +
      • +
      + + + +
        +
      • +

        items

        +
        public java.util.List<java.lang.Object> items()
        +
        +
        Specified by:
        +
        items in interface Tuple
        +
        +
      • +
      + + + +
        +
      • +

        equals

        +
        public boolean equals(java.lang.Object o)
        +
        +
        Overrides:
        +
        equals in class java.lang.Object
        +
        +
      • +
      + + + +
        +
      • +

        hashCode

        +
        public int hashCode()
        +
        +
        Overrides:
        +
        hashCode in class java.lang.Object
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public java.lang.String toString()
        +
        +
        Overrides:
        +
        toString in class java.lang.Object
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Tuple.Tuple2.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Tuple.Tuple2.html new file mode 100644 index 000000000..33a29f9e2 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Tuple.Tuple2.html @@ -0,0 +1,373 @@ + + + + + +Tuple.Tuple2 (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Class Tuple.Tuple2<T1,T2>

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, java.lang.Cloneable, Tuple
    +
    +
    +
    Direct Known Subclasses:
    +
    Tuple.Tuple3
    +
    +
    +
    Enclosing interface:
    +
    Tuple
    +
    +
    +
    +
    public static class Tuple.Tuple2<T1,T2>
    +extends Tuple.Tuple1<T1>
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+ +
+
+ +
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Tuple.Tuple3.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Tuple.Tuple3.html new file mode 100644 index 000000000..8b992fa93 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Tuple.Tuple3.html @@ -0,0 +1,385 @@ + + + + + +Tuple.Tuple3 (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Class Tuple.Tuple3<T1,T2,T3>

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, java.lang.Cloneable, Tuple
    +
    +
    +
    Direct Known Subclasses:
    +
    Tuple.Tuple4
    +
    +
    +
    Enclosing interface:
    +
    Tuple
    +
    +
    +
    +
    public static class Tuple.Tuple3<T1,T2,T3>
    +extends Tuple.Tuple2<T1,T2>
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+ +
+
+ +
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Tuple.Tuple4.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Tuple.Tuple4.html new file mode 100644 index 000000000..afa551502 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Tuple.Tuple4.html @@ -0,0 +1,397 @@ + + + + + +Tuple.Tuple4 (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Class Tuple.Tuple4<T1,T2,T3,T4>

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, java.lang.Cloneable, Tuple
    +
    +
    +
    Direct Known Subclasses:
    +
    Tuple.Tuple5
    +
    +
    +
    Enclosing interface:
    +
    Tuple
    +
    +
    +
    +
    public static class Tuple.Tuple4<T1,T2,T3,T4>
    +extends Tuple.Tuple3<T1,T2,T3>
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+ +
+
+ +
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Tuple.Tuple5.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Tuple.Tuple5.html new file mode 100644 index 000000000..c5dc3902f --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Tuple.Tuple5.html @@ -0,0 +1,409 @@ + + + + + +Tuple.Tuple5 (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Class Tuple.Tuple5<T1,T2,T3,T4,T5>

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, java.lang.Cloneable, Tuple
    +
    +
    +
    Direct Known Subclasses:
    +
    Tuple.Tuple6
    +
    +
    +
    Enclosing interface:
    +
    Tuple
    +
    +
    +
    +
    public static class Tuple.Tuple5<T1,T2,T3,T4,T5>
    +extends Tuple.Tuple4<T1,T2,T3,T4>
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+ +
+
+ +
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Tuple.Tuple6.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Tuple.Tuple6.html new file mode 100644 index 000000000..dc7b50cf1 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Tuple.Tuple6.html @@ -0,0 +1,421 @@ + + + + + +Tuple.Tuple6 (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Class Tuple.Tuple6<T1,T2,T3,T4,T5,T6>

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, java.lang.Cloneable, Tuple
    +
    +
    +
    Direct Known Subclasses:
    +
    Tuple.Tuple7
    +
    +
    +
    Enclosing interface:
    +
    Tuple
    +
    +
    +
    +
    public static class Tuple.Tuple6<T1,T2,T3,T4,T5,T6>
    +extends Tuple.Tuple5<T1,T2,T3,T4,T5>
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+ +
+
+ +
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Tuple.Tuple7.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Tuple.Tuple7.html new file mode 100644 index 000000000..fa91ecebf --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Tuple.Tuple7.html @@ -0,0 +1,433 @@ + + + + + +Tuple.Tuple7 (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Class Tuple.Tuple7<T1,T2,T3,T4,T5,T6,T7>

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, java.lang.Cloneable, Tuple
    +
    +
    +
    Direct Known Subclasses:
    +
    Tuple.Tuple8
    +
    +
    +
    Enclosing interface:
    +
    Tuple
    +
    +
    +
    +
    public static class Tuple.Tuple7<T1,T2,T3,T4,T5,T6,T7>
    +extends Tuple.Tuple6<T1,T2,T3,T4,T5,T6>
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+ +
+
+ +
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Tuple.Tuple8.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Tuple.Tuple8.html new file mode 100644 index 000000000..fe039d670 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Tuple.Tuple8.html @@ -0,0 +1,441 @@ + + + + + +Tuple.Tuple8 (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Class Tuple.Tuple8<T1,T2,T3,T4,T5,T6,T7,T8>

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, java.lang.Cloneable, Tuple
    +
    +
    +
    Enclosing interface:
    +
    Tuple
    +
    +
    +
    +
    public static class Tuple.Tuple8<T1,T2,T3,T4,T5,T6,T7,T8>
    +extends Tuple.Tuple7<T1,T2,T3,T4,T5,T6,T7>
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+ +
+
+ +
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/Tuple.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/Tuple.html new file mode 100644 index 000000000..54f9a7186 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/Tuple.html @@ -0,0 +1,465 @@ + + + + + +Tuple (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api
+

Interface Tuple

+
+
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        size

        +
        int size()
        +
      • +
      + + + +
        +
      • +

        items

        +
        default java.util.List<java.lang.Object> items()
        +
      • +
      + + + + + + + + + + + +
        +
      • +

        of

        +
        static <T1,T2> Tuple.Tuple2<T1,T2> of(T1 v1,
        +                                      T2 v2)
        +
      • +
      + + + + + +
        +
      • +

        of

        +
        static <T1,T2,T3> Tuple.Tuple3<T1,T2,T3> of(T1 v1,
        +                                            T2 v2,
        +                                            T3 v3)
        +
      • +
      + + + + + +
        +
      • +

        of

        +
        static <T1,T2,T3,T4> Tuple.Tuple4<T1,T2,T3,T4> of(T1 v1,
        +                                                  T2 v2,
        +                                                  T3 v3,
        +                                                  T4 v4)
        +
      • +
      + + + + + +
        +
      • +

        of

        +
        static <T1,T2,T3,T4,T5> Tuple.Tuple5<T1,T2,T3,T4,T5> of(T1 v1,
        +                                                        T2 v2,
        +                                                        T3 v3,
        +                                                        T4 v4,
        +                                                        T5 v5)
        +
      • +
      + + + + + +
        +
      • +

        of

        +
        static <T1,T2,T3,T4,T5,T6> Tuple.Tuple6<T1,T2,T3,T4,T5,T6> of(T1 v1,
        +                                                              T2 v2,
        +                                                              T3 v3,
        +                                                              T4 v4,
        +                                                              T5 v5,
        +                                                              T6 v6)
        +
      • +
      + + + + + +
        +
      • +

        of

        +
        static <T1,T2,T3,T4,T5,T6,T7> Tuple.Tuple7<T1,T2,T3,T4,T5,T6,T7> of(T1 v1,
        +                                                                    T2 v2,
        +                                                                    T3 v3,
        +                                                                    T4 v4,
        +                                                                    T5 v5,
        +                                                                    T6 v6,
        +                                                                    T7 v7)
        +
      • +
      + + + + + +
        +
      • +

        of

        +
        static <T1,T2,T3,T4,T5,T6,T7,T8> Tuple.Tuple8<T1,T2,T3,T4,T5,T6,T7,T8> of(T1 v1,
        +                                                                          T2 v2,
        +                                                                          T3 v3,
        +                                                                          T4 v4,
        +                                                                          T5 v5,
        +                                                                          T6 v6,
        +                                                                          T7 v7,
        +                                                                          T8 v8)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/BigDecimalArbitrary.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/BigDecimalArbitrary.html new file mode 100644 index 000000000..b259abfcc --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/BigDecimalArbitrary.html @@ -0,0 +1,419 @@ + + + + + +BigDecimalArbitrary (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.arbitraries
+

Interface BigDecimalArbitrary

+
+
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        between

        +
        default BigDecimalArbitrary between(java.math.BigDecimal min,
        +                                    java.math.BigDecimal max)
        +
        Set the allowed lower min (included) and upper max (included) border of generated numbers.
        +
        +
        Parameters:
        +
        min - The lower border of possible values
        +
        max - The upper border of possible values
        +
        +
      • +
      + + + +
        +
      • +

        between

        +
        @API(status=MAINTAINED,
        +     since="1.2.7")
        +BigDecimalArbitrary between(java.math.BigDecimal min,
        +                                                                        boolean minIncluded,
        +                                                                        java.math.BigDecimal max,
        +                                                                        boolean maxIncluded)
        +
        Set the allowed lower min (included) and upper max (included) border of generated numbers. + Specify if borders should be included in allowed values or not.
        +
        +
        Parameters:
        +
        min - The lower border of possible values
        +
        minIncluded - Should the lower border be included
        +
        max - The upper border of possible values
        +
        maxIncluded - Should the upper border be included
        +
        +
      • +
      + + + +
        +
      • +

        greaterOrEqual

        +
        BigDecimalArbitrary greaterOrEqual(java.math.BigDecimal min)
        +
        Set the allowed lower min (included) border of generated numbers.
        +
        +
        Parameters:
        +
        min - The lower border of possible values
        +
        +
      • +
      + + + +
        +
      • +

        greaterThan

        +
        @API(status=MAINTAINED,
        +     since="1.2.7")
        +BigDecimalArbitrary greaterThan(java.math.BigDecimal min)
        +
        Set the allowed lower min (excluded) border of generated numbers.
        +
        +
        Parameters:
        +
        min - The lower border of possible values
        +
        +
      • +
      + + + +
        +
      • +

        lessOrEqual

        +
        BigDecimalArbitrary lessOrEqual(java.math.BigDecimal max)
        +
        Set the allowed upper max (included) bounder of generated numbers.
        +
        +
        Parameters:
        +
        max - The upper border of possible values
        +
        +
      • +
      + + + +
        +
      • +

        lessThan

        +
        @API(status=MAINTAINED,
        +     since="1.2.7")
        +BigDecimalArbitrary lessThan(java.math.BigDecimal max)
        +
        Set the allowed upper max (excluded) border of generated numbers.
        +
        +
        Parameters:
        +
        max - The upper border of possible values
        +
        +
      • +
      + + + +
        +
      • +

        ofScale

        +
        BigDecimalArbitrary ofScale(int scale)
        +
        Set the scale (maximum number of decimal places) to scale.
        +
      • +
      + + + +
        +
      • +

        shrinkTowards

        +
        @API(status=EXPERIMENTAL,
        +     since="1.1.5")
        +BigDecimalArbitrary shrinkTowards(java.math.BigDecimal target)
        +
        Set shrinking target to target which must be between the allowed bounds.
        +
        +
        Parameters:
        +
        target - The value which is considered to be the most simple value for shrinking
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/BigIntegerArbitrary.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/BigIntegerArbitrary.html new file mode 100644 index 000000000..ee83293b4 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/BigIntegerArbitrary.html @@ -0,0 +1,310 @@ + + + + + +BigIntegerArbitrary (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.arbitraries
+

Interface BigIntegerArbitrary

+
+
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        between

        +
        default BigIntegerArbitrary between(java.math.BigInteger min,
        +                                    java.math.BigInteger max)
        +
        Set the allowed lower min (included) and upper max (included) bounder of generated numbers.
        +
      • +
      + + + +
        +
      • +

        greaterOrEqual

        +
        BigIntegerArbitrary greaterOrEqual(java.math.BigInteger min)
        +
        Set the allowed lower min (included) bounder of generated numbers.
        +
      • +
      + + + +
        +
      • +

        lessOrEqual

        +
        BigIntegerArbitrary lessOrEqual(java.math.BigInteger max)
        +
        Set the allowed upper max (included) bounder of generated numbers.
        +
      • +
      + + + +
        +
      • +

        shrinkTowards

        +
        @API(status=EXPERIMENTAL,
        +     since="1.1.4")
        +Arbitrary<java.math.BigInteger> shrinkTowards(java.math.BigInteger target)
        +
        Set shrinking target to target which must be between the allowed bounds.
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/ByteArbitrary.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/ByteArbitrary.html new file mode 100644 index 000000000..0ab662e39 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/ByteArbitrary.html @@ -0,0 +1,310 @@ + + + + + +ByteArbitrary (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.arbitraries
+

Interface ByteArbitrary

+
+
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        between

        +
        default ByteArbitrary between(byte min,
        +                              byte max)
        +
        Set the allowed lower min (included) and upper max (included) bounds of generated numbers.
        +
      • +
      + + + +
        +
      • +

        greaterOrEqual

        +
        ByteArbitrary greaterOrEqual(byte min)
        +
        Set the allowed lower min (included) bound of generated numbers.
        +
      • +
      + + + +
        +
      • +

        lessOrEqual

        +
        ByteArbitrary lessOrEqual(byte max)
        +
        Set the allowed upper max (included) bound of generated numbers.
        +
      • +
      + + + +
        +
      • +

        shrinkTowards

        +
        @API(status=EXPERIMENTAL,
        +     since="1.1.4")
        +Arbitrary<java.lang.Byte> shrinkTowards(int target)
        +
        Set shrinking target to target which must be between the allowed bounds.
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/CharacterArbitrary.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/CharacterArbitrary.html new file mode 100644 index 000000000..b1c642c71 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/CharacterArbitrary.html @@ -0,0 +1,391 @@ + + + + + +CharacterArbitrary (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.arbitraries
+

Interface CharacterArbitrary

+
+
+
+
    +
  • +
    +
    All Superinterfaces:
    +
    Arbitrary<java.lang.Character>
    +
    +
    +
    +
    @API(status=MAINTAINED,
    +     since="1.0")
    +public interface CharacterArbitrary
    +extends Arbitrary<java.lang.Character>
    +
    Fluent interface to configure the generation of Character and char values.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        all

        +
        CharacterArbitrary all()
        +
        Allow all unicode chars to show up in generated values. + + Resets previous settings.
        +
      • +
      + + + +
        +
      • +

        with

        +
        @API(status=MAINTAINED,
        +     since="1.1.3")
        +CharacterArbitrary with(char... allowedChars)
        +
        Allow all chars in allowedChars show up in generated values. + + Adds to all already allowed chars.
        +
      • +
      + + + +
        +
      • +

        with

        +
        @API(status=EXPERIMENTAL,
        +     since="1.3.0")
        +CharacterArbitrary with(Arbitrary<java.lang.Character> characterArbitrary)
        +
        Allow all chars generated by characterArbitrary. + + Adds to all already allowed chars.
        +
      • +
      + + + +
        +
      • +

        with

        +
        @API(status=MAINTAINED,
        +     since="1.2.1")
        +CharacterArbitrary with(java.lang.CharSequence allowedChars)
        +
        Allow all chars in allowedChars show up in generated values. + + Adds to all already allowed chars.
        +
      • +
      + + + +
        +
      • +

        range

        +
        @API(status=MAINTAINED,
        +     since="1.1.3")
        +CharacterArbitrary range(char min,
        +                                                                     char max)
        +
        Allow all chars within min (included) and max (included) to show up in generated values. + + Adds to all already allowed chars.
        +
      • +
      + + + +
        +
      • +

        ascii

        +
        CharacterArbitrary ascii()
        +
        Allow all ascii chars to show up in generated values. + + Adds to all already allowed chars.
        +
      • +
      + + + +
        +
      • +

        digit

        +
        CharacterArbitrary digit()
        +
        Allow all numeric chars (digits) to show up in generated values. + + Adds to all already allowed chars.
        +
      • +
      + + + +
        +
      • +

        whitespace

        +
        @API(status=MAINTAINED,
        +     since="1.1.3")
        +CharacterArbitrary whitespace()
        +
        Allow all whitespace chars to show up in generated values. + + Adds to all already allowed chars.
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/DoubleArbitrary.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/DoubleArbitrary.html new file mode 100644 index 000000000..93b42835a --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/DoubleArbitrary.html @@ -0,0 +1,417 @@ + + + + + +DoubleArbitrary (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.arbitraries
+

Interface DoubleArbitrary

+
+
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        between

        +
        default DoubleArbitrary between(double min,
        +                                double max)
        +
        Set the allowed lower min (included) and upper max (included) border of generated numbers.
        +
        +
        Parameters:
        +
        min - The lower border of possible values
        +
        max - The upper border of possible values
        +
        +
      • +
      + + + +
        +
      • +

        between

        +
        DoubleArbitrary between(double min,
        +                        boolean minIncluded,
        +                        double max,
        +                        boolean maxIncluded)
        +
        Set the allowed lower min (included) and upper max (included) border of generated numbers. + Specify if borders should be included in allowed values or not.
        +
        +
        Parameters:
        +
        min - The lower border of possible values
        +
        minIncluded - Should the lower border be included
        +
        max - The upper border of possible values
        +
        maxIncluded - Should the upper border be included
        +
        +
      • +
      + + + +
        +
      • +

        greaterOrEqual

        +
        DoubleArbitrary greaterOrEqual(double min)
        +
        Set the allowed lower min (included) border of generated numbers.
        +
        +
        Parameters:
        +
        min - The lower border of possible values
        +
        +
      • +
      + + + +
        +
      • +

        greaterThan

        +
        @API(status=MAINTAINED,
        +     since="1.2.7")
        +DoubleArbitrary greaterThan(double min)
        +
        Set the allowed lower min (excluded) border of generated numbers.
        +
        +
        Parameters:
        +
        min - The lower border of possible values
        +
        +
      • +
      + + + +
        +
      • +

        lessOrEqual

        +
        DoubleArbitrary lessOrEqual(double max)
        +
        Set the allowed upper max (included) border of generated numbers.
        +
        +
        Parameters:
        +
        max - The upper border of possible values
        +
        +
      • +
      + + + +
        +
      • +

        lessThan

        +
        @API(status=MAINTAINED,
        +     since="1.2.7")
        +DoubleArbitrary lessThan(double max)
        +
        Set the allowed upper max (excluded) border of generated numbers.
        +
        +
        Parameters:
        +
        max - The upper border of possible values
        +
        +
      • +
      + + + +
        +
      • +

        ofScale

        +
        DoubleArbitrary ofScale(int scale)
        +
        Set the scale (maximum number of decimal places) to scale.
        +
      • +
      + + + +
        +
      • +

        shrinkTowards

        +
        @API(status=EXPERIMENTAL,
        +     since="1.1.5")
        +DoubleArbitrary shrinkTowards(double target)
        +
        Set shrinking target to target which must be between the allowed bounds.
        +
        +
        Parameters:
        +
        target - The value which is considered to be the most simple value for shrinking
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/FloatArbitrary.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/FloatArbitrary.html new file mode 100644 index 000000000..446a9ea27 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/FloatArbitrary.html @@ -0,0 +1,413 @@ + + + + + +FloatArbitrary (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.arbitraries
+

Interface FloatArbitrary

+
+
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        between

        +
        default FloatArbitrary between(float min,
        +                               float max)
        +
        Set the allowed lower min (included) and upper max (included) border of generated numbers.
        +
        +
        Parameters:
        +
        min - The lower border of possible values
        +
        max - The upper border of possible values
        +
        +
      • +
      + + + +
        +
      • +

        between

        +
        FloatArbitrary between(float min,
        +                       boolean minIncluded,
        +                       float max,
        +                       boolean maxIncluded)
        +
        Set the allowed lower min (included) and upper max (included) border of generated numbers. + Specify if borders should be included in allowed values or not.
        +
        +
        Parameters:
        +
        min - The lower border of possible values
        +
        minIncluded - Should the lower border be included
        +
        max - The upper border of possible values
        +
        maxIncluded - Should the upper border be included
        +
        +
      • +
      + + + +
        +
      • +

        greaterOrEqual

        +
        FloatArbitrary greaterOrEqual(float min)
        +
        Set the allowed lower min (included) border of generated numbers.
        +
        +
        Parameters:
        +
        min - The lower border of possible values
        +
        +
      • +
      + + + +
        +
      • +

        greaterThan

        +
        @API(status=MAINTAINED,
        +     since="1.2.7")
        +FloatArbitrary greaterThan(float min)
        +
        Set the allowed lower min (excluded) border of generated numbers.
        +
        +
        Parameters:
        +
        min - The lower border of possible values
        +
        +
      • +
      + + + +
        +
      • +

        lessOrEqual

        +
        FloatArbitrary lessOrEqual(float max)
        +
        Set the allowed upper max (included) border of generated numbers.
        +
        +
        Parameters:
        +
        max - The upper border of possible values
        +
        +
      • +
      + + + +
        +
      • +

        lessThan

        +
        @API(status=MAINTAINED,
        +     since="1.2.7")
        +FloatArbitrary lessThan(float max)
        +
        Set the allowed upper max (excluded) border of generated numbers.
        +
        +
        Parameters:
        +
        max - The upper border of possible values
        +
        +
      • +
      + + + +
        +
      • +

        ofScale

        +
        FloatArbitrary ofScale(int scale)
        +
        Set the scale (maximum number of decimal places) to scale.
        +
      • +
      + + + +
        +
      • +

        shrinkTowards

        +
        @API(status=EXPERIMENTAL,
        +     since="1.1.5")
        +FloatArbitrary shrinkTowards(float target)
        +
        Set shrinking target to target which must be between the allowed bounds.
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/FunctionArbitrary.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/FunctionArbitrary.html new file mode 100644 index 000000000..1995ed01b --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/FunctionArbitrary.html @@ -0,0 +1,265 @@ + + + + + +FunctionArbitrary (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.arbitraries
+

Interface FunctionArbitrary<F,R>

+
+
+
+
    +
  • +
    +
    Type Parameters:
    +
    F - The exact functional type to generate
    +
    R - The return type of the functional interface
    +
    +
    +
    All Superinterfaces:
    +
    Arbitrary<F>
    +
    +
    +
    +
    @API(status=MAINTAINED,
    +     since="1.3.0")
    +public interface FunctionArbitrary<F,R>
    +extends Arbitrary<F>
    +
    Fluent interface to configure arbitraries that represent functional types
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        when

        +
        <F_> FunctionArbitrary<F_,R> when(java.util.function.Predicate<java.util.List<java.lang.Object>> parameterCondition,
        +                                  java.util.function.Function<java.util.List<java.lang.Object>,R> answer)
        +
        +
        Type Parameters:
        +
        F_ - The exact functional type to generate. Must be same as F
        +
        Parameters:
        +
        parameterCondition - A predicate that's true when for the given list of parameters + answer should be used to produce the function' result
        +
        answer - A function that produces a concrete answer or throws an exception
        +
        Returns:
        +
        A new instance of function arbitrary
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/IntegerArbitrary.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/IntegerArbitrary.html new file mode 100644 index 000000000..1c576532c --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/IntegerArbitrary.html @@ -0,0 +1,310 @@ + + + + + +IntegerArbitrary (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.arbitraries
+

Interface IntegerArbitrary

+
+
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        between

        +
        default IntegerArbitrary between(int min,
        +                                 int max)
        +
        Set the allowed lower min (included) and upper max (included) bounder of generated numbers.
        +
      • +
      + + + +
        +
      • +

        greaterOrEqual

        +
        IntegerArbitrary greaterOrEqual(int min)
        +
        Set the allowed lower min (included) bounder of generated numbers.
        +
      • +
      + + + +
        +
      • +

        lessOrEqual

        +
        IntegerArbitrary lessOrEqual(int max)
        +
        Set the allowed upper max (included) bounder of generated numbers.
        +
      • +
      + + + +
        +
      • +

        shrinkTowards

        +
        @API(status=EXPERIMENTAL,
        +     since="1.1.4")
        +IntegerArbitrary shrinkTowards(int target)
        +
        Set shrinking target to target which must be between the allowed bounds.
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/LongArbitrary.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/LongArbitrary.html new file mode 100644 index 000000000..a296eb048 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/LongArbitrary.html @@ -0,0 +1,310 @@ + + + + + +LongArbitrary (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.arbitraries
+

Interface LongArbitrary

+
+
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        between

        +
        default LongArbitrary between(long min,
        +                              long max)
        +
        Set the allowed lower min (included) and upper max (included) bounds of generated numbers.
        +
      • +
      + + + +
        +
      • +

        greaterOrEqual

        +
        LongArbitrary greaterOrEqual(long min)
        +
        Set the allowed lower min (included) bound of generated numbers.
        +
      • +
      + + + +
        +
      • +

        lessOrEqual

        +
        LongArbitrary lessOrEqual(long max)
        +
        Set the allowed upper max (included) bound of generated numbers.
        +
      • +
      + + + +
        +
      • +

        shrinkTowards

        +
        @API(status=EXPERIMENTAL,
        +     since="1.1.4")
        +LongArbitrary shrinkTowards(long target)
        +
        Set shrinking target to target which must be between the allowed bounds.
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/NumericalArbitrary.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/NumericalArbitrary.html new file mode 100644 index 000000000..feeee43f7 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/NumericalArbitrary.html @@ -0,0 +1,265 @@ + + + + + +NumericalArbitrary (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.arbitraries
+

Interface NumericalArbitrary<T,A extends NumericalArbitrary<T,A>>

+
+
+
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/ShortArbitrary.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/ShortArbitrary.html new file mode 100644 index 000000000..c4d245c13 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/ShortArbitrary.html @@ -0,0 +1,310 @@ + + + + + +ShortArbitrary (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.arbitraries
+

Interface ShortArbitrary

+
+
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        between

        +
        default ShortArbitrary between(short min,
        +                               short max)
        +
        Set the allowed lower min (included) and upper max (included) bounder of generated numbers.
        +
      • +
      + + + +
        +
      • +

        greaterOrEqual

        +
        ShortArbitrary greaterOrEqual(short min)
        +
        Set the allowed lower min (included) bounder of generated numbers.
        +
      • +
      + + + +
        +
      • +

        lessOrEqual

        +
        ShortArbitrary lessOrEqual(short max)
        +
        Set the allowed upper max (included) bounder of generated numbers.
        +
      • +
      + + + +
        +
      • +

        shrinkTowards

        +
        @API(status=EXPERIMENTAL,
        +     since="1.1.4")
        +Arbitrary<java.lang.Short> shrinkTowards(short target)
        +
        Set shrinking target to target which must be between the allowed bounds.
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/SizableArbitrary.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/SizableArbitrary.html new file mode 100644 index 000000000..898da1691 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/SizableArbitrary.html @@ -0,0 +1,287 @@ + + + + + +SizableArbitrary (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.arbitraries
+

Interface SizableArbitrary<U>

+
+
+
+
    +
  • +
    +
    All Superinterfaces:
    +
    Arbitrary<U>
    +
    +
    +
    All Known Subinterfaces:
    +
    ActionSequenceArbitrary<M>, StreamableArbitrary<T,U>
    +
    +
    +
    +
    @API(status=MAINTAINED,
    +     since="1.0")
    +public interface SizableArbitrary<U>
    +extends Arbitrary<U>
    +
    Fluent interface to configure arbitraries that have size constraints for generated values, e.g. collections and arrays.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        ofSize

        +
        default SizableArbitrary<U> ofSize(int size)
        +
        Fix the size to size.
        +
      • +
      + + + +
        +
      • +

        ofMinSize

        +
        SizableArbitrary<U> ofMinSize(int minSize)
        +
        Set lower size boundary minSize (included).
        +
      • +
      + + + +
        +
      • +

        ofMaxSize

        +
        SizableArbitrary<U> ofMaxSize(int maxSize)
        +
        Set upper size boundary maxSize (included).
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/StreamableArbitrary.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/StreamableArbitrary.html new file mode 100644 index 000000000..e78f056bd --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/StreamableArbitrary.html @@ -0,0 +1,327 @@ + + + + + +StreamableArbitrary (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.arbitraries
+

Interface StreamableArbitrary<T,U>

+
+
+
+
    +
  • +
    +
    All Superinterfaces:
    +
    Arbitrary<U>, SizableArbitrary<U>
    +
    +
    +
    +
    @API(status=EXPERIMENTAL,
    +     since="1.2.1")
    +public interface StreamableArbitrary<T,U>
    +extends SizableArbitrary<U>
    +
    Fluent interface to add functionality to arbitraries whose generation artefacts + can be streamed, e.g. List, Set, Stream and Arrays
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + + + +
        +
      • +

        reduce

        +
        <R> Arbitrary<R> reduce(R initial,
        +                        java.util.function.BiFunction<R,T,R> accumulator)
        +
        Given an initial argument use accumulator to produce + the final result.
        +
        +
        Type Parameters:
        +
        R - The result type
        +
        Parameters:
        +
        initial - The initial argument. Also the result if streamable is empty
        +
        accumulator - The function used to reduce a streamable into a result one by one
        +
        Returns:
        +
        The result of accumulating all elements in streamable
        +
        +
      • +
      + + + + + + + + + + + + +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/StringArbitrary.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/StringArbitrary.html new file mode 100644 index 000000000..82efd2aad --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/StringArbitrary.html @@ -0,0 +1,453 @@ + + + + + +StringArbitrary (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.arbitraries
+

Interface StringArbitrary

+
+
+
+
    +
  • +
    +
    All Superinterfaces:
    +
    Arbitrary<java.lang.String>
    +
    +
    +
    +
    @API(status=MAINTAINED,
    +     since="1.0")
    +public interface StringArbitrary
    +extends Arbitrary<java.lang.String>
    +
    Fluent interface to configure arbitraries that generate String values.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        ofMaxLength

        +
        StringArbitrary ofMaxLength(int maxLength)
        +
        Set the maximum allowed length maxLength (included) of generated strings.
        +
      • +
      + + + +
        +
      • +

        ofMinLength

        +
        StringArbitrary ofMinLength(int minLength)
        +
        Set the minimum allowed length mixLength (included) of generated strings.
        +
      • +
      + + + +
        +
      • +

        ofLength

        +
        default StringArbitrary ofLength(int length)
        +
        Fix the length to length of generated strings.
        +
      • +
      + + + +
        +
      • +

        withChars

        +
        StringArbitrary withChars(char... chars)
        +
        Allow all chars in chars to show up in generated strings. + + Can be combined with other methods that allow chars.
        +
      • +
      + + + +
        +
      • +

        withChars

        +
        @API(status=MAINTAINED,
        +     since="1.2.1")
        +StringArbitrary withChars(java.lang.CharSequence chars)
        +
        Allow all chars in chars to show up in generated strings. + + Can be combined with other methods that allow chars.
        +
      • +
      + + + +
        +
      • +

        withChars

        +
        @API(status=EXPERIMENTAL,
        +     since="1.3.0")
        +StringArbitrary withChars(Arbitrary<java.lang.Character> characterArbitrary)
        +
        Allow all chars generated by characterArbitrary. + + Can be combined with other methods that allow chars.
        +
      • +
      + + + +
        +
      • +

        withCharRange

        +
        StringArbitrary withCharRange(char from,
        +                              char to)
        +
        Allow all chars within from (included) and to (included) to show up in generated strings. + + Can be combined with other methods that allow chars.
        +
      • +
      + + + +
        +
      • +

        ascii

        +
        StringArbitrary ascii()
        +
        Allow all ascii chars to show up in generated strings. + + Can be combined with other methods that allow chars.
        +
      • +
      + + + +
        +
      • +

        alpha

        +
        StringArbitrary alpha()
        +
        Allow all alpha chars to show up in generated strings. + + Can be combined with other methods that allow chars.
        +
      • +
      + + + +
        +
      • +

        numeric

        +
        StringArbitrary numeric()
        +
        Allow all numeric chars (digits) to show up in generated strings. + + Can be combined with other methods that allow chars.
        +
      • +
      + + + +
        +
      • +

        whitespace

        +
        StringArbitrary whitespace()
        +
        Allow all chars that will return true for + Character.isWhitespace(char). + + Can be combined with other methods that allow chars.
        +
      • +
      + + + +
        +
      • +

        all

        +
        StringArbitrary all()
        +
        Allow all unicode chars even noncharacters and private use characters + but only in plane 0 (aka Basic Multilingual Plane)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/TypeArbitrary.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/TypeArbitrary.html new file mode 100644 index 000000000..57c710253 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/TypeArbitrary.html @@ -0,0 +1,408 @@ + + + + + +TypeArbitrary (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.arbitraries
+

Interface TypeArbitrary<T>

+
+
+
+
    +
  • +
    +
    All Superinterfaces:
    +
    Arbitrary<T>
    +
    +
    +
    +
    @API(status=MAINTAINED,
    +     since="1.2")
    +public interface TypeArbitrary<T>
    +extends Arbitrary<T>
    +
    Fluent interface to configure arbitraries that try to generate instances + of a given type T from the type's available constructors and factory methods. + +

    + When constructors and factory methods have parameters those parameters will be resolved + by searching for matching registered arbitrary providers. + The searching is performed either globally or in the property method's specified + domain contexts. +

    +
    +
    See Also:
    +
    Domain, +DomainContext
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        use

        +
        TypeArbitrary<T> use(java.lang.reflect.Executable creator)
        +
        Add another creator (function or constructor) to be used + for generating values of type T
        +
        +
        Parameters:
        +
        creator - The static function or constructor
        +
        Returns:
        +
        the same arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        usePublicConstructors

        +
        TypeArbitrary<T> usePublicConstructors()
        +
        Add public constructors of class T to be used + for generating values of type T
        +
        +
        Returns:
        +
        the same arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        useAllConstructors

        +
        TypeArbitrary<T> useAllConstructors()
        +
        Add all constructors (public, private or package scope) of class T to be used + for generating values of type T
        +
        +
        Returns:
        +
        the same arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        useConstructors

        +
        TypeArbitrary<T> useConstructors(java.util.function.Predicate<? super java.lang.reflect.Constructor<?>> filter)
        +
        Add all constructors (public, private or package scope) of class T to be used + for generating values of type T
        +
        +
        Parameters:
        +
        filter - Predicate to add only those constructors for which the predicate returns true
        +
        Returns:
        +
        the same arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        usePublicFactoryMethods

        +
        TypeArbitrary<T> usePublicFactoryMethods()
        +
        Add public factory methods (static methods with return type T) + of class T to be used for generating values of type T
        +
        +
        Returns:
        +
        the same arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        useAllFactoryMethods

        +
        TypeArbitrary<T> useAllFactoryMethods()
        +
        Add all factory methods (static methods with return type T) + of class T to be used for generating values of type T
        +
        +
        Returns:
        +
        the same arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        useFactoryMethods

        +
        TypeArbitrary<T> useFactoryMethods(java.util.function.Predicate<java.lang.reflect.Method> filter)
        +
        Add all factory methods (static methods with return type T) + of class T to be used for generating values of type T
        +
        +
        Parameters:
        +
        filter - Predicate to add only those factory methods for which the predicate returns true
        +
        Returns:
        +
        the same arbitrary instance
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/package-frame.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/package-frame.html new file mode 100644 index 000000000..53c8eb29b --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/package-frame.html @@ -0,0 +1,33 @@ + + + + + +net.jqwik.api.arbitraries (documentation 1.3.0 API) + + + + +

net.jqwik.api.arbitraries

+
+

Interfaces

+ +
+ + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/package-summary.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/package-summary.html new file mode 100644 index 000000000..b1515fd55 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/package-summary.html @@ -0,0 +1,225 @@ + + + + + +net.jqwik.api.arbitraries (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + +
+

Package net.jqwik.api.arbitraries

+
+
+ +
+ +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/package-tree.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/package-tree.html new file mode 100644 index 000000000..6b4e90c97 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/package-tree.html @@ -0,0 +1,154 @@ + + + + + +net.jqwik.api.arbitraries Class Hierarchy (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + +
+

Hierarchy For Package net.jqwik.api.arbitraries

+Package Hierarchies: + +
+
+

Interface Hierarchy

+ +
+ +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/configurators/ArbitraryConfigurationException.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/configurators/ArbitraryConfigurationException.html new file mode 100644 index 000000000..fdff9efa7 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/configurators/ArbitraryConfigurationException.html @@ -0,0 +1,231 @@ + + + + + +ArbitraryConfigurationException (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.configurators
+

Class ArbitraryConfigurationException

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable
    +
    +
    +
    +
    @API(status=MAINTAINED,
    +     since="1.0")
    +public class ArbitraryConfigurationException
    +extends JqwikException
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Throwable

        +addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/configurators/ArbitraryConfigurator.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/configurators/ArbitraryConfigurator.html new file mode 100644 index 000000000..3026b6d4d --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/configurators/ArbitraryConfigurator.html @@ -0,0 +1,287 @@ + + + + + +ArbitraryConfigurator (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.configurators
+

Interface ArbitraryConfigurator

+
+
+
+
    +
  • +
    +
    All Superinterfaces:
    +
    java.lang.Comparable<ArbitraryConfigurator>
    +
    +
    +
    All Known Implementing Classes:
    +
    ArbitraryConfiguratorBase
    +
    +
    +
    +
    @API(status=MAINTAINED,
    +     since="1.0")
    +public interface ArbitraryConfigurator
    +extends java.lang.Comparable<ArbitraryConfigurator>
    +
    Implementors can modify any arbitrary before it's being used for value generation. + Most implementations use ArbitraryConfiguratorBase to derive from + +

    + Implementations must be registered in /META-INF/services/net.jqwik.api.configurators.ArbitraryConfigurator + so that they will be automatically considered for arbitrary configuration. +

    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        configure

        +
        <T> Arbitrary<T> configure(Arbitrary<T> arbitrary,
        +                           TypeUsage targetType)
        +
        Configure a given arbitrary and return the configured instance.
        +
        +
        Parameters:
        +
        arbitrary - The arbitrary instance to be configured
        +
        targetType - The type of the object to be generated by the arbitrary
        +
        Returns:
        +
        the newly configured arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        order

        +
        default int order()
        +
        Determines the order in which a configurator will be applied in regards to other configurators. + Default value is 100. Use lower values to enforce earlier application and + higher values for later application.
        +
        +
        Returns:
        +
        the order
        +
        +
      • +
      + + + + +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/configurators/ArbitraryConfiguratorBase.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/configurators/ArbitraryConfiguratorBase.html new file mode 100644 index 000000000..e73a15995 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/configurators/ArbitraryConfiguratorBase.html @@ -0,0 +1,333 @@ + + + + + +ArbitraryConfiguratorBase (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.configurators
+

Class ArbitraryConfiguratorBase

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ArbitraryConfiguratorBase

        +
        public ArbitraryConfiguratorBase()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        configure

        +
        public <T> Arbitrary<T> configure(Arbitrary<T> arbitrary,
        +                                  TypeUsage targetType)
        +
        Description copied from interface: ArbitraryConfigurator
        +
        Configure a given arbitrary and return the configured instance.
        +
        +
        Specified by:
        +
        configure in interface ArbitraryConfigurator
        +
        Parameters:
        +
        arbitrary - The arbitrary instance to be configured
        +
        targetType - The type of the object to be generated by the arbitrary
        +
        Returns:
        +
        the newly configured arbitrary instance
        +
        +
      • +
      + + + +
        +
      • +

        acceptTargetType

        +
        protected boolean acceptTargetType(TypeUsage targetType)
        +
        Override if configurator only works for certain types of domain objects
        +
        +
        Parameters:
        +
        targetType - The concrete domain type to be generated
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/configurators/SelfConfiguringArbitrary.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/configurators/SelfConfiguringArbitrary.html new file mode 100644 index 000000000..bef8fbdad --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/configurators/SelfConfiguringArbitrary.html @@ -0,0 +1,269 @@ + + + + + +SelfConfiguringArbitrary (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.configurators
+

Interface SelfConfiguringArbitrary<T>

+
+
+
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/configurators/package-frame.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/configurators/package-frame.html new file mode 100644 index 000000000..e601bc6c6 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/configurators/package-frame.html @@ -0,0 +1,28 @@ + + + + + +net.jqwik.api.configurators (documentation 1.3.0 API) + + + + +

net.jqwik.api.configurators

+
+

Interfaces

+ +

Classes

+ +

Exceptions

+ +
+ + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/configurators/package-summary.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/configurators/package-summary.html new file mode 100644 index 000000000..a76a5f7e8 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/configurators/package-summary.html @@ -0,0 +1,186 @@ + + + + + +net.jqwik.api.configurators (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + +
+

Package net.jqwik.api.configurators

+
+
+ +
+ +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/configurators/package-tree.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/configurators/package-tree.html new file mode 100644 index 000000000..fca9881ee --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/configurators/package-tree.html @@ -0,0 +1,160 @@ + + + + + +net.jqwik.api.configurators Class Hierarchy (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + +
+

Hierarchy For Package net.jqwik.api.configurators

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Interface Hierarchy

+ +
+ +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/AlphaChars.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/AlphaChars.html new file mode 100644 index 000000000..d8863e0b2 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/AlphaChars.html @@ -0,0 +1,177 @@ + + + + + +AlphaChars (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.constraints
+

Annotation Type AlphaChars

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,PARAMETER,TYPE_USE})
    + @Retention(value=RUNTIME)
    + @LowerChars
    + @UpperChars
    + @Documented
    + @API(status=MAINTAINED,
    +     since="1.0")
    +public @interface AlphaChars
    +
    Constrain the chars used to generate Strings or Characters to upper and lower case chars. + + Applies to String or Character parameters which are also annotated with @ForAll. + + When used with String parameters it can be combined with other char constraining annotations. + In that case the set of possible characters is expanded by each annotation.
    +
    +
    See Also:
    +
    ForAll
    +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/BigRange.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/BigRange.html new file mode 100644 index 000000000..a5b76b5dd --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/BigRange.html @@ -0,0 +1,296 @@ + + + + + +BigRange (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.constraints
+

Annotation Type BigRange

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,PARAMETER,TYPE_USE})
    + @Retention(value=RUNTIME)
    + @Documented
    + @API(status=MAINTAINED,
    +     since="1.0")
    +public @interface BigRange
    +
    Constrain the range of a generated "Big" number. +

    + Applies to BigInteger and BigDecimal parameters which are also annotated with @ForAll. +

    + minIncluded() and maxIncluded() only work for BigDecimal.

    +
    +
    See Also:
    +
    ForAll, +ByteRange, +ShortRange, +IntRange, +LongRange, +FloatRange, +DoubleRange
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Optional Element Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      Optional Elements 
      Modifier and TypeOptional Element and Description
      java.lang.Stringmax 
      booleanmaxIncluded 
      java.lang.Stringmin 
      booleanminIncluded 
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Element Detail

      + + + +
        +
      • +

        min

        +
        public abstract java.lang.String min
        +
        +
        Default:
        +
        ""
        +
        +
      • +
      +
    • +
    +
      +
    • + + +
        +
      • +

        minIncluded

        +
        @API(status=MAINTAINED,
        +     since="1.2.7")
        +public abstract boolean minIncluded
        +
        +
        Default:
        +
        true
        +
        +
      • +
      +
    • +
    +
      +
    • + + +
        +
      • +

        max

        +
        public abstract java.lang.String max
        +
        +
        Default:
        +
        ""
        +
        +
      • +
      +
    • +
    +
      +
    • + + +
        +
      • +

        maxIncluded

        +
        @API(status=MAINTAINED,
        +     since="1.2.7")
        +public abstract boolean maxIncluded
        +
        +
        Default:
        +
        true
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/ByteRange.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/ByteRange.html new file mode 100644 index 000000000..3207fee8c --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/ByteRange.html @@ -0,0 +1,250 @@ + + + + + +ByteRange (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.constraints
+

Annotation Type ByteRange

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,PARAMETER,TYPE_USE})
    + @Retention(value=RUNTIME)
    + @Documented
    + @API(status=MAINTAINED,
    +     since="1.0")
    +public @interface ByteRange
    +
    Constrain the range of a generated byte or Byte parameters. + + Applies to byte or Byte parameters which are also annotated with @ForAll.
    +
    +
    See Also:
    +
    ForAll, +ShortRange, +IntRange, +LongRange, +FloatRange, +DoubleRange, +BigRange
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Optional Element Summary

      + + + + + + + + + + + + + + +
      Optional Elements 
      Modifier and TypeOptional Element and Description
      bytemax 
      bytemin 
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Element Detail

      + + + +
        +
      • +

        min

        +
        public abstract byte min
        +
        +
        Default:
        +
        0
        +
        +
      • +
      +
    • +
    +
      +
    • + + +
        +
      • +

        max

        +
        public abstract byte max
        +
        +
        Default:
        +
        127
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/CharRange.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/CharRange.html new file mode 100644 index 000000000..01a2c5999 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/CharRange.html @@ -0,0 +1,262 @@ + + + + + +CharRange (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.constraints
+

Annotation Type CharRange

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,PARAMETER,TYPE_USE})
    + @Retention(value=RUNTIME)
    + @Repeatable(value=CharRangeList.class)
    + @Documented
    + @API(status=MAINTAINED,
    +     since="1.0")
    +public @interface CharRange
    +
    Constrain the chars used to generate Strings or Characters to chars in the range + from from to to. + + Applies to String or Character parameters which are also annotated with @ForAll. + + When used with String parameters it can be combined with other char constraining annotations. + In that case the set of possible characters is expanded by each annotation.
    +
    +
    See Also:
    +
    ForAll, +Chars
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Required Element Summary

      + + + + + + + + + + +
      Required Elements 
      Modifier and TypeRequired Element and Description
      charto 
      +
    • +
    + +
      +
    • + + +

      Optional Element Summary

      + + + + + + + + + + +
      Optional Elements 
      Modifier and TypeOptional Element and Description
      charfrom 
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Element Detail

      + + + +
        +
      • +

        to

        +
        public abstract char to
        +
      • +
      +
    • +
    + +
      +
    • + + +
        +
      • +

        from

        +
        public abstract char from
        +
        +
        Default:
        +
        0
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/CharRangeList.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/CharRangeList.html new file mode 100644 index 000000000..00d873536 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/CharRangeList.html @@ -0,0 +1,213 @@ + + + + + +CharRangeList (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.constraints
+

Annotation Type CharRangeList

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,PARAMETER,TYPE_USE})
    + @Retention(value=RUNTIME)
    + @Documented
    + @API(status=MAINTAINED,
    +     since="1.0")
    +public @interface CharRangeList
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Required Element Summary

      + + + + + + + + + + +
      Required Elements 
      Modifier and TypeRequired Element and Description
      CharRange[]value 
      +
    • +
    +
  • +
+
+
+
    +
  • + + +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/Chars.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/Chars.html new file mode 100644 index 000000000..023bdd652 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/Chars.html @@ -0,0 +1,226 @@ + + + + + +Chars (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.constraints
+

Annotation Type Chars

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,PARAMETER,TYPE_USE})
    + @Retention(value=RUNTIME)
    + @Repeatable(value=CharsList.class)
    + @Documented
    + @API(status=MAINTAINED,
    +     since="1.0")
    +public @interface Chars
    +
    Constrain the chars used to generate Strings or Characters to chars + contained in value. + + Applies to String or Character parameters which are also annotated with @ForAll. + + When used with String parameters it can be combined with other char constraining annotations. + In that case the set of possible characters is expanded by each annotation.
    +
    +
    See Also:
    +
    ForAll, +CharRange
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Required Element Summary

      + + + + + + + + + + +
      Required Elements 
      Modifier and TypeRequired Element and Description
      char[]value 
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Element Detail

      + + + +
        +
      • +

        value

        +
        public abstract char[] value
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/CharsList.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/CharsList.html new file mode 100644 index 000000000..9755a1a41 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/CharsList.html @@ -0,0 +1,213 @@ + + + + + +CharsList (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.constraints
+

Annotation Type CharsList

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,PARAMETER,TYPE_USE})
    + @Retention(value=RUNTIME)
    + @Documented
    + @API(status=MAINTAINED,
    +     since="1.0")
    +public @interface CharsList
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Required Element Summary

      + + + + + + + + + + +
      Required Elements 
      Modifier and TypeRequired Element and Description
      Chars[]value 
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Element Detail

      + + + +
        +
      • +

        value

        +
        public abstract Chars[] value
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/DoubleRange.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/DoubleRange.html new file mode 100644 index 000000000..80aa406e1 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/DoubleRange.html @@ -0,0 +1,294 @@ + + + + + +DoubleRange (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.constraints
+

Annotation Type DoubleRange

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,PARAMETER,TYPE_USE})
    + @Retention(value=RUNTIME)
    + @Documented
    + @API(status=MAINTAINED,
    +     since="1.0")
    +public @interface DoubleRange
    +
    Constrain the range of a generated double or Double parameters. + + Applies to double or Double parameters which are also annotated with @ForAll.
    +
    +
    See Also:
    +
    ForAll, +ByteRange, +ShortRange, +IntRange, +LongRange, +FloatRange, +BigRange
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Optional Element Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      Optional Elements 
      Modifier and TypeOptional Element and Description
      doublemax 
      booleanmaxIncluded 
      doublemin 
      booleanminIncluded 
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Element Detail

      + + + +
        +
      • +

        min

        +
        public abstract double min
        +
        +
        Default:
        +
        0.0
        +
        +
      • +
      +
    • +
    +
      +
    • + + +
        +
      • +

        minIncluded

        +
        @API(status=MAINTAINED,
        +     since="1.2.7")
        +public abstract boolean minIncluded
        +
        +
        Default:
        +
        true
        +
        +
      • +
      +
    • +
    +
      +
    • + + +
        +
      • +

        max

        +
        public abstract double max
        +
        +
        Default:
        +
        1.7976931348623157E308
        +
        +
      • +
      +
    • +
    +
      +
    • + + +
        +
      • +

        maxIncluded

        +
        @API(status=MAINTAINED,
        +     since="1.2.7")
        +public abstract boolean maxIncluded
        +
        +
        Default:
        +
        true
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/FloatRange.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/FloatRange.html new file mode 100644 index 000000000..b68ed6e61 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/FloatRange.html @@ -0,0 +1,290 @@ + + + + + +FloatRange (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.constraints
+

Annotation Type FloatRange

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,PARAMETER,TYPE_USE})
    + @Retention(value=RUNTIME)
    + @Documented
    + @API(status=MAINTAINED,
    +     since="1.0")
    +public @interface FloatRange
    +
    Constrain the range of a generated float or Float parameters. + + Applies to float or Float parameters which are also annotated with @ForAll.
    +
    +
    See Also:
    +
    ForAll, +ByteRange, +ShortRange, +IntRange, +LongRange, +DoubleRange, +BigRange
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Optional Element Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      Optional Elements 
      Modifier and TypeOptional Element and Description
      floatmax 
      booleanmaxIncluded 
      floatmin 
      booleanminIncluded 
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Element Detail

      + + + +
        +
      • +

        min

        +
        public abstract float min
        +
        +
        Default:
        +
        0.0f
        +
        +
      • +
      +
    • +
    +
      +
    • + + +
        +
      • +

        minIncluded

        +
        public abstract boolean minIncluded
        +
        +
        Default:
        +
        true
        +
        +
      • +
      +
    • +
    +
      +
    • + + +
        +
      • +

        max

        +
        public abstract float max
        +
        +
        Default:
        +
        3.4028234663852886E38f
        +
        +
      • +
      +
    • +
    +
      +
    • + + +
        +
      • +

        maxIncluded

        +
        public abstract boolean maxIncluded
        +
        +
        Default:
        +
        true
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/IntRange.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/IntRange.html new file mode 100644 index 000000000..412fbdd14 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/IntRange.html @@ -0,0 +1,250 @@ + + + + + +IntRange (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.constraints
+

Annotation Type IntRange

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,PARAMETER,TYPE_USE})
    + @Retention(value=RUNTIME)
    + @Documented
    + @API(status=MAINTAINED,
    +     since="1.0")
    +public @interface IntRange
    +
    Constrain the range of a generated int or Integer parameters. + + Applies to int or Integer parameters which are also annotated with @ForAll.
    +
    +
    See Also:
    +
    ForAll, +ByteRange, +ShortRange, +LongRange, +FloatRange, +DoubleRange, +BigRange
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Optional Element Summary

      + + + + + + + + + + + + + + +
      Optional Elements 
      Modifier and TypeOptional Element and Description
      intmax 
      intmin 
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Element Detail

      + + + +
        +
      • +

        min

        +
        public abstract int min
        +
        +
        Default:
        +
        0
        +
        +
      • +
      +
    • +
    +
      +
    • + + +
        +
      • +

        max

        +
        public abstract int max
        +
        +
        Default:
        +
        2147483647
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/LongRange.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/LongRange.html new file mode 100644 index 000000000..6bfe2d92e --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/LongRange.html @@ -0,0 +1,250 @@ + + + + + +LongRange (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.constraints
+

Annotation Type LongRange

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,PARAMETER,TYPE_USE})
    + @Retention(value=RUNTIME)
    + @Documented
    + @API(status=MAINTAINED,
    +     since="1.0")
    +public @interface LongRange
    +
    Constrain the range of a generated long or BigInteger parameters. + + Applies to long or Long parameters which are also annotated with @ForAll.
    +
    +
    See Also:
    +
    ForAll, +ByteRange, +ShortRange, +IntRange, +FloatRange, +DoubleRange, +BigRange
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Optional Element Summary

      + + + + + + + + + + + + + + +
      Optional Elements 
      Modifier and TypeOptional Element and Description
      longmax 
      longmin 
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Element Detail

      + + + +
        +
      • +

        min

        +
        public abstract long min
        +
        +
        Default:
        +
        0L
        +
        +
      • +
      +
    • +
    +
      +
    • + + +
        +
      • +

        max

        +
        public abstract long max
        +
        +
        Default:
        +
        9223372036854775807L
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/LowerChars.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/LowerChars.html new file mode 100644 index 000000000..e769344fa --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/LowerChars.html @@ -0,0 +1,177 @@ + + + + + +LowerChars (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.constraints
+

Annotation Type LowerChars

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,PARAMETER,TYPE_USE})
    + @Retention(value=RUNTIME)
    + @CharRange(from=97,
    +           to=122)
    + @Documented
    + @API(status=MAINTAINED,
    +     since="1.0")
    +public @interface LowerChars
    +
    Constrain the chars used to generate Strings or Characters to lower case chars. + + Applies to String or Character parameters which are also annotated with @ForAll. + + When used with String parameters it can be combined with other char constraining annotations. + In that case the set of possible characters is expanded by each annotation.
    +
    +
    See Also:
    +
    ForAll
    +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/Negative.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/Negative.html new file mode 100644 index 000000000..7d81581e1 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/Negative.html @@ -0,0 +1,173 @@ + + + + + +Negative (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.constraints
+

Annotation Type Negative

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,PARAMETER,TYPE_USE})
    + @Retention(value=RUNTIME)
    + @Documented
    + @API(status=MAINTAINED,
    +     since="1.0")
    +public @interface Negative
    +
    Constrain the range of a generated number to be less than 0. + + Applies to numeric parameters which are also annotated with @ForAll.
    +
    +
    See Also:
    +
    ForAll, +Positive
    +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/NotEmpty.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/NotEmpty.html new file mode 100644 index 000000000..a16e47ce4 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/NotEmpty.html @@ -0,0 +1,177 @@ + + + + + +NotEmpty (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.constraints
+

Annotation Type NotEmpty

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,PARAMETER,TYPE_USE})
    + @Retention(value=RUNTIME)
    + @Size(min=1)
    + @StringLength(min=1)
    + @Documented
    + @API(status=MAINTAINED,
    +     since="1.0")
    +public @interface NotEmpty
    +
    Constrain the size of generated "sizable" types to be at least 1. + + Applies to String, List, Set, Stream, and arrays which are also annotated with @ForAll. + + Can be combined with @Size(max=XXX) or @StringLength(max=XXX).
    +
    +
    See Also:
    +
    ForAll, +Size
    +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/NumericChars.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/NumericChars.html new file mode 100644 index 000000000..bc170a74f --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/NumericChars.html @@ -0,0 +1,178 @@ + + + + + +NumericChars (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.constraints
+

Annotation Type NumericChars

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,PARAMETER,TYPE_USE})
    + @Retention(value=RUNTIME)
    + @CharRange(from=48,
    +           to=57)
    + @Documented
    + @API(status=MAINTAINED,
    +     since="1.0")
    +public @interface NumericChars
    +
    Constrain the chars used to generate Strings or Characters to digits. + + Applies to String or Character parameters which are also annotated with @ForAll. + + When used with String parameters it can be combined with other char constraining annotations. + In that case the set of possible characters is expanded by each annotation.
    +
    +
    See Also:
    +
    ForAll, +AlphaChars
    +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/Positive.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/Positive.html new file mode 100644 index 000000000..2b5d18dfa --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/Positive.html @@ -0,0 +1,173 @@ + + + + + +Positive (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.constraints
+

Annotation Type Positive

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,PARAMETER,TYPE_USE})
    + @Retention(value=RUNTIME)
    + @Documented
    + @API(status=MAINTAINED,
    +     since="1.0")
    +public @interface Positive
    +
    Constrain the range of a generated number to be greater than 0. + + Applies to numeric parameters which are also annotated with @ForAll.
    +
    +
    See Also:
    +
    ForAll, +Negative
    +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/Scale.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/Scale.html new file mode 100644 index 000000000..2780ecd20 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/Scale.html @@ -0,0 +1,221 @@ + + + + + +Scale (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.constraints
+

Annotation Type Scale

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,PARAMETER,TYPE_USE})
    + @Retention(value=RUNTIME)
    + @Documented
    + @API(status=MAINTAINED,
    +     since="1.0")
    +public @interface Scale
    +
    Use to constrain the maximum number of decimal places when generating decimal numbers. + If this annotation is not present the scale is 2 by default. + + Applies to Float, Double and BigDecimal parameters which are also annotated with @ForAll.
    +
    +
    See Also:
    +
    ForAll
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Required Element Summary

      + + + + + + + + + + +
      Required Elements 
      Modifier and TypeRequired Element and Description
      intvalue 
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Element Detail

      + + + +
        +
      • +

        value

        +
        public abstract int value
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/ShortRange.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/ShortRange.html new file mode 100644 index 000000000..fcb44caf0 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/ShortRange.html @@ -0,0 +1,250 @@ + + + + + +ShortRange (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.constraints
+

Annotation Type ShortRange

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,PARAMETER,TYPE_USE})
    + @Retention(value=RUNTIME)
    + @Documented
    + @API(status=MAINTAINED,
    +     since="1.0")
    +public @interface ShortRange
    +
    Constrain the range of a generated short or Short parameters. + + Applies to short or Short parameters which are also annotated with @ForAll.
    +
    +
    See Also:
    +
    ForAll, +ByteRange, +IntRange, +LongRange, +FloatRange, +DoubleRange, +BigRange
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Optional Element Summary

      + + + + + + + + + + + + + + +
      Optional Elements 
      Modifier and TypeOptional Element and Description
      shortmax 
      shortmin 
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Element Detail

      + + + +
        +
      • +

        min

        +
        public abstract short min
        +
        +
        Default:
        +
        0
        +
        +
      • +
      +
    • +
    +
      +
    • + + +
        +
      • +

        max

        +
        public abstract short max
        +
        +
        Default:
        +
        32767
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/Size.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/Size.html new file mode 100644 index 000000000..001fc25cc --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/Size.html @@ -0,0 +1,264 @@ + + + + + +Size (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.constraints
+

Annotation Type Size

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,PARAMETER,TYPE_USE})
    + @Retention(value=RUNTIME)
    + @Documented
    + @API(status=MAINTAINED,
    +     since="1.0")
    +public @interface Size
    +
    Constrain the size of generated "sizable" types. + + Applies to List, Set, Stream, and arrays which are also annotated with @ForAll.
    +
    +
    See Also:
    +
    ForAll
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Optional Element Summary

      + + + + + + + + + + + + + + + + + + +
      Optional Elements 
      Modifier and TypeOptional Element and Description
      intmax 
      intmin 
      intvalue 
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Element Detail

      + + + +
        +
      • +

        min

        +
        public abstract int min
        +
        +
        Default:
        +
        0
        +
        +
      • +
      +
    • +
    +
      +
    • + + +
        +
      • +

        max

        +
        public abstract int max
        +
        +
        Default:
        +
        0
        +
        +
      • +
      +
    • +
    +
      +
    • + + +
        +
      • +

        value

        +
        public abstract int value
        +
        +
        Default:
        +
        0
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/StringLength.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/StringLength.html new file mode 100644 index 000000000..8d3227b13 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/StringLength.html @@ -0,0 +1,264 @@ + + + + + +StringLength (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.constraints
+

Annotation Type StringLength

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,PARAMETER,TYPE_USE})
    + @Retention(value=RUNTIME)
    + @Documented
    + @API(status=MAINTAINED,
    +     since="1.0")
    +public @interface StringLength
    +
    Constrain the length of generated Strings. + + Applies to String parameters which are also annotated with @ForAll.
    +
    +
    See Also:
    +
    ForAll
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Optional Element Summary

      + + + + + + + + + + + + + + + + + + +
      Optional Elements 
      Modifier and TypeOptional Element and Description
      intmax 
      intmin 
      intvalue 
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Element Detail

      + + + +
        +
      • +

        value

        +
        public abstract int value
        +
        +
        Default:
        +
        0
        +
        +
      • +
      +
    • +
    +
      +
    • + + +
        +
      • +

        min

        +
        public abstract int min
        +
        +
        Default:
        +
        0
        +
        +
      • +
      +
    • +
    +
      +
    • + + +
        +
      • +

        max

        +
        public abstract int max
        +
        +
        Default:
        +
        0
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/Unique.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/Unique.html new file mode 100644 index 000000000..f26f0b336 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/Unique.html @@ -0,0 +1,174 @@ + + + + + +Unique (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.constraints
+

Annotation Type Unique

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,PARAMETER,TYPE_USE})
    + @Retention(value=RUNTIME)
    + @Documented
    + @API(status=MAINTAINED,
    +     since="1.0")
    +public @interface Unique
    +
    Make a generated value to be unique withing the same try. + +

    + Applies to any embedded types of a parameter that is annotated with @ForAll. +

    +
    +
    See Also:
    +
    ForAll
    +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/UpperChars.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/UpperChars.html new file mode 100644 index 000000000..d83fe07b7 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/UpperChars.html @@ -0,0 +1,179 @@ + + + + + +UpperChars (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.constraints
+

Annotation Type UpperChars

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,PARAMETER,TYPE_USE})
    + @Retention(value=RUNTIME)
    + @CharRange(from=65,
    +           to=90)
    + @Documented
    + @API(status=MAINTAINED,
    +     since="1.0")
    +public @interface UpperChars
    +
    Constrain the chars used to generate Strings or Characters to upper and lower case chars. + + Applies to String or Character parameters which are also annotated with @ForAll. + + When used with String parameters it can be combined with other char constraining annotations. + In that case the set of possible characters is expanded by each annotation.
    +
    +
    See Also:
    +
    ForAll, +LowerChars, +AlphaChars
    +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/UseType.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/UseType.html new file mode 100644 index 000000000..45b6b9382 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/UseType.html @@ -0,0 +1,233 @@ + + + + + +UseType (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.constraints
+

Annotation Type UseType

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,PARAMETER})
    + @Retention(value=RUNTIME)
    + @Documented
    + @API(status=MAINTAINED,
    +     since="1.2")
    +public @interface UseType
    +
    Generate a value from the annotated class' or type's constructors or factory methods. + +

    + Applies to any parameter that is annotated with @ForAll. + Only the raw type of a parameter is considered. + Parameterized and generic types are forbidden. +

    + +

    + If no value is given, the default is to use public constructors and + factory methods from the annotated type. +

    +
    +
    See Also:
    +
    ForAll
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Optional Element Summary

      + + + + + + + + + + +
      Optional Elements 
      Modifier and TypeOptional Element and Description
      UseTypeMode[]value 
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Element Detail

      + + + +
        +
      • +

        value

        +
        public abstract UseTypeMode[] value
        +
        +
        Default:
        +
        {}
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/UseTypeMode.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/UseTypeMode.html new file mode 100644 index 000000000..e4bcac534 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/UseTypeMode.html @@ -0,0 +1,379 @@ + + + + + +UseTypeMode (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.constraints
+

Enum UseTypeMode

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, java.lang.Comparable<UseTypeMode>
    +
    +
    +
    +
    @API(status=MAINTAINED,
    +     since="1.2")
    +public enum UseTypeMode
    +extends java.lang.Enum<UseTypeMode>
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Enum Constant Detail

      + + + +
        +
      • +

        CONSTRUCTORS

        +
        public static final UseTypeMode CONSTRUCTORS
        +
      • +
      + + + +
        +
      • +

        FACTORIES

        +
        public static final UseTypeMode FACTORIES
        +
      • +
      + + + +
        +
      • +

        PUBLIC_CONSTRUCTORS

        +
        public static final UseTypeMode PUBLIC_CONSTRUCTORS
        +
      • +
      + + + +
        +
      • +

        PUBLIC_FACTORIES

        +
        public static final UseTypeMode PUBLIC_FACTORIES
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static UseTypeMode[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (UseTypeMode c : UseTypeMode.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static UseTypeMode valueOf(java.lang.String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        +
        java.lang.NullPointerException - if the argument is null
        +
        +
      • +
      + + + + +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/Whitespace.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/Whitespace.html new file mode 100644 index 000000000..11aaeb9be --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/Whitespace.html @@ -0,0 +1,177 @@ + + + + + +Whitespace (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.constraints
+

Annotation Type Whitespace

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,PARAMETER,TYPE_USE})
    + @Retention(value=RUNTIME)
    + @Documented
    + @API(status=MAINTAINED,
    +     since="1.0")
    +public @interface Whitespace
    +
    Constrain the chars used to generate Strings or Characters to chars + that will return true for Character.isWhitespace(char). + + Applies to String or Character parameters which are also annotated with @ForAll. + + When used with String parameters it can be combined with other char constraining annotations. + In that case the set of possible characters is expanded by each annotation.
    +
    +
    See Also:
    +
    ForAll, +Chars
    +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/WithNull.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/WithNull.html new file mode 100644 index 000000000..596ae8328 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/WithNull.html @@ -0,0 +1,226 @@ + + + + + +WithNull (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.constraints
+

Annotation Type WithNull

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,PARAMETER,TYPE_USE})
    + @Retention(value=RUNTIME)
    + @Documented
    + @API(status=MAINTAINED,
    +     since="1.0")
    +public @interface WithNull
    +
    Allows jqwik to inject null parameters into generated values. + + Applies to any parameter which is also annotated with @ForAll. + + value specifies the probability between 0 and 1.0 to use for injecting null values.
    +
    +
    See Also:
    +
    ForAll
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Optional Element Summary

      + + + + + + + + + + +
      Optional Elements 
      Modifier and TypeOptional Element and Description
      doublevalue 
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Element Detail

      + + + +
        +
      • +

        value

        +
        public abstract double value
        +
        +
        Default:
        +
        0.1
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/package-frame.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/package-frame.html new file mode 100644 index 000000000..7c9628654 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/package-frame.html @@ -0,0 +1,47 @@ + + + + + +net.jqwik.api.constraints (documentation 1.3.0 API) + + + + +

net.jqwik.api.constraints

+
+

Enums

+ +

Annotation Types

+ +
+ + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/package-summary.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/package-summary.html new file mode 100644 index 000000000..75f18546a --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/package-summary.html @@ -0,0 +1,299 @@ + + + + + +net.jqwik.api.constraints (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + +
+

Package net.jqwik.api.constraints

+
+
+ +
+ +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/package-tree.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/package-tree.html new file mode 100644 index 000000000..d2aeffa21 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/constraints/package-tree.html @@ -0,0 +1,166 @@ + + + + + +net.jqwik.api.constraints Class Hierarchy (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + +
+

Hierarchy For Package net.jqwik.api.constraints

+Package Hierarchies: + +
+
+

Annotation Type Hierarchy

+ +

Enum Hierarchy

+ +
+ +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/domains/AbstractDomainContextBase.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/domains/AbstractDomainContextBase.html new file mode 100644 index 000000000..e1598bf1a --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/domains/AbstractDomainContextBase.html @@ -0,0 +1,396 @@ + + + + + +AbstractDomainContextBase (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.domains
+

Class AbstractDomainContextBase

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    DomainContext
    +
    +
    +
    +
    @API(status=EXPERIMENTAL,
    +     since="1.1")
    +public abstract class AbstractDomainContextBase
    +extends java.lang.Object
    +implements DomainContext
    +
    Subclass for easier implementation of DomainContext
    +
    +
    See Also:
    +
    DomainContext
    +
    +
  • +
+
+
+ +
+
+ +
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/domains/Domain.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/domains/Domain.html new file mode 100644 index 000000000..b50615d92 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/domains/Domain.html @@ -0,0 +1,296 @@ + + + + + +Domain (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.domains
+

Annotation Type Domain

+
+
+
+
    +
  • +
    +
    +
    @Target(value={METHOD,TYPE,ANNOTATION_TYPE})
    + @Retention(value=RUNTIME)
    + @Documented
    + @Repeatable(value=DomainList.class)
    + @API(status=MAINTAINED,
    +     since="1.2.0")
    +public @interface Domain
    +
    Use @Domain(MyDomainContext.class) to use only + arbitrary providers and + arbitrary configurators + defined in given context class +

    + You can have many domains on the same element. Providers and configurators + from all domains will be considered. +

    + The priority of ArbitraryProviders and ArbitraryConfigurators can be changed + using priority

    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      + + + + + + + + + + +
      Fields 
      Modifier and TypeFields and Description
      static intPRIORITY_NOT_SET 
      +
    • +
    + +
      +
    • + + +

      Required Element Summary

      + + + + + + + + + + +
      Required Elements 
      Modifier and TypeRequired Element and Description
      java.lang.Class<? extends DomainContext>value 
      +
    • +
    + +
      +
    • + + +

      Optional Element Summary

      + + + + + + + + + + +
      Optional Elements 
      Modifier and TypeOptional Element and Description
      intpriority 
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        PRIORITY_NOT_SET

        +
        public static final int PRIORITY_NOT_SET
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Element Detail

      + + + +
        +
      • +

        value

        +
        public abstract java.lang.Class<? extends DomainContext> value
        +
      • +
      +
    • +
    + +
      +
    • + + +
        +
      • +

        priority

        +
        public abstract int priority
        +
        +
        Default:
        +
        -2147483648
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/domains/DomainContext.DomainContextFacade.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/domains/DomainContext.DomainContextFacade.html new file mode 100644 index 000000000..04d623203 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/domains/DomainContext.DomainContextFacade.html @@ -0,0 +1,273 @@ + + + + + +DomainContext.DomainContextFacade (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.domains
+

Class DomainContext.DomainContextFacade

+
+
+ +
+
    +
  • +
    +
    Enclosing interface:
    +
    DomainContext
    +
    +
    +
    +
    @API(status=INTERNAL)
    +public abstract static class DomainContext.DomainContextFacade
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethod and Description
      abstract DomainContextglobal() 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        DomainContextFacade

        +
        public DomainContextFacade()
        +
      • +
      +
    • +
    + + +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/domains/DomainContext.Global.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/domains/DomainContext.Global.html new file mode 100644 index 000000000..e6f6c22d4 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/domains/DomainContext.Global.html @@ -0,0 +1,322 @@ + + + + + +DomainContext.Global (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.domains
+

Class DomainContext.Global

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    DomainContext
    +
    +
    +
    Enclosing interface:
    +
    DomainContext
    +
    +
    +
    +
    @API(status=MAINTAINED,
    +     since="1.1")
    +public static class DomainContext.Global
    +extends java.lang.Object
    +implements DomainContext
    +
  • +
+
+
+ +
+
+ +
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/domains/DomainContext.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/domains/DomainContext.html new file mode 100644 index 000000000..90dfac098 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/domains/DomainContext.html @@ -0,0 +1,298 @@ + + + + + +DomainContext (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.domains
+

Interface DomainContext

+
+
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + + + + + +
        +
      • +

        setDefaultPriority

        +
        default void setDefaultPriority(int priority)
        +
      • +
      + + + +
        +
      • +

        getArbitraryProviders

        +
        java.util.List<ArbitraryProvider> getArbitraryProviders()
        +
      • +
      + + + + +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/domains/DomainList.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/domains/DomainList.html new file mode 100644 index 000000000..ddf44746a --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/domains/DomainList.html @@ -0,0 +1,213 @@ + + + + + +DomainList (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.domains
+

Annotation Type DomainList

+
+
+
+
    +
  • +
    +
    +
    @Target(value={METHOD,TYPE,ANNOTATION_TYPE})
    + @Retention(value=RUNTIME)
    + @Documented
    + @API(status=MAINTAINED,
    +     since="1.2.0")
    +public @interface DomainList
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Required Element Summary

      + + + + + + + + + + +
      Required Elements 
      Modifier and TypeRequired Element and Description
      Domain[]value 
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Element Detail

      + + + +
        +
      • +

        value

        +
        public abstract Domain[] value
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/domains/package-frame.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/domains/package-frame.html new file mode 100644 index 000000000..a00221a85 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/domains/package-frame.html @@ -0,0 +1,30 @@ + + + + + +net.jqwik.api.domains (documentation 1.3.0 API) + + + + +

net.jqwik.api.domains

+
+

Interfaces

+ +

Classes

+ +

Annotation Types

+ +
+ + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/domains/package-summary.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/domains/package-summary.html new file mode 100644 index 000000000..fcaeae1f4 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/domains/package-summary.html @@ -0,0 +1,193 @@ + + + + + +net.jqwik.api.domains (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + +
+

Package net.jqwik.api.domains

+
+
+ +
+ +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/domains/package-tree.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/domains/package-tree.html new file mode 100644 index 000000000..466dad9f2 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/domains/package-tree.html @@ -0,0 +1,145 @@ + + + + + +net.jqwik.api.domains Class Hierarchy (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + +
+

Hierarchy For Package net.jqwik.api.domains

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Interface Hierarchy

+ +

Annotation Type Hierarchy

+ +
+ +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AddLifecycleHook.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AddLifecycleHook.html new file mode 100644 index 000000000..f00167201 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AddLifecycleHook.html @@ -0,0 +1,269 @@ + + + + + +AddLifecycleHook (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Annotation Type AddLifecycleHook

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,METHOD,TYPE})
    + @Retention(value=RUNTIME)
    + @Repeatable(value=LifecycleHooks.class)
    + @API(status=EXPERIMENTAL,
    +     since="1.0")
    +public @interface AddLifecycleHook
    +
    Use to register a concrete lifecycle hook implementation + for a test element -- a container class or a property method. More than one + hook can be registered. + +

    + This annotation can be used as meta annotation for self-made ones. +

    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Required Element Summary

      + + + + + + + + + + +
      Required Elements 
      Modifier and TypeRequired Element and Description
      java.lang.Class<? extends LifecycleHook>value 
      +
    • +
    + + +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Element Detail

      + + + +
        +
      • +

        value

        +
        public abstract java.lang.Class<? extends LifecycleHook> value
        +
        +
        Returns:
        +
        Concrete lifecycle hook implementation class
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +
        +
      • +

        propagateTo

        +
        @API(status=EXPERIMENTAL,
        +     since="1.0")
        +public abstract PropagationMode propagateTo
        +
        Override the propagation mode specified in LifecycleHook.propagateTo().
        +
        +
        Returns:
        +
        Propagation mode enum value
        +
        +
        +
        Default:
        +
        net.jqwik.api.lifecycle.PropagationMode.NOT_SET
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AfterContainer.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AfterContainer.html new file mode 100644 index 000000000..20968e799 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AfterContainer.html @@ -0,0 +1,181 @@ + + + + + +AfterContainer (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Annotation Type AfterContainer

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,METHOD})
    + @Retention(value=RUNTIME)
    + @API(status=EXPERIMENTAL,
    +     since="1.2.4")
    +public @interface AfterContainer
    +
    Annotate static methods of a container class with @AfterContainer + to have them run exactly once after all of its properties or any lifecycle + methods from embedded containers have been run. + +

    @AfterContainer methods must be static void + and they cannot have parameters. + +

    @AfterContainer methods are inherited from superclasses + and implemented interfaces as long as they are not hidden + or overridden. + +

    The execution order of multiple @AfterContainer methods + within the same container is not guaranteed and might change.

    +
    +
    See Also:
    +
    BeforeContainer
    +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AfterContainerHook.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AfterContainerHook.html new file mode 100644 index 000000000..04af152f5 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AfterContainerHook.html @@ -0,0 +1,325 @@ + + + + + +AfterContainerHook (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Interface AfterContainerHook

+
+
+
+
    +
  • +
    +
    All Superinterfaces:
    +
    LifecycleHook
    +
    +
    +
    All Known Subinterfaces:
    +
    AroundContainerHook
    +
    +
    +
    +
    @API(status=EXPERIMENTAL,
    +     since="1.2.4")
    +public interface AfterContainerHook
    +extends LifecycleHook
    +
    Implement this hook to define behaviour for a container (class or whole test suite) + that should be run exactly once after of its property methods and child containers.
    +
  • +
+
+
+ +
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        afterContainer

        +
        void afterContainer(ContainerLifecycleContext context)
        +             throws java.lang.Throwable
        +
        The code of this method will be run exactly once after all property methods and child containers.
        +
        +
        Parameters:
        +
        context - The container's context object
        +
        Throws:
        +
        java.lang.Throwable
        +
        +
      • +
      + + + +
        +
      • +

        afterContainerProximity

        +
        default int afterContainerProximity()
        +
        The higher the value, the closer to the actual property methods, i.e. the earlier it will be run. + Default value is 0. + +

        + Values greater than -10 will make it run before methods annotated with AfterContainer, + values smaller than -10 will make it run after. +

        +
        +
        Returns:
        +
        an integer value
        +
        +
      • +
      + + + +
        +
      • +

        compareTo

        +
        @API(status=INTERNAL)
        +default int compareTo(AfterContainerHook other)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AfterExample.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AfterExample.html new file mode 100644 index 000000000..c4323c836 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AfterExample.html @@ -0,0 +1,170 @@ + + + + + +AfterExample (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Annotation Type AfterExample

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,METHOD})
    + @Retention(value=RUNTIME)
    + @API(status=EXPERIMENTAL,
    +     since="1.2.5")
    +public @interface AfterExample
    +
    This is an alias of AfterProperty
    +
    +
    See Also:
    +
    BeforeExample, +AfterProperty
    +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AfterProperty.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AfterProperty.html new file mode 100644 index 000000000..e6211e989 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AfterProperty.html @@ -0,0 +1,185 @@ + + + + + +AfterProperty (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Annotation Type AfterProperty

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,METHOD})
    + @Retention(value=RUNTIME)
    + @API(status=EXPERIMENTAL,
    +     since="1.2.4")
    +public @interface AfterProperty
    +
    Annotate methods of a container class with @AfterProperty + to have them run once after each property (or example) + including properties (or examples) of embedded containers. + +

    @AfterProperty methods are inherited from superclasses + and implemented interfaces as long as they are not hidden + or overridden. + +

    In embedded container classes the @AfterProperty methods + from the inner container are run before the outer container's methods. + +

    The execution order of multiple @AfterProperty methods + within the same container is not guaranteed and might change. + +

    Parameters of this method will be resolved using registered instances + of ResolveParameterHook. Parameters with annotation + ForAll are not allowed.

    +
    +
    See Also:
    +
    BeforeProperty
    +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AfterTry.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AfterTry.html new file mode 100644 index 000000000..77b8122f2 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AfterTry.html @@ -0,0 +1,186 @@ + + + + + +AfterTry (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Annotation Type AfterTry

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,METHOD})
    + @Retention(value=RUNTIME)
    + @API(status=EXPERIMENTAL,
    +     since="1.2.4")
    +public @interface AfterTry
    +
    Annotate methods of a container class with @AfterTry + to have them run once after each try - the actual invocation of the property + method with generated parameters - including properties of + embedded containers. + +

    @AfterTry methods are inherited from superclasses + and implemented interfaces as long as they are not hidden + or overridden. + +

    In embedded container classes the @AfterTry methods + from the inner container are run before the outer container's methods. + +

    The execution order of multiple @BeforeTry methods + within the same container is not guaranteed and might change. + +

    Parameters of this method will be resolved using registered instances + of ResolveParameterHook. Parameters with annotation + ForAll are not allowed.

    +
    +
    See Also:
    +
    BeforeTry
    +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AroundContainerHook.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AroundContainerHook.html new file mode 100644 index 000000000..1fc2f42f3 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AroundContainerHook.html @@ -0,0 +1,387 @@ + + + + + +AroundContainerHook (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Interface AroundContainerHook

+
+
+
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AroundPropertyHook.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AroundPropertyHook.html new file mode 100644 index 000000000..15dd9e22d --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AroundPropertyHook.html @@ -0,0 +1,338 @@ + + + + + +AroundPropertyHook (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Interface AroundPropertyHook

+
+
+
+
    +
  • +
    +
    All Superinterfaces:
    +
    LifecycleHook
    +
    +
    +
    All Known Implementing Classes:
    +
    PerProperty.PerPropertyHook
    +
    +
    +
    Functional Interface:
    +
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
    +
    +
    +
    +
    @API(status=EXPERIMENTAL,
    +     since="1.0")
    + @FunctionalInterface
    +public interface AroundPropertyHook
    +extends LifecycleHook
    +
    Implement this hook to define behaviour that should "wrap" the execution of a property, + i.e., do something directly before or after running a property - or both. + You can even change the result of a property from successful to failed or the other way round.
    +
  • +
+
+
+ +
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        aroundProperty

        +
        PropertyExecutionResult aroundProperty(PropertyLifecycleContext context,
        +                                       PropertyExecutor property)
        +                                throws java.lang.Throwable
        +
        When you wrap a property you can do stuff before and/or after its execution. + All implementors should invoke the property with property.execute() + and either return the result of this call or map it to another result.
        +
        +
        Parameters:
        +
        context - The property's context object
        +
        property - An executor to run the property
        +
        Returns:
        +
        The result of running the property
        +
        Throws:
        +
        java.lang.Throwable
        +
        +
      • +
      + + + +
        +
      • +

        aroundPropertyProximity

        +
        default int aroundPropertyProximity()
        +
        The higher the value, the closer to the actual property method. + Default value is 0. + +

        + Values greater than -10 will make it run "inside" + annotated lifecycle methods (BeforeProperty and AfterProperty). +

        +
        +
        Returns:
        +
        an integer value
        +
        +
      • +
      + + + +
        +
      • +

        compareTo

        +
        @API(status=INTERNAL)
        +default int compareTo(AroundPropertyHook other)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AroundTryHook.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AroundTryHook.html new file mode 100644 index 000000000..2e08878a0 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AroundTryHook.html @@ -0,0 +1,346 @@ + + + + + +AroundTryHook (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Interface AroundTryHook

+
+
+
+
    +
  • +
    +
    All Superinterfaces:
    +
    LifecycleHook
    +
    +
    +
    Functional Interface:
    +
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
    +
    +
    +
    +
    @API(status=EXPERIMENTAL,
    +     since="1.2.3")
    + @FunctionalInterface
    +public interface AroundTryHook
    +extends LifecycleHook
    +
    Implement this hook to define behaviour that should "wrap" the execution of a single try, + i.e., do something directly before or after executing a property method with a given list of parameters. + You can even change the result of a try from satisfied to falsified or the other way round.
    +
  • +
+
+
+ +
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        aroundTry

        +
        TryExecutionResult aroundTry(TryLifecycleContext context,
        +                             TryExecutor aTry,
        +                             java.util.List<java.lang.Object> parameters)
        +                      throws java.lang.Throwable
        +
        When you wrap a try you can do stuff before and/or after its execution. + All implementors should invoke the try with aTry.execute(parameters) + and either return the result of this call or create another result. + +

        + It is possible to manipulate the parameters before invoking + aTry.execute(parameters). + Never change the number and types of parameters because this will result + in runtime errors. + Also keep in mind that + all manipulation might mess up random generation and shrinking. +

        +
        +
        Parameters:
        +
        context - The property's context object
        +
        aTry - executor to call
        +
        parameters - the generated parameters for this try
        +
        Returns:
        +
        result of running a single try
        +
        Throws:
        +
        java.lang.Throwable
        +
        +
      • +
      + + + +
        +
      • +

        aroundTryProximity

        +
        default int aroundTryProximity()
        +
        The higher the value, the closer to the actual property method. + Default value is 0. + +

        + Values greater than -10 will make it run "inside" + annotated lifecycle methods (BeforeTry and AfterTry). +

        +
        +
        Returns:
        +
        an integer value
        +
        +
      • +
      + + + +
        +
      • +

        compareTo

        +
        @API(status=INTERNAL)
        +default int compareTo(AroundTryHook other)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/BeforeContainer.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/BeforeContainer.html new file mode 100644 index 000000000..1839ad368 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/BeforeContainer.html @@ -0,0 +1,181 @@ + + + + + +BeforeContainer (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Annotation Type BeforeContainer

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,METHOD})
    + @Retention(value=RUNTIME)
    + @API(status=EXPERIMENTAL,
    +     since="1.2.4")
    +public @interface BeforeContainer
    +
    Annotate static methods of a container class with @BeforeContainer + to have them run exactly once before any of its properties or any lifecycle + methods from embedded containers will be run. + +

    @BeforeContainer methods must be static void + and they cannot have parameters. + +

    @BeforeContainer methods are inherited from superclasses + and implemented interfaces as long as they are not hidden + or overridden. + +

    The execution order of multiple @BeforeContainer methods + within the same container is not guaranteed and might change.

    +
    +
    See Also:
    +
    AfterContainer
    +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/BeforeContainerHook.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/BeforeContainerHook.html new file mode 100644 index 000000000..68ef0a7b4 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/BeforeContainerHook.html @@ -0,0 +1,330 @@ + + + + + +BeforeContainerHook (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Interface BeforeContainerHook

+
+
+
+
    +
  • +
    +
    All Superinterfaces:
    +
    LifecycleHook
    +
    +
    +
    All Known Subinterfaces:
    +
    AroundContainerHook
    +
    +
    +
    Functional Interface:
    +
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
    +
    +
    +
    +
    @API(status=EXPERIMENTAL,
    +     since="1.2.4")
    + @FunctionalInterface
    +public interface BeforeContainerHook
    +extends LifecycleHook
    +
    Implement this hook to define behaviour for a container (class or whole test suite) + that should be run exactly once before any of its property methods and child containers.
    +
  • +
+
+
+ +
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        beforeContainer

        +
        void beforeContainer(ContainerLifecycleContext context)
        +              throws java.lang.Throwable
        +
        The code of this method will be run exactly once before any property method or child container.
        +
        +
        Parameters:
        +
        context - The container's context object
        +
        Throws:
        +
        java.lang.Throwable
        +
        +
      • +
      + + + +
        +
      • +

        beforeContainerProximity

        +
        default int beforeContainerProximity()
        +
        The higher the value, the closer to the actual property methods, i.e. the later it will be run. + Default value is 0. + +

        + Values greater than -10 will make it run after methods annotated with BeforeContainer, + values smaller than -10 will make it run before. +

        +
        +
        Returns:
        +
        an integer value
        +
        +
      • +
      + + + + +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/BeforeExample.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/BeforeExample.html new file mode 100644 index 000000000..f2e70246a --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/BeforeExample.html @@ -0,0 +1,170 @@ + + + + + +BeforeExample (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Annotation Type BeforeExample

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,METHOD})
    + @Retention(value=RUNTIME)
    + @API(status=EXPERIMENTAL,
    +     since="1.2.5")
    +public @interface BeforeExample
    +
    This is an alias of BeforeProperty
    +
    +
    See Also:
    +
    AfterExample, +BeforeProperty
    +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/BeforeProperty.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/BeforeProperty.html new file mode 100644 index 000000000..671f8bee3 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/BeforeProperty.html @@ -0,0 +1,185 @@ + + + + + +BeforeProperty (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Annotation Type BeforeProperty

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,METHOD})
    + @Retention(value=RUNTIME)
    + @API(status=EXPERIMENTAL,
    +     since="1.2.4")
    +public @interface BeforeProperty
    +
    Annotate methods of a container class with @BeforeProperty + to have them run once before each property (or example) + including properties (or examples) of embedded containers. + +

    @BeforeProperty methods are inherited from superclasses + and implemented interfaces as long as they are not hidden + or overridden. + +

    In embedded container classes the @BeforeProperty methods + from the inner container are run after the outer container's methods. + +

    The execution order of multiple @BeforeProperty methods + within the same container is not guaranteed and might change. + +

    Parameters of this method will be resolved using registered instances + of ResolveParameterHook. Parameters with annotation + ForAll are not allowed.

    +
    +
    See Also:
    +
    AfterProperty
    +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/BeforeTry.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/BeforeTry.html new file mode 100644 index 000000000..131ec557f --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/BeforeTry.html @@ -0,0 +1,186 @@ + + + + + +BeforeTry (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Annotation Type BeforeTry

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,METHOD})
    + @Retention(value=RUNTIME)
    + @API(status=EXPERIMENTAL,
    +     since="1.2.4")
    +public @interface BeforeTry
    +
    Annotate methods of a container class with @BeforeTry + to have them run once before each try - the actual invocation of the property + method with generated parameters - including properties of + embedded containers. + +

    @BeforeTry methods are inherited from superclasses + and implemented interfaces as long as they are not hidden + or overridden. + +

    In embedded container classes the @BeforeTry methods + from the inner container are run after the outer container's methods. + +

    The execution order of multiple @BeforeTry methods + within the same container is not guaranteed and might change. + +

    Parameters of this method will be resolved using registered instances + of ResolveParameterHook. Parameters with annotation + ForAll are not allowed.

    +
    +
    See Also:
    +
    AfterTry
    +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/CannotFindStoreException.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/CannotFindStoreException.html new file mode 100644 index 000000000..1c1ed4de9 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/CannotFindStoreException.html @@ -0,0 +1,274 @@ + + + + + +CannotFindStoreException (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Class CannotFindStoreException

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable
    +
    +
    +
    +
    @API(status=EXPERIMENTAL,
    +     since="1.2.3")
    +public class CannotFindStoreException
    +extends JqwikException
    +
    Experimental feature. Not ready for public usage yet.
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      CannotFindStoreException(java.lang.Object identifier, + java.lang.String retrieverId) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Throwable

        +addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CannotFindStoreException

        +
        public CannotFindStoreException(java.lang.Object identifier,
        +                                java.lang.String retrieverId)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/CannotResolveParameterException.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/CannotResolveParameterException.html new file mode 100644 index 000000000..22caaeb26 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/CannotResolveParameterException.html @@ -0,0 +1,290 @@ + + + + + +CannotResolveParameterException (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Class CannotResolveParameterException

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable
    +
    +
    +
    +
    @API(status=EXPERIMENTAL,
    +     since="1.2.4")
    +public class CannotResolveParameterException
    +extends JqwikException
    +
    Experimental feature. Not ready for public usage yet.
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Throwable

        +addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CannotResolveParameterException

        +
        public CannotResolveParameterException(ParameterResolutionContext context,
        +                                       java.lang.String info)
        +
      • +
      + + + +
        +
      • +

        CannotResolveParameterException

        +
        @API(status=EXPERIMENTAL,
        +     since="1.2.5")
        +public CannotResolveParameterException(java.lang.reflect.Parameter parameter,
        +                                                                                     java.lang.String info)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/ContainerLifecycleContext.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/ContainerLifecycleContext.html new file mode 100644 index 000000000..7d912e942 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/ContainerLifecycleContext.html @@ -0,0 +1,193 @@ + + + + + +ContainerLifecycleContext (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Interface ContainerLifecycleContext

+
+
+
+
    +
  • +
    +
    All Superinterfaces:
    +
    LifecycleContext
    +
    +
    +
    +
    @API(status=EXPERIMENTAL,
    +     since="1.0")
    +public interface ContainerLifecycleContext
    +extends LifecycleContext
    +
    The context of a test container (a container class or the whole jqwik suite).
    +
  • +
+
+
+ +
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/LifecycleContext.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/LifecycleContext.html new file mode 100644 index 000000000..afb0e0feb --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/LifecycleContext.html @@ -0,0 +1,400 @@ + + + + + +LifecycleContext (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Interface LifecycleContext

+
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethod and Description
      <T extends java.lang.annotation.Annotation>
      java.util.Optional<T>
      findAnnotation(java.lang.Class<T> annotationClass) +
      Retrieve an annotation if present at the current test element.
      +
      java.lang.Stringlabel() +
      The elements label under which it shows up in test reports and IDEs.
      +
      <T> TnewInstance(java.lang.Class<T> clazz) +
      Create a new instance of a clazz in the context of the property in which it + is running.
      +
      java.util.Optional<java.lang.Class<?>>optionalContainerClass() +
      If the context refers to a class or a method the class or the method's class + is returned, otherwise Optional.empty()
      +
      java.util.Optional<java.lang.reflect.AnnotatedElement>optionalElement() +
      If the context refers to a class or a method the class or method + is returned, otherwise Optional.empty()
      +
      Reporterreporter() +
      Get hold of test reporter for publishing additional information on a test container or method.
      +
      java.util.Optional<ResolveParameterHook.ParameterSupplier>resolveParameter(java.lang.reflect.Executable executable, + int index) +
      Resolve a parameter from a method in the context of the property in which it + is running.
      +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        label

        +
        java.lang.String label()
        +
        The elements label under which it shows up in test reports and IDEs.
        +
        +
        Returns:
        +
        a String
        +
        +
      • +
      + + + +
        +
      • +

        optionalElement

        +
        @API(status=EXPERIMENTAL,
        +     since="1.2.5")
        +java.util.Optional<java.lang.reflect.AnnotatedElement> optionalElement()
        +
        If the context refers to a class or a method the class or method + is returned, otherwise Optional.empty()
        +
        +
        Returns:
        +
        an optional annotated element
        +
        +
      • +
      + + + +
        +
      • +

        optionalContainerClass

        +
        @API(status=EXPERIMENTAL,
        +     since="1.2.5")
        +java.util.Optional<java.lang.Class<?>> optionalContainerClass()
        +
        If the context refers to a class or a method the class or the method's class + is returned, otherwise Optional.empty()
        +
        +
        Returns:
        +
        an optional annotated element
        +
        +
      • +
      + + + +
        +
      • +

        reporter

        +
        @API(status=EXPERIMENTAL,
        +     since="1.2.3")
        +Reporter reporter()
        +
        Get hold of test reporter for publishing additional information on a test container or method.
        +
        +
        Returns:
        +
        Current instance to test reporter
        +
        +
      • +
      + + + +
        +
      • +

        findAnnotation

        +
        @API(status=EXPERIMENTAL,
        +     since="1.2.4")
        +<T extends java.lang.annotation.Annotation> java.util.Optional<T> findAnnotation(java.lang.Class<T> annotationClass)
        +
        Retrieve an annotation if present at the current test element.
        +
        +
        Type Parameters:
        +
        T - The annotation type
        +
        Parameters:
        +
        annotationClass - The annotation type
        +
        Returns:
        +
        instance of annotation type
        +
        +
      • +
      + + + +
        +
      • +

        newInstance

        +
        @API(status=EXPERIMENTAL,
        +     since="1.2.4")
        +<T> T newInstance(java.lang.Class<T> clazz)
        +
        Create a new instance of a clazz in the context of the property in which it + is running. Use this method for instance when trying to instantiate a class + retrieved from an annotation's attribute. + +

        + The behaviour of this method differs from Class.newInstance() if + the class to instantiate is a non-static member of the container class or even + a nested container class. +

        +
        +
        Type Parameters:
        +
        T - The type to instantiate
        +
        Parameters:
        +
        clazz - The class to instantiate
        +
        Returns:
        +
        a freshly created instance of class clazz
        +
        +
      • +
      + + + +
        +
      • +

        resolveParameter

        +
        @API(status=EXPERIMENTAL,
        +     since="1.2.5")
        +java.util.Optional<ResolveParameterHook.ParameterSupplier> resolveParameter(java.lang.reflect.Executable executable,
        +                                                                                                                          int index)
        +
        Resolve a parameter from a method in the context of the property in which it + is running.
        +
        +
        Parameters:
        +
        executable - The executable of the test container the parameter of which should be resolved
        +
        index - The parameter's position in a method - starting with 0.
        +
        Returns:
        +
        supplier instance
        +
        Throws:
        +
        CannotResolveParameterException
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/LifecycleHook.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/LifecycleHook.html new file mode 100644 index 000000000..da84fe337 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/LifecycleHook.html @@ -0,0 +1,278 @@ + + + + + +LifecycleHook (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Interface LifecycleHook

+
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Instance Methods Default Methods 
      Modifier and TypeMethod and Description
      default booleanappliesTo(java.util.Optional<java.lang.reflect.AnnotatedElement> element) +
      This method is called once per hook and potential element during lifecycle hooks registration.
      +
      default PropagationModepropagateTo() +
      Override this method if you want to change a concrete hook implementation's default + propagation behaviour: Do not use hook in child elements -- sub containers or properties.
      +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        appliesTo

        +
        @API(status=EXPERIMENTAL,
        +     since="1.2.4")
        +default boolean appliesTo(java.util.Optional<java.lang.reflect.AnnotatedElement> element)
        +
        This method is called once per hook and potential element during lifecycle hooks registration.
        +
        +
        Parameters:
        +
        element - The Optional instance contains element for container classes + or method but is empty for the engine
        +
        Returns:
        +
        true if a hook shall be applied to this element
        +
        +
      • +
      + + + +
        +
      • +

        propagateTo

        +
        @API(status=EXPERIMENTAL,
        +     since="1.2.4")
        +default PropagationMode propagateTo()
        +
        Override this method if you want to change a concrete hook implementation's default + propagation behaviour: Do not use hook in child elements -- sub containers or properties.
        +
        +
        Returns:
        +
        propagation mode enum
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/LifecycleHooks.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/LifecycleHooks.html new file mode 100644 index 000000000..a22fe4d6b --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/LifecycleHooks.html @@ -0,0 +1,213 @@ + + + + + +LifecycleHooks (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Annotation Type LifecycleHooks

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,METHOD,TYPE})
    + @Retention(value=RUNTIME)
    + @API(status=EXPERIMENTAL,
    +     since="1.0")
    +public @interface LifecycleHooks
    +
    Experimental feature. Not ready for public usage yet.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Required Element Summary

      + + + + + + + + + + +
      Required Elements 
      Modifier and TypeRequired Element and Description
      AddLifecycleHook[]value 
      +
    • +
    +
  • +
+
+
+ +
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/Lifespan.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/Lifespan.html new file mode 100644 index 000000000..9887150dd --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/Lifespan.html @@ -0,0 +1,377 @@ + + + + + +Lifespan (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Enum Lifespan

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, java.lang.Comparable<Lifespan>
    +
    +
    +
    +
    @API(status=EXPERIMENTAL,
    +     since="1.2.4")
    +public enum Lifespan
    +extends java.lang.Enum<Lifespan>
    +
    Define how long a resource, + e.g. the value in a Store with the same identifier, + will live: + +
      +
    • For the whole test run
    • +
    • For the currently running property
    • +
    • For the currently running try
    • +
    + + Any hook or collection of hooks can use this enum to allow the specification + of the lifespan of resources from which it is abstracting.
    +
    +
    See Also:
    +
    Store
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Enum Constant Summary

      + + + + + + + + + + + + + + +
      Enum Constants 
      Enum Constant and Description
      PROPERTY +
      Live until the currently running property is finished
      +
      RUN +
      Live for the whole test run
      +
      TRY +
      Live for a single try
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static LifespanvalueOf(java.lang.String name) +
      Returns the enum constant of this type with the specified name.
      +
      static Lifespan[]values() +
      Returns an array containing the constants of this enum type, in +the order they are declared.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Enum

        +clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +getClass, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Enum Constant Detail

      + + + +
        +
      • +

        RUN

        +
        public static final Lifespan RUN
        +
        Live for the whole test run
        +
      • +
      + + + +
        +
      • +

        PROPERTY

        +
        public static final Lifespan PROPERTY
        +
        Live until the currently running property is finished
        +
      • +
      + + + +
        +
      • +

        TRY

        +
        public static final Lifespan TRY
        +
        Live for a single try
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static Lifespan[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (Lifespan c : Lifespan.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static Lifespan valueOf(java.lang.String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        +
        java.lang.NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/ParameterResolutionContext.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/ParameterResolutionContext.html new file mode 100644 index 000000000..b5400274f --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/ParameterResolutionContext.html @@ -0,0 +1,247 @@ + + + + + +ParameterResolutionContext (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Interface ParameterResolutionContext

+
+
+
+
    +
  • +
    +
    +
    @API(status=EXPERIMENTAL,
    +     since="1.2.4")
    +public interface ParameterResolutionContext
    +
    Experimental feature. Not ready for public usage yet.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        parameter

        +
        java.lang.reflect.Parameter parameter()
        +
      • +
      + + + + + + + +
        +
      • +

        index

        +
        int index()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/PerProperty.Lifecycle.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/PerProperty.Lifecycle.html new file mode 100644 index 000000000..a22283e2a --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/PerProperty.Lifecycle.html @@ -0,0 +1,309 @@ + + + + + +PerProperty.Lifecycle (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Interface PerProperty.Lifecycle

+
+
+
+
    +
  • +
    +
    Enclosing class:
    +
    PerProperty
    +
    +
    +
    +
    public static interface PerProperty.Lifecycle
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        resolve

        +
        default java.util.Optional<ResolveParameterHook.ParameterSupplier> resolve(ParameterResolutionContext parameterContext)
        +
        Override if you want to provide parameters for this property.
        +
        +
        Parameters:
        +
        parameterContext - The object to retrieve information about the parameter to resolve
        +
        Returns:
        +
        a supplier wrapped in Optional.of()
        +
        +
      • +
      + + + +
        +
      • +

        before

        +
        default void before(PropertyLifecycleContext context)
        +
        Override if you want to perform some work once before the annotated property (or example).
        +
        +
        Parameters:
        +
        context - The object to retrieve information about the current property
        +
        +
      • +
      + + + +
        +
      • +

        after

        +
        default void after(PropertyExecutionResult propertyExecutionResult)
        +
        Override if you want to perform some work once after the annotated property (or example).
        +
        +
        Parameters:
        +
        propertyExecutionResult - The object to retrieve information about the property's execution result
        +
        +
      • +
      + + + +
        +
      • +

        onSuccess

        +
        default void onSuccess()
        +
        Override if you want to perform some work or run assertions if - and only if - the property succeeded. + If you want to make the property fail just use an appropriate assertion methods or throw an exception.
        +
      • +
      + + + +
        +
      • +

        onFailure

        +
        default PropertyExecutionResult onFailure(PropertyExecutionResult propertyExecutionResult)
        +
        Override if you want to perform some work or run assertions if - and only if - the property failed. + You have to return the original propertyExecutionResult or transform it into another result.
        +
        +
        Parameters:
        +
        propertyExecutionResult - The object that represents the property's execution result
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/PerProperty.PerPropertyHook.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/PerProperty.PerPropertyHook.html new file mode 100644 index 000000000..2229afa71 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/PerProperty.PerPropertyHook.html @@ -0,0 +1,408 @@ + + + + + +PerProperty.PerPropertyHook (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Class PerProperty.PerPropertyHook

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PerPropertyHook

        +
        public PerPropertyHook()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        aroundProperty

        +
        public PropertyExecutionResult aroundProperty(PropertyLifecycleContext context,
        +                                              PropertyExecutor property)
        +
        Description copied from interface: AroundPropertyHook
        +
        When you wrap a property you can do stuff before and/or after its execution. + All implementors should invoke the property with property.execute() + and either return the result of this call or map it to another result.
        +
        +
        Specified by:
        +
        aroundProperty in interface AroundPropertyHook
        +
        Parameters:
        +
        context - The property's context object
        +
        property - An executor to run the property
        +
        Returns:
        +
        The result of running the property
        +
        +
      • +
      + + + +
        +
      • +

        aroundPropertyProximity

        +
        public int aroundPropertyProximity()
        +
        Description copied from interface: AroundPropertyHook
        +
        The higher the value, the closer to the actual property method. + Default value is 0. + +

        + Values greater than -10 will make it run "inside" + annotated lifecycle methods (BeforeProperty and AfterProperty). +

        +
        +
        Specified by:
        +
        aroundPropertyProximity in interface AroundPropertyHook
        +
        Returns:
        +
        an integer value
        +
        +
      • +
      + + + +
        +
      • +

        resolve

        +
        public java.util.Optional<ResolveParameterHook.ParameterSupplier> resolve(ParameterResolutionContext parameterContext,
        +                                                                          LifecycleContext lifecycleContext)
        +
        Description copied from interface: ResolveParameterHook
        +
        This method will be called only once per property, whereas the returned supplier's get method + is usually invoked for each try - and potentially more often during shrinking or when resolving + parameters in before/after methods. + The returned supplier should always return an equivalent object, + i.e. an object that behaves the same when used in the same way.
        +
        +
        Specified by:
        +
        resolve in interface ResolveParameterHook
        +
        Parameters:
        +
        parameterContext - Contains information of parameter to resolve
        +
        lifecycleContext - Can be of type ContainerLifecycleContext or PropertyLifecycleContext
        +
        Returns:
        +
        supplier instance wrapped in Optional or Optional.empty() if it cannot be resolved
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/PerProperty.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/PerProperty.html new file mode 100644 index 000000000..4cd4140c7 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/PerProperty.html @@ -0,0 +1,226 @@ + + + + + +PerProperty (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Annotation Type PerProperty

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,METHOD})
    + @Retention(value=RUNTIME)
    + @API(status=EXPERIMENTAL,
    +     since="1.2.4")
    +public @interface PerProperty
    +
    Annotate property methods of a container class with @PerProperty + if you want to have some lifecycle control over this property alone. + +

    + If you want to control the lifecycle of all property methods use + BeforeProperty or AfterProperty. +

    +
  • +
+
+
+ +
+
+ +
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/PropagationMode.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/PropagationMode.html new file mode 100644 index 000000000..f8197ac0a --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/PropagationMode.html @@ -0,0 +1,384 @@ + + + + + +PropagationMode (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Enum PropagationMode

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, java.lang.Comparable<PropagationMode>
    +
    +
    +
    +
    @API(status=EXPERIMENTAL,
    +     since="1.2.4")
    +public enum PropagationMode
    +extends java.lang.Enum<PropagationMode>
    +
    Describes if and how a concrete registered hook is propagated to children of + the element where the hook has been registered. The default behaviour + can be changed by: + +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static PropagationModevalueOf(java.lang.String name) +
      Returns the enum constant of this type with the specified name.
      +
      static PropagationMode[]values() +
      Returns an array containing the constants of this enum type, in +the order they are declared.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Enum

        +clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +getClass, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static PropagationMode[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (PropagationMode c : PropagationMode.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static PropagationMode valueOf(java.lang.String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        +
        java.lang.NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/PropertyExecutionResult.Status.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/PropertyExecutionResult.Status.html new file mode 100644 index 000000000..31d45c315 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/PropertyExecutionResult.Status.html @@ -0,0 +1,370 @@ + + + + + +PropertyExecutionResult.Status (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Enum PropertyExecutionResult.Status

+
+
+ +
+ +
+
+
    +
  • + +
      +
    • + + +

      Enum Constant Summary

      + + + + + + + + + + + + + + +
      Enum Constants 
      Enum Constant and Description
      ABORTED +
      Indicates that the execution of a property was + aborted before the actual property method could be run.
      +
      FAILED +
      Indicates that the execution of a property has + failed.
      +
      SUCCESSFUL +
      Indicates that the execution of a property was + successful.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static PropertyExecutionResult.StatusvalueOf(java.lang.String name) +
      Returns the enum constant of this type with the specified name.
      +
      static PropertyExecutionResult.Status[]values() +
      Returns an array containing the constants of this enum type, in +the order they are declared.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Enum

        +clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +getClass, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static PropertyExecutionResult.Status[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (PropertyExecutionResult.Status c : PropertyExecutionResult.Status.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static PropertyExecutionResult.Status valueOf(java.lang.String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        +
        java.lang.NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/PropertyExecutionResult.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/PropertyExecutionResult.html new file mode 100644 index 000000000..ccaa2fee0 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/PropertyExecutionResult.html @@ -0,0 +1,485 @@ + + + + + +PropertyExecutionResult (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Interface PropertyExecutionResult

+
+
+
+
    +
  • +
    +
    +
    @API(status=EXPERIMENTAL,
    +     since="1.0")
    +public interface PropertyExecutionResult
    +
    Represents the result of running a property.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        seed

        +
        java.util.Optional<java.lang.String> seed()
        +
        The seed used to generate randomized parameters.
        +
        +
        Returns:
        +
        an optional String
        +
        +
      • +
      + + + +
        +
      • +

        falsifiedSample

        +
        java.util.Optional<java.util.List<java.lang.Object>> falsifiedSample()
        +
        The potentially shrunk set of parameters that falsified this property.
        +
        +
        Returns:
        +
        an optional list of parameters
        +
        +
      • +
      + + + + + + + +
        +
      • +

        throwable

        +
        java.util.Optional<java.lang.Throwable> throwable()
        +
        Will return Optional.empty() if status is anything but FAILED. + If FAILED the optional MUST contain a throwable.
        +
      • +
      + + + +
        +
      • +

        countChecks

        +
        @API(status=EXPERIMENTAL,
        +     since="1.2.4")
        +int countChecks()
        +
        The number of tries for which parameters were created + and the property method run.
        +
        +
        Returns:
        +
        an number equal to or greater than 0
        +
        +
      • +
      + + + +
        +
      • +

        countTries

        +
        @API(status=EXPERIMENTAL,
        +     since="1.2.4")
        +int countTries()
        +
        The number of tries for which parameters were created and the property method run + and which were not aborted, e.g. through a failing assumption.
        +
        +
        Returns:
        +
        an number equal to or greater than 0
        +
        +
      • +
      + + + + + + + + + + + + + + + + + + + + +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/PropertyExecutor.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/PropertyExecutor.html new file mode 100644 index 000000000..5cc00b84a --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/PropertyExecutor.html @@ -0,0 +1,231 @@ + + + + + +PropertyExecutor (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Interface PropertyExecutor

+
+
+
+
    +
  • +
    +
    +
    @API(status=EXPERIMENTAL,
    +     since="1.0")
    +public interface PropertyExecutor
    +
    Objects of this class represent a property's execution. + This is used in AroundPropertyHook.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        execute

        +
        PropertyExecutionResult execute()
        +
        Call to actually run the property, including all hooks that are "closer" + (have a higher proximity) than the current hook.
        +
        +
        Returns:
        +
        The execution result
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/PropertyLifecycleContext.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/PropertyLifecycleContext.html new file mode 100644 index 000000000..be4f2506f --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/PropertyLifecycleContext.html @@ -0,0 +1,308 @@ + + + + + +PropertyLifecycleContext (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Interface PropertyLifecycleContext

+
+
+
+
    +
  • +
    +
    All Superinterfaces:
    +
    LifecycleContext
    +
    +
    +
    +
    @API(status=EXPERIMENTAL,
    +     since="1.0")
    +public interface PropertyLifecycleContext
    +extends LifecycleContext
    +
    The context information of a property or example.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        targetMethod

        +
        java.lang.reflect.Method targetMethod()
        +
        The method that defines the current property or example.
        +
        +
        Returns:
        +
        a Method instance
        +
        +
      • +
      + + + +
        +
      • +

        containerClass

        +
        java.lang.Class<?> containerClass()
        +
        The container class in which the current property method is running. + +

        + Most of the time that's also the defining class. It differs when + running properties that are defined in a super class or an implemented interface. +

        +
        +
        Returns:
        +
        a Class instance
        +
        +
      • +
      + + + +
        +
      • +

        testInstance

        +
        java.lang.Object testInstance()
        +
        The current instance of the property's container class. + There is exactly one instance per property method.
        +
        +
        Returns:
        +
        an instance of the container class in which the current property method is running
        +
        +
      • +
      + + + +
        +
      • +

        extendedLabel

        +
        @API(status=EXPERIMENTAL,
        +     since="1.2.3")
        +java.lang.String extendedLabel()
        +
        The extended label contains additional information about the current container class.
        +
        +
        Returns:
        +
        a String
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/RegistrarHook.Registrar.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/RegistrarHook.Registrar.html new file mode 100644 index 000000000..3f04e18c6 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/RegistrarHook.Registrar.html @@ -0,0 +1,253 @@ + + + + + +RegistrarHook.Registrar (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Interface RegistrarHook.Registrar

+
+
+
+
    +
  • +
    +
    Enclosing interface:
    +
    RegistrarHook
    +
    +
    +
    +
    public static interface RegistrarHook.Registrar
    +
    A short-lived object used for registering concrete hook implementation classes.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        register

        +
        void register(java.lang.Class<? extends LifecycleHook> hook,
        +              PropagationMode propagationMode)
        +
        Register a concrete hook implementation.
        +
        +
        Parameters:
        +
        hook - a concrete hook implementation class
        +
        propagationMode - propagation enum
        +
        +
      • +
      + + + +
        +
      • +

        register

        +
        default void register(java.lang.Class<? extends LifecycleHook> hook)
        +
        Register a concrete hook implementation with its default PropagationMode.
        +
        +
        Parameters:
        +
        hook - a concrete hook implementation class
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/RegistrarHook.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/RegistrarHook.html new file mode 100644 index 000000000..f07304665 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/RegistrarHook.html @@ -0,0 +1,269 @@ + + + + + +RegistrarHook (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Interface RegistrarHook

+
+
+
+
    +
  • +
    +
    All Superinterfaces:
    +
    LifecycleHook
    +
    +
    +
    Functional Interface:
    +
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
    +
    +
    +
    +
    @API(status=EXPERIMENTAL,
    +     since="1.2.5")
    + @FunctionalInterface
    +public interface RegistrarHook
    +extends LifecycleHook
    +
    Use this hook if you want to apply several hook implementations that belong + together but that cannot be implemented in a single class, e.g. because + the same hook type must be added with different proximity or different propagation.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        registerHooks

        +
        void registerHooks(RegistrarHook.Registrar registrar)
        +
        This method will be called during hook registration, i.e. before any test has been started. + It allows to register as many other hook implementations as necessary.
        +
        +
        Parameters:
        +
        registrar - the registrar to use for registering lifecycle hooks
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/Reporter.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/Reporter.html new file mode 100644 index 000000000..7af2caf2b --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/Reporter.html @@ -0,0 +1,245 @@ + + + + + +Reporter (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Interface Reporter

+
+
+
+
    +
  • +
    +
    Functional Interface:
    +
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
    +
    +
    +
    +
    @API(status=EXPERIMENTAL,
    +     since="1.2.3")
    + @FunctionalInterface
    +public interface Reporter
    +
    An interface that can be used to report additional information for a test element, + i.e. a test container or property. + +

    + Reporting additional test information is a JUnit 5 platform feature. + Some tools will output this information to stdout; + other tools, e.g. Gradle as of version 6, ignore it. + That's why jqwik prints this information to stdout itself + unless told otherwise. +

    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethod and Description
      voidpublish(java.lang.String key, + java.lang.String value) +
      Publish some value under a given key.
      +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        publish

        +
        void publish(java.lang.String key,
        +             java.lang.String value)
        +
        Publish some value under a given key.
        +
        +
        Parameters:
        +
        key - a String
        +
        value - a String
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/ResolveParameterHook.ParameterSupplier.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/ResolveParameterHook.ParameterSupplier.html new file mode 100644 index 000000000..c7e2ee74f --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/ResolveParameterHook.ParameterSupplier.html @@ -0,0 +1,242 @@ + + + + + +ResolveParameterHook.ParameterSupplier (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Interface ResolveParameterHook.ParameterSupplier

+
+
+
+
    +
  • +
    +
    Enclosing interface:
    +
    ResolveParameterHook
    +
    +
    +
    Functional Interface:
    +
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
    +
    +
    +
    +
    @API(status=EXPERIMENTAL,
    +     since="1.2.5")
    + @FunctionalInterface
    +public static interface ResolveParameterHook.ParameterSupplier
    +
    A functional interface specialized on providing parameters to property methods + and to annotated lifecycle methods.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        get

        +
        java.lang.Object get(java.util.Optional<TryLifecycleContext> optionalTry)
        +
        Supply the requested parameter. For the same optionalTry the same + object must be returned if this object has state that could change its behaviour.
        +
        +
        Parameters:
        +
        optionalTry - Contains a TryLifecycleContext instance if used to supply a property method's parameter. + Otherwise it's empty.
        +
        Returns:
        +
        the freshly generated object or one stored for the same context
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/ResolveParameterHook.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/ResolveParameterHook.html new file mode 100644 index 000000000..b8b168a71 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/ResolveParameterHook.html @@ -0,0 +1,322 @@ + + + + + +ResolveParameterHook (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Interface ResolveParameterHook

+
+
+
+
    +
  • +
    +
    All Superinterfaces:
    +
    LifecycleHook
    +
    +
    +
    All Known Implementing Classes:
    +
    PerProperty.PerPropertyHook
    +
    +
    +
    Functional Interface:
    +
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
    +
    +
    +
    +
    @API(status=EXPERIMENTAL,
    +     since="1.2.4")
    + @FunctionalInterface
    +public interface ResolveParameterHook
    +extends LifecycleHook
    +
    This hook type allows to provide parameters for property methods + but also to annotated lifecycle methods.
    +
  • +
+
+
+ +
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        resolve

        +
        @API(status=EXPERIMENTAL,
        +     since="1.2.5")
        +java.util.Optional<ResolveParameterHook.ParameterSupplier> resolve(ParameterResolutionContext parameterContext,
        +                                                                                                                 LifecycleContext lifecycleContext)
        +
        This method will be called only once per property, whereas the returned supplier's get method + is usually invoked for each try - and potentially more often during shrinking or when resolving + parameters in before/after methods. + The returned supplier should always return an equivalent object, + i.e. an object that behaves the same when used in the same way.
        +
        +
        Parameters:
        +
        parameterContext - Contains information of parameter to resolve
        +
        lifecycleContext - Can be of type ContainerLifecycleContext or PropertyLifecycleContext
        +
        Returns:
        +
        supplier instance wrapped in Optional or Optional.empty() if it cannot be resolved
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/SkipExecutionHook.SkipResult.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/SkipExecutionHook.SkipResult.html new file mode 100644 index 000000000..6b6984583 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/SkipExecutionHook.SkipResult.html @@ -0,0 +1,326 @@ + + + + + +SkipExecutionHook.SkipResult (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Class SkipExecutionHook.SkipResult

+
+
+ +
+
    +
  • +
    +
    Enclosing interface:
    +
    SkipExecutionHook
    +
    +
    +
    +
    public static class SkipExecutionHook.SkipResult
    +extends java.lang.Object
    +
  • +
+
+
+ +
+
+ +
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/SkipExecutionHook.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/SkipExecutionHook.html new file mode 100644 index 000000000..15f9fdf1f --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/SkipExecutionHook.html @@ -0,0 +1,307 @@ + + + + + +SkipExecutionHook (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Interface SkipExecutionHook

+
+
+
+
    +
  • +
    +
    All Superinterfaces:
    +
    LifecycleHook
    +
    +
    +
    Functional Interface:
    +
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
    +
    +
    +
    +
    @API(status=EXPERIMENTAL,
    +     since="1.0")
    + @FunctionalInterface
    +public interface SkipExecutionHook
    +extends LifecycleHook
    +
    Use this hook to determine if an annotated element should be skipped during + a test run or not. Evaluation of hooks is stopped + as soon as a single hook returns SkipExecutionHook.SkipResult.skip(String).
    +
  • +
+
+
+ +
+
+ +
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/Store.StoreFacade.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/Store.StoreFacade.html new file mode 100644 index 000000000..bb202f1f9 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/Store.StoreFacade.html @@ -0,0 +1,290 @@ + + + + + +Store.StoreFacade (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Class Store.StoreFacade

+
+
+ +
+
    +
  • +
    +
    Enclosing interface:
    +
    Store<T>
    +
    +
    +
    +
    @API(status=INTERNAL)
    +public abstract static class Store.StoreFacade
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      StoreFacade() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethod and Description
      abstract <T> Store<T>create(java.lang.Object identifier, + Lifespan visibility, + java.util.function.Supplier<T> initializer) 
      abstract <T> Store<T>get(java.lang.Object identifier) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        StoreFacade

        +
        public StoreFacade()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        create

        +
        public abstract <T> Store<T> create(java.lang.Object identifier,
        +                                    Lifespan visibility,
        +                                    java.util.function.Supplier<T> initializer)
        +
      • +
      + + + +
        +
      • +

        get

        +
        public abstract <T> Store<T> get(java.lang.Object identifier)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/Store.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/Store.html new file mode 100644 index 000000000..9b86c9574 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/Store.html @@ -0,0 +1,382 @@ + + + + + +Store (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Interface Store<T>

+
+
+
+
    +
  • +
    +
    +
    @API(status=EXPERIMENTAL,
    +     since="1.2.3")
    +public interface Store<T>
    +
    Experimental feature. Not ready for public usage yet.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      + + + + + + + + + + +
      Nested Classes 
      Modifier and TypeInterface and Description
      static class Store.StoreFacade 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Instance Methods Abstract Methods Default Methods 
      Modifier and TypeMethod and Description
      static <T> Store<T>create(java.lang.Object identifier, + Lifespan lifespan, + java.util.function.Supplier<T> initializer) +
      Create a new store for storing and retrieving values and objects in lifecycle + hooks and lifecycle-dependent methods.
      +
      Tget() 
      static <T> Store<T>get(java.lang.Object identifier) +
      Retrieve a store that must be created somewhere else.
      +
      static <T> Store<T>getOrCreate(java.lang.Object identifier, + Lifespan lifespan, + java.util.function.Supplier<T> initializer) +
      Find an existing store or create a new one if it doesn't exist
      +
      Lifespanlifespan() 
      Store<T>onClose(java.util.function.Consumer<T> onCloseCallback) 
      voidreset() 
      voidupdate(java.util.function.Function<T,T> updater) 
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        get

        +
        T get()
        +
      • +
      + + + + + + + +
        +
      • +

        update

        +
        void update(java.util.function.Function<T,T> updater)
        +
      • +
      + + + +
        +
      • +

        reset

        +
        void reset()
        +
      • +
      + + + +
        +
      • +

        onClose

        +
        @API(status=EXPERIMENTAL,
        +     since="1.2.4")
        +Store<T> onClose(java.util.function.Consumer<T> onCloseCallback)
        +
      • +
      + + + +
        +
      • +

        create

        +
        static <T> Store<T> create(java.lang.Object identifier,
        +                           Lifespan lifespan,
        +                           java.util.function.Supplier<T> initializer)
        +
        Create a new store for storing and retrieving values and objects in lifecycle + hooks and lifecycle-dependent methods.
        +
        +
        Type Parameters:
        +
        T - The type of object to store
        +
        Parameters:
        +
        identifier - Any object to identify a store. Must be globally unique.
        +
        lifespan - A stored object's lifespan
        +
        initializer - Supplies the value to be used for initializing the store depending on its lifespan
        +
        Returns:
        +
        New store instance
        +
        +
      • +
      + + + +
        +
      • +

        getOrCreate

        +
        static <T> Store<T> getOrCreate(java.lang.Object identifier,
        +                                Lifespan lifespan,
        +                                java.util.function.Supplier<T> initializer)
        +
        Find an existing store or create a new one if it doesn't exist
        +
        +
        Type Parameters:
        +
        T - The type of object to store
        +
        Parameters:
        +
        identifier - Any object to identify a store. Must be globally unique.
        +
        lifespan -
        +
        initializer - Supplies the value to be used for initializing the store depending on its lifespan
        +
        Returns:
        +
        New or existing store instance
        +
        +
      • +
      + + + +
        +
      • +

        get

        +
        static <T> Store<T> get(java.lang.Object identifier)
        +
        Retrieve a store that must be created somewhere else.
        +
        +
        Type Parameters:
        +
        T - The type of object to store
        +
        Parameters:
        +
        identifier - Any object to identify a store. Must be globally unique.
        +
        Returns:
        +
        Existing store instance
        +
        Throws:
        +
        CannotFindStoreException
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/TryExecutionResult.Status.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/TryExecutionResult.Status.html new file mode 100644 index 000000000..d9a091039 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/TryExecutionResult.Status.html @@ -0,0 +1,364 @@ + + + + + +TryExecutionResult.Status (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Enum TryExecutionResult.Status

+
+
+ +
+ +
+
+
    +
  • + +
      +
    • + + +

      Enum Constant Summary

      + + + + + + + + + + + + + + +
      Enum Constants 
      Enum Constant and Description
      FALSIFIED +
      Current try does falsify the property
      +
      INVALID +
      Current try has invalid parameters
      +
      SATISFIED +
      Current try does not falsify the property
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static TryExecutionResult.StatusvalueOf(java.lang.String name) +
      Returns the enum constant of this type with the specified name.
      +
      static TryExecutionResult.Status[]values() +
      Returns an array containing the constants of this enum type, in +the order they are declared.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Enum

        +clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +getClass, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static TryExecutionResult.Status[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (TryExecutionResult.Status c : TryExecutionResult.Status.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static TryExecutionResult.Status valueOf(java.lang.String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        +
        java.lang.NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/TryExecutionResult.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/TryExecutionResult.html new file mode 100644 index 000000000..4803735a8 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/TryExecutionResult.html @@ -0,0 +1,388 @@ + + + + + +TryExecutionResult (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Interface TryExecutionResult

+
+
+
+
    +
  • +
    +
    +
    @API(status=EXPERIMENTAL,
    +     since="1.2.3")
    +public interface TryExecutionResult
    +
    Represents the result of calling a property method with a list of parameters.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        satisfied

        +
        static TryExecutionResult satisfied()
        +
        Create a result that satisfies the current property with the current parameter set. + All remaining tries to be executed.
        +
        +
        Returns:
        +
        result instance
        +
        +
      • +
      + + + +
        +
      • +

        satisfied

        +
        static TryExecutionResult satisfied(boolean shouldPropertyFinishEarly)
        +
        Create a result that satisfies the current property and will immediately + finish this property as successful.
        +
        +
        Returns:
        +
        result instance
        +
        +
      • +
      + + + +
        +
      • +

        falsified

        +
        static TryExecutionResult falsified(java.lang.Throwable throwable)
        +
        Create a result that falsified the current property and will immediately + finish this property as failed.
        +
        +
        Parameters:
        +
        throwable - The throwable to describe the reason of falsification
        +
        Returns:
        +
        result instance
        +
        +
      • +
      + + + +
        +
      • +

        invalid

        +
        static TryExecutionResult invalid()
        +
        Create a result that calls out the current parameter list as invalid. + All remaining tries will be executed.
        +
        +
        Returns:
        +
        result instance
        +
        +
      • +
      + + + +
        +
      • +

        isSatisfied

        +
        default boolean isSatisfied()
        +
        +
        Returns:
        +
        true if status is satisfied
        +
        +
      • +
      + + + + + + + +
        +
      • +

        throwable

        +
        java.util.Optional<java.lang.Throwable> throwable()
        +
        Will return Optional.empty() if status is anything but TryExecutionResult.Status.FALSIFIED.
        +
        +
        Returns:
        +
        instance of Throwable or subtype
        +
        +
      • +
      + + + +
        +
      • +

        shouldPropertyFinishEarly

        +
        boolean shouldPropertyFinishEarly()
        +
        +
        Returns:
        +
        true if status is satisfied and remaining tries shall be skipped
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/TryExecutor.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/TryExecutor.html new file mode 100644 index 000000000..288c00854 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/TryExecutor.html @@ -0,0 +1,221 @@ + + + + + +TryExecutor (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Interface TryExecutor

+
+
+
+
    +
  • +
    +
    +
    @API(status=EXPERIMENTAL,
    +     since="1.2.3")
    +public interface TryExecutor
    +
    Experimental feature. Not ready for public usage yet.
    +
  • +
+
+
+ +
+
+
    +
  • + + +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/TryLifecycleContext.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/TryLifecycleContext.html new file mode 100644 index 000000000..a11a16064 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/TryLifecycleContext.html @@ -0,0 +1,296 @@ + + + + + +TryLifecycleContext (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.lifecycle
+

Interface TryLifecycleContext

+
+
+
+
    +
  • +
    +
    All Superinterfaces:
    +
    LifecycleContext
    +
    +
    +
    +
    @API(status=EXPERIMENTAL,
    +     since="1.2.3")
    +public interface TryLifecycleContext
    +extends LifecycleContext
    +
    The context information of a single try of a property.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        targetMethod

        +
        @API(status=EXPERIMENTAL,
        +     since="1.2.7")
        +java.lang.reflect.Method targetMethod()
        +
        The method that defines the current property or example.
        +
        +
        Returns:
        +
        a Method instance
        +
        +
      • +
      + + + +
        +
      • +

        containerClass

        +
        @API(status=EXPERIMENTAL,
        +     since="1.2.7")
        +java.lang.Class<?> containerClass()
        +
        The container class in which the current property method is running. + +

        + Most of the time that's also the defining class. It differs when + running properties that are defined in a super class or an implemented interface. +

        +
        +
        Returns:
        +
        a Class instance
        +
        +
      • +
      + + + +
        +
      • +

        testInstance

        +
        @API(status=EXPERIMENTAL,
        +     since="1.2.7")
        +java.lang.Object testInstance()
        +
        The current instance of the property's container class. + There is exactly one instance per property method. + +

        + Mind that all tries of a property share the same test instance. +

        +
        +
        Returns:
        +
        an instance of the container class in which the current property method is running
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/package-frame.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/package-frame.html new file mode 100644 index 000000000..c00cfedd3 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/package-frame.html @@ -0,0 +1,73 @@ + + + + + +net.jqwik.api.lifecycle (documentation 1.3.0 API) + + + + +

net.jqwik.api.lifecycle

+
+

Interfaces

+ +

Classes

+ +

Enums

+ +

Exceptions

+ +

Annotation Types

+ +
+ + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/package-summary.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/package-summary.html new file mode 100644 index 000000000..831a64410 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/package-summary.html @@ -0,0 +1,468 @@ + + + + + +net.jqwik.api.lifecycle (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + +
+

Package net.jqwik.api.lifecycle

+
+
+ +
+ +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/package-tree.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/package-tree.html new file mode 100644 index 000000000..1e2a50e04 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/package-tree.html @@ -0,0 +1,222 @@ + + + + + +net.jqwik.api.lifecycle Class Hierarchy (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + +
+

Hierarchy For Package net.jqwik.api.lifecycle

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Interface Hierarchy

+ +

Annotation Type Hierarchy

+ +

Enum Hierarchy

+ +
+ +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/package-frame.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/package-frame.html new file mode 100644 index 000000000..0cfd7528d --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/package-frame.html @@ -0,0 +1,106 @@ + + + + + +net.jqwik.api (documentation 1.3.0 API) + + + + +

net.jqwik.api

+
+

Interfaces

+ +

Classes

+ +

Enums

+ +

Exceptions

+ +

Annotation Types

+ +
+ + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/package-summary.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/package-summary.html new file mode 100644 index 000000000..287a5697e --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/package-summary.html @@ -0,0 +1,530 @@ + + + + + +net.jqwik.api (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + +
+

Package net.jqwik.api

+
+
+ +
+ +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/package-tree.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/package-tree.html new file mode 100644 index 000000000..89565bd76 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/package-tree.html @@ -0,0 +1,279 @@ + + + + + +net.jqwik.api Class Hierarchy (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + +
+

Hierarchy For Package net.jqwik.api

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Interface Hierarchy

+ +

Annotation Type Hierarchy

+ +

Enum Hierarchy

+ +
+ +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/providers/ArbitraryProvider.SubtypeProvider.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/providers/ArbitraryProvider.SubtypeProvider.html new file mode 100644 index 000000000..566869db4 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/providers/ArbitraryProvider.SubtypeProvider.html @@ -0,0 +1,253 @@ + + + + + +ArbitraryProvider.SubtypeProvider (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.providers
+

Interface ArbitraryProvider.SubtypeProvider

+
+
+
+
    +
  • +
    +
    All Superinterfaces:
    +
    java.util.function.Function<TypeUsage,java.util.Set<Arbitrary<?>>>
    +
    +
    +
    Enclosing interface:
    +
    ArbitraryProvider
    +
    +
    +
    Functional Interface:
    +
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
    +
    +
    +
    +
    @FunctionalInterface
    +public static interface ArbitraryProvider.SubtypeProvider
    +extends java.util.function.Function<TypeUsage,java.util.Set<Arbitrary<?>>>
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + +
      All Methods Instance Methods Default Methods 
      Modifier and TypeMethod and Description
      default java.util.stream.Stream<java.util.List<Arbitrary<?>>>resolveAndCombine(TypeUsage... typeUsages) +
      Resolve all typeUsages and return a stream of all possible arbitraries + combinations per type.
      +
      +
        +
      • + + +

        Methods inherited from interface java.util.function.Function

        +andThen, apply, compose, identity
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        resolveAndCombine

        +
        @API(status=EXPERIMENTAL,
        +     since="1.2.0")
        +default java.util.stream.Stream<java.util.List<Arbitrary<?>>> resolveAndCombine(TypeUsage... typeUsages)
        +
        Resolve all typeUsages and return a stream of all possible arbitraries + combinations per type. The list of arbitraries returned in the + stream has the same size as the number of typeUsages handed in.
        +
        +
        Parameters:
        +
        typeUsages -
        +
        Returns:
        +
        stream of list of arbitraries
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/providers/ArbitraryProvider.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/providers/ArbitraryProvider.html new file mode 100644 index 000000000..77429a2ad --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/providers/ArbitraryProvider.html @@ -0,0 +1,307 @@ + + + + + +ArbitraryProvider (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.providers
+

Interface ArbitraryProvider

+
+
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        canProvideFor

        +
        boolean canProvideFor(TypeUsage targetType)
        +
        Return true if the provider is suitable for targetType
        +
      • +
      + + + +
        +
      • +

        provideFor

        +
        java.util.Set<Arbitrary<?>> provideFor(TypeUsage targetType,
        +                                       ArbitraryProvider.SubtypeProvider subtypeProvider)
        +
        This is the method you must override in your own implementations of ArbitraryProvider. + It should return a set of arbitrary instances for a given targetType. +

        + Only targetTypes that have been allowed by canProvideFor(TypeUsage) + will be given to this method. +

        + subtypeProvider can be used to get the arbitraries for any type argument of targetType.

        +
      • +
      + + + +
        +
      • +

        priority

        +
        default int priority()
        +
        Providers with higher priority will replace providers with lower priority. If there is more than one + provider for a given type with the same priority, there results will add up in a single set of arbitraries + to use. + +
          +
        • Override with value > 0 to replace most of _jqwik_'s default providers.
        • +
        • Override with value > 100 to replace arbitrary provisioning for unrestricted type variables and wildcard types.
        • +
        • Override with value > 100 to replace arbitrary provisioning for plain type Object.
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/providers/TypeUsage.TypeUsageFacade.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/providers/TypeUsage.TypeUsageFacade.html new file mode 100644 index 000000000..8945ec330 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/providers/TypeUsage.TypeUsageFacade.html @@ -0,0 +1,301 @@ + + + + + +TypeUsage.TypeUsageFacade (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.providers
+

Class TypeUsage.TypeUsageFacade

+
+
+ +
+
    +
  • +
    +
    Enclosing interface:
    +
    TypeUsage
    +
    +
    +
    +
    @API(status=INTERNAL)
    +public abstract static class TypeUsage.TypeUsageFacade
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      TypeUsageFacade() 
      +
    • +
    + + +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        TypeUsageFacade

        +
        public TypeUsageFacade()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        of

        +
        public abstract TypeUsage of(java.lang.Class<?> type,
        +                             TypeUsage... typeParameters)
        +
      • +
      + + + + + + + +
        +
      • +

        forType

        +
        public abstract TypeUsage forType(java.lang.reflect.Type type)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/providers/TypeUsage.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/providers/TypeUsage.html new file mode 100644 index 000000000..12393c1d0 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/providers/TypeUsage.html @@ -0,0 +1,676 @@ + + + + + +TypeUsage (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.providers
+

Interface TypeUsage

+
+
+
+
    +
  • +
    +
    +
    @API(status=MAINTAINED,
    +     since="1.0")
    +public interface TypeUsage
    +
    An instance of TypeUsage describes the information available for parameter or return types. + The class is supposed to relieve its users from all the intricacies of the Java reflection API. + Doing that it will resolve meta annotations, repeated annotations as well as annotated type parameters. +

    + TypeUsage provides access to: +

      +
    • the native type of an object
    • +
    • the component type (if it's an array)
    • +
    • the type parameters (again as instances of TypeUsage)
    • +
    • the annotations (if the object is derived from a parameter)
    • +
    • methods to test for compatibility of types that do also handle compatibility + between raw types and boxed type
    • +
    +

    + Within the public API TypeUsage is used in two places: +

    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      + + + + + + + + + + +
      Nested Classes 
      Modifier and TypeInterface and Description
      static class TypeUsage.TypeUsageFacade 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Instance Methods Abstract Methods Default Methods 
      Modifier and TypeMethod and Description
      booleancanBeAssignedTo(TypeUsage targetType) +
      Check if an instance can be assigned to another TypeUsage instance.
      +
      <A extends java.lang.annotation.Annotation>
      java.util.Optional<A>
      findAnnotation(java.lang.Class<A> annotationType) +
      Return an Optional of the first instance of a specific annotationType + if there is one (directly or indirectly through meta-annotations).
      +
      static TypeUsageforType(java.lang.reflect.Type type) 
      java.lang.reflect.AnnotatedTypegetAnnotatedType() 
      java.util.List<java.lang.annotation.Annotation>getAnnotations() +
      Return all annotations of a parameter (or an annotated type argument).
      +
      java.util.Optional<TypeUsage>getComponentType() +
      Return an Optional of an array's component type - if it is an array.
      +
      java.util.List<TypeUsage>getInterfaces() +
      Return interfaces of this type.
      +
      java.util.List<TypeUsage>getLowerBounds() +
      Return lower bounds if a generic type is a wildcard.
      +
      java.lang.Class<?>getRawType() +
      Return the raw type which is usually the class or interface you see in a parameters or return values + specification.
      +
      java.util.Optional<TypeUsage>getSuperclass() +
      Return superclass of this type.
      +
      java.lang.reflect.TypegetType() 
      TypeUsagegetTypeArgument(int position) +
      Return the type argument at a specific position.
      +
      java.util.List<TypeUsage>getTypeArguments() +
      Return the type arguments of a generic type in the order of there appearance in a type's declaration.
      +
      java.util.List<TypeUsage>getUpperBounds() +
      Return upper bounds if a generic type is a wildcard or type variable.
      +
      <A extends java.lang.annotation.Annotation>
      boolean
      isAnnotated(java.lang.Class<A> annotationType) +
      Return true if the current instance is annotated (directly or indirectly through meta-annotations) + with a specific annotationType.
      +
      booleanisArray() +
      Return true if a type is an array type.
      +
      booleanisAssignableFrom(java.lang.Class<?> providedClass) +
      Check if a given providedClass is assignable from this generic type.
      +
      booleanisEnum() +
      Return true if a type is an enum type.
      +
      booleanisGeneric() +
      Return true if a type has any type arguments itself.
      +
      booleanisOfType(java.lang.Class<?> aRawType) +
      Check if an instance is of a specific raw type + + Most of the time this is what you want to do when checking for applicability of a + ArbitraryProvider.
      +
      booleanisTypeVariable() +
      Return true if a generic type is a wildcard.
      +
      booleanisTypeVariableOrWildcard() +
      Return true if a generic type is a type variable or a wildcard.
      +
      booleanisVoid() +
      Return true if type is Void.
      +
      booleanisWildcard() +
      Return true if a generic type is a wildcard.
      +
      static TypeUsageof(java.lang.Class<?> type, + TypeUsage... typeParameters) 
      static TypeUsagewildcard(TypeUsage upperBound) 
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        of

        +
        static TypeUsage of(java.lang.Class<?> type,
        +                    TypeUsage... typeParameters)
        +
      • +
      + + + + + + + +
        +
      • +

        forType

        +
        static TypeUsage forType(java.lang.reflect.Type type)
        +
      • +
      + + + +
        +
      • +

        getRawType

        +
        java.lang.Class<?> getRawType()
        +
        Return the raw type which is usually the class or interface you see in a parameters or return values + specification. +

        + A raw type always exists.

        +
      • +
      + + + +
        +
      • +

        getUpperBounds

        +
        java.util.List<TypeUsage> getUpperBounds()
        +
        Return upper bounds if a generic type is a wildcard or type variable. + TypeUsage.of(Object.class) is always included.
        +
      • +
      + + + +
        +
      • +

        getLowerBounds

        +
        java.util.List<TypeUsage> getLowerBounds()
        +
        Return lower bounds if a generic type is a wildcard.
        +
      • +
      + + + +
        +
      • +

        isWildcard

        +
        boolean isWildcard()
        +
        Return true if a generic type is a wildcard.
        +
      • +
      + + + +
        +
      • +

        isTypeVariable

        +
        boolean isTypeVariable()
        +
        Return true if a generic type is a wildcard.
        +
      • +
      + + + +
        +
      • +

        isTypeVariableOrWildcard

        +
        boolean isTypeVariableOrWildcard()
        +
        Return true if a generic type is a type variable or a wildcard.
        +
      • +
      + + + +
        +
      • +

        getTypeArguments

        +
        java.util.List<TypeUsage> getTypeArguments()
        +
        Return the type arguments of a generic type in the order of there appearance in a type's declaration.
        +
      • +
      + + + +
        +
      • +

        getTypeArgument

        +
        TypeUsage getTypeArgument(int position)
        +
        Return the type argument at a specific position.
        +
      • +
      + + + +
        +
      • +

        isOfType

        +
        boolean isOfType(java.lang.Class<?> aRawType)
        +
        Check if an instance is of a specific raw type +

        + Most of the time this is what you want to do when checking for applicability of a + ArbitraryProvider.

        +
      • +
      + + + +
        +
      • +

        canBeAssignedTo

        +
        boolean canBeAssignedTo(TypeUsage targetType)
        +
        Check if an instance can be assigned to another TypeUsage instance.
        +
      • +
      + + + +
        +
      • +

        isGeneric

        +
        boolean isGeneric()
        +
        Return true if a type has any type arguments itself.
        +
      • +
      + + + +
        +
      • +

        isEnum

        +
        boolean isEnum()
        +
        Return true if a type is an enum type.
        +
      • +
      + + + +
        +
      • +

        isArray

        +
        boolean isArray()
        +
        Return true if a type is an array type.
        +
      • +
      + + + +
        +
      • +

        getAnnotations

        +
        java.util.List<java.lang.annotation.Annotation> getAnnotations()
        +
        Return all annotations of a parameter (or an annotated type argument). +

        + This list already contains all meta annotations, repeated annotations and annotations + from annotated type arguments. Thus, it does much more than the usual Java reflection API.

        +
      • +
      + + + +
        +
      • +

        findAnnotation

        +
        <A extends java.lang.annotation.Annotation> java.util.Optional<A> findAnnotation(java.lang.Class<A> annotationType)
        +
        Return an Optional of the first instance of a specific annotationType + if there is one (directly or indirectly through meta-annotations).
        +
      • +
      + + + +
        +
      • +

        isAnnotated

        +
        <A extends java.lang.annotation.Annotation> boolean isAnnotated(java.lang.Class<A> annotationType)
        +
        Return true if the current instance is annotated (directly or indirectly through meta-annotations) + with a specific annotationType.
        +
      • +
      + + + +
        +
      • +

        isAssignableFrom

        +
        boolean isAssignableFrom(java.lang.Class<?> providedClass)
        +
        Check if a given providedClass is assignable from this generic type.
        +
      • +
      + + + +
        +
      • +

        getComponentType

        +
        java.util.Optional<TypeUsage> getComponentType()
        +
        Return an Optional of an array's component type - if it is an array.
        +
      • +
      + + + +
        +
      • +

        isVoid

        +
        @API(status=EXPERIMENTAL,
        +     since="1.2.0")
        +boolean isVoid()
        +
        Return true if type is Void.
        +
      • +
      + + + +
        +
      • +

        getSuperclass

        +
        @API(status=EXPERIMENTAL,
        +     since="1.2.0")
        +java.util.Optional<TypeUsage> getSuperclass()
        +
        Return superclass of this type.
        +
      • +
      + + + +
        +
      • +

        getInterfaces

        +
        @API(status=EXPERIMENTAL,
        +     since="1.2.0")
        +java.util.List<TypeUsage> getInterfaces()
        +
        Return interfaces of this type.
        +
      • +
      + + + +
        +
      • +

        getType

        +
        @API(status=INTERNAL,
        +     since="1.2.0")
        +java.lang.reflect.Type getType()
        +
      • +
      + + + +
        +
      • +

        getAnnotatedType

        +
        @API(status=INTERNAL,
        +     since="1.2.0")
        +java.lang.reflect.AnnotatedType getAnnotatedType()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/providers/package-frame.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/providers/package-frame.html new file mode 100644 index 000000000..746b8fb00 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/providers/package-frame.html @@ -0,0 +1,25 @@ + + + + + +net.jqwik.api.providers (documentation 1.3.0 API) + + + + +

net.jqwik.api.providers

+
+

Interfaces

+ +

Classes

+ +
+ + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/providers/package-summary.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/providers/package-summary.html new file mode 100644 index 000000000..a63a87d1a --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/providers/package-summary.html @@ -0,0 +1,167 @@ + + + + + +net.jqwik.api.providers (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + +
+

Package net.jqwik.api.providers

+
+
+ +
+ +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/providers/package-tree.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/providers/package-tree.html new file mode 100644 index 000000000..59187cfe0 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/providers/package-tree.html @@ -0,0 +1,144 @@ + + + + + +net.jqwik.api.providers Class Hierarchy (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + +
+

Hierarchy For Package net.jqwik.api.providers

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Interface Hierarchy

+ +
+ +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/stateful/Action.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/stateful/Action.html new file mode 100644 index 000000000..5122e3cdb --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/stateful/Action.html @@ -0,0 +1,263 @@ + + + + + +Action (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.stateful
+

Interface Action<S>

+
+
+
+
    +
  • +
    +
    Type Parameters:
    +
    S -
    +
    +
    +
    +
    @API(status=MAINTAINED,
    +     since="1.0")
    +public interface Action<S>
    +
    An action class represents a state change that can be preformed + on a stateful S. + + At runtime the execution of an action is regulated by a precondition.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and TypeMethod and Description
      default booleanprecondition(S state) +
      If this method returns false, the action will not be performed.
      +
      Srun(S state) +
      Perform an action on state S and return the same state (if it has state) + or a new one representing the new state.
      +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + + + +
        +
      • +

        precondition

        +
        default boolean precondition(S state)
        +
        If this method returns false, the action will not be performed.
        +
        +
        Parameters:
        +
        state -
        +
        Returns:
        +
        +
      • +
      + + + + + +
        +
      • +

        run

        +
        S run(S state)
        +
        Perform an action on state S and return the same state (if it has state) + or a new one representing the new state.
        +
        +
        Parameters:
        +
        state -
        +
        Returns:
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/stateful/ActionSequence.RunState.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/stateful/ActionSequence.RunState.html new file mode 100644 index 000000000..23e996f70 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/stateful/ActionSequence.RunState.html @@ -0,0 +1,366 @@ + + + + + +ActionSequence.RunState (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.stateful
+

Enum ActionSequence.RunState

+
+
+ +
+ +
+
+
    +
  • + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static ActionSequence.RunStatevalueOf(java.lang.String name) +
      Returns the enum constant of this type with the specified name.
      +
      static ActionSequence.RunState[]values() +
      Returns an array containing the constants of this enum type, in +the order they are declared.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Enum

        +clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +getClass, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static ActionSequence.RunState[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (ActionSequence.RunState c : ActionSequence.RunState.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static ActionSequence.RunState valueOf(java.lang.String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        +
        java.lang.NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/stateful/ActionSequence.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/stateful/ActionSequence.html new file mode 100644 index 000000000..dcde73346 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/stateful/ActionSequence.html @@ -0,0 +1,364 @@ + + + + + +ActionSequence (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.stateful
+

Interface ActionSequence<M>

+
+
+
+
    +
  • +
    +
    Type Parameters:
    +
    M - The type of the model
    +
    +
    +
    +
    @API(status=MAINTAINED,
    +     since="1.0")
    +public interface ActionSequence<M>
    +
    A sequence of Actions that can be run with a model of type M
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        runActions

        +
        java.util.List<Action<M>> runActions()
        +
      • +
      + + + + + +
        +
      • +

        run

        +
        M run(M model)
        +
      • +
      + + + + + + + +
        +
      • +

        withInvariant

        +
        @API(status=EXPERIMENTAL,
        +     since="1.2.5")
        +ActionSequence<M> withInvariant(java.lang.String label,
        +                                                                              Invariant<M> invariant)
        +
        Add a labelled invariant to a sequence.
        +
        +
        Parameters:
        +
        label - will show up in error messages when the invariant fails
        +
        invariant - will be checked after each successful invocation of run(Object)
        +
        Returns:
        +
        the same sequence instance
        +
        See Also:
        +
        withInvariant(Invariant)
        +
        +
      • +
      + + + +
        +
      • +

        finalModel

        +
        M finalModel()
        +
      • +
      + + + + + + + +
        +
      • +

        peek

        +
        @API(status=EXPERIMENTAL,
        +     since="1.2.5")
        +ActionSequence<M> peek(java.util.function.Consumer<M> modelPeeker)
        +
        Peek into the model of a running sequence. + The modelPeeker will be called after each successful + invocation of run(Object) but before checking invariants.
        +
        +
        Parameters:
        +
        modelPeeker -
        +
        Returns:
        +
        the same sequence instance
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/stateful/ActionSequenceArbitrary.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/stateful/ActionSequenceArbitrary.html new file mode 100644 index 000000000..2068c60d2 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/stateful/ActionSequenceArbitrary.html @@ -0,0 +1,297 @@ + + + + + +ActionSequenceArbitrary (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.stateful
+

Interface ActionSequenceArbitrary<M>

+
+
+
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/stateful/Invariant.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/stateful/Invariant.html new file mode 100644 index 000000000..d08081dbf --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/stateful/Invariant.html @@ -0,0 +1,227 @@ + + + + + +Invariant (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.stateful
+

Interface Invariant<T>

+
+
+
+
    +
  • +
    +
    Functional Interface:
    +
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
    +
    +
    +
    +
    @FunctionalInterface
    + @API(status=MAINTAINED,
    +     since="1.0")
    +public interface Invariant<T>
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + + + +
        +
      • +

        check

        +
        void check(T model)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/stateful/package-frame.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/stateful/package-frame.html new file mode 100644 index 000000000..df65e1b04 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/stateful/package-frame.html @@ -0,0 +1,26 @@ + + + + + +net.jqwik.api.stateful (documentation 1.3.0 API) + + + + +

net.jqwik.api.stateful

+
+

Interfaces

+ +

Enums

+ +
+ + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/stateful/package-summary.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/stateful/package-summary.html new file mode 100644 index 000000000..2cb48d3be --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/stateful/package-summary.html @@ -0,0 +1,171 @@ + + + + + +net.jqwik.api.stateful (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + +
+

Package net.jqwik.api.stateful

+
+
+ +
+ +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/stateful/package-tree.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/stateful/package-tree.html new file mode 100644 index 000000000..5ace0b54a --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/stateful/package-tree.html @@ -0,0 +1,153 @@ + + + + + +net.jqwik.api.stateful Class Hierarchy (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + +
+

Hierarchy For Package net.jqwik.api.stateful

+Package Hierarchies: + +
+
+

Interface Hierarchy

+ +

Enum Hierarchy

+ +
+ +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/Histogram.Bucket.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/Histogram.Bucket.html new file mode 100644 index 000000000..a55aa4309 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/Histogram.Bucket.html @@ -0,0 +1,252 @@ + + + + + +Histogram.Bucket (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.statistics
+

Class Histogram.Bucket

+
+
+ +
+
    +
  • +
    +
    Enclosing class:
    +
    Histogram
    +
    +
    +
    +
    public static class Histogram.Bucket
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      Bucket(java.lang.String label) 
      Bucket(java.lang.String label, + int initialCount) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Bucket

        +
        public Bucket(java.lang.String label)
        +
      • +
      + + + +
        +
      • +

        Bucket

        +
        public Bucket(java.lang.String label,
        +              int initialCount)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/Histogram.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/Histogram.html new file mode 100644 index 000000000..3c5d021e4 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/Histogram.html @@ -0,0 +1,413 @@ + + + + + +Histogram (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.statistics
+

Class Histogram

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    StatisticsReportFormat
    +
    +
    +
    Direct Known Subclasses:
    +
    NumberRangeHistogram
    +
    +
    +
    +
    @API(status=EXPERIMENTAL,
    +     since="1.3.0")
    +public class Histogram
    +extends java.lang.Object
    +implements StatisticsReportFormat
    +
    A statistics report format to display collected statistics entries as a histogram
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      + + + + + + + + + + +
      Nested Classes 
      Modifier and TypeClass and Description
      static class Histogram.Bucket 
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      Histogram() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected java.util.List<Histogram.Bucket>cluster(java.util.List<StatisticsEntry> entries) +
      Cluster entries into buckets.
      +
      protected java.util.Comparator<? super StatisticsEntry>comparator() +
      Determine how entries are being sorted from top to bottom.
      +
      java.util.List<java.lang.String>formatReport(java.util.List<StatisticsEntry> entries) +
      Return a list of report lines.
      +
      protected java.lang.Stringlabel(StatisticsEntry entry) +
      Determine how entries are being labelled in the histogram.
      +
      protected intmaxDrawRange() +
      Determine how many block characters are maximally used to draw the distribution.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Histogram

        +
        public Histogram()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        formatReport

        +
        public java.util.List<java.lang.String> formatReport(java.util.List<StatisticsEntry> entries)
        +
        Description copied from interface: StatisticsReportFormat
        +
        Return a list of report lines. Often, one line will represent one entry + but that must not necessarily be the case.
        +
        +
        Specified by:
        +
        formatReport in interface StatisticsReportFormat
        +
        Returns:
        +
        All report lines. No trailing `CR` or `LF` characters are needed.
        +
        See Also:
        +
        StatisticsEntry
        +
        +
      • +
      + + + +
        +
      • +

        maxDrawRange

        +
        protected int maxDrawRange()
        +
        Determine how many block characters are maximally used to draw the distribution. + The more you have the further the histogram extends to the right. + +

        + Can be overridden. +

        +
        +
        Returns:
        +
        A positive number. Default is 80.
        +
        +
      • +
      + + + +
        +
      • +

        comparator

        +
        protected java.util.Comparator<? super StatisticsEntry> comparator()
        +
        Determine how entries are being sorted from top to bottom. + +

        + Can be overridden. +

        +
        +
        Returns:
        +
        A comparator instance.
        +
        +
      • +
      + + + +
        +
      • +

        label

        +
        protected java.lang.String label(StatisticsEntry entry)
        +
        Determine how entries are being labelled in the histogram. + +

        + Can be overridden. +

        +
        +
        Parameters:
        +
        entry -
        +
        Returns:
        +
        A non-null string
        +
        +
      • +
      + + + +
        +
      • +

        cluster

        +
        protected java.util.List<Histogram.Bucket> cluster(java.util.List<StatisticsEntry> entries)
        +
        Cluster entries into buckets. + +

        + Override if entries should be aggregated into buckets to display in histogram. +

        +
        +
        Parameters:
        +
        entries - An already sorted list of entries
        +
        Returns:
        +
        A sorted list of buckets
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/NumberRangeHistogram.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/NumberRangeHistogram.html new file mode 100644 index 000000000..212b837f2 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/NumberRangeHistogram.html @@ -0,0 +1,408 @@ + + + + + +NumberRangeHistogram (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.statistics
+

Class NumberRangeHistogram

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    StatisticsReportFormat
    +
    +
    +
    +
    @API(status=EXPERIMENTAL,
    +     since="1.3.0")
    +public class NumberRangeHistogram
    +extends Histogram
    +
    A specialized type of Histogram to divide collected numbers + into range-based clusters for display in a histogram.
    +
  • +
+
+
+
    +
  • + + + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected intbuckets() +
      Determines the number of buckets into which the full range of collected + numbers will be clustered.
      +
      protected java.util.List<Histogram.Bucket>cluster(java.util.List<StatisticsEntry> entries) +
      Does not make sense to override because this has the number range functionality
      +
      protected java.util.Comparator<? super StatisticsEntry>comparator() +
      Does not make sense to override since order does not matter for clustering anyway
      +
      protected java.lang.Stringlabel(StatisticsEntry entry) +
      Does not make sense to override since these labels won't be used anyway
      +
      protected java.lang.StringrangeLabel(java.math.BigInteger min, + java.math.BigInteger max, + boolean maxIncluded) +
      Determines how a range of numbers is being displayed.
      +
      + +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        NumberRangeHistogram

        +
        public NumberRangeHistogram()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        buckets

        +
        protected int buckets()
        +
        Determines the number of buckets into which the full range of collected + numbers will be clustered.
        +
        +
        Returns:
        +
        A number greater than 0
        +
        +
      • +
      + + + +
        +
      • +

        rangeLabel

        +
        protected java.lang.String rangeLabel(java.math.BigInteger min,
        +                                      java.math.BigInteger max,
        +                                      boolean maxIncluded)
        +
        Determines how a range of numbers is being displayed.
        +
        +
        Parameters:
        +
        min - The minimum value of the range (included)
        +
        max - The maximum value of the range
        +
        maxIncluded - If the maximum value is included in the range
        +
        Returns:
        +
        A string to describe the range
        +
        +
      • +
      + + + +
        +
      • +

        label

        +
        protected final java.lang.String label(StatisticsEntry entry)
        +
        Does not make sense to override since these labels won't be used anyway
        +
        +
        Overrides:
        +
        label in class Histogram
        +
        Returns:
        +
        A non-null string
        +
        +
      • +
      + + + +
        +
      • +

        comparator

        +
        protected final java.util.Comparator<? super StatisticsEntry> comparator()
        +
        Does not make sense to override since order does not matter for clustering anyway
        +
        +
        Overrides:
        +
        comparator in class Histogram
        +
        Returns:
        +
        A comparator instance.
        +
        +
      • +
      + + + +
        +
      • +

        cluster

        +
        protected final java.util.List<Histogram.Bucket> cluster(java.util.List<StatisticsEntry> entries)
        +
        Does not make sense to override because this has the number range functionality
        +
        +
        Overrides:
        +
        cluster in class Histogram
        +
        Parameters:
        +
        entries - An already sorted list of entries
        +
        Returns:
        +
        A sorted list of buckets
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/Statistics.StatisticsFacade.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/Statistics.StatisticsFacade.html new file mode 100644 index 000000000..ad32d2a5e --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/Statistics.StatisticsFacade.html @@ -0,0 +1,285 @@ + + + + + +Statistics.StatisticsFacade (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.statistics
+

Class Statistics.StatisticsFacade

+
+
+ +
+
    +
  • +
    +
    Enclosing class:
    +
    Statistics
    +
    +
    +
    +
    public abstract static class Statistics.StatisticsFacade
    +extends java.lang.Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        StatisticsFacade

        +
        public StatisticsFacade()
        +
      • +
      +
    • +
    + + +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/Statistics.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/Statistics.html new file mode 100644 index 000000000..88b17aee2 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/Statistics.html @@ -0,0 +1,362 @@ + + + + + +Statistics (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.statistics
+

Class Statistics

+
+
+ +
+
    +
  • +
    +
    +
    @API(status=MAINTAINED,
    +     since="1.2.3")
    +public class Statistics
    +extends java.lang.Object
    +
    This class serves as a container for static methods to collect statistical + data about generated values within a property method and to check coverage + of that data.
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static voidcollect(java.lang.Object... values) +
      Call this method to record an entry for statistical data about generated values.
      +
      static voidcoverage(java.util.function.Consumer<StatisticsCoverage> checker) +
      Perform coverage checking for successful property on statistics + for values collected with collect(Object...)
      +
      static StatisticsCollectorlabel(java.lang.String label) +
      Call this method to get a labeled instance of StatisticsCollector.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        collect

        +
        public static void collect(java.lang.Object... values)
        +
        Call this method to record an entry for statistical data about generated values. + As soon as this method is called at least once in a property method, + the statistical data will be reported after the property has finished. +

        + Usually you call collect(Object[]) method with all arbitraries + (parameters passed to test) and than you use coverage(Consumer) + method to ensure that certain count of some value has been tried. +

        + NOTE: you can give descriptive name to some collections using label(String) + method. Usually you make multiple label+collect calls, i.e. for each passed arbitrary + parameter. This way you can provide parameters with descriptive names/labels. +

        + Complete documentation is found at + + the jqwik documentation page for Checking Coverage of Collected Statistics. +

        + Simple example: + +

        + @Property(generation = GenerationMode.RANDOMIZED)
        + void labeledStatistics(@ForAll @IntRange(min = 1, max = 10) Integer anInt) {
        +        String range = anInt < 3 ? "small" : "large";
        +        Statistics.label("range").collect(range);
        +        Statistics.label("value").collect(anInt);
        +
        +        Statistics.label("range).coverage(
        +                coverage -> coverage.check("small").percentage(p -> p > 20.0)
        +         );
        +        Statistics.label("value").coverage(
        +                coverage -> coverage.check(0).count(c -> c > 0)
        +         );
        + }
        + 
        +
        +
        Parameters:
        +
        values - Can be anything. The list of these values is considered + a key for the reported table of frequencies. Constraints: +
          +
        • There must be at least one value
        • +
        • The number of values must always be the same in a single property
        • +
        • Values can be null
        • +
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if one of the constraints on values is violated
        +
        See Also:
        +
        label(String)
        +
        +
      • +
      + + + + + + + +
        +
      • +

        coverage

        +
        @API(status=EXPERIMENTAL,
        +     since="1.2.3")
        +public static void coverage(java.util.function.Consumer<StatisticsCoverage> checker)
        +
        Perform coverage checking for successful property on statistics + for values collected with collect(Object...) +

        + Sample usage: + +

        + Statistics.coverage(coverage -> coverage.check("small").percentage(p -> p > 20.0));
        + Statistics.coverage(coverage -> coverage.check(0).count(c -> c > 0));
        + 
        +
        +
        Parameters:
        +
        checker - Code that consumes a StatisticsCoverage object
        +
        See Also:
        +
        javadoc of the collect(Object...) method for example usage
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/StatisticsCollector.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/StatisticsCollector.html new file mode 100644 index 000000000..80712343c --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/StatisticsCollector.html @@ -0,0 +1,272 @@ + + + + + +StatisticsCollector (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.statistics
+

Interface StatisticsCollector

+
+
+
+
    +
  • +
    +
    +
    @API(status=MAINTAINED,
    +     since="1.2.3")
    +public interface StatisticsCollector
    +
    This class serves as an interface to collect statistical + data about generated values within a property method.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        collect

        +
        StatisticsCollector collect(java.lang.Object... values)
        +
        Call this method to record an entry for statistical data about generated values. + As soon as this method is called at least once in a property method, + the statistical data will be reported after the property has finished. + +

        + For examples see Statistics.collect(Object...) +

        +
        +
        Parameters:
        +
        values - Can be anything. The list of these values is considered + a key for the reported table of frequencies. Constraints: +
          +
        • There must be at least one value
        • +
        • The number of values for the same collector (i.e. same label) + must always be the same in a single property
        • +
        • Values can be null
        • +
        +
        Returns:
        +
        The current instance of collector to allow a fluent coverage API
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if one of the constraints on values is violated
        +
        +
      • +
      + + + +
        +
      • +

        coverage

        +
        @API(status=EXPERIMENTAL,
        +     since="1.2.3")
        +void coverage(java.util.function.Consumer<StatisticsCoverage> checker)
        +
        Perform coverage checking for successful property on statistics. + +

        + For examples see Statistics.coverage(Consumer) +

        +
        +
        Parameters:
        +
        checker - Code that consumes a StatisticsCoverage object
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/StatisticsCoverage.CoverageChecker.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/StatisticsCoverage.CoverageChecker.html new file mode 100644 index 000000000..380197524 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/StatisticsCoverage.CoverageChecker.html @@ -0,0 +1,335 @@ + + + + + +StatisticsCoverage.CoverageChecker (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.statistics
+

Interface StatisticsCoverage.CoverageChecker

+
+
+
+
    +
  • +
    +
    Enclosing interface:
    +
    StatisticsCoverage
    +
    +
    +
    +
    public static interface StatisticsCoverage.CoverageChecker
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethod and Description
      voidcount(java.util.function.BiConsumer<java.lang.Integer,java.lang.Integer> countChecker) +
      Check the number of occurrences using one or more assertions.
      +
      voidcount(java.util.function.BiPredicate<java.lang.Integer,java.lang.Integer> countChecker) +
      Check the number of occurrences using one or more assertions.
      +
      voidcount(java.util.function.Consumer<java.lang.Integer> countChecker) +
      Check the number of occurrences returning true (ok) or false (fail).
      +
      voidcount(java.util.function.Predicate<java.lang.Integer> countChecker) +
      Check the number of occurrences returning true (ok) or false (fail)
      +
      voidpercentage(java.util.function.Consumer<java.lang.Double> percentageChecker) +
      Check the number of occurrences returning true (ok) or false (fail).
      +
      voidpercentage(java.util.function.Predicate<java.lang.Double> percentageChecker) +
      Check the percentage of occurrences returning true (ok) or false (fail)
      +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        count

        +
        void count(java.util.function.Predicate<java.lang.Integer> countChecker)
        +
        Check the number of occurrences returning true (ok) or false (fail)
        +
        +
        Parameters:
        +
        countChecker - a predicate to accept a selected value set's number of occurrences
        +
        +
      • +
      + + + +
        +
      • +

        count

        +
        void count(java.util.function.BiPredicate<java.lang.Integer,java.lang.Integer> countChecker)
        +
        Check the number of occurrences using one or more assertions.
        +
        +
        Parameters:
        +
        countChecker - a consumer to accept a selected value set's number of occurrences + and the count of all submitted value sets to compare with + or make a calculation
        +
        +
      • +
      + + + +
        +
      • +

        count

        +
        void count(java.util.function.Consumer<java.lang.Integer> countChecker)
        +
        Check the number of occurrences returning true (ok) or false (fail).
        +
        +
        Parameters:
        +
        countChecker - a predicate to accept a selected value set's number of occurrences
        +
        +
      • +
      + + + +
        +
      • +

        count

        +
        void count(java.util.function.BiConsumer<java.lang.Integer,java.lang.Integer> countChecker)
        +
        Check the number of occurrences using one or more assertions.
        +
        +
        Parameters:
        +
        countChecker - a predicate to accept a selected value set's number of occurrences + and the count of all submitted value sets to compare with + or make a calculation
        +
        +
      • +
      + + + +
        +
      • +

        percentage

        +
        void percentage(java.util.function.Predicate<java.lang.Double> percentageChecker)
        +
        Check the percentage of occurrences returning true (ok) or false (fail)
        +
        +
        Parameters:
        +
        percentageChecker - a predicate to accept a selected value set's + percentage (0.0 - 100.0) of occurrences
        +
        +
      • +
      + + + +
        +
      • +

        percentage

        +
        void percentage(java.util.function.Consumer<java.lang.Double> percentageChecker)
        +
        Check the number of occurrences returning true (ok) or false (fail).
        +
        +
        Parameters:
        +
        percentageChecker - a predicate to accept a selected value set's + percentage (0.0 - 100.0) of occurrences
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/StatisticsCoverage.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/StatisticsCoverage.html new file mode 100644 index 000000000..918c20a81 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/StatisticsCoverage.html @@ -0,0 +1,272 @@ + + + + + +StatisticsCoverage (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.statistics
+

Interface StatisticsCoverage

+
+
+
+
    +
  • +
    +
    +
    @API(status=EXPERIMENTAL,
    +     since="1.2.3")
    +public interface StatisticsCoverage
    +
    Intermediate object to provide statistics coverage checking capabilities
    +
    +
    See Also:
    +
    Statistics.coverage(Consumer)
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + + + + + +
        +
      • +

        checkQuery

        +
        StatisticsCoverage.CoverageChecker checkQuery(java.util.function.Predicate<? extends java.util.List<?>> query)
        +
        Execute a query for coverage checking.
        +
        +
        Parameters:
        +
        query - A Predicate that takes the collected values as parameter + and returns true if the specific values shall be counted.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/StatisticsEntry.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/StatisticsEntry.html new file mode 100644 index 000000000..0cbcfd9cf --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/StatisticsEntry.html @@ -0,0 +1,279 @@ + + + + + +StatisticsEntry (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.statistics
+

Interface StatisticsEntry

+
+
+
+
    +
  • +
    +
    +
    @API(status=EXPERIMENTAL,
    +     since="1.2.3")
    +public interface StatisticsEntry
    +
    Describes an entry for a given statistics selector. + This is used when plugging in your own statistics report formats.
    +
    +
    See Also:
    +
    StatisticsReportFormat
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethod and Description
      intcount() +
      The number of times a certain value (set) has been collected
      +
      java.lang.Stringname() +
      The name of an entry usually refers to the collected value(s)
      +
      doublepercentage() +
      The percentage of times a certain value (set) has been collected
      +
      java.util.List<java.lang.Object>values() +
      The values collected during Statistics.collect(Object...)
      +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        name

        +
        java.lang.String name()
        +
        The name of an entry usually refers to the collected value(s)
        +
      • +
      + + + +
        +
      • +

        count

        +
        int count()
        +
        The number of times a certain value (set) has been collected
        +
      • +
      + + + +
        +
      • +

        percentage

        +
        double percentage()
        +
        The percentage of times a certain value (set) has been collected
        +
      • +
      + + + +
        +
      • +

        values

        +
        @API(status=EXPERIMENTAL,
        +     since="1.3.0")
        +java.util.List<java.lang.Object> values()
        +
        The values collected during Statistics.collect(Object...)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/StatisticsReport.None.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/StatisticsReport.None.html new file mode 100644 index 000000000..48d60d749 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/StatisticsReport.None.html @@ -0,0 +1,291 @@ + + + + + +StatisticsReport.None (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.statistics
+

Class StatisticsReport.None

+
+
+ +
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      None() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      java.util.List<java.lang.String>formatReport(java.util.List<StatisticsEntry> entries) +
      Return a list of report lines.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        None

        +
        public None()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        formatReport

        +
        public java.util.List<java.lang.String> formatReport(java.util.List<StatisticsEntry> entries)
        +
        Description copied from interface: StatisticsReportFormat
        +
        Return a list of report lines. Often, one line will represent one entry + but that must not necessarily be the case.
        +
        +
        Specified by:
        +
        formatReport in interface StatisticsReportFormat
        +
        Returns:
        +
        All report lines. No trailing `CR` or `LF` characters are needed.
        +
        See Also:
        +
        StatisticsEntry
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/StatisticsReport.StatisticsReportMode.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/StatisticsReport.StatisticsReportMode.html new file mode 100644 index 000000000..0c4452578 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/StatisticsReport.StatisticsReportMode.html @@ -0,0 +1,363 @@ + + + + + +StatisticsReport.StatisticsReportMode (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.statistics
+

Enum StatisticsReport.StatisticsReportMode

+
+
+ +
+ +
+
+
    +
  • + +
      +
    • + + +

      Enum Constant Summary

      + + + + + + + + + + + + + + +
      Enum Constants 
      Enum Constant and Description
      OFF +
      No statistics report
      +
      PLUG_IN +
      Plug in your own format.
      +
      STANDARD +
      Standard statistics report format
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static StatisticsReport.StatisticsReportModevalueOf(java.lang.String name) +
      Returns the enum constant of this type with the specified name.
      +
      static StatisticsReport.StatisticsReportMode[]values() +
      Returns an array containing the constants of this enum type, in +the order they are declared.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Enum

        +clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +getClass, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static StatisticsReport.StatisticsReportMode[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (StatisticsReport.StatisticsReportMode c : StatisticsReport.StatisticsReportMode.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static StatisticsReport.StatisticsReportMode valueOf(java.lang.String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        +
        java.lang.NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/StatisticsReport.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/StatisticsReport.html new file mode 100644 index 000000000..a1f4d7090 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/StatisticsReport.html @@ -0,0 +1,260 @@ + + + + + +StatisticsReport (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.statistics
+

Annotation Type StatisticsReport

+
+
+
+
    +
  • +
    +
    +
    @Target(value={ANNOTATION_TYPE,METHOD,TYPE})
    + @Retention(value=RUNTIME)
    + @Documented
    + @API(status=EXPERIMENTAL,
    +     since="1.2.3")
    +public @interface StatisticsReport
    +
    This annotation can be used to influence statistics reporting. You can either + annotate a property method to change reporting for this property only + or a container class to change reporting for all properties in this class + or nested subclasses. +

    + There are three usage scenarios: +

      +
    • + Use @StatisticsReport(STANDARD) to enable the standard reporting. + This is the default anyway. +
    • +
    • + Use @StatisticsReport(OFF) to disable statistics reporting. +
    • +
    • + Use @StatisticsReport(format = YourReportFormat.class) to plug in your own format. +
    • +
    +
  • +
+
+
+ +
+
+
    +
  • + + +
      +
    • + + +
        +
      • +

        format

        +
        public abstract java.lang.Class<? extends StatisticsReportFormat> format
        +
        The format to be used for publishing statistics reports + in the annotated property.
        +
        +
        Default:
        +
        net.jqwik.api.statistics.StatisticsReport.None.class
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/StatisticsReportFormat.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/StatisticsReportFormat.html new file mode 100644 index 000000000..8fc9e315f --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/StatisticsReportFormat.html @@ -0,0 +1,245 @@ + + + + + +StatisticsReportFormat (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + + +
+
net.jqwik.api.statistics
+

Interface StatisticsReportFormat

+
+
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        formatReport

        +
        java.util.List<java.lang.String> formatReport(java.util.List<StatisticsEntry> entries)
        +
        Return a list of report lines. Often, one line will represent one entry + but that must not necessarily be the case.
        +
        +
        Returns:
        +
        All report lines. No trailing `CR` or `LF` characters are needed.
        +
        See Also:
        +
        StatisticsEntry
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/package-frame.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/package-frame.html new file mode 100644 index 000000000..d8a3c8105 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/package-frame.html @@ -0,0 +1,40 @@ + + + + + +net.jqwik.api.statistics (documentation 1.3.0 API) + + + + +

net.jqwik.api.statistics

+
+

Interfaces

+ +

Classes

+ +

Enums

+ +

Annotation Types

+ +
+ + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/package-summary.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/package-summary.html new file mode 100644 index 000000000..176da7147 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/package-summary.html @@ -0,0 +1,241 @@ + + + + + +net.jqwik.api.statistics (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + +
+

Package net.jqwik.api.statistics

+
+
+ +
+ +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/package-tree.html b/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/package-tree.html new file mode 100644 index 000000000..4c31407b0 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/net/jqwik/api/statistics/package-tree.html @@ -0,0 +1,166 @@ + + + + + +net.jqwik.api.statistics Class Hierarchy (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + +
+

Hierarchy For Package net.jqwik.api.statistics

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Interface Hierarchy

+ +

Annotation Type Hierarchy

+ +

Enum Hierarchy

+ +
+ +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/overview-frame.html b/docs/docs/1.3.0/javadoc/overview-frame.html new file mode 100644 index 000000000..5321f7942 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/overview-frame.html @@ -0,0 +1,28 @@ + + + + + +Overview List (documentation 1.3.0 API) + + + + +
All Classes
+
+

Packages

+ +
+

 

+ + diff --git a/docs/docs/1.3.0/javadoc/overview-summary.html b/docs/docs/1.3.0/javadoc/overview-summary.html new file mode 100644 index 000000000..88c9804d1 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/overview-summary.html @@ -0,0 +1,167 @@ + + + + + +Overview (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + +
+

documentation 1.3.0 API

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Packages 
PackageDescription
net.jqwik.api 
net.jqwik.api.arbitraries 
net.jqwik.api.configurators 
net.jqwik.api.constraints 
net.jqwik.api.domains 
net.jqwik.api.lifecycle 
net.jqwik.api.providers 
net.jqwik.api.stateful 
net.jqwik.api.statistics 
+
+ +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/overview-tree.html b/docs/docs/1.3.0/javadoc/overview-tree.html new file mode 100644 index 000000000..6391de12e --- /dev/null +++ b/docs/docs/1.3.0/javadoc/overview-tree.html @@ -0,0 +1,443 @@ + + + + + +Class Hierarchy (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + +
+

Hierarchy For All Packages

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Interface Hierarchy

+ +

Annotation Type Hierarchy

+ +

Enum Hierarchy

+ +
+ +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/package-list b/docs/docs/1.3.0/javadoc/package-list new file mode 100644 index 000000000..c3e0a0ba3 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/package-list @@ -0,0 +1,9 @@ +net.jqwik.api +net.jqwik.api.arbitraries +net.jqwik.api.configurators +net.jqwik.api.constraints +net.jqwik.api.domains +net.jqwik.api.lifecycle +net.jqwik.api.providers +net.jqwik.api.stateful +net.jqwik.api.statistics diff --git a/docs/docs/1.3.0/javadoc/script.js b/docs/docs/1.3.0/javadoc/script.js new file mode 100644 index 000000000..b34635693 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/script.js @@ -0,0 +1,30 @@ +function show(type) +{ + count = 0; + for (var key in methods) { + var row = document.getElementById(key); + if ((methods[key] & type) != 0) { + row.style.display = ''; + row.className = (count++ % 2) ? rowColor : altColor; + } + else + row.style.display = 'none'; + } + updateTabs(type); +} + +function updateTabs(type) +{ + for (var value in tabs) { + var sNode = document.getElementById(tabs[value][0]); + var spanNode = sNode.firstChild; + if (value == type) { + sNode.className = activeTableTab; + spanNode.innerHTML = tabs[value][1]; + } + else { + sNode.className = tableTab; + spanNode.innerHTML = "" + tabs[value][1] + ""; + } + } +} diff --git a/docs/docs/1.3.0/javadoc/serialized-form.html b/docs/docs/1.3.0/javadoc/serialized-form.html new file mode 100644 index 000000000..1a5c62f50 --- /dev/null +++ b/docs/docs/1.3.0/javadoc/serialized-form.html @@ -0,0 +1,301 @@ + + + + + +Serialized Form (documentation 1.3.0 API) + + + + + + + +
+ + + + + + + +
+ + +
+

Serialized Form

+
+
+ +
+ +
+ + + + + + + +
+ + + + diff --git a/docs/docs/1.3.0/javadoc/stylesheet.css b/docs/docs/1.3.0/javadoc/stylesheet.css new file mode 100644 index 000000000..98055b22d --- /dev/null +++ b/docs/docs/1.3.0/javadoc/stylesheet.css @@ -0,0 +1,574 @@ +/* Javadoc style sheet */ +/* +Overall document style +*/ + +@import url('resources/fonts/dejavu.css'); + +body { + background-color:#ffffff; + color:#353833; + font-family:'DejaVu Sans', Arial, Helvetica, sans-serif; + font-size:14px; + margin:0; +} +a:link, a:visited { + text-decoration:none; + color:#4A6782; +} +a:hover, a:focus { + text-decoration:none; + color:#bb7a2a; +} +a:active { + text-decoration:none; + color:#4A6782; +} +a[name] { + color:#353833; +} +a[name]:hover { + text-decoration:none; + color:#353833; +} +pre { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; +} +h1 { + font-size:20px; +} +h2 { + font-size:18px; +} +h3 { + font-size:16px; + font-style:italic; +} +h4 { + font-size:13px; +} +h5 { + font-size:12px; +} +h6 { + font-size:11px; +} +ul { + list-style-type:disc; +} +code, tt { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; + margin-top:8px; + line-height:1.4em; +} +dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; +} +table tr td dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + vertical-align:top; + padding-top:4px; +} +sup { + font-size:8px; +} +/* +Document title and Copyright styles +*/ +.clear { + clear:both; + height:0px; + overflow:hidden; +} +.aboutLanguage { + float:right; + padding:0px 21px; + font-size:11px; + z-index:200; + margin-top:-9px; +} +.legalCopy { + margin-left:.5em; +} +.bar a, .bar a:link, .bar a:visited, .bar a:active { + color:#FFFFFF; + text-decoration:none; +} +.bar a:hover, .bar a:focus { + color:#bb7a2a; +} +.tab { + background-color:#0066FF; + color:#ffffff; + padding:8px; + width:5em; + font-weight:bold; +} +/* +Navigation bar styles +*/ +.bar { + background-color:#4D7A97; + color:#FFFFFF; + padding:.8em .5em .4em .8em; + height:auto;/*height:1.8em;*/ + font-size:11px; + margin:0; +} +.topNav { + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.bottomNav { + margin-top:10px; + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.subNav { + background-color:#dee3e9; + float:left; + width:100%; + overflow:hidden; + font-size:12px; +} +.subNav div { + clear:left; + float:left; + padding:0 0 5px 6px; + text-transform:uppercase; +} +ul.navList, ul.subNavList { + float:left; + margin:0 25px 0 0; + padding:0; +} +ul.navList li{ + list-style:none; + float:left; + padding: 5px 6px; + text-transform:uppercase; +} +ul.subNavList li{ + list-style:none; + float:left; +} +.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited { + color:#FFFFFF; + text-decoration:none; + text-transform:uppercase; +} +.topNav a:hover, .bottomNav a:hover { + text-decoration:none; + color:#bb7a2a; + text-transform:uppercase; +} +.navBarCell1Rev { + background-color:#F8981D; + color:#253441; + margin: auto 5px; +} +.skipNav { + position:absolute; + top:auto; + left:-9999px; + overflow:hidden; +} +/* +Page header and footer styles +*/ +.header, .footer { + clear:both; + margin:0 20px; + padding:5px 0 0 0; +} +.indexHeader { + margin:10px; + position:relative; +} +.indexHeader span{ + margin-right:15px; +} +.indexHeader h1 { + font-size:13px; +} +.title { + color:#2c4557; + margin:10px 0; +} +.subTitle { + margin:5px 0 0 0; +} +.header ul { + margin:0 0 15px 0; + padding:0; +} +.footer ul { + margin:20px 0 5px 0; +} +.header ul li, .footer ul li { + list-style:none; + font-size:13px; +} +/* +Heading styles +*/ +div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList ul.blockList li.blockList h3 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList li.blockList h3 { + padding:0; + margin:15px 0; +} +ul.blockList li.blockList h2 { + padding:0px 0 20px 0; +} +/* +Page layout container styles +*/ +.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer { + clear:both; + padding:10px 20px; + position:relative; +} +.indexContainer { + margin:10px; + position:relative; + font-size:12px; +} +.indexContainer h2 { + font-size:13px; + padding:0 0 3px 0; +} +.indexContainer ul { + margin:0; + padding:0; +} +.indexContainer ul li { + list-style:none; + padding-top:2px; +} +.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt { + font-size:12px; + font-weight:bold; + margin:10px 0 0 0; + color:#4E4E4E; +} +.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd { + margin:5px 0 10px 0px; + font-size:14px; + font-family:'DejaVu Sans Mono',monospace; +} +.serializedFormContainer dl.nameValue dt { + margin-left:1px; + font-size:1.1em; + display:inline; + font-weight:bold; +} +.serializedFormContainer dl.nameValue dd { + margin:0 0 0 1px; + font-size:1.1em; + display:inline; +} +/* +List styles +*/ +ul.horizontal li { + display:inline; + font-size:0.9em; +} +ul.inheritance { + margin:0; + padding:0; +} +ul.inheritance li { + display:inline; + list-style:none; +} +ul.inheritance li ul.inheritance { + margin-left:15px; + padding-left:15px; + padding-top:1px; +} +ul.blockList, ul.blockListLast { + margin:10px 0 10px 0; + padding:0; +} +ul.blockList li.blockList, ul.blockListLast li.blockList { + list-style:none; + margin-bottom:15px; + line-height:1.4; +} +ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList { + padding:0px 20px 5px 10px; + border:1px solid #ededed; + background-color:#f8f8f8; +} +ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList { + padding:0 0 5px 8px; + background-color:#ffffff; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockList { + margin-left:0; + padding-left:0; + padding-bottom:15px; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast { + list-style:none; + border-bottom:none; + padding-bottom:0; +} +table tr td dl, table tr td dl dt, table tr td dl dd { + margin-top:0; + margin-bottom:1px; +} +/* +Table styles +*/ +.overviewSummary, .memberSummary, .typeSummary, .useSummary, .constantsSummary, .deprecatedSummary { + width:100%; + border-left:1px solid #EEE; + border-right:1px solid #EEE; + border-bottom:1px solid #EEE; +} +.overviewSummary, .memberSummary { + padding:0px; +} +.overviewSummary caption, .memberSummary caption, .typeSummary caption, +.useSummary caption, .constantsSummary caption, .deprecatedSummary caption { + position:relative; + text-align:left; + background-repeat:no-repeat; + color:#253441; + font-weight:bold; + clear:none; + overflow:hidden; + padding:0px; + padding-top:10px; + padding-left:1px; + margin:0px; + white-space:pre; +} +.overviewSummary caption a:link, .memberSummary caption a:link, .typeSummary caption a:link, +.useSummary caption a:link, .constantsSummary caption a:link, .deprecatedSummary caption a:link, +.overviewSummary caption a:hover, .memberSummary caption a:hover, .typeSummary caption a:hover, +.useSummary caption a:hover, .constantsSummary caption a:hover, .deprecatedSummary caption a:hover, +.overviewSummary caption a:active, .memberSummary caption a:active, .typeSummary caption a:active, +.useSummary caption a:active, .constantsSummary caption a:active, .deprecatedSummary caption a:active, +.overviewSummary caption a:visited, .memberSummary caption a:visited, .typeSummary caption a:visited, +.useSummary caption a:visited, .constantsSummary caption a:visited, .deprecatedSummary caption a:visited { + color:#FFFFFF; +} +.overviewSummary caption span, .memberSummary caption span, .typeSummary caption span, +.useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + padding-bottom:7px; + display:inline-block; + float:left; + background-color:#F8981D; + border: none; + height:16px; +} +.memberSummary caption span.activeTableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#F8981D; + height:16px; +} +.memberSummary caption span.tableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#4D7A97; + height:16px; +} +.memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab { + padding-top:0px; + padding-left:0px; + padding-right:0px; + background-image:none; + float:none; + display:inline; +} +.overviewSummary .tabEnd, .memberSummary .tabEnd, .typeSummary .tabEnd, +.useSummary .tabEnd, .constantsSummary .tabEnd, .deprecatedSummary .tabEnd { + display:none; + width:5px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .activeTableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .tableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + background-color:#4D7A97; + float:left; + +} +.overviewSummary td, .memberSummary td, .typeSummary td, +.useSummary td, .constantsSummary td, .deprecatedSummary td { + text-align:left; + padding:0px 0px 12px 10px; +} +th.colOne, th.colFirst, th.colLast, .useSummary th, .constantsSummary th, +td.colOne, td.colFirst, td.colLast, .useSummary td, .constantsSummary td{ + vertical-align:top; + padding-right:0px; + padding-top:8px; + padding-bottom:3px; +} +th.colFirst, th.colLast, th.colOne, .constantsSummary th { + background:#dee3e9; + text-align:left; + padding:8px 3px 3px 7px; +} +td.colFirst, th.colFirst { + white-space:nowrap; + font-size:13px; +} +td.colLast, th.colLast { + font-size:13px; +} +td.colOne, th.colOne { + font-size:13px; +} +.overviewSummary td.colFirst, .overviewSummary th.colFirst, +.useSummary td.colFirst, .useSummary th.colFirst, +.overviewSummary td.colOne, .overviewSummary th.colOne, +.memberSummary td.colFirst, .memberSummary th.colFirst, +.memberSummary td.colOne, .memberSummary th.colOne, +.typeSummary td.colFirst{ + width:25%; + vertical-align:top; +} +td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover { + font-weight:bold; +} +.tableSubHeadingColor { + background-color:#EEEEFF; +} +.altColor { + background-color:#FFFFFF; +} +.rowColor { + background-color:#EEEEEF; +} +/* +Content styles +*/ +.description pre { + margin-top:0; +} +.deprecatedContent { + margin:0; + padding:10px 0; +} +.docSummary { + padding:0; +} + +ul.blockList ul.blockList ul.blockList li.blockList h3 { + font-style:normal; +} + +div.block { + font-size:14px; + font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; +} + +td.colLast div { + padding-top:0px; +} + + +td.colLast a { + padding-bottom:3px; +} +/* +Formatting effect styles +*/ +.sourceLineNo { + color:green; + padding:0 30px 0 0; +} +h1.hidden { + visibility:hidden; + overflow:hidden; + font-size:10px; +} +.block { + display:block; + margin:3px 10px 2px 0px; + color:#474747; +} +.deprecatedLabel, .descfrmTypeLabel, .memberNameLabel, .memberNameLink, +.overrideSpecifyLabel, .packageHierarchyLabel, .paramLabel, .returnLabel, +.seeLabel, .simpleTagLabel, .throwsLabel, .typeNameLabel, .typeNameLink { + font-weight:bold; +} +.deprecationComment, .emphasizedPhrase, .interfaceName { + font-style:italic; +} + +div.block div.block span.deprecationComment, div.block div.block span.emphasizedPhrase, +div.block div.block span.interfaceName { + font-style:normal; +} + +div.contentContainer ul.blockList li.blockList h2{ + padding-bottom:0px; +} diff --git a/docs/docs/1.3.0/user-guide.md b/docs/docs/1.3.0/user-guide.md new file mode 100644 index 000000000..eea5d4261 --- /dev/null +++ b/docs/docs/1.3.0/user-guide.md @@ -0,0 +1,4090 @@ +--- +title: jqwik User Guide - 1.3.0 +--- +

The jqwik User Guide +1.3.0 +

+ + + + +### Table of Contents + +- [How to Use](#how-to-use) + - [Required Version of JUnit Platform](#required-version-of-junit-platform) + - [Gradle](#gradle) + - [Seeing jqwik Reporting in Gradle Output](#seeing-jqwik-reporting-in-gradle-output) + - [Maven](#maven) + - [Snapshot Releases](#snapshot-releases) + - [Project without Build Tool](#project-without-build-tool) +- [Creating a Property](#creating-a-property) + - [Optional `@Property` Parameters](#optional-property-parameters) + - [Additional Reporting](#additional-reporting) +- [Creating an Example-based Test](#creating-an-example-based-test) +- [Assertions](#assertions) +- [Lifecycle](#lifecycle) + - [Simple Property Lifecycle](#simple-property-lifecycle) + - [Annotated Lifecycle Methods](#annotated-lifecycle-methods) + - [Single Property Lifecycle](#single-property-lifecycle) +- [Grouping Tests](#grouping-tests) +- [Naming and Labeling Tests](#naming-and-labeling-tests) +- [Tagging Tests](#tagging-tests) +- [Disabling Tests](#disabling-tests) +- [Default Parameter Generation](#default-parameter-generation) + - [Constraining Default Generation](#constraining-default-generation) + - [Allow Null Values](#allow-null-values) + - [Unique Values](#unique-values) + - [String Length](#string-length) + - [Character Sets](#character-sets) + - [List, Set, Stream, Map and Array Size](#list-set-stream-map-and-array-size) + - [Integer Constraints](#integer-constraints) + - [Decimal Constraints](#decimal-constraints) + - [Constraining parameterized types](#constraining-parameterized-types) + - [Providing variable types](#providing-variable-types) +- [Self-Made Annotations](#self-made-annotations) +- [Customized Parameter Generation](#customized-parameter-generation) + - [Parameter Provider Methods](#parameter-provider-methods) + - [Providing Arbitraries for Embedded Types](#providing-arbitraries-for-embedded-types) + - [Static `Arbitraries` methods](#static-arbitraries-methods) + - [Generate values yourself](#generate-values-yourself) + - [Select or generate values randomly](#select-or-generate-values-randomly) + - [Select randomly with Weights](#select-randomly-with-weights) + - [Characters and Strings](#characters-and-strings) + - [java.util.Random](#javautilrandom) + - [Shuffling Permutations](#shuffling-permutations) + - [Default Types](#default-types) + - [Numeric Arbitrary Types](#numeric-arbitrary-types) + - [Integrals](#integrals) + - [Decimals](#decimals) + - [Random Numeric Distribution](#random-numeric-distribution) + - [Collections, Streams, Arrays and Optional](#collections-streams-arrays-and-optional) + - [Collecting Values in a List](#collecting-values-in-a-list) + - [Tuples of same base type](#tuples-of-same-base-type) + - [Maps](#maps) + - [Functional Types](#functional-types) + - [Fluent Configuration Interfaces](#fluent-configuration-interfaces) + - [Generate `null` values](#generate-null-values) + - [Inject duplicate values](#inject-duplicate-values) + - [Filtering](#filtering) + - [Creating unique values](#creating-unique-values) + - [Mapping](#mapping) + - [Flat Mapping](#flat-mapping) + - [Flat Mapping with Tuple Types](#flat-mapping-with-tuple-types) + - [Randomly Choosing among Arbitraries](#randomly-choosing-among-arbitraries) + - [Combining Arbitraries](#combining-arbitraries) + - [Combining Arbitraries with Builder](#combining-arbitraries-with-builder) + - [Flat Combination](#flat-combination) + - [Fix an Arbitrary's `genSize`](#fix-an-arbitrarys-gensize) +- [Recursive Arbitraries](#recursive-arbitraries) + - [Probabilistic Recursion](#probabilistic-recursion) + - [Deterministic Recursion](#deterministic-recursion) + - [Deterministic Recursion with `recursive()`](#deterministic-recursion-with-recursive) +- [Using Arbitraries Directly](#using-arbitraries-directly) + - [Generating a Single Value](#generating-a-single-value) + - [Generating a Stream of Values](#generating-a-stream-of-values) + - [Generating all possible values](#generating-all-possible-values) + - [Iterating through all possible values](#iterating-through-all-possible-values) +- [Contract Tests](#contract-tests) +- [Stateful Testing](#stateful-testing) + - [Specify Actions](#specify-actions) + - [Check Postconditions](#check-postconditions) + - [Number of actions](#number-of-actions) + - [Check Invariants](#check-invariants) +- [Assumptions](#assumptions) +- [Result Shrinking](#result-shrinking) + - [Integrated Shrinking](#integrated-shrinking) + - [Switch Shrinking Off](#switch-shrinking-off) + - [Switch Shrinking to Full Mode](#switch-shrinking-to-full-mode) + - [Change the Shrinking Target](#change-the-shrinking-target) +- [Collecting and Reporting Statistics](#collecting-and-reporting-statistics) + - [Labeled Statistics](#labeled-statistics) + - [Statistics Report Formatting](#statistics-report-formatting) + - [Switch Statistics Reporting Off](#switch-statistics-reporting-off) + - [Histograms](#histograms) + - [Make Your Own Statistics Report Format](#make-your-own-statistics-report-format) + - [Checking Coverage of Collected Statistics](#checking-coverage-of-collected-statistics) + - [Check Percentages and Counts](#check-percentages-and-counts) + - [Check Ad-hoc Query Coverage](#check-ad-hoc-query-coverage) +- [Providing Default Arbitraries](#providing-default-arbitraries) + - [Simple Arbitrary Providers](#simple-arbitrary-providers) + - [Arbitrary Providers for Parameterized Types](#arbitrary-providers-for-parameterized-types) + - [Arbitrary Provider Priority](#arbitrary-provider-priority) +- [Create your own Annotations for Arbitrary Configuration](#create-your-own-annotations-for-arbitrary-configuration) + - [Arbitrary Configuration Example: `@Odd`](#arbitrary-configuration-example-odd) +- [Domain and Domain Context](#domain-and-domain-context) + - [Domain example: American Addresses](#domain-example-american-addresses) +- [Generation from a Type's Interface](#generation-from-a-types-interface) +- [Generation of Edge Cases](#generation-of-edge-cases) + - [Tuning Edge Cases](#tuning-edge-cases) +- [Exhaustive Generation](#exhaustive-generation) +- [Data-Driven Properties](#data-driven-properties) +- [Rerunning Falsified Properties](#rerunning-falsified-properties) +- [jqwik Configuration](#jqwik-configuration) +- [Advanced Topics](#advanced-topics) + - [Implement your own Arbitraries and Generators](#implement-your-own-arbitraries-and-generators) + - [Lifecycle Hooks](#lifecycle-hooks) + - [Principles of Lifecycle Hooks](#principles-of-lifecycle-hooks) + - [Lifecycle Hook Types](#lifecycle-hook-types) + - [Lifecycle Execution Hooks](#lifecycle-execution-hooks) + - [Other Hooks](#other-hooks) + - [Lifecycle Storage](#lifecycle-storage) +- [API Evolution](#api-evolution) +- [Release Notes](#release-notes) + + + +## How to Use + +__jqwik__ is an alternative test engine for the +[JUnit 5 platform](https://junit.org/junit5/docs/current/api/org/junit/platform/engine/TestEngine.html). +That means that you can use it either stand-alone or combine it with any other JUnit 5 engine, e.g. +[Jupiter (the standard engine)](https://junit.org/junit5/docs/current/user-guide/#dependency-metadata-junit-jupiter) or +[Vintage (aka JUnit 4)](https://junit.org/junit5/docs/current/user-guide/#dependency-metadata-junit-vintage). +All you have to do is add all needed engines to your `testCompile` dependencies as shown in the +[gradle file](#gradle) below. + +The latest release of __jqwik__ is deployed to [Maven Central](https://search.maven.org/search?q=g:net.jqwik). + +Snapshot releases can be fetched from https://oss.sonatype.org/content/repositories/snapshots. + +### Required Version of JUnit Platform + +The minimum required version of the JUnit platform is `1.6.2`. + +### Gradle + +Since version 4.6, Gradle has +[built-in support for the JUnit platform](https://docs.gradle.org/current/dsl/org.gradle.api.tasks.testing.Test.html). +Set up is rather simple; here are the relevant parts of a project's `build.gradle` file: + + +``` +repositories { + ... + mavenCentral() + + # For snapshot releases only: + maven { url 'https://oss.sonatype.org/content/repositories/snapshots' } + +} + +ext.junitPlatformVersion = '1.6.2' +ext.junitJupiterVersion = '5.6.2' + +ext.jqwikVersion = '1.3.0' + +test { + useJUnitPlatform { + includeEngines 'jqwik' + + // Or include several Junit engines if you use them + // includeEngines 'jqwik', 'junit-jupiter', 'junit-vintage' + + // includeTags 'fast', 'medium' + // excludeTags 'slow' + } + + include '**/*Properties.class' + include '**/*Test.class' + include '**/*Tests.class' +} + +dependencies { + ... + + // aggregate jqwik dependency + testImplementation "net.jqwik:jqwik:${jqwikVersion}" + + // Add if you also want to use the Jupiter engine or Assertions from it + testImplementation "org.junit.jupiter:junit-jupiter:5.6.2" + + // Add any other test library you need... + testImplementation "org.assertj:assertj-core:3.12.2" + +} +``` + +With version 1.0.0 `net.jqwik:jqwik` has become an aggregating module to +simplify jqwik integration for standard users. If you want to be more explicit +about the real dependencies you can replace this dependency with + +``` + testImplementation "net.jqwik:jqwik-api:${jqwikVersion}" + testRuntime "net.jqwik:jqwik-engine:${jqwikVersion}" +``` + +In jqwik's samples repository you can find a rather minimal +[starter example for jqwik with Gradle](https://github.com/jlink/jqwik-samples/tree/master/jqwik-starter-gradle). + +See [the Gradle section in JUnit 5's user guide](https://junit.org/junit5/docs/current/user-guide/#running-tests-build-gradle) +for more details on how to configure Gradle for the JUnit 5 platform. +There is also a comprehensive +[list of options for Gradle's `test` task](https://docs.gradle.org/current/userguide/java_plugin.html#sec:java_test). + +#### Seeing jqwik Reporting in Gradle Output + +Since Gradle does not yet support JUnit platform reporting +([see this Github issue](https://github.com/gradle/gradle/issues/4605)) +jqwik has switched to do its own reporting by default. This behaviour +[can be configured](#jqwik-configuration) through parameter `useJunitPlatformReporter` +(default: `false`). + +If you want to see jqwik's reports in the output use Gradle's command line option `--info`: + +``` +> gradle clean test --info +... +mypackage.MyClassProperties > myPropertyMethod STANDARD_OUT + timestamp = 2019-02-28T18:01:14.302, MyClassProperties:myPropertyMethod = + |-----------------------jqwik----------------------- + tries = 1000 | # of calls to property + checks = 1000 | # of not rejected calls + generation = RANDOMIZED | parameters are randomly generated + after-failure = PREVIOUS_SEED | use the previous seed + edge-cases#mode = MIXIN | edge cases are generated first + edge-cases#total = 0 | # of all combined edge cases + edge-cases#tried = 0 | # of edge cases tried in current run + seed = 1685744359484719817 | random seed to reproduce generated values +``` + +### Maven + +Starting with version 2.22.0, Maven Surefire and Maven Failsafe provide native support +for executing tests on the JUnit Platform and thus for running _jqwik_ properties. +The configuration of Maven Surefire is described in +[the Maven section of JUnit 5's user guide](https://junit.org/junit5/docs/current/user-guide/#running-tests-build-maven). + +Additionally you have to add the following dependency to your `pom.xml` file: + +``` + + ... + + net.jqwik + jqwik + 1.3.0 + test + + +``` + +In jqwik's samples repository you can find a rather minimal +[starter example for jqwik with Maven](https://github.com/jlink/jqwik-samples/tree/master/jqwik-starter-maven). + +### Snapshot Releases + +Snapshot releases are available through Sonatype's +[snapshot repositories](#https://oss.sonatype.org/content/repositories/snapshots). + +Adding + +``` +https://oss.sonatype.org/content/repositories/snapshots +``` + +as a maven repository +will allow you to use _jqwik_'s snapshot release which contains all the latest features. + +### Project without Build Tool + +I've never tried it but using jqwik without gradle or some other tool to manage dependencies should also work. +You will have to add _at least_ the following jars to your classpath: + +- `jqwik-1.3.0.jar` +- `junit-platform-engine-1.6.2.jar` +- `junit-platform-commons-1.6.2.jar` +- `opentest4j-1.1.1.jar` +- `assertj-core-3.11.x.jar` in case you need assertion support + +## Creating a Property + +_Properties_ are the core concept of [property-based testing](/#properties). + +You create a _Property_ by annotating a `public`, `protected` +or package-scoped method with +[`@Property`](/docs/1.3.0/javadoc/net/jqwik/api/Property.html). +In contrast to examples a property method is supposed to have one or +more parameters, all of which must be annotated with +[`@ForAll`](/docs/1.3.0/javadoc/net/jqwik/api/ForAll.html). + +At test runtime the exact parameter values of the property method +will be filled in by _jqwik_. + +Just like an example test a property method has to +- either return a `boolean` value that signifies success (`true`) + or failure (`false`) of this property. +- or return nothing (`void`). In that case you will probably + use [assertions](#assertions) to check the property's invariant. + +If not [specified differently](#optional-property-parameters), +_jqwik_ __will run 1000 tries__, i.e. a 1000 different sets of +parameter values and execute the property method with each of those parameter sets. +The first failed execution will stop value generation +and be reported as failure - usually followed by an attempt to +[shrink](#result-shrinking) the falsified parameter set. + +[Here](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/PropertyBasedTests.java) +are two properties whose failures might surprise you: + +```java +import net.jqwik.api.*; +import org.assertj.core.api.*; + +class PropertyBasedTests { + + @Property + boolean absoluteValueOfAllNumbersIsPositive(@ForAll int anInteger) { + return Math.abs(anInteger) >= 0; + } + + @Property + void lengthOfConcatenatedStringIsGreaterThanLengthOfEach( + @ForAll String string1, @ForAll String string2 + ) { + String conc = string1 + string2; + Assertions.assertThat(conc.length()).isGreaterThan(string1.length()); + Assertions.assertThat(conc.length()).isGreaterThan(string2.length()); + } +} +``` + +Currently _jqwik_ cannot deal with parameters that are not +annotated with '@ForAll'. However, this might change +in future versions. + +### Optional `@Property` Parameters + +The [`@Property`](/docs/1.3.0/javadoc/net/jqwik/api/Property.html) +annotation has a few optional values: + +- `int tries`: The number of times _jqwik_ tries to generate parameter values for this method. + + The default is `1000` which can be overridden in [`jqwik.properties`](#jqwik-configuration). + +- `String seed`: The _random seed_ to use for generating values. If you do not specify a values + _jqwik_ will use a random _random seed_. The actual seed used is being reported by + each run property. + +- `int maxDiscardRatio`: The maximal number of tried versus actually checked property runs + in case you are using [Assumptions](#assumptions). If the ratio is exceeded _jqwik_ will + report this property as a failure. + + The default is `5` which can be overridden in [`jqwik.properties`](#jqwik-configuration). + +- `ShrinkingMode shrinking`: You can influence the way [shrinking](#result-shrinking) is done + - `ShrinkingMode.OFF`: No shrinking at all + - `ShrinkingMode.FULL`: Shrinking continues until no smaller value can + be found that also falsifies the property. + This might take very long or not end at all in rare cases. + - `ShrinkingMode.BOUNDED`: Shrinking is tried to a depth of 1000 steps + maximum per value. This is the default. + + Most of the time you want to stick with the default. Only if + bounded shrinking is reported - look at a falsified property's output! - + should you try with `ShrinkingMode.FULL`. + +- `GenerationMode generation`: You can direct _jqwik_ about the principal approach + it takes towards value generation. + + - `GenerationMode.AUTO` is the default. This will choose [exhaustive generation](#exhaustive-generation) + whenever this is deemed sensible, i.e., when the maximum number of generated values is + equal or less thant the configured `tries` attribute. + - `GenerationMode.RANDOMIZED` directs _jqwik_ to always generate values using its + randomized generators. + - `GenerationMode.EXHAUSTIVE` directs _jqwik_ to use [exhaustive generation](#exhaustive-generation) + if the arbitraries in use support exhaustive generation at all and if the calculated + maximum number of different values to generate is below `Integer.MAX_VALUE`. + - `GenerationMode.DATA_DRIVEN` directs _jqwik_ to feed values from a data provider + specified with `@FromData`. See [data-driven properties](#data-driven-properties) + for more information. + +- `AfterFailureMode afterFailure`: Determines how jqwik will generate values of a property + that has failed in the previous run. + + - `AfterFailureMode.PREVIOUS_SEED` is the default. jqwik will use the same seed and thereby generate + the same sequence of parameters as in the previous, failing run. + - `AfterFailureMode.SAMPLE_ONLY` means that jqwik will only use the last shrunk example of parameters. + This requires that all parameters can be serialized. + - `AfterFailureMode.SAMPLE_FIRST` means that jqwik will use the last shrunk example of parameters first + and then, if successful, go for a new randomly generated set of parameters. + - `AfterFailureMode.RANDOM_SEED` makes jqwik use a new random seed even directly after a failure. + This might lead to a "flaky" property that sometimes fails and sometimes succeeds. + +- `EdgeCasesMode edgeCases`: Determines if and when jqwik will generate + the permutation of [edge cases](#generation-of-edge-cases). + + - `EdgeCasesMode.MIXIN` is the default. Edge cases will be mixed with randomly generated parameter sets + until all known permutations have been mixed in. + - `EdgeCasesMode.FIRST` results in all edge cases being generated before jqwik starts with randomly + generated samples. + - `EdgeCasesMode.NONE` will not generate edge cases for the full parameter set at all. However, + edge cases for individual parameters are still being mixed into the set from time to time. + +The effective values for tries, seed, after-failure mode, generation mode edge-cases mode +and edge cases numbers are reported after each run property: + +``` +tries = 10 +checks = 10 +generation = EXHAUSTIVE +after-failure = PREVIOUS_SEED +edge-cases#mode = MIXIN +edge-cases#total = 2 +edge-cases#tried = 2 +seed = 42859154278924201 +``` + + +### Additional Reporting + +You can switch on additional reporting aspects by adding a +[`@Report(Reporting[])` annotation](/docs/1.3.0/javadoc/net/jqwik/api/Property.html) +to a property method. + +The following reporting aspects are available: + +- `Reporting.GENERATED` will report each generated set of parameters. +- `Reporting.FALSIFIED` will report each set of parameters + that is falsified during shrinking. + +## Creating an Example-based Test + +_jqwik_ also supports example-based testing. +In order to write an example test annotate a `public`, `protected` or package-scoped method with +[`@Example`](/docs/1.3.0/javadoc/net/jqwik/api/Example.html). +Example-based tests work just like plain JUnit-style test cases. + +A test case method must +- either return a `boolean` value that signifies success (`true`) + or failure (`false`) of this test case. +- or return nothing (`void`) in which case you will probably + use [assertions](#assertions) in order to verify the test condition. + +[Here](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/ExampleBasedTests.java) +is a test class with two example-based tests: + +```java +import static org.assertj.core.api.Assertions.*; + +import net.jqwik.api.*; +import org.assertj.core.data.*; + +class ExampleBasedTests { + + @Example + void squareRootOf16is4() { + assertThat(Math.sqrt(16)).isCloseTo(4.0, Offset.offset(0.01)); + } + + @Example + boolean add1plu3is4() { + return (1 + 3) == 4; + } +} +``` + +Internally _jqwik_ treats examples as properties with the number of tries hardcoded to `1`. +Thus, everything that works for property methods also works for example methods -- +including random generation of parameters annotated with `@ForAll`. + +## Assertions + +__jqwik__ does not come with any assertions, so you have to use one of the +third-party assertion libraries, e.g. [Hamcrest](http://hamcrest.org/) or +[AssertJ](http://joel-costigliola.github.io/assertj/). + +If you have Jupiter in your test dependencies anyway, you can also use the +static methods in `org.junit.jupiter.api.Assertions`. + +## Lifecycle + +To understand the lifecycle it is important to know that _the tree of test elements_ +consists of two main types of elements: + +- __Containers__: The root engine container, container classes + and embedded container classes (those annotated with `@Group`) +- __Properties__: Methods annotated with + [`@Property`](/docs/1.3.0/javadoc/net/jqwik/api/Property.html) or + [`@Example`](/docs/1.3.0/javadoc/net/jqwik/api/Example.html). + An _example_ is just a property with a single _try_ (see below). + +So a typical tree might look like: + +``` +Jqwik Engine + class MyFooTests + @Property fooProperty1() + @Property fooProperty2() + @Example fooExample() + class MyBarTests + @Property barProperty() + @Group class Group1 + @Property group1Property() + @Group class Group2 + @Example group2Example() +``` + +Mind that packages do not show up as in-between containers! + +When running your whole test suite there are additional things happening: + +- For each property or example a new instance of the containing class + will be created. +- Each property will have 1 to n _tries_. Usually each try gets its own + set of generated arguments which are bound to parameters annotated + with `@ForAll`. + +_jqwik_ gives you more than one way to hook into the lifecycle of containers, +properties and tries. + +### Simple Property Lifecycle + +If you need nothing but some initialization and cleanup of the container instance +per property or example: + +- Do the initialization work in a constructor without parameters. +- If you have cleanup work to do for each property method, + the container class can implement `java.lang.AutoCloseable`. + The `close`-Method will be called after each test method execution. + +```java +import net.jqwik.api.*; + +class SimpleLifecycleTests implements AutoCloseable { + + SimpleLifecycleTests() { + System.out.println("Before each"); + } + + @Example void anExample() { + System.out.println("anExample"); + } + + @Property(tries = 5) + void aProperty(@ForAll String aString) { + System.out.println("aProperty: " + aString); + } + + @Override + public void close() throws Exception { + System.out.println("After each"); + } +} +``` + +In this example both the constructor and `close()` will be called twice times: +Once for `anExample()` and once for `aProperty(...)`. However, all five calls +to `aProperty(..)` will share the same instance of `SimpleLifecycleTests`. + +### Annotated Lifecycle Methods + +The other way to influence all elements of a test run is through annotated lifecycle +methods, which you might already know from JUnit 4 and 5. _jqwik_ currently has +eight annotations: + +- [`@BeforeContainer`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/BeforeContainer.html): + _Static_ methods with this annotation will run exactly once before any property + of a container class will be executed, even before the first instance of this class will be created. +- [`@AfterContainer`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AfterContainer.html): + _Static_ methods with this annotation will run exactly once after all properties + of a container class have run. +- [`@BeforeProperty`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/BeforeProperty.html): + Methods with this annotation will run once before each property or example. + `@BeforeExample` is an alias with the same functionality. +- [`@AfterProperty`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AfterProperty.html): + Methods with this annotation will run once after each property or example. + `@AfterExample` is an alias with the same functionality. +- [`@BeforeTry`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/BeforeTry.html): + Methods with this annotation will run once before each try, i.e. execution + of a property or example method. +- [`@AfterTry`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AfterTry.html): + Methods with this annotation will run once after each try, i.e. execution + of a property or example method. + +Given the following container class: + +```java +class FullLifecycleExamples { + + @BeforeContainer + static void beforeContainer() { + System.out.println("before container"); + } + + @AfterContainer + static void afterContainer() { + System.out.println("after container"); + } + + @BeforeProperty + void beforeProperty() { + System.out.println("before property"); + } + + @AfterProperty + void afterProperty() { + System.out.println("after property"); + } + + @BeforeTry + void beforeTry() { + System.out.println("before try"); + } + + @AfterTry + void afterTry() { + System.out.println("after try"); + } + + @Property(tries = 3) + void property(@ForAll @IntRange(min = -5, max = 5) int anInt) { + System.out.println("property: " + anInt); + } +} +``` + +Running this test container should produce something like the following output +(maybe with your test report in-between): + +``` +before container + +before property +before try +property: 3 +after try +before try +property: 1 +after try +before try +property: 4 +after try +after property + +after container +``` + +All those lifecycle methods are being run through _jqwik_'s mechanism for +writing [_lifecycle hooks_](#lifecycle-hooks) under the hood. + + +### Single Property Lifecycle + +All [lifecycle methods](#annotated-lifecycle-methods) described in the previous section +apply to all property methods of a container class. +In rare cases, however, you may feel the need to hook into the lifecycle of a single property, +for example when you expect a property to fail. + +Here is one example that checks that a property will fail with an `AssertionError` +and succeed in that case: + +```java +@Property +@PerProperty(SucceedIfThrowsAssertionError.class) +void expectToFail(@ForAll int aNumber) { + Assertions.assertThat(aNumber).isNotEqualTo(1); +} + +private class SucceedIfThrowsAssertionError implements PerProperty.Lifecycle { + @Override + public PropertyExecutionResult onFailure(PropertyExecutionResult propertyExecutionResult) { + if (propertyExecutionResult.throwable().isPresent() && + propertyExecutionResult.throwable().get() instanceof AssertionError) { + return propertyExecutionResult.mapToSuccessful(); + } + return propertyExecutionResult; + } +} +``` + +Have a look at [`PerProperty.Lifecycle`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/PerProperty.Lifecycle.html) +to find out which aspects of a property's lifecycle you can control. + + +## Grouping Tests + +Within a containing test class you can group other containers by embedding +another non-static and non-private inner class and annotating it with `@Group`. +Grouping examples and properties is a means to improve the organization and +maintainability of your tests. + +Groups can be nested and there lifecycle is also nested, that means that +the lifecycle of a test class is also applied to inner groups of that container. +Have a look at [this example](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/TestsWithGroups.java): + +```java +import net.jqwik.api.*; + +class TestsWithGroups { + + @Property + void outer(@ForAll String aString) { + } + + @Group + class Group1 { + @Property + void group1Property(@ForAll String aString) { + } + + @Group + class Subgroup { + @Property + void subgroupProperty(@ForAll String aString) { + } + } + } + + @Group + class Group2 { + @Property + void group2Property(@ForAll String aString) { + } + } +} +``` + +## Naming and Labeling Tests + +Using Java-style camel case naming for your test container classes and property methods +will sometimes lead to hard to read display names in your test reports +and your IDE. +Therefore, _jqwik_ provides a simple way to insert spaces +into the displayed name of your test container or property: +just add underscores (`_`), which are valid Java identifier characters. +Each underscore will be replaced by a space for display purposes. + +If you want to tweak display names even more, +test container classes, groups, example methods and property methods can be labeled +using the annotation `@Label("a label")`. This label will be used to display the element +in test reports or within the IDE. +[In the following example](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/NamingExamples.java), +every test relevant element has been labeled: + +```java +@Label("Naming") +class NamingExamples { + + @Property + @Label("a property") + void aPropertyWithALabel() { } + + @Group + @Label("A Group") + class GroupWithLabel { + @Example + @Label("an example with äöüÄÖÜ") + void anExampleWithALabel() { } + } + + @Group + class Group_with_spaces { + @Example + void example_with_spaces() { } + } + +} +``` + +Labels can consist of any characters and don't have to be unique - but you probably want them +to be unique within their container. + +## Tagging Tests + +Test container classes, groups, example methods and property methods can be tagged +using the annotation `@Tag("a-tag")`. You can have many tags on the same element. + +Those tag can be used to filter the set of tests +[run by the IDE](https://blog.jetbrains.com/idea/2018/01/intellij-idea-starts-2018-1-early-access-program/) or +[the build tool](https://docs.gradle.org/4.6/release-notes.html#junit-5-support). +Tags are handed down from container (class or group) to its children (test methods or groups). + +Have a look at +[the following example](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/TaggingExamples.java). +Including the tag `integration-test` will include +all tests of the class. + +```java +@Tag("integration-test") +class TaggingExamples { + + @Property + @Tag("fast") + void aFastProperty() { } + + @Example + @Tag("slow") @Tag("involved") + void aSlowTest() { } +} +``` + +Tags must follow certain rules as described +[here](/docs/1.3.0/javadoc/net/jqwik/api/Tag.html) + +## Disabling Tests + +From time to time you might want to disable a test or all tests in a container +temporarily. You can do that by adding the +[`@Disabled`](/docs/1.3.0/javadoc/net/jqwik/api/Disabled.html) annotation +to a property method or a container class. + +```java +import net.jqwik.api.Disabled; + +@Disabled("for whatever reason") +class DisablingExamples { + + @Property + @Disabled + void aDisabledProperty() { } + +} +``` + +Disabled properties will be reported by IDEs and build tools as "skipped" +together with the reason - if one has been provided. + +Be careful not to use the Jupiter annotation with the same name. +_Jqwik_ will refuse to execute methods that have Jupiter annotations. + + +## Default Parameter Generation + +_jqwik_ tries to generate values for those property method parameters that are +annotated with [`@ForAll`](/docs/1.3.0/javadoc/net/jqwik/api/ForAll.html). If the annotation does not have a `value` parameter, +jqwik will use default generation for the following types: + +- `Object` +- `String` +- Integral types `Byte`, `byte`, `Short`, `short` `Integer`, `int`, `Long`, `long` and `BigInteger` +- Floating types `Float`, `float`, `Double`, `double` and `BigDecimal` +- `Boolean` and `boolean` +- `Character` and `char` +- All `enum` types +- Collection types `List`, `Set` and `Stream` + as long as `T` can also be provided by default generation. +- `Iterable` and `Iterator` of types that are provided by default. +- `Optional` of types that are provided by default. +- Array `T[]` of types that are provided by default. +- `Map` as long as `K` and `V` can also be provided by default generation. +- `HashMap` as long as `K` and `V` can also be provided by default generation. +- `Map.Entry` as long as `K` and `V` can also be provided by default generation. +- `java.util.Random` +- [Functional Types](#functional-types) + +If you use [`@ForAll`](/docs/1.3.0/javadoc/net/jqwik/api/ForAll.html) +with a value, e.g. `@ForAll("aMethodName")`, the method +referenced by `"aMethodName"` will be called to provide an Arbitrary of the +required type (see [Parameter Provider Methods](#parameter-provider-methods)). + +### Constraining Default Generation + +Default parameter generation can be influenced and constrained by additional annotations, +depending on the requested parameter type. + +#### Allow Null Values + +- [`@WithNull(double value = 0.1)`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/WithNull.html): + Inject `null` into generated values with a probability of `value`. + + Works for all generated types. + +#### Unique Values + +- [`@Unique`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/Unique.html): + Prevent duplicate values to be generated _per try_. That means that + there can still be duplicate values across several tries. That also means + that `@Unique` only makes sense as annotation for a parameter type, e.g.: + + ```java + @Property + void uniqueInList(@ForAll @Size(5) List<@IntRange(min = 0, max = 10) @Unique Integer> aList) { + Assertions.assertThat(aList).doesNotHaveDuplicates(); + Assertions.assertThat(aList).allMatch(anInt -> anInt >= 0 && anInt <= 10); + } + ``` + + Trying to generate a list with more than 11 elements would not work here. + + Works for all generated types. + +#### String Length + +- [`@StringLength(int value = 0, int min = 0, int max = 0)`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/StringLength.html): + Set either fixed length through `value` or configure the length range between `min` and `max`. + +- [`@NotEmpty`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/NotEmpty.html): + Set minimum length to `1`. + +#### Character Sets + +When generating chars any unicode character might be generated. + +When generating Strings, however, +Unicode "noncharacters" and "private use characters" +will not be generated unless you explicitly include them using +`@Chars` or `@CharRange` (see below). + +You can use the following annotations to restrict the set of allowed characters and even +combine several of them: + +- [`@Chars(chars[] value = {})`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/Chars.html): + Specify a set of characters. + This annotation can be repeated which will add up all allowed chars. +- [`@CharRange(char from = 0, char to = 0)`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/CharRange.html): + Specify a start and end character. + This annotation can be repeated which will add up all allowed chars. +- [`@NumericChars`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/NumericChars.html): + Use digits `0` through `9` +- [`@LowerChars`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/LowerChars.html): + Use lower case chars `a` through `z` +- [`@UpperChars`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/UpperChars.html): + Use upper case chars `A` through `Z` +- [`@AlphaChars`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/AlphaChars.html): + Lower and upper case chars are allowed. +- [`@Whitespace`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/Whitespace.html): + All whitespace characters are allowed. + +They work for generated `String`s and `Character`s. + +#### List, Set, Stream, Map and Array Size + +- [`@Size(int value = 0, int min = 0, int max = 0)`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/Size.html): + Set either fixed size through `value` or configure the size range between `min` and `max`. + +- [`@NotEmpty`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/NotEmpty.html): + Set minimum size to `1`. + + +#### Integer Constraints + +- [`@ByteRange(byte min = 0, byte max = Byte.MAX_VALUE)`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/ByteRange.html): + For `Byte` and `byte` only. +- [`@ShortRange(short min = 0, short max = Short.MAX_VALUE)`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/ShortRange.html): + For `Short` and `short` only. +- [`@IntRange(int min = 0, int max = Integer.MAX_VALUE)`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/IntRange.html): + For `Integer` and `int` only. +- [`@LongRange(long min = 0L, long max = Long.MAX_VALUE)`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/LongRange.html): + For `Long` and `long` only. +- [`@BigRange(String min = "", String max = "")`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/BigRange.html): + For `BigInteger` generation. +- [`@Positive`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/Positive.html): + Numbers larger than `0`. For all integral types. +- [`@Negative`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/Negative.html): + Numbers lower than `0`. For all integral types. + + +#### Decimal Constraints + +- [`@FloatRange(float min = 0.0f, minIncluded = true, float max = Float.MAX_VALUE, maxIncluded = true)`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/FloatRange.html): + For `Float` and `float` only. +- [`@DoubleRange(double min = 0.0, minIncluded = true, double max = Double.MAX_VALUE, boolean maxIncluded = true)`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/DoubleRange.html): + For `Double` and `double` only. +- [`@BigRange(String min = "", minIncluded = true, String max = "", maxIncluded = true)`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/BigRange.html): + For `BigDecimal` generation. +- [`@Scale(int value)`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/Scale.html): + Specify the maximum number of decimal places. For all decimal types. +- [`@Positive`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/Positive.html): + Numbers larger than `0.0`. For all decimal types. +- [`@Negative`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/Negative.html): + Numbers lower than `0.0`. For all decimal types. + +### Constraining parameterized types + +When you want to constrain the generation of contained parameter types you can annotate +the parameter type directly, e.g.: + +```java +@Property +void aProperty(@ForAll @Size(min= 1) List<@StringLength(max=10) String> listOfStrings) { +} +``` +will generate lists with a minimum size of 1 filled with Strings that have 10 characters max. + +### Providing variable types + +While checking properties of generically typed classes or functions, you often don't care +about the exact type of variables and therefore want to express them with type variables. +_jqwik_ can also handle type variables and wildcard types. The handling of upper and lower +bounds works mostly as you would expect it. + +Consider +[the following examples](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/VariableTypedPropertyExamples.java): + +```java +class VariableTypedPropertyExamples { + + @Property + boolean unboundedGenericTypesAreResolved(@ForAll List items, @ForAll T newItem) { + items.add(newItem); + return items.contains(newItem); + } + + @Property + void someBoundedGenericTypesCanBeResolved(@ForAll List items, @ForAll T newItem) { + } + + @Property + void someWildcardTypesWithUpperBoundsCanBeResolved(@ForAll List items) { + } + +} +``` + +In the case of unbounded type variables or an unbounded wildcard type, _jqwik_ +will create instanced of a special class (`WildcardObject`) under the hood. + +In the case of bounded type variables and bounded wildcard types, _jqwik_ +will check if any [registered arbitrary provider](#providing-default-arbitraries) +can provide suitable arbitraries and choose randomly between those. + +There is, however, a potentially unexpected behaviour, +when the same type variable is used in more than one place and can be +resolved by more than one arbitrary. In this case it can happen that the variable +does not represent the same type in all places. You can see this above +in property method `someBoundedGenericTypesCanBeResolved()` where `items` +might be a list of Strings but `newItem` of some number type - and all that +_in the same call to the method_! + +## Self-Made Annotations + +You can [make your own annotations](http://junit.org/junit5/docs/5.0.0/user-guide/#writing-tests-meta-annotations) +instead of using _jqwik_'s built-in ones. BTW, '@Example' is nothing but a plain annotation using [`@Property`](/docs/1.3.0/javadoc/net/jqwik/api/Property.html) +as "meta"-annotation. + +The following example provides an annotation to constrain String or Character generation to German letters only: + +```java +@Target({ ElementType.ANNOTATION_TYPE, ElementType.PARAMETER }) +@Retention(RetentionPolicy.RUNTIME) +@NumericChars +@AlphaChars +@Chars({'ä', 'ö', 'ü', 'Ä', 'Ö', 'Ü', 'ß'}) +@Chars({' ', '.', ',', ';', '?', '!'}) +@StringLength(min = 10, max = 100) +public @interface GermanText { } + +@Property(tries = 10) @Reporting(Reporting.GENERATED) +void aGermanText(@ForAll @GermanText String aText) {} +``` + +The drawback of self-made annotations is that they do not forward their parameters to meta-annotations, +which constrains their applicability to simple cases. + + +## Customized Parameter Generation + +Sometimes the possibilities of adjusting default parameter generation +through annotations is not enough. You want to control the creation +of values programmatically. The means to do that are _provider methods_. + +### Parameter Provider Methods + +Look at the +[following example](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/ProvideMethodExamples.java): + +```java +@Property +boolean concatenatingStringWithInt( + @ForAll("shortStrings") String aShortString, + @ForAll("10 to 99") int aNumber +) { + String concatenated = aShortString + aNumber; + return concatenated.length() > 2 && concatenated.length() < 11; +} + +@Provide +Arbitrary shortStrings() { + return Arbitraries.strings().withCharRange('a', 'z') + .ofMinLength(1).ofMaxLength(8); +} + +@Provide("10 to 99") +Arbitrary numbers() { + return Arbitraries.integers().between(10, 99); +} +``` + +The String value of the [`@ForAll`](/docs/1.3.0/javadoc/net/jqwik/api/ForAll.html) +annotation serves as a reference to a +method within the same class (or one of its superclasses or owning classes). +This reference refers to either the method's name or the String value +of the method's `@Provide` annotation. + +The providing method has to return an object of type +[`@Arbitrary`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html) +where `T` is the static type of the parameter to be provided. Optionally +the provider method can take tow optional parameters: + +- a first parameter of type `TypeUsage` that describes the details of the target parameter to be provided +- a second parameter of type `ArbitraryProvider.SubtypeProvider` + +These two objects can be used to get detailed information about the parameter, +like annotations and embedded type parameters, and to resolve other types, +usually from type parameters embedded in the original parameter. Use with care! + +Parameter provision usually starts with a +[static method call to `Arbitraries`](#static-arbitraries-methods), maybe followed +by one or more [filtering](#filtering), [mapping](#mapping) or +[combining](#combining-arbitraries) actions. + + +### Providing Arbitraries for Embedded Types + +There is an alternative syntax to `@ForAll("methodRef")` using a `From` annotation: + +```java +@Property +boolean concatenatingStringWithInt( + @ForAll @From("shortStrings") String aShortString, + @ForAll @From("10 to 99") int aNumber +) { ... } +``` + +Why this redundancy? Well, `@From` becomes a necessity when you want to provide +the arbitrary of an embedded type parameter. Consider this example: + +```java +@Property +boolean joiningListOfStrings(@ForAll List<@From("shortStrings") String> listOfStrings) { + String concatenated = String.join("", listOfStrings); + return concatenated.length() <= 8 * listOfStrings.size(); +} +``` + +Here, the list is created using the default list arbitrary, but the +String elements are generated using the arbitrary from the method `shortStrings`. + +### Static `Arbitraries` methods + +The starting point for generation usually is a static method call on class +[`Arbitraries`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html). + +#### Generate values yourself + +- [`Arbitrary randomValue(Function generator)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#randomValue-java.util.function.Function-): + Take a `random` instance and create an object from it. + Those values cannot be [shrunk](#result-shrinking), though. + + Generating prime numbers might look like that: + ```java + @Provide + Arbitrary primesGenerated() { + return Arbitraries.randomValue(random -> generatePrime(random)); + } + + private Integer generatePrime(Random random) { + int candidate; + do { + candidate = random.nextInt(10000) + 2; + } while (!isPrime(candidate)); + return candidate; + } + ``` + +- [`Arbitrary fromGenerator(RandomGenerator generator)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#fromGenerator-net.jqwik.api.RandomGenerator-): + If the number of _tries_ influences value generation or if you want + to allow for [shrinking](#result-shrinking) you have to provide + your own `RandomGenerator` implementation. + +#### Select or generate values randomly + +- [`Arbitrary of(U... values)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#of-U...-): + Choose randomly from a list of values. Shrink towards the first one. + +- [`Arbitrary ofSuppliers(Supplier... valueSuppliers)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#ofSuppliers-java.util.function.Supplier...-): + Choose randomly from a list of value suppliers and get the object from this supplier. + This is useful when dealing with mutable objects where `Arbitrary.of(..)` would reuse a potentially changed object. + +- [`Arbitrary constant(T constantValue)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#constant-T-): + Always provide the same constant value in each try. Mostly useful to combine with other arbitraries. + +- [`Arbitrary of(Class enumClass)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#of-java.lang.Class-): + Choose randomly from all values of an `enum`. Shrink towards first enum value. + +- [`Arbitrary create(Supplier supplier)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#constant-java.util.function.Supplier-): + In each try use a new unshrinkable instance of type `T` using `supplier` to freshly create it. + This is useful when dealing with mutable objects where `Arbitrary.constant()` may reuse a changed object. + +#### Select randomly with Weights + +If you have a set of values to choose from with weighted probabilities, use ` +[`Arbitraries.frequency(...)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#frequency-net.jqwik.api.Tuple.Tuple2...-): + +```java +@Property +void abcdWithFrequencies(@ForAll("abcdWeighted") String aString) { + Statistics.collect(aString); +} + +@Provide +Arbitrary abcdWeighted() { + return Arbitraries.frequency( + Tuple.of(1, "a"), + Tuple.of(5, "b"), + Tuple.of(10, "c"), + Tuple.of(20, "d") + ); +} +``` + +The first value of the tuple specifies the frequency of a particular value in relation to the +sum of all frequencies. In +[the given example](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/ChoosingExamples.java#L17) +the sum is 36, thus `"a"` will be generated with a probability of `1/36` +whereas `"d"` has a generation probability of `20/36` (= `5/9`). + +Shrinking moves towards the start of the frequency list. + +#### Characters and Strings + +- [`StringArbitrary strings()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#strings--) +- [`CharacterArbitrary chars()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#chars--) + +#### java.util.Random + +- [`Arbitrary randoms()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#randoms--): + Random instances will never be shrunk + +#### Shuffling Permutations + +- [`Arbitrary> shuffle(T ... values)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#shuffle-T...-): + Return unshrinkable permutations of the `values` handed in. + +- [`Arbitrary> shuffle(List values)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#shuffle-java.util.List-): + Return unshrinkable permutations of the `values` handed in. + +#### Default Types + +- [`Arbitrary defaultFor(Class type, Class ... parameterTypes)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#defaultFor-java.lang.Class-java.lang.Class...-): + Return the default arbitrary available for type `type` [if one is provided](#providing-default-arbitraries) + by default. For parameterized types you can also specify the parameter types. + + Keep in mind, though, that the parameter types are lost in the type signature and therefore + cannot be used in the respective [`@ForAll`](/docs/1.3.0/javadoc/net/jqwik/api/ForAll.html) property method parameter. Raw types and wildcards, + however, match; thus the following example will work: + + ```java + @Property + boolean listWithWildcard(@ForAll("stringLists") List stringList) { + return stringList.isEmpty() || stringList.get(0) instanceof String; + } + + @Provide + Arbitrary stringLists() { + return Arbitraries.defaultFor(List.class, String.class); + } + ``` + +### Numeric Arbitrary Types + +Creating an arbitrary for numeric values also starts by calling a static method +on class `Arbitraries`. There are two fundamental types of numbers: _integral_ numbers +and _decimal_ numbers. _jqwik_ supports all of Java's built-in number types. + +Each type has its own [fluent interface](https://en.wikipedia.org/wiki/Fluent_interface) +but all numeric arbitrary types share some things: + +- You can constrain their minimum and maximum values using `between(min, max)`, + `greaterOrEqual(min)` and `lessOrEqual(max)`. +- You can determine the _target value_ through `shrinkTowards(target)`. + This value is supposed to be the "center" of all possible values used for shrinking + and as a mean for [random distributions](random-numeric-distribution). + +#### Integrals + +- [`ByteArbitrary bytes()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#bytes--) +- [`ShortArbitrary shorts()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#shorts--) +- [`IntegerArbitrary integers()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#integers--) +- [`LongArbitrary longs()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#longs--) +- [`BigIntegerArbitrary bigIntegers()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#bigIntegers--) + +#### Decimals + +- [`FloatArbitrary floats()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#floats--) +- [`DoubleArbitrary doubles()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#doubles--) +- [`BigDecimalArbitrary bigDecimals()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#bigDecimals--) + +Decimal arbitrary types come with a few additional capabilities: + +- You can include or exclude the borders using `between(min, minIncluded, max, maxIncluded)`, + `greaterThan(minExcluded)` and `lessThan(maxExclude)`. +- You can set the _scale_, i.e. number of significant decimal places with `ofScale(scale)`. + The default scale is `2`. + +#### Random Numeric Distribution + +With release `1.3.0` jqwik provides you with a means to influence the probability distribution +of randomly generated numbers. The way to do that is by calling +[`withDistribution(distribution)`](https://jqwik.net/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/NumericalArbitrary.html#withDistribution-net.jqwik.api.RandomDistribution-). +Currently three different distributions are supported: + +- [`RandomDistribution.biased()`](https://jqwik.net/docs/1.3.0/javadoc/net/jqwik/api/RandomDistribution.html#biased--): + This is the default. + It generates values closer to the center of a numerical range with a higher probability. + The bigger the range the stronger the bias. + +- [`RandomDistribution.uniform()`](https://jqwik.net/docs/1.3.0/javadoc/net/jqwik/api/RandomDistribution.html#uniform--): + This distribution will generate values across the allowed range + with a uniform probability distribution. + +- [`RandomDistribution.gaussian(borderSigma)`](https://jqwik.net/docs/1.3.0/javadoc/net/jqwik/api/RandomDistribution.html#gaussian-double-): + A (potentially asymmetric) gaussian distribution -- + aka "normal distribution" -- the mean of which is the specified center + and the probability at the borders is `borderSigma` times _standard deviation_. + Gaussian generation is approximately 10 times slower than biased or uniform generation. + +- [`RandomDistribution.gaussian()`](https://jqwik.net/docs/1.3.0/javadoc/net/jqwik/api/RandomDistribution.html#gaussian--): + A gaussian distribution with `borderSigma` of 3, i.e. approximately 99.7% of values are within the borders. + +The specified distribution does not influence the generation of [edge cases](#generation-of-edge-cases). + +The following example generates numbers between 0 and 20 using a gaussian probability distribution +with its mean at 10 and a standard deviation of about 3.3: + +```java +@Property(generation = GenerationMode.RANDOMIZED) +@StatisticsReport(format = Histogram.class) +void gaussianDistributedIntegers(@ForAll("gaussians") int aNumber) { + Statistics.collect(aNumber); +} + +@Provide +Arbitrary gaussians() { + return Arbitraries + .integers() + .between(0, 20) + .shrinkTowards(10) + .withDistribution(RandomDistribution.gaussian()); +} +``` + +Look at the statistics to see if it fits your expectation: +``` +[RandomDistributionExamples:gaussianDistributedIntegers] (1000) statistics = + # | label | count | + -----|-------|-------|--------------------------------------------------------------------------------- + 0 | 0 | 15 | ■■■■■ + 1 | 1 | 8 | ■■ + 2 | 2 | 12 | ■■■■ + 3 | 3 | 9 | ■■■ + 4 | 4 | 14 | ■■■■ + 5 | 5 | 28 | ■■■■■■■■■ + 6 | 6 | 38 | ■■■■■■■■■■■■■ + 7 | 7 | 67 | ■■■■■■■■■■■■■■■■■■■■■■■ + 8 | 8 | 77 | ■■■■■■■■■■■■■■■■■■■■■■■■■■ + 9 | 9 | 116 | ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ + 10 | 10 | 231 | ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ + 11 | 11 | 101 | ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ + 12 | 12 | 91 | ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ + 13 | 13 | 60 | ■■■■■■■■■■■■■■■■■■■■ + 14 | 14 | 45 | ■■■■■■■■■■■■■■■ + 15 | 15 | 36 | ■■■■■■■■■■■■ + 16 | 16 | 19 | ■■■■■■ + 17 | 17 | 10 | ■■■ + 18 | 18 | 7 | ■■ + 19 | 19 | 1 | + 20 | 20 | 15 | ■■■■■ +``` + +You can notice that values `0` and `20` should have the lowest probability but they do not. +This is because they will be generated a few times as edge cases. + +### Collections, Streams, Arrays and Optional + +Generating types who have generic type parameters, requires to start with +an `Arbitrary` instance for the generic type. You can create the corresponding collection arbitrary from there: + +- [`Arbitrary.list()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html#list--) +- [`Arbitrary.set()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html#set--) +- [`Arbitrary.streamOf()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html#stream--) +- [`Arbitrary.array(Class arrayClass)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html#array-java.lang.Class-) +- [`Arbitrary.optional()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html#optional--) + +### Collecting Values in a List + +If you do not want any random combination of values in your list - as +can be done with `Arbitrary.list()` - you have the possibility to collect random values +in a list until a certain condition is fulfilled. +[`Arbitrary.collect(Predicate condition)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html#collect-java.util.function.Predicate-) +is what you need in those cases. + +Imagine you need a list of integers the sum of which should be at least `1000`. +Here's how you could do that: + +```java +Arbitrary integers = Arbitraries.integers().between(1, 100); +Arbitrary> collected = integers.collect(list -> sum(list) >= 1000); +``` + +### Tuples of same base type + +If you want to generate tuples of the same base types that also use the same generator, that's how you can do it: + +```java +Arbitrary integerPair = Arbitrary.integers().between(1, 25).tuple2(); +``` + +There's a method for tuples of length 1 to 4: + +- [`Arbitrary.tuple1()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html#tuple1--) +- [`Arbitrary.tuple2()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html#tuple2--) +- [`Arbitrary.tuple3()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html#tuple3--) +- [`Arbitrary.tuple4()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html#tuple4--) + + + + +### Maps + +Generating instances of type `Map` is a bit different since two arbitraries +are needed, one for the key and one for the value. Therefore you have to use +[`Arbitraries.maps(...)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#maps-net.jqwik.api.Arbitrary-net.jqwik.api.Arbitrary-) like this: + +```java +@Property +void mapsFromNumberToString(@ForAll("numberMaps") Map map) { + Assertions.assertThat(map.keySet()).allMatch(key -> key >= 0 && key <= 1000); + Assertions.assertThat(map.values()).allMatch(value -> value.length() == 5); +} + +@Provide +Arbitrary> numberMaps() { + Arbitrary keys = Arbitraries.integers().between(1, 100); + Arbitrary values = Arbitraries.strings().alpha().ofLength(5); + return Arbitraries.maps(keys, values); +} +``` + +For generating individual `Map.Entry` instances there is +[`Arbitraries.entries(...)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#maps-net.jqwik.api.Arbitrary-net.jqwik.api.Arbitrary-). + + +### Functional Types + +Interfaces that have a single (non default) method are considered to be +_Functional types_; they are sometimes called _SAM_ types for "single abstract method". +If a functional type is used as a `@ForAll`-parameter _jqwik_ will automatically +generate instances of those functions. The generated functions have the following +characteristics: + +- Given the input parameters they will produce the same return values. +- The return values are generated using the type information and constraints + in the parameter. +- Given different input parameters they will _usually_ produce different + return values. +- Shrinking of generated functions will try constant functions, i.e. functions + that always return the same value. + +Let's look at an example: + +```java +@Property +void fromIntToString(@ForAll Function function) { + assertThat(function.apply(42)).hasSize(5); + assertThat(function.apply(1)).isEqualTo(function.apply(1)); +} +``` + +This works for any _interface-based_ functional types, even your own. +If you [register a default provider](#providing-default-arbitraries) for +a functional type with a priority of 0 or above, it will take precedence. + +If the functions need some specialized arbitrary for return values or if you +want to fix the function's behaviour for some range of values, you can define +the arbitrary manually: + +```java +@Property +void emptyStringsTestFalse(@ForAll("predicates") Predicate predicate) { + assertThat(predicate.test("")).isFalse(); +} + +@Provide +Arbitrary> predicates() { + return Functions + .function(Predicate.class) + .returns(Arbitraries.of(true, false)) + .when(parameters -> parameters.get(0).equals(""), parameters -> false); +} +``` + +In this example the generated predicate will always return `false` when +given an empty String and randomly choose between `true` and `false` in +all other cases. + +### Fluent Configuration Interfaces + +Most specialized arbitrary interfaces provide special methods to configure things +like size, length, boundaries etc. Have a look at the Java doc for the following types: + +- [BigDecimalArbitrary](/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/BigDecimalArbitrary.html) +- [BigIntegerArbitrary](/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/BigIntegerArbitrary.html) +- [ByteArbitrary](/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/ByteArbitrary.html) +- [CharacterArbitrary](/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/CharacterArbitrary.html) +- [DoubleArbitrary](/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/DoubleArbitrary.html) +- [FloatArbitrary](/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/FloatArbitrary.html) +- [IntegerArbitrary](/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/IntegerArbitrary.html) +- [LongArbitrary](/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/LongArbitrary.html) +- [ShortArbitrary](/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/ShortArbitrary.html) +- [SizableArbitrary](/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/SizableArbitrary.html) +- [StreamableArbitrary](/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/StreamableArbitrary.html) +- [StringArbitrary](/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/StringArbitrary.html) +- [FunctionArbitrary](/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/FunctionArbitrary.html) + + +Here are a +[two examples](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/FluentConfigurationExamples.java) +to give you a hint of what you can do: + +```java +@Provide +Arbitrary alphaNumericStringsWithMinLength5() { + return Arbitraries.strings().ofMinLength(5).alpha().numeric(); +} + +@Provide +Arbitrary> fixedSizedListOfPositiveIntegers() { + return Arbitraries.integers().greaterOrEqual(0).list().ofSize(17); +} +``` + +### Generate `null` values + +Predefined generators will never create `null` values. If you want to allow that, +call [`Arbitrary.injectNull(double probability)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html#injectNull-double-). +The following provider method creates an arbitrary that will return a `null` String +in about 1 of 100 generated values. + +```java +@Provide +Arbitrary stringsWithNull() { + return Arbitraries.strings(0, 10).injectNull(0.01); +} +``` + +### Inject duplicate values + +Sometimes it is important that your generator will create _a previous value_ +again in order to trigger certain scenarios or branches in your code. +Imagine you want to check if your carefully hand-crafted String comparator really +is as symmetric as it's supposed to be: + +```java +Comparator comparator = (s1, s2) -> { + if (s1.length() + s2.length() == 0) return 0; + if (s1.compareTo(s2) > 0) { + return 1; + } else { + return -1; + } +}; + +@Property +boolean comparing_strings_is_symmetric(@ForAll String first, @ForAll String second) { + int comparison = comparator.compare(first, second); + return comparator.compare(second, first) == -comparison; +} +``` + +The property (most probably) succeeds and will give you confidence in your code. +Or does it? Natural scepticism makes you check some statistics: + +```java +@Property +boolean comparing_strings_is_symmetric(@ForAll String first, @ForAll String second) { + int comparison = comparator.compare(first, second); + String comparisonRange = comparison < 0 ? "<0" : comparison > 0 ? ">0" : "=0"; + String empty = first.isEmpty() || second.isEmpty() ? "empty" : "not empty"; + Statistics.collect(comparisonRange, empty); + return comparator.compare(second, first) == -comparison; +} +``` + +The following output + +``` +[comparing strings is symmetric] (1000) statistics = + <0 not empty (471) : 47,10 % + >0 not empty (456) : 45,60 % + <0 empty ( 37) : 3,70 % + >0 empty ( 35) : 3,50 % + =0 empty ( 1) : 0,10 % +``` + +reveals that our generated test data is missing one combination: +Comparison value of 0 for non-empty strings. In theory a generic String arbitrary +could generate the same non-empty string but it's highly unlikely. +This is where we have to think about raising the probability of the same +value being generated more often: + +``` +@Property +boolean comparing_strings_is_symmetric(@ForAll("pair") Tuple2 pair) { + String first = pair.get1(); + String second = pair.get2(); + int comparison = comparator.compare(first, second); + return comparator.compare(second, first) == -comparison; +} + +@Provide +Arbitrary> pair() { + return Arbitraries.strings().injectDuplicates(0.1).tuple2(); +} +``` + +This will cover the missing case and will reveal a bug in the comparator. +Mind that you have to make sure that the _same generator instance_ is being used +for the two String values - using `tuple2()` does that. + + +### Filtering + +If you want to include only part of all the values generated by an arbitrary, +use +[`Arbitrary.filter(Predicate filterPredicate)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html#filter-java.util.function.Predicate-). +The following arbitrary will filter out all +even numbers from the stream of generated integers: + +```java +@Provide +Arbitrary oddNumbers() { + return Arbitraries.integers().filter(aNumber -> aNumber % 2 != 0); +} +``` + +Keep in mind that your filter condition should not be too restrictive. +If the generator fails to find a suitable value after 10000 trials, +the current property will be abandoned by throwing an exception. + +### Creating unique values + +If you want to make sure that all the values generated by an arbitrary are unique, +use +[`Arbitrary.unique()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html#unique--). +The following arbitrary will generate integers between 1 and 1000 but never the same integer twice: + +```java +@Provide +Arbitrary oddNumbers() { + return Arbitraries.integers().between(1, 1000).unique(); +} +``` + +This means that a maximum of 1000 values can be generated. If the generator fails +to find a yet unseen value after 10000 trials, +the current property will be abandoned by throwing an exception. + +### Mapping + +Sometimes it's easier to start with an existing arbitrary and use its generated values to +build other objects from them. In that case, use +[`Arbitrary.map(Function mapper)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html#map-java.util.function.Function-). +The following example uses generated integers to create numerical Strings: + +```java +@Provide +Arbitrary fiveDigitStrings() { + return Arbitraries.integers(10000, 99999).map(aNumber -> String.valueOf(aNumber)); +} +``` + +You could generate the same kind of values by constraining and filtering a generated String. +However, the [shrinking](#result-shrinking) target would probably be different. In the example above, shrinking +will move towards the lowest allowed number, that is `10000`. + + +### Flat Mapping + +Similar as in the case of `Arbitrary.map(..)` there are situations in which you want to use +a generated value in order to create another Arbitrary from it. Sounds complicated? +Have a look at the +[following example](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/FlatMappingExamples.java#L26): + +```java +@Property +boolean fixedSizedStrings(@ForAll("listsOfEqualSizedStrings")List lists) { + return lists.stream().distinct().count() == 1; +} + +@Provide +Arbitrary> listsOfEqualSizedStrings() { + Arbitrary integers2to5 = Arbitraries.integers().between(2, 5); + return integers2to5.flatMap(stringSize -> { + Arbitrary strings = Arbitraries.strings() // + .withCharRange('a', 'z') // + .ofMinLength(stringSize).ofMaxLength(stringSize); + return strings.list(); + }); +} +``` +The provider method will create random lists of strings, but in each list the size of the contained strings +will always be the same - between 2 and 5. + +### Flat Mapping with Tuple Types + +In the example above you used a generated value in order to create another arbitrary. +In those situations you often want to also provide the original values to your property test. + +Imagine, for instance, that you'd like to test properties of `String.substring(begin, end)`. +To randomize the method call, you not only need a string but also the `begin` and `end` indices. +However, both have dependencies: +- `end` must not be larger than the string size +- `begin` must not be larger than `end` +You can make _jqwik_ create all three values by using +[`flatMap`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html#flatMap-java.util.function.Function-) +combined with a tuple type +[like this](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/FlatMappingExamples.java#L32): + + +```java +@Property +void substringLength(@ForAll("stringWithBeginEnd") Tuple3 stringBeginEnd) { + String aString = stringBeginEnd.get1(); + int begin = stringBeginEnd.get2(); + int end = stringBeginEnd.get3(); + Assertions.assertThat(aString.substring(begin, end).length()) + .isEqualTo(end - begin); +} + +@Provide +Arbitrary> stringWithBeginEnd() { + Arbitrary stringArbitrary = Arbitraries.strings() // + .withCharRange('a', 'z') // + .ofMinLength(2).ofMaxLength(20); + return stringArbitrary // + .flatMap(aString -> Arbitraries.integers().between(0, aString.length()) // + .flatMap(end -> Arbitraries.integers().between(0, end) // + .map(begin -> Tuple.of(aString, begin, end)))); +} +``` + +Mind the nested flat mapping, which is an aesthetic nuisance but nevertheless +very useful. + + +### Randomly Choosing among Arbitraries + +If you have several arbitraries of the same type, you can create a new arbitrary of +the same type which will choose randomly one of those arbitraries before generating +a value: + +```java +@Property +boolean intsAreCreatedFromOneOfThreeArbitraries(@ForAll("oneOfThree") int anInt) { + String classifier = anInt < -1000 ? "below" : anInt > 1000 ? "above" : "one"; + Statistics.collect(classifier); + + return anInt < -1000 // + || Math.abs(anInt) == 1 // + || anInt > 1000; +} + +@Provide +Arbitrary oneOfThree() { + IntegerArbitrary below1000 = Arbitraries.integers().between(-2000, -1001); + IntegerArbitrary above1000 = Arbitraries.integers().between(1001, 2000); + Arbitrary oneOrMinusOne = Arbitraries.samples(-1, 1); + + return Arbitraries.oneOf(below1000, above1000, oneOrMinusOne); +} +``` + +[In this example](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/OneOfExamples.java) +the statistics should also give you an equal distribution between +the three types of integers. + +If you don't want to choose with equal probability - but with differing frequency - +you can do that in a similar way: + +```java +@Property(tries = 100) +@Report(Reporting.GENERATED) +boolean intsAreCreatedFromOneOfThreeArbitraries(@ForAll("oneOfThree") int anInt) { + return anInt < -1000 // + || Math.abs(anInt) == 1 // + || anInt > 1000; +} + +@Provide +Arbitrary oneOfThree() { + IntegerArbitrary below1000 = Arbitraries.integers().between(-1050, -1001); + IntegerArbitrary above1000 = Arbitraries.integers().between(1001, 1050); + Arbitrary oneOrMinusOne = Arbitraries.samples(-1, 1); + + return Arbitraries.frequencyOf( + Tuple.of(1, below1000), + Tuple.of(3, above1000), + Tuple.of(6, oneOrMinusOne) + ); +} +``` + +### Combining Arbitraries + +Sometimes just mapping a single stream of generated values is not enough to generate +a more complicated domain object. In those cases you can combine several arbitraries to +a single result arbitrary using +[`Combinators.combine()`](/docs/1.3.0/javadoc/net/jqwik/api/Combinators.html#combine-net.jqwik.api.Arbitrary-net.jqwik.api.Arbitrary-) +with up to eight arbitraries. +[Create an issue on github](https://github.com/jlink/jqwik/issues) if you need more than eight. + +[The following example](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/MappingAndCombinatorExamples.java#L25) +generates `Person` instances from three arbitraries as inputs. + +```java +@Property +void validPeopleHaveIDs(@ForAll("validPeople") Person aPerson) { + Assertions.assertThat(aPerson.getID()).contains("-"); + Assertions.assertThat(aPerson.getID().length()).isBetween(5, 24); +} + +@Provide +Arbitrary validPeople() { + Arbitrary names = Arbitraries.strings().withCharRange('a', 'z') + .ofMinLength(3).ofMaxLength(21); + Arbitrary ages = Arbitraries.integers().between(0, 130); + return Combinators.combine(names, ages) + .as((name, age) -> new Person(name, age)); +} + +class Person { + private final String name; + private final int age; + + public Person(String name, int age) { + this.name = name; + this.age = age; + } + + public String getID() { + return name + "-" + age; + } + + @Override + public String toString() { + return String.format("%s:%s", name, age); + } +} +``` + +The property should fail, thereby shrinking the falsified Person instance to +`[aaaaaaaaaaaaaaaaaaaaa:100]`. + +The `Combinators.combine` method accepts up to 8 parameters of type Arbitrary. +If you need more you have a few options: + +- Consider to group some parameters into an object of their own and change your design +- Generate inbetween arbitraries e.g. of type `Tuple` and combine those in another step +- Introduce a build for your domain object and combine them + [in this way](#combining-arbitraries-with-builder) + + +### Combining Arbitraries with Builder + +There's an alternative way to combine arbitraries to create an aggregated object +by using a builder for the aggregated object. Consider the example from +[above](#combining-arbitraries) and throw a `PersonBuilder` into the mix: + +```java +static class PersonBuilder { + + private String name = "A name"; + private int age = 42; + + public PersonBuilder withName(String name) { + this.name = name; + return this; + } + + public PersonBuilder withAge(int age) { + this.age = age; + return this; + } + + public Person build() { + return new Person(name, age); + } +} +``` + +Then you can go about generating people in the following way: + +```java +@Provide +Arbitrary validPeopleWithBuilder() { + Arbitrary names = + Arbitraries.strings().withCharRange('a', 'z').ofMinLength(2).ofMaxLength(20); + Arbitrary ages = Arbitraries.integers().between(0, 130); + + return Combinators.withBuilder(() -> new PersonBuilder()) + .use(names).in((builder, name) -> builder.withName(name)) + .use(ages).in((builder, age)-> builder.withAge(age)) + .build( builder -> builder.build()); +} +``` + +Have a look at +[Combinators.withBuilder(Supplier)](/docs/1.3.0/javadoc/net/jqwik/api/Combinators.html#withBuilder-java.util.function.Supplier-) +and [Combinators.withBuilder(Arbitrary)](/docs/1.3.0/javadoc/net/jqwik/api/Combinators.html#withBuilder-net.jqwik.api.Arbitrary-) +to check the API. + +#### Flat Combination + +If generating domain values requires to use several generated values to be used +in generating another one, there's the combination of flat mapping and combining: + +```java +@Property +boolean fullNameHasTwoParts(@ForAll("fullName") String aName) { + return aName.split(" ").length == 2; +} + +@Provide +Arbitrary fullName() { + IntegerArbitrary firstNameLength = Arbitraries.integers().between(2, 10); + IntegerArbitrary lastNameLength = Arbitraries.integers().between(2, 10); + return Combinators.combine(firstNameLength, lastNameLength).flatAs( (fLength, lLength) -> { + Arbitrary firstName = Arbitraries.strings().alpha().ofLength(fLength); + Arbitrary lastName = Arbitraries.strings().alpha().ofLength(fLength); + return Combinators.combine(firstName, lastName).as((f,l) -> f + " " + l); + }); +} +``` + +Often, however, there's an easier way to achieve the same goal which +does not require the flat combination of arbitraries: + +```java +@Provide +Arbitrary fullName2() { + Arbitrary firstName = Arbitraries.strings().alpha().ofMinLength(2).ofMaxLength(10); + Arbitrary lastName = Arbitraries.strings().alpha().ofMinLength(2).ofMaxLength(10); + return Combinators.combine(firstName, lastName).as((f, l) -> f + " " + l); +} +``` + +This is not only easier to understand but it usually improves shrinking. + +### Fix an Arbitrary's `genSize` + +Some generators (e.g. most number generators) are sensitive to the +`genSize` value that is used when creating them. +The default value for `genSize` is the number of tries configured for the property +they are used in. If there is a need to influence the behaviour of generators +you can do so by using +[`Arbitrary.fixGenSize(int)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html#fixGenSize-int-).. + +## Recursive Arbitraries + +Sometimes it seems like a good idea to compose arbitraries and thereby +recursively calling an arbitrary creation method. Generating recursive data types +is one application field but you can also use it for other stuff. + +### Probabilistic Recursion + +Look at the +[following example](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/RecursiveExamples.java) +which generates sentences by recursively adding words to a sentence: + +```java +@Property +boolean sentencesEndWithAPoint(@ForAll("sentences") String aSentence) { + return aSentence.endsWith("."); +} + +@Provide +Arbitrary sentences() { + Arbitrary sentence = Combinators.combine( // + Arbitraries.lazy(this::sentences), // + word() // + ).as((s, w) -> w + " " + s); + return Arbitraries.oneOf( // + word().map(w -> w + "."), // + sentence, // + sentence, // + sentence // + ); +} + +private StringArbitrary word() { + return Arbitraries.strings().alpha().ofLength(5); +} +``` + +There are two things to which you must pay attention: + +- Use [`Arbitraries.lazy(Supplier>)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#lazy-java.util.function.Supplier-) + to wrap the recursive call itself. + Otherwise _jqwik_'s attempt to build the arbitrary will quickly result in a stack overflow. +- Every recursion needs one or more base cases in order to stop recursion at some point. + Base cases must have a high enough probability, + otherwise a stack overflow will get you during value generation. + +### Deterministic Recursion + +An alternative to the non-deterministic recursion shown above, is to use classical +recursion with a counter to determine the base case. If you then use an arbitrary value +for the counter, the generated sentences will be very similar, and there is _no need_ +for using `Arbitraries.lazy()` at all: + +```java +@Property(tries = 10) +boolean sentencesEndWithAPoint(@ForAll("deterministic") String aSentence) { + return aSentence.endsWith("."); +} + +@Provide +Arbitrary deterministic() { + Arbitrary length = Arbitraries.integers().between(0, 10); + Arbitrary lastWord = word().map(w -> w + "."); + return length.flatMap(l -> deterministic(l, lastWord)); +} + +@Provide +Arbitrary deterministic(int length, Arbitrary sentence) { + if (length == 0) { + return sentence; + } + Arbitrary more = Combinators.combine(word(), sentence).as((w, s) -> w + " " + s); + return deterministic(length - 1, more); +} +``` + +### Deterministic Recursion with `recursive()` + +To further simplify this _jqwik_ provides a helper function: +[`Arbitraries.recursive(...)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#recursive-java.util.function.Supplier-java.util.function.Function-int-). +Using that further simplifies the example: + +```java +@Property(tries = 10) +boolean sentencesEndWithAPoint(@ForAll("deterministic") String aSentence) { + return aSentence.endsWith("."); +} + +@Provide +Arbitrary deterministic() { + Arbitrary length = Arbitraries.integers().between(0, 10); + Arbitrary lastWord = word().map(w -> w + "."); + + return length.flatMap(l -> Arbitraries.recursive(() -> lastWord, s -> prependWord(s), l)); +} + +private Arbitrary prependWord(Arbitrary sentence) { + return Combinators.combine(word(), sentence).as((w, s) -> w + " " + s); +} +``` + +## Using Arbitraries Directly + +Most of the time arbitraries are used indirectly, i.e. _jqwik_ uses them under +the hood to inject generated values as parameters. There are situations, though, +in which you might want to generate values directly. + +### Generating a Single Value + +Getting a single random value out of an arbitrary is easy and can be done +with [`Arbitrary.sample()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html#sample--): + +```java +Arbitrary strings = Arbitraries.of("string1", "string2", "string3"); +String aString = strings.sample(); +assertThat(aString).isIn("string1", "string2", "string3"); +``` + +Among other things, this allows you to use jqwik's generation functionality +with other test engines like Jupiter. +Mind that _jqwik_ uses a default `genSize` of 1000 under the hood and that +the `Random` object will be either taken from the current property's context or +freshly instantiated if used outside a property. + +### Generating a Stream of Values + +Getting a stream of generated values is just as easy with [`Arbitrary.sampleStream()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html#sampleStream--): + +```java +List values = Arrays.asList("string1", "string2", "string3"); +Arbitrary strings = Arbitraries.of(values); +Stream streamOfStrings = strings.sampleStream(); + +assertThat(streamOfStrings).allMatch(values::contains); +``` + +### Generating all possible values + +There are a few cases when you don't want to generate individual values from an +arbitrary but use all possible values to construct another arbitrary. This can be achieved through +[`Arbitrary.allValues()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html#allValues--). + +Return type is `Optional>` because _jqwik_ can only perform this task if +[exhaustive generation](#exhaustive-generation) is doable. + + +### Iterating through all possible values + +You can also use an arbitrary to iterate through all values it specifies. +Use +[`Arbitrary.forEachValue(Consumer action)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html#forEachValue-java.util.function.Consumer-). +for that purpose. This only works when [exhaustive generation](#exhaustive-generation) is possible. +In other cases the attempt to iterate will result in an exception. + +This is typically useful when your test requires to assert some fact for all +values of a given (sub)set of objects. Here's a contrived example: + +```java +@Property +void canPressAnyKeyOnKeyboard(@ForAll Keyboard keyboard, @ForAll Key key) { + keyboard.press(key); + assertThat(keyboard.isPressed(key)); + + Arbitrary unpressedKeys = Arbitraries.of(keyboard.allKeys()).filter(k -> !k.equals(key)); + unpressedKeys.forEachValue(k -> assertThat(keyboard.isPressed(k)).isFalse()); +} +``` + +In this example a simple for loop over `allKeys()` would also work. In more complicated scenarios +_jqwik_ will do all the combinations and filtering for you. + + + + +## Contract Tests + +When you combine type variables with properties defined in superclasses or interfaces +you can do some kind of _contract testing_. That means that you specify +the properties in a generically typed interface and specify the concrete class to +instantiate in a test container implementing the interface. + +The following example was influence by a similar feature in +[junit-quickcheck](http://pholser.github.io/junit-quickcheck/site/0.8/usage/contract-tests.html). +Here's the contract: + +```java +interface ComparatorContract { + Comparator subject(); + + @Property + default void symmetry(@ForAll("anyT") T x, @ForAll("anyT") T y) { + Comparator subject = subject(); + + Assertions.assertThat(signum(subject.compare(x, y))).isEqualTo(-signum(subject.compare(y, x))); + } + + @Provide + Arbitrary anyT(); +} +``` + +And here's the concrete test container that can be run to execute +the property with generated Strings: + +```java +class StringCaseInsensitiveProperties implements ComparatorContract { + + @Override public Comparator subject() { + return String::compareToIgnoreCase; + } + + @Override + @Provide + public Arbitrary anyT() { + return Arbitraries.strings().alpha().ofMaxLength(20); + } +} +``` + +What we can see here is that _jqwik_ is able to figure out the concrete +type of type variables when they are used in subtypes that fill in +the variables. + + +## Stateful Testing + +Despite its bad reputation _state_ is an important concept in object-oriented languages like Java. +We often have to deal with stateful objects or components whose state can be changed through methods. + +Thinking in a more formal way we can look at those objects as _state machines_ and the methods as +_actions_ that move the object from one state to another. Some actions have preconditions to constrain +when they can be invoked and some objects have invariants that should never be violated regardless +of the sequence of performed actions. + +To make this abstract concept concrete, let's look at a +[simple stack implementation](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/stateful/mystack/MyStringStack.java): + +```java +public class MyStringStack { + public void push(String element) { ... } + public String pop() { ... } + public void clear() { ... } + public boolean isEmpty() { ... } + public int size() { ... } + public String top() { ... } +} +``` + +### Specify Actions + +We can see at least three _actions_ with their preconditions and expected state changes: + +- [`Push`](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/stateful/mystack/PushAction.java): + Push a string onto the stack. The string should be on top afterwards and the size + should have increased by 1. + + ```java + import net.jqwik.api.stateful.*; + import org.assertj.core.api.*; + + class PushAction implements Action { + + private final String element; + + PushAction(String element) { + this.element = element; + } + + @Override + public MyStringStack run(MyStringStack stack) { + int sizeBefore = stack.size(); + stack.push(element); + Assertions.assertThat(stack.isEmpty()).isFalse(); + Assertions.assertThat(stack.size()).isEqualTo(sizeBefore + 1); + return stack; + } + + @Override + public String toString() { return String.format("push(%s)", element); } + } + ``` + +- [`Pop`](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/stateful/mystack/PopAction.java): + If (and only if) the stack is not empty, pop the element on top off the stack. + The size of the stack should have decreased by 1. + + ```java + class PopAction implements Action { + + @Override + public boolean precondition(MyStringStack stack) { + return !stack.isEmpty(); + } + + @Override + public MyStringStack run(MyStringStack stack) { + int sizeBefore = stack.size(); + String topBefore = stack.top(); + + String popped = stack.pop(); + Assertions.assertThat(popped).isEqualTo(topBefore); + Assertions.assertThat(stack.size()).isEqualTo(sizeBefore - 1); + return stack; + } + + @Override + public String toString() { return "pop"; } + } + ``` + +- [`Clear`](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/stateful/mystack/ClearAction.java): + Remove all elements from the stack which should be empty afterwards. + + ```java + class ClearAction implements Action { + + @Override + public MyStringStack run(MyStringStack stack) { + stack.clear(); + Assertions.assertThat(stack.isEmpty()).isTrue(); + return stack; + } + + @Override + public String toString() { return "clear"; } + } + ``` + +### Check Postconditions + +The fundamental property that _jqwik_ should try to falsify is: + + For any valid sequence of actions all required state changes + (aka postconditions) should be fulfilled. + +We can formulate that quite easily as a +[_jqwik_ property](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/stateful/mystack/MyStringStackProperties.java): + +```java +class MyStringStackProperties { + + @Property + void checkMyStack(@ForAll("sequences") ActionSequence actions) { + actions.run(new MyStringStack()); + } + + @Provide + Arbitrary> sequences() { + return Arbitraries.sequences(Arbitraries.oneOf(push(), pop(), clear())); + } + + private Arbitrary> push() { + return Arbitraries.strings().alpha().ofLength(5).map(PushAction::new); + } + + private Arbitrary> clear() { + return Arbitraries.constant(new ClearAction()); + } + + private Arbitrary> pop() { + return Arbitraries.constant(new PopAction()); + } +} +``` + +The interesting API elements are +- [`ActionSequence`](/docs/1.3.0/javadoc/net/jqwik/api/stateful/ActionSequence.html): + A generic collection type especially crafted for holding and shrinking of a list of actions. + As a convenience it will apply the actions to a state-based object when you call `run(state)`. + +- [`Arbitraries.sequences()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#sequences-net.jqwik.api.Arbitrary-): + This method will create the arbitrary for generating an `ActionSequence` given the + arbitrary for generating actions. + +To give _jqwik_ something to falsify, we broke the implementation of `clear()` so that +it won't clear everything if there are more than two elements on the stack: + +```java +public void clear() { + // Wrong implementation to provoke falsification for stacks with more than 2 elements + if (elements.size() > 2) { + elements.remove(0); + } else { + elements.clear(); + } +} +``` + +Running the property should now produce a result similar to: + +``` +org.opentest4j.AssertionFailedError: Run failed after following actions: + push(AAAAA) + push(AAAAA) + push(AAAAA) + clear + final state: ["AAAAA", "AAAAA"] +``` + +### Number of actions + +_jqwik_ will vary the number of generated actions according to the number +of `tries` of your property. For the default of 1000 tries a sequence will +have up to 32 actions. If need be you can specify the number of actions +to generate using either the fluent interface or the `@Size` annotation: + +```java +@Property +// check stack with sequences of 7 actions: +void checkMyStack(@ForAll("sequences") @Size(max = 7) ActionSequence actions) { + actions.run(new MyStringStack()); +} +``` + +The minimum number of generated actions in a sequence is 1 since checking +an empty sequence does not make sense. + +### Check Invariants + +We can also add invariants to our sequence checking property: + +```java +@Property +void checkMyStackWithInvariant(@ForAll("sequences") ActionSequence actions) { + actions + .withInvariant(stack -> Assertions.assertThat(stack.size()).isGreaterThanOrEqualTo(0)) + .withInvariant(stack -> Assertions.assertThat(stack.size()).isLessThan(5)) + .run(new MyStringStack()); +} +``` + +If we first fix the bug in `MyStringStack.clear()` our property should eventually fail +with the following result: + +``` +org.opentest4j.AssertionFailedError: Run failed after following actions: + push(AAAAA) + push(AAAAA) + push(AAAAA) + push(AAAAA) + push(AAAAA) + final state: ["AAAAA", "AAAAA", "AAAAA", "AAAAA", "AAAAA"] +``` + + +## Assumptions + +If you want to constrain the set of generated values in a way that embraces +more than one parameter, [filtering](#filtering) does not work. What you +can do instead is putting one or more assumptions at the beginning of your property. + +[The following property](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/AssumptionExamples.java) +works only on strings that are not equal: + +```java +@Property +boolean comparingUnequalStrings( // + @ForAll @StringLength(min = 1, max = 10) String string1, // + @ForAll @StringLength(min = 1, max = 10) String string2 // +) { + Assume.that(!string1.equals(string2)); + + return string1.compareTo(string2) != 0; +} +``` + +This is a reasonable use of +[`Assume.that(boolean condition)`](/docs/1.3.0/javadoc/net/jqwik/api/Assume.html#that-boolean-) +because most generated value sets will pass through. + +Have a look at a seemingly similar example: + +```java +@Property +boolean findingContainedStrings( // + @ForAll @StringLength(min = 1, max = 10) String container, // + @ForAll @StringLength(min = 1, max = 5) String contained // +) { + Assume.that(container.contains(contained)); + + return container.indexOf(contained) >= 0; +} +``` + +Despite the fact that the property condition itself is correct, the property will most likely +fail with the following message: + +``` +org.opentest4j.AssertionFailedError: + Property [findingContainedStrings] exhausted after [1000] tries and [980] rejections + +tries = 1000 +checks = 20 +generation = RANDOMIZED +after-failure = PREVIOUS_SEED +edge-cases#mode = MIXIN +seed = 1066117555581106850 +``` + +The problem is that - given a random generation of two strings - only in very few cases +one string will be contained in the other. _jqwik_ will report a property as `exhausted` +if the ratio between generated and accepted parameters is higher than 5. You can change +the maximum discard ratio by specifying a parameter `maxDiscardRatio` in the +[`@Property`](/docs/1.3.0/javadoc/net/jqwik/api/Property.html) annotation. +That's why changing to `@Property(maxDiscardRatio = 100)` in the previous example +will probably result in a successful property run, even though only a handful +cases - of 1000 generated - will actually be checked. + +In many cases turning up the accepted discard ration is a bad idea. With some creativity +we can often avoid the problem by generating out test data a bit differently. +Look at this variant of the above property, which also uses +[`Assume.that()`](/docs/1.3.0/javadoc/net/jqwik/api/Assume.html#that-boolean-) +but with a much lower discard ratio: + +```java +@Property +boolean findingContainedStrings_variant( // + @ForAll @StringLength(min = 5, max = 10) String container, // + @ForAll @IntRange(min = 1, max = 5) int length, // + @ForAll @IntRange(min = 0, max = 9) int startIndex // +) { + Assume.that((length + startIndex) <= container.length()); + + String contained = container.substring(startIndex, startIndex + length); + return container.indexOf(contained) >= 0; +} +``` + +## Result Shrinking + +If a property could be falsified with a generated set of values, _jqwik_ will +try to "shrink" this sample in order to find a "smaller" sample that also falsifies the property. + +Try this property: + +```java +@Property +boolean stringShouldBeShrunkToAA(@ForAll @AlphaChars String aString) { + return aString.length() > 5 || aString.length() < 2; +} +``` + +The test run result should look something like: + +``` +AssertionFailedError: Property [stringShouldBeShrunkToAA] falsified with sample ["AA"] + +tries = 38 +checks = 38 +... +sample = ["AA"] +original-sample ["LVtyB"] +``` + +In this case the _originalSample_ could be any string between 2 and 5 chars, whereas the final _sample_ +should be exactly `AA` since this is the shortest failing string and `A` has the lowest numeric value +of all allowed characters. + +### Integrated Shrinking + +_jqwik_'s shrinking approach is called _integrated shrinking_, as opposed to _type-based shrinking_ +which most property-based testing tools use. +The general idea and its advantages are explained +[here](http://hypothesis.works/articles/integrated-shrinking/). + +Consider a somewhat +[more complicated example](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/ShrinkingExamples.java#L15): + +```java +@Property +boolean shrinkingCanTakeLong(@ForAll("first") String first, @ForAll("second") String second) { + String aString = first + second; + return aString.length() > 5 || aString.length() < 2; +} + +@Provide +Arbitrary first() { + return Arbitraries.strings() + .withCharRange('a', 'z') + .ofMinLength(1).ofMaxLength(10) + .filter(string -> string.endsWith("h")); +} + +@Provide +Arbitrary second() { + return Arbitraries.strings() + .withCharRange('0', '9') + .ofMinLength(0).ofMaxLength(10) + .filter(string -> string.length() >= 1); +} +``` + +Shrinking still works, although there's quite a bit of filtering and string concatenation happening: +``` +AssertionFailedError: Property [shrinkingCanTakeLong] falsified with sample ["h", "0"] + +checks = 20 +tries = 20 +... +sample = ["h", "0"] +original-sample ["gh", "774"] +``` + +### Switch Shrinking Off + +Sometimes shrinking takes a really long time or won't finish at all (usually a _jqwik_ bug!). +In those cases you can switch shrinking off for an individual property: + +```java +@Property(shrinking = ShrinkingMode.OFF) +void aPropertyWithLongShrinkingTimes( + @ForAll List> list1, + @ForAll List> list2 +) { ... } +``` + +### Switch Shrinking to Full Mode + +Sometimes you can find a message like + +``` +shrinking bound reached = + steps : 1000 + original value : [blah blah blah ...] + shrunk value : [bl bl bl ...] +``` + +in your testrun's output. +This happens in rare cases when _jqwik_ has not found the end of its search for +simpler falsifiable values after 1000 iterations. In those cases you +can try + +```java +@Property(shrinking = ShrinkingMode.FULL) +``` + +to tell _jqwik_ to go all the way, even if it takes a million steps, +even if it never ends... + +### Change the Shrinking Target + +By default shrinking of numbers will move towards zero (0). +If zero is outside the bounds of generation the closest number to zero - +either the min or max value - is used as a target for shrinking. +There are cases, however, when you'd like _jqwik_ to choose a different +shrinking target, usually when the default value of a number is not 0. + +Consider generating signals with a standard frequency of 50 hz that can vary by +plus/minus 5 hz. If possible, shrinking of falsified scenarios should move +towards the standard frequency. Here's how the provider method might look: + +```java +@Provide +Arbitrary> signals() { + Arbitrary frequencies = + Arbitraries + .longs() + .between(45, 55) + .shrinkTowards(50); + + return frequencies.map(f -> Signal.withFrequency(f)).list().ofMaxSize(1000); +} +``` + +Currently shrinking targets are supported for all [number types](#numeric-arbitrary-types). + + +## Collecting and Reporting Statistics + +In many situations you'd like to know if _jqwik_ will really generate +the kind of values you expect and if the frequency and distribution of +certain value classes meets your testing needs. +[`Statistics.collect()`](/docs/1.3.0/javadoc/net/jqwik/api/statistics/Statistics.html#collect-java.lang.Object...-) +is made for this exact purpose. + +In the most simple case you'd like to know how often a certain value +is being generated: + +```java +@Property +void simpleStats(@ForAll RoundingMode mode) { + Statistics.collect(mode); +} +``` + +will create an output similar to that: + +``` +[MyTest:simpleStats] (1000) statistics = + FLOOR (158) : 16 % + HALF_EVEN (135) : 14 % + DOWN (126) : 13 % + UP (120) : 12 % + HALF_UP (118) : 12 % + CEILING (117) : 12 % + UNNECESSARY (117) : 12 % + HALF_DOWN (109) : 11 % +``` + +More typical is the case in which you'll classify generated values +into two or more groups: + +```java +@Property +void integerStats(@ForAll int anInt) { + Statistics.collect(anInt > 0 ? "positive" : "negative"); +} +``` + +``` +[MyTest:integerStats] (1000) statistics = + negative (506) : 51 % + positive (494) : 49 % +``` + +You can also collect the distribution in more than one category +and combine those categories: + +```java +@Property +void combinedIntegerStats(@ForAll int anInt) { + String posOrNeg = anInt > 0 ? "positive" : "negative"; + String evenOrOdd = anInt % 2 == 0 ? "even" : "odd"; + String bigOrSmall = Math.abs(anInt) > 50 ? "big" : "small"; + Statistics.collect(posOrNeg, evenOrOdd, bigOrSmall); +} +``` + +``` +[MyTest:combinedIntegerStats] (1000) statistics = + negative even big (222) : 22 % + positive even big (201) : 20 % + positive odd big (200) : 20 % + negative odd big (194) : 19 % + negative even small ( 70) : 7 % + positive odd small ( 42) : 4 % + negative odd small ( 38) : 4 % + positive even small ( 33) : 3 % +``` + +And, of course, you can combine different generated parameters into +one statistical group: + +```java +@Property +void twoParameterStats( + @ForAll @Size(min = 1, max = 10) List aList, // + @ForAll @IntRange(min = 0, max = 10) int index // +) { + Statistics.collect(aList.size() > index ? "index within size" : null); +} +``` + +``` +[MyTest:twoParameterStats] (1000) statistics = + index within size (507) : 51 % +``` + +As you can see, collected `null` values are not being reported. + +[Here](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/statistics/StatisticsExamples.java) +are a couple of examples to try out. + +### Labeled Statistics + +If you want more than one statistic in a single property, you must give them labels for differentiation: + +```java +@Property +void severalStatistics(@ForAll @IntRange(min = 1, max = 10) Integer anInt) { + String range = anInt < 3 ? "small" : "large"; + Statistics.label("range").collect(range); + Statistics.label("value").collect(anInt); +} +``` + +produces the following reports: + +``` +[MyTest:labeledStatistics] (1000) range = + large (783) : 78 % + small (217) : 22 % + +[MyTest:labeledStatistics] (1000) value = + 1 (115) : 12 % + 5 (109) : 11 % + 10 (105) : 11 % + 4 (103) : 10 % + 2 (102) : 10 % + 3 ( 99) : 10 % + 6 ( 97) : 10 % + 8 ( 92) : 9 % + 7 ( 91) : 9 % + 9 ( 87) : 9 % +``` + +### Statistics Report Formatting + +There is a +[`@StatisticsReport`](/docs/1.3.0/javadoc/net/jqwik/api/statistics/StatisticsReport.html) +annotation that allows to change statistics report +formats or to even switch it off. The annotation can be used on property methods +or on container classes. + +The `value` attribute is of type +[StatisticsReportMode.OFF](/docs/1.3.0/javadoc/net/jqwik/api/statistics/StatisticsReport.StatisticsReportMode.html) and can have one of: + +- __`STANDARD`__: Use jqwik's standard reporting format. This is used anyway + if you leave the annotation away. +- __`OFF`__: Switch statistics reporting off +- __`PLUG_IN`__: Plug in your homemade format. This is the default so that + you only have to provide the `format` attribute + [as shown below](#plug-in-your-own-statistics-report-format) + + +#### Switch Statistics Reporting Off + +You can switch off statistics report as simple as that: + +```java +@Property +@StatisticsReport(StatisticsReport.StatisticsReportMode.OFF) +void queryStatistics(@ForAll int anInt) { + Statistics.collect(anInt); +} +``` + +#### Histograms + +_jqwik_ comes with two report formats to display collected data as histograms: +[`Histogram`](/docs/1.3.0/javadoc/net/jqwik/api/statistics/Histogram.html) +and [`NumberRangeHistogram`](/docs/1.3.0/javadoc/net/jqwik/api/statistics/NumberRangeHistogram.html). + +`Histogram` displays the collected raw data as a histogram: + +```java +@Property(generation = GenerationMode.RANDOMIZED) +@StatisticsReport(format = Histogram.class) +void integers(@ForAll("gaussians") int aNumber) { + Statistics.collect(aNumber); +} + +@Provide +Arbitrary gaussians() { + return Arbitraries + .integers() + .between(0, 20) + .shrinkTowards(10) + .withDistribution(RandomDistribution.gaussian()); +} +``` + +``` +[HistogramExamples:integers] (1000) statistics = + # | label | count | + -----|-------|-------|--------------------------------------------------------------------------------- + 0 | 0 | 13 | ■■■■ + 1 | 1 | 13 | ■■■■ + 2 | 2 | 15 | ■■■■■ + 3 | 3 | 6 | ■■ + 4 | 4 | 10 | ■■■ + 5 | 5 | 22 | ■■■■■■■ + 6 | 6 | 49 | ■■■■■■■■■■■■■■■■ + 7 | 7 | 60 | ■■■■■■■■■■■■■■■■■■■■ + 8 | 8 | 102 | ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ + 9 | 9 | 100 | ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ + 10 | 10 | 233 | ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ + 11 | 11 | 114 | ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ + 12 | 12 | 74 | ■■■■■■■■■■■■■■■■■■■■■■■■■ + 13 | 13 | 64 | ■■■■■■■■■■■■■■■■■■■■■ + 14 | 14 | 43 | ■■■■■■■■■■■■■■ + 15 | 15 | 32 | ■■■■■■■■■■ + 16 | 16 | 16 | ■■■■■ + 17 | 17 | 8 | ■■ + 18 | 18 | 7 | ■■ + 19 | 20 | 19 | ■■■■■■ +``` + +`NumberRangeHistogram` clusters the collected raw data into ranges: + +```java +@Property(generation = GenerationMode.RANDOMIZED) +@StatisticsReport(format = NumberRangeHistogram.class) +void integersInRanges(@ForAll @IntRange(min = -1000, max = 1000) int aNumber) { + Statistics.collect(aNumber); +} +``` + +``` +[HistogramExamples:integersInRanges] (1000) statistics = + # | label | count | + -----|---------------|-------|--------------------------------------------------------------------------------- + 0 | [-1000..-900[ | 20 | ■■■■■ + 1 | [-900..-800[ | 17 | ■■■■ + 2 | [-800..-700[ | 16 | ■■■■ + 3 | [-700..-600[ | 8 | ■■ + 4 | [-600..-500[ | 12 | ■■■ + 5 | [-500..-400[ | 14 | ■■■ + 6 | [-400..-300[ | 17 | ■■■■ + 7 | [-300..-200[ | 46 | ■■■■■■■■■■■ + 8 | [-200..-100[ | 59 | ■■■■■■■■■■■■■■ + 9 | [-100..0[ | 315 | ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ + 10 | [0..100[ | 276 | ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ + 11 | [100..200[ | 47 | ■■■■■■■■■■■ + 12 | [200..300[ | 49 | ■■■■■■■■■■■■ + 13 | [300..400[ | 25 | ■■■■■■ + 14 | [400..500[ | 14 | ■■■ + 15 | [500..600[ | 13 | ■■■ + 16 | [600..700[ | 15 | ■■■ + 17 | [700..800[ | 14 | ■■■ + 18 | [800..900[ | 11 | ■■ + 19 | [900..1000] | 12 | ■■■ +``` + +Both types can be subclassed to override behaviour like the number of buckets, +the maximum drawing range of the bar, the order of elements and the label of a bucket. + +#### Make Your Own Statistics Report Format + +In order to format statistics to your own liking you have to create an +implementation of type +[StatisticsReportFormat](/docs/1.3.0/javadoc/net/jqwik/api/statistics/StatisticsReportFormat.html) and + +```java +@Property +@StatisticsReport(format = MyStatisticsFormat.class) +void statisticsWithHandMadeFormat(@ForAll Integer anInt) { + String range = anInt < 0 ? "negative" : anInt > 0 ? "positive" : "zero"; + Statistics.collect(range); +} + +class MyStatisticsFormat implements StatisticsReportFormat { + @Override + public List formatReport(List entries) { + return entries.stream() + .map(e -> String.format("%s: %d", e.name(), e.count())) + .collect(Collectors.toList()); + } +} +``` + +Running this property should produce a report similar to that: + +``` +[StatisticsExamples:statisticsWithHandMadeFormat] (1000) statistics = + negative: 520 + positive: 450 + zero: 30 +``` + +### Checking Coverage of Collected Statistics + +Just looking at the statistics of generated values might not be sufficient. +Sometimes you want to make sure that certain scenarios are being covered by +your generators and fail a property otherwise. In _jqwik_ you do that +by first +[collecting statistics](#collecting-and-reporting-statistics) +and then specifying coverage conditions for those statistics. + +#### Check Percentages and Counts + +The following example does that for generated values of enum `RoundingMode`: + +```java +@Property(generation = GenerationMode.RANDOMIZED) +void simpleStats(@ForAll RoundingMode mode) { + Statistics.collect(mode); + + Statistics.coverage(coverage -> { + coverage.check(RoundingMode.CEILING).percentage(p -> p > 5.0); + coverage.check(RoundingMode.FLOOR).count(c -> c > 2); + }); +} +``` + +The same thing is possible for values collected with a specific label +and in a fluent API style. + +```java +@Property(generation = GenerationMode.RANDOMIZED) +void labeledStatistics(@ForAll @IntRange(min = 1, max = 10) Integer anInt) { + String range = anInt < 3 ? "small" : "large"; + + Statistics.label("range") + .collect(range) + .coverage(coverage -> coverage.check("small").percentage(p -> p > 20.0)); + + Statistics.label("value") + .collect(anInt) + .coverage(coverage -> coverage.check(0).count(c -> c > 0)); +} +``` + +Start by looking at +[`Statistics.coverage()`](/docs/1.3.0/javadoc/net/jqwik/api/statistics/Statistics.html#coverage-java.util.function.Consumer-) +to see all the options you have for checking percentages and counts. + +#### Check Ad-hoc Query Coverage + +Instead of classifying values at collection time you have the possibility to +collect the raw data and use a query when doing coverage checking: + +```java +@Property +@StatisticsReport(StatisticsReport.StatisticsReportMode.OFF) +void queryStatistics(@ForAll int anInt) { + Statistics.collect(anInt); + + Statistics.coverage(coverage -> { + Predicate> isZero = params -> params.get(0) == 0; + coverage.checkQuery(isZero).percentage(p -> p > 5.0); + }); +} +``` + +In those cases you probably want to +[switch off reporting](#switch-statistics-reporting-off), +otherwise the reports might get very long - and without informative value. + + +## Providing Default Arbitraries + +Sometimes you want to use a certain, self-made `Arbitrary` for one of your own domain +classes, in all of your properties, and without having to add `@Provide` method +to all test classes. _jqwik_ enables this feature by using +Java’s `java.util.ServiceLoader` mechanism. All you have to do is: + +- Implement the interface [`ArbitraryProvider`](/docs/1.3.0/javadoc/net/jqwik/api/providers/ArbitraryProvider.html).
+ The implementing class _must_ have a default constructor without parameters. +- Register the implementation class in file + + ``` + META-INF/services/net.jqwik.api.providers.ArbitraryProvider + ``` + +_jqwik_ will then add an instance of your arbitrary provider into the list of +its default providers. Those default providers are considered for every test parameter annotated +with [`@ForAll`](/docs/1.3.0/javadoc/net/jqwik/api/ForAll.html) that has no explicit `value`. +By using this mechanism you can also replace the default providers +packaged into _jqwik_. + +### Simple Arbitrary Providers + +A simple provider is one that delivers arbitraries for types without type variables. +Consider the class [`Money`](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/defaultprovider/Money.java): + +```java +public class Money { + public BigDecimal getAmount() { + return amount; + } + + public String getCurrency() { + return currency; + } + + public Money(BigDecimal amount, String currency) { + this.amount = amount; + this.currency = currency; + } + + public Money times(int factor) { + return new Money(amount.multiply(new BigDecimal(factor)), currency); + } +} +``` + +If you register the following class +[`MoneyArbitraryProvider`](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/defaultprovider/MoneyArbitraryProvider.java): + +```java +package my.own.provider; + +public class MoneyArbitraryProvider implements ArbitraryProvider { + @Override + public boolean canProvideFor(TypeUsage targetType) { + return targetType.isOfType(Money.class); + } + + @Override + public Set> provideFor(TypeUsage targetType, SubtypeProvider subtypeProvider) { + Arbitrary amount = Arbitraries.bigDecimals() // + .between(BigDecimal.ZERO, new BigDecimal(1_000_000_000)) // + .ofScale(2); + Arbitrary currency = Arbitraries.of("EUR", "USD", "CHF"); + return Collections.singleton(Combinators.combine(amount, currency).as(Money::new)); + } +} +``` + +in file +[`META-INF/services/net.jqwik.api.providers.ArbitraryProvider`](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/resources/META-INF/services/net.jqwik.api.providers.ArbitraryProvider) +with such an entry: + +``` +my.own.provider.MoneyArbitraryProvider +``` + +The +[following property](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/defaultprovider/MoneyProperties.java) +will run without further ado - regardless the class you put it in: + +```java +@Property +void moneyCanBeMultiplied(@ForAll Money money) { + Money times2 = money.times(2); + Assertions.assertThat(times2.getCurrency()).isEqualTo(money.getCurrency()); + Assertions.assertThat(times2.getAmount()) + .isEqualTo(money.getAmount().multiply(new BigDecimal(2))); +} +``` + +### Arbitrary Providers for Parameterized Types + +Providing arbitraries for generic types requires a little bit more effort +since you have to create arbitraries for the "inner" types as well. +Let's have a look at the default provider for `java.util.Optional`: + +```java +public class OptionalArbitraryProvider implements ArbitraryProvider { + @Override + public boolean canProvideFor(TypeUsage targetType) { + return targetType.isOfType(Optional.class); + } + + @Override + public Set> provideFor(TypeUsage targetType, SubtypeProvider subtypeProvider) { + TypeUsage innerType = targetType.getTypeArguments().get(0); + return subtypeProvider.apply(innerType).stream() // + .map(Arbitrary::optional) + .collect(Collectors.toSet()); + } +} +``` + +Mind that `provideFor` returns a set of potential arbitraries. +That's necessary because the `subtypeProvider` might also deliver a choice of +subtype arbitraries. Not too difficult, is it? + + +### Arbitrary Provider Priority + +When more than one provider is suitable for a given type, _jqwik_ will randomly +choose between all available options. That's why you'll have to take additional +measures if you want to replace an already registered provider. The trick +is to override a provider's `priority()` method that returns `0` by default: + +```java +public class AlternativeStringArbitraryProvider implements ArbitraryProvider { + @Override + public boolean canProvideFor(TypeUsage targetType) { + return targetType.isAssignableFrom(String.class); + } + + @Override + public int priority() { + return 1; + } + + @Override + public Set> provideFor(TypeUsage targetType, SubtypeProvider subtypeProvider) { + return Collections.singleton(Arbitraries.constant("A String")); + } +} +``` + +If you register this class as arbitrary provider any `@ForAll String` will +be resolved to `"A String"`. + +## Create your own Annotations for Arbitrary Configuration + +All you can do [to constrain default parameter generation](#constraining-default-generation) +is adding another annotation to a parameter or its parameter types. What if the existing parameters +do not suffice your needs? Is there a way to enhance the set of constraint annotations? Yes, there is! + +The mechanism you can plug into is similar to what you do when +[providing your own default arbitrary providers](#providing-default-arbitraries). That means: + +1. Create an implementation of an interface, in this case + [`ArbitraryConfigurator`](/docs/1.3.0/javadoc/net/jqwik/api/configurators/ArbitraryConfigurator.html). +2. Register the implementation using using Java’s `java.util.ServiceLoader` mechanism. + +### Arbitrary Configuration Example: `@Odd` + +To demonstrate the idea let's create an annotation `@Odd` which will constrain any integer +generation to only generate odd numbers. First things first, so here's +the [`@Odd` annotation](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/arbitraryconfigurator/Odd.java) +together with the +[configurator implementation](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/arbitraryconfigurator/OddConfigurator.java): + +```java +@Target({ ElementType.ANNOTATION_TYPE, ElementType.PARAMETER, ElementType.TYPE_USE }) +@Retention(RetentionPolicy.RUNTIME) +public @interface Odd { +} + +public class OddConfigurator extends ArbitraryConfiguratorBase { + public Arbitrary configure(Arbitrary arbitrary, Odd odd) { + return arbitrary.filter(number -> Math.abs(number % 2) == 1); + } +} +``` + +Mind that the implementation uses an abstract base class - instead of the interface itself - +which simplifies implementation if you're only interested in a single annotation. + +If you now +[register the implementation](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/resources/META-INF/services/net.jqwik.api.configurators.ArbitraryConfigurator), +the [following example](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/arbitraryconfigurator/OddProperties.java) +will work: + +```java +@Property +boolean oddIntegersOnly(@ForAll @Odd int aNumber) { + return Math.abs(aNumber % 2) == 1; +} +``` + +There are a few catches, though: + +- Currently `OddConfigurator` will accept any target type since type erasure + will get rid of `` in configure-method's signature at runtime. + Therefore, using `@Odd` together with e.g. `BigInteger` will lead to a runtime + exception. You can prevent that by explicitly accepting only some target types: + + ```java + public class OddConfigurator extends ArbitraryConfiguratorBase { + + @Override + protected boolean acceptTargetType(TypeUsage targetType) { + return targetType.isAssignableFrom(Integer.class); + } + + public Arbitrary configure(Arbitrary arbitrary, Odd odd) { + return arbitrary.filter(number -> Math.abs(number % 2) == 1); + } + } + ``` + + Alternatively, you can check for an object's type directly and use different + filter algorithms: + + ```java + public Arbitrary configure(Arbitrary arbitrary, Odd odd) { + return arbitrary.filter(number -> { + if (number instanceof Integer) + return Math.abs((int) number % 2) == 1; + if (number instanceof BigInteger) + return ((BigInteger) number).remainder(BigInteger.valueOf(2)) + .abs().equals(BigInteger.ONE); + return false; + }); + } + ``` + +- You can combine `@Odd` with other annotations like `@Positive` or `@Range` or another + self-made configurator. In this case the order of configurator application might play a role, + which can be influenced by overriding the `order()` method of a configurator. + +## Domain and Domain Context + +Until now you have seen two ways to specify which arbitraries will be created for a given parameter: + +- Annotate the parameter with `@ForAll("providerMethod")`. +- [Register a global arbitrary provider](#providing-default-arbitraries) + that will be triggered by a known parameter signature. + +In many cases both approaches can be tedious to set up or require constant repetition of the same +annotation value. There's another way that allows you to collect a number of arbitrary providers +(and also arbitrary configurators) in a single place, called a `DomainContext` and tell +a property method or container to only use providers and configurators from those domain contexts +that are explicitly stated in a `@Domain(Class)` annotation. + +As for ways to implement domain context classes have a look at +[DomainContext](/docs/1.3.0/javadoc/net/jqwik/api/domains/DomainContext.html) +and [AbstractDomainContextBase](/docs/1.3.0/javadoc/net/jqwik/api/domains/AbstractDomainContextBase.html). + + +### Domain example: American Addresses + +Let's say that US postal addresses play a crucial role in the software that we're developing. +That's why there are a couple of classes that represent important domain concepts: +`Street`, `State`, `City` and `Address`. Since we have to generate instances of those classes +for our properties, we collect all arbitrary provision code in +[AmericanAddresses](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/domains/AmericanAddresses.java). +Now look at +[this example](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/domains/AddressProperties.java): + +```java +class AddressProperties { + + @Property + @Domain(AmericanAddresses.class) + void anAddressWithAStreetNumber(@ForAll Address anAddress, @ForAll int streetNumber) { + } + + @Property + @Domain(AmericanAddresses.class) + void globalDomainNotPresent(@ForAll Address anAddress, @ForAll String anyString) { + } + + @Property + @Domain(DomainContext.Global.class) + @Domain(AmericanAddresses.class) + void globalDomainCanBeAdded(@ForAll Address anAddress, @ForAll String anyString) { + } +} +``` + +The first two properties above will resolve their arbitraries solely through providers +specified in `AmericanAddresses`, whereas the last one also uses the default (global) context. +Since `AmericanAddresses` does not configure any arbitrary provider for `String` parameters, +property method `globalDomainNotPresent` will fail with a `CannotFindArbitraryException`. + +## Generation from a Type's Interface + +Some domain classes are mostly data holders. They come with constructors +or factory methods to create them and you might want to create different +instances by "just" filling the constructors' parameters with values +that are themselves generated. Using the building blocks you've seen until +now requires the use of `Arbitrary.map()` or even `Combinators.combine(...).as(...)` +to invoke the relevant constructor(s) and/or factories yourself. +There's a simpler way, though... + +Consider a simple `Person` class: + +```java +public class Person { + + private final String name; + private final int age; + + public Person(String name, int age) { + if (name == null || name.trim().isEmpty()) + throw new IllegalArgumentException(); + if (age < 0 || age > 130) + throw new IllegalArgumentException(); + + this.name = name; + this.age = age; + } + + @Override + public String toString() { + return String.format("%s (%d)", name, age); + } +} +``` + +A first step to use arbitrarily generated `Person` objects without having +to write a lot of _jqwik_-specific boiler plat code could look like that: + +```java +@Property +void aPersonsIsAlwaysValid(@ForAll @UseType Person aPerson) { + Assertions.assertThat(aPerson.name).isNotBlank(); + Assertions.assertThat(aPerson.age).isBetween(0, 130); +} +``` + +Notice the annotation `@UseType` which tells _jqwik_ to use the type +information of `Person` to generate it. By default the framework will +use all public constructors and all public, static factory methods in +the class in order to generate instances. Whenever there's an exception during +generation they will be ignored; that way you'll only get valid instances. + +There are quite a few ways usage and configuration options. Have a look +at the [complete example](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/types/TypeArbitraryExamples.java) +and check the following api entry points: + +- [UseType](/docs/1.3.0/javadoc/net/jqwik/api/constraints/UseType.html) +- [UseTypeMode](/docs/1.3.0/javadoc/net/jqwik/api/constraints/UseTypeMode.html) +- [Arbitraries.forType()](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#forType-java.lang.Class-) +- [TypeArbitrary](/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/TypeArbitrary.html) + +## Generation of Edge Cases + +It's well-known that many programming bugs and specification gaps happen at the border +of allowed value ranges. For example, in the domain of integer numbers the minimum +(`Integer.MIN_VALUE`) and maximum (`Integer.MAX_VALUE`) belong in the set of those +[_edge cases_](https://en.wikipedia.org/wiki/Edge_case). Many people use the term a bit +more loosely and also include other special values that tend to have a higher chance +of revealing implementation problems, like `0` for numbers or an empty string. + +_jqwik_ has special treatment for edge cases. Most base type arbitraries come with +their set of edge cases. You can find out about edge cases by asking an arbitrary +about it. Run the following example + +```java +@Example +void printEdgeCases() { + System.out.println(Arbitraries.integers().edgeCases()); + System.out.println(Arbitraries.strings().withCharRange('a', 'z').edgeCases()); + System.out.println(Arbitraries.floats().list().edgeCases()); +} +``` + +and you will see this output: + +``` +EdgeCases[-2, -1, 0, 2, 1, -2147483648, 2147483647] +EdgeCases["a", "z", ""] +EdgeCases[[], [0.0], [1.0], [-1.0], [0.01], [-0.01], [-3.4028235E38], [3.4028235E38]] +``` + +You may notice that edge cases are not just hard-coded values but also make use +of underlying arbitraries' edge cases to arrive at new ones. +That's why a list of floats arbitrary has single element lists of floats as edge cases. +Edge cases are also being combined and permuted when +[`Combinators`](#combining-arbitraries) are used. +Also, most methods from `Arbitrary` - like `map()`, `filter()` and `flatMap()` - provide +sensible edge cases behaviour. +Thus, your self-made domain-specific arbitraries get edge cases automatically. + +_jqwik_ makes use of edge cases in two ways: + +1. Whenever an arbitrary is asked to produce a value it will mix-in edge cases + from time to time. +2. By default jqwik will mix the _combination of permutations of edge cases_ + of a property's parameters with purely randomized generation of parameters. + You can even try all edge case combinations first as the next property shows. + +```java +@Property(edgeCases = EdgeCasesMode.FIRST) +void combinedEdgeCasesOfTwoParameters( + @ForAll List intList, + @ForAll @IntRange(min = -100, max = 0) int anInt +) { + String parameters = String.format("%s, %s", intList, anInt); + System.out.println(parameters); +} +``` + +Run it and have a look at the output. + +How jqwik handles edge cases generation can be controlled with +[an annotation property](#optional-property-parameters) and +[a configuration parameter](#jqwik-configuration). + + +### Tuning Edge Cases + +Currently there is only one way to change which edge cases a specific arbitrary generates: +You can switch them off with `Arbitrary.withoutEdgeCases()`. +It would be desirable, though, to optimize edge cases for your domain. +Stay tuned for enhancements! + +## Exhaustive Generation + +Sometimes it is possible to run a property method with all possible value combinations. +Consider the following example: + +```java +@Property +boolean allSquaresOnChessBoardExist( + @ForAll @CharRange(from = 'a', to = 'h') char column, + @ForAll @CharRange(from = '1', to = '8') char row +) { + return new ChessBoard().square(column, row).isOnBoard(); +} +``` + +The property is supposed to check that all valid squares in chess are present +on a new chess board. If _jqwik_ generated the values for `column` and `row` +randomly, 1000 tries might or might not produce all 64 different combinations. +Why not change strategies in cases like that and just iterate through all +possible values? + +This is exactly what _jqwik_ will do: +- As long as it can figure out that the maximum number of possible values + is equal or below a property's `tries` attribute (1000 by default), + all combinations will be generated. +- You can also enforce an exhaustive or randomized generation mode by using the + [Property.generation attribute](#optional-property-parameters). + The default generation mode can be set in the [configuration file](jqwik-configuration). +- If _jqwik_ cannot figure out how to do exhaustive generation for one of the + participating arbitraries it will switch to randomized generation if in auto mode + or throw an exception if in exhaustive mode. + +Exhaustive generation is considered for: +- All integral types +- Characters and chars +- Enums +- Booleans +- Strings +- Fixed number of choices given by `Arbitraries.of()` +- Fixed number of choices given by `Arbitraries.shuffle()` +- Lists, sets, streams, optionals and maps of the above +- Combinations of the above using `Combinators.combine()` +- Mapped arbitraries using `Arbitrary.map()` +- Filtered arbitraries using `Arbitrary.filter()` +- Flat mapped arbitraries using `Arbitrary.flatMap()` +- And a few other derived arbitraries... + + +## Data-Driven Properties + +In addition to the usual randomized generation of property parameters you have also +the possibility to feed a property with preconceived or deterministically generated +parameter sets. Why would you want to do that? One reason might be that you are aware +of some problematic test cases but they are rare enough that _jqwik_'s randomization +strategies don't generate them (often enough). Another reason could be that you'd like +to feed some properties with prerecorded data - maybe even from production. +And last but not least there's a chance that you want to check for a concrete result +given a set of input parameters. + +Feeding data into a property is quite simple: + +```java +@Data +Iterable> fizzBuzzExamples() { + return Table.of( + Tuple.of(1, "1"), + Tuple.of(3, "Fizz"), + Tuple.of(5, "Buzz"), + Tuple.of(15, "FizzBuzz") + ); +} + +@Property +@FromData("fizzBuzzExamples") +void fizzBuzzWorks(@ForAll int index, @ForAll String result) { + Assertions.assertThat(fizzBuzz(index)).isEqualTo(result); +} +``` + +All you have to do is annotate the property method with +`@FromData("dataProviderReference")`. The method you reference must be +annotated with `@Data` and return an object of type `Iterable`. +The [`Table` class](/docs/1.3.0/javadoc/net/jqwik/api/Table.html) +is just a convenient way to create such an object, but you can return +any collection or create an implementation of your own. + +Keep in mind that the `Tuple` subtype you choose must conform to the +number of `@ForAll` parameters in your property method, e.g. `Tuple.Tuple3` +for a method with three parameters. Otherwise _jqwik_ will fail the property +and tell you that the provided data is inconsistent with the method's parameters. + +Data points are fed to the property in their provided order. +The `tries` parameter of `@Property` will constrain the maximum data points +being tried. +Unlike parameterized tests in JUnit4 or Jupiter, _jqwik_ will report only the +first falsified data point. Thus, fixing the first failure might lead to another +falsified data point later on. There is also _no shrinking_ being done for data-driven +properties since _jqwik_ has no information about the constraints under which +the external data was conceived or generated. + +## Rerunning Falsified Properties + +When you rerun properties after they failed, they will - by default - use +the previous random seed so that the next run will generate the exact same +parameter data and thereby expose the same failing behaviour. This simplifies +debugging and regression testing since it makes a property's falsification +stick until the problem has been fixed. + +If you want to, you can change this behaviour for a given property like this: + +```java +@Property(afterFailure = AfterFailureMode.RANDOM_SEED) +void myProperty() { ... } +``` + +The `afterFailure` property can have one of four values: + +- `AfterFailureMode.PREVIOUS_SEED`: Choose the same seed that provoked the failure in the first place. + Provided no arbitrary provider code has been changed, this will generate the same + sequence of generated parameters as the previous test run. + +- `AfterFailureMode.RANDOM_SEED`: Choose a new random seed even after failure in the previous run. + A constant seed will always prevail thought, as in the following example: + + ```java + @Property(seed = "424242", afterFailure = AfterFailureMode.RANDOM_SEED) + void myProperty() { ... } + ``` + +- `AfterFailureMode.SAMPLE_ONLY`: Only run the property with just the last falsified (and shrunk) + generated sample set of parameters. This only works if all parameters could + be serialized. Look into your test run log to check out if a serialization problem occurred. + +- `AfterFailureMode.SAMPLE_FIRST`: Same as `SAMPLE_ONLY` but generate additional examples if the + property no longer fails with the recorded sample. + + +You can also determine the default behaviour of all properties by setting +the `defaultAfterFailure` property in the [configuration file](jqwik-configuration) +to one of those enum values. + +## jqwik Configuration + +_jqwik_ will look for a file `jqwik.properties` in your classpath in which you can configure +a few basic parameters: + +``` +database = .jqwik-database # The database file in which to store data of previous runs. + # Set to empty to fully disable test run recording. +defaultTries = 1000 # The default number of tries for each property +defaultMaxDiscardRatio = 5 # The default ratio before assumption misses make a property fail +useJunitPlatformReporter = false # Set to true if you want to use platform reporting +defaultAfterFailure = PREVIOUS_SEED # Set default behaviour for falsified properties: + # PREVIOUS_SEED, SAMPLE_ONLY or SAMPLE_FIRST +reportOnlyFailures = false # Set to true if only falsified properties should be reported +defaultGeneration = AUTO # Set default behaviour for generation: + # AUTO, RANDOMIZED, or EXHAUSTIVE +defaultEdgeCases = MIXIN # Set default behaviour for edge cases generation: + # FIRST, MIXIN, or NONE +``` + +## Advanced Topics + +### Implement your own Arbitraries and Generators + +Looking at _jqwik_'s most prominent interfaces -- `Arbitrary` and `RandomGenerator` -- you might +think that rolling your own implementations is a reasonable thing to do. +I'd like to tell you that it _never_ is, but I've learned that "never" is a word you should never use. +There's just too many things to consider when implementing a new type of `Arbitrary` +to make it work smoothly with the rest of the framework. + +Therefore, use the innumerable features to combine existing arbitraries into your special one. +If you cannot figure out how to create an arbitrary with the desired behaviour +either [ask on stack overflow](https://stackoverflow.com/questions/tagged/jqwik) +or [open a Github issue](https://github.com/jlink/jqwik/issues). + +### Lifecycle Hooks + +Similar to [Jupiter's Extension Model](https://junit.org/junit5/docs/current/user-guide/#extensions) +_jqwik_ provides a means to extend and change the way how properties and containers are being +configured, run and reported on. The API -- interfaces, classes and annotations -- for accessing +those _lifecycle hooks_ lives in the package `net.jqwik.api.lifecycle` and is -- as of this release -- +still in the [API evolution status](#api-evolution) `EXPERIMENTAL`: Some parts of it will probably +change without notice in later versions. + +#### Principles of Lifecycle Hooks + +There are a few fundamental principles that determine and constrain the lifecycle hook API: + +1. There are several [types of lifecycle hooks](#lifecycle-hook-types), + each of which is an interface that extends + [`net.jqwik.api.lifecycle.LifecycleHook`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/LifecycleHook.html). +2. A concrete lifecycle hook is an implementation of one or more lifecycle hook interfaces. +3. You can add a concrete lifecycle hook to a container class or a property method with the annotation + [`@AddLifecycleHook`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AddLifecycleHook.html). + By default, a lifecycle hook is only added to the annotated element, not to its children. + However, you can override this behaviour by either: + - Override `LifecycleHook.propagateTo()` + - Use the annotation attribute `@AddLifecycleHook.propagateTo()` +4. To add a global lifecycle use Java’s `java.util.ServiceLoader` mechanism and add the concrete lifecylcle hook + class to file `META-INF/services/net.jqwik.api.lifecycle.LifecycleHook`. + Do not forget to override `LifecycleHook.propagateTo()` if the global hook should be applied to all test elements. +5. In a single test run there will only be a single instance of each concrete lifecycle hook implementation. + That's why you have to use jqwik's [lifecycle storage](#lifecycle-storage) mechanism if shared state + across several calls to lifecycle methods is necessary. +6. Since all instances of lifecycle hooks are created before the whole test run is started, + you cannot use non-static inner classes of test containers to implement lifecycle interfaces. +7. If relevant, the order in which hook methods are being applied is determined by dedicated methods + in the hook interface, e.g. + [`BeforeContainerHook.beforeContainerProximity()`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/BeforeContainerHook.html#beforeContainerProximity--). + +Mind that much of what you can do with hooks can also be done using the simpler +mechanisms of [annotated lifecycle methods](#annotated-lifecycle-methods) or +a [property lifecycle class](#single-property-lifecycle). +You usually start to consider using lifecycle hooks when you want to +reuse generic behaviour in many places or even across projects. + + +#### Lifecycle Hook Types + +All lifecycle hook interfaces extend `net.jqwik.api.lifecycle.LifecycleHook` which +has two methods that may be overridden: + +- [`propagateTo()`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/LifecycleHook.html#propagateTo--): + Determine if and how a hook will be propagated to an element's children. + +- [`appliesTo(Optional)`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/LifecycleHook.html#appliesTo-java.util.Optional-): + Determine if a hook will be applied to a concrete element. For example, you might want to constrain a certain hook + to apply only to property methods and not to containers: + + ```java + @Override + public boolean appliesTo(final Optional element) { + return element + .map(annotatedElement -> annotatedElement instanceof Method) + .orElse(false); + } + ``` + +_jqwik_ currently supports eight types of lifecycle hooks: + +- [Lifecycle execution hooks](#lifecycle-execution-hooks): + - `SkipExecutionHook` + - `BeforeContainerHook` + - `AfterContainerHook` + - `AroundContainerHook` + - `AroundPropertyHook` + - `AroundTryHook` + +- [Other hooks](#other-hooks) + - `ResolveParameterHook` + - `RegistrarHook` + +#### Lifecycle Execution Hooks + +With these hooks you can determine if a test element will be run at all, +and what potential actions should be done before or after running it. + +##### SkipExecutionHook + +Implement [`SkipExecutionHook`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/SkipExecutionHook.html) +to filter out a test container or property method depending on some runtime condition. + +Given this hook implementation: + +```java +public class OnMacOnly implements SkipExecutionHook { + @Override + public SkipResult shouldBeSkipped(final LifecycleContext context) { + if (System.getProperty("os.name").equals("Mac OS X")) { + return SkipResult.doNotSkip(); + } + return SkipResult.skip("Only on Mac"); + } +} +``` + +The following property will only run on a Mac: + +```java +@Property +@AddLifecycleHook(OnMacOnly.class) +void macSpecificProperty(@ForAll int anInt) { +} +``` + +##### BeforeContainerHook + +Implement [`BeforeContainerHook`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/BeforeContainerHook.html) +for a hook that's supposed to do some work exactly once before any of its property methods and child containers +will be run. +This is typically used to set up a resource to share among all properties within this container. + +##### AfterContainerHook + +Implement [`AfterContainerHook`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AfterContainerHook.html) +for a hook that's supposed to do some work exactly once after all of its property methods and child containers +have been run. +This is typically used to tear down a resource that has been shared among all properties within this container. + +##### AroundContainerHook + +[`AroundContainerHook`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AroundContainerHook.html) +is a convenience interface to implement both [`BeforeContainerHook`](#beforecontainerhook) and +[`AfterContainerHook`](#aftercontainerhook) in one go. +This is typically used to set up and tear down a resource that is intended to be shared across all the container's children. + +Here's an example that shows how to start and stop an external server once for all +properties of a test container: + +```java +@AddLifecycleHook(ExternalServerResource.class) +class AroundContainerHookExamples { + @Example + void example1() { + System.out.println("Running example 1"); + } + @Example + void example2() { + System.out.println("Running example 2"); + } +} + +class ExternalServerResource implements AroundContainerHook { + @Override + public void beforeContainer(final ContainerLifecycleContext context) { + System.out.println("Starting server..."); + } + + @Override + public void afterContainer(final ContainerLifecycleContext context) { + System.out.println("Stopping server..."); + } +} +``` + +Running this example should output + +``` +Starting server... + +Running example 1 + +Running example 2 + +Stopping server... +``` + +If you wanted to do something before and/or after _the whole jqwik test run_, +using a container hook and registering it globally is probably the easiest way. + +##### AroundPropertyHook + +[`AroundPropertyHook`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AroundPropertyHook.html) +comes in handy if you need to define behaviour that should "wrap" the execution of a property, +i.e., do something directly before or after running a property - or both. +Since you have access to an object that describes the final result of a property +you can also change the result, e.g. make a failed property successful or vice versa. + +Here is a hook implementation that will measure the time spent on running a property +and publish the result using a [`Reporter`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/Reporter.html): + +```java +@Property(tries = 100) +@AddLifecycleHook(MeasureTime.class) +void measureTimeSpent(@ForAll Random random) throws InterruptedException { + Thread.sleep(random.nextInt(50)); +} + +class MeasureTime implements AroundPropertyHook { + @Override + public PropertyExecutionResult aroundProperty(PropertyLifecycleContext context, PropertyExecutor property) { + long before = System.currentTimeMillis(); + PropertyExecutionResult executionResult = property.execute(); + long after = System.currentTimeMillis(); + context.reporter().publish("time", String.format("%d ms", after - before)); + return executionResult; + } +} +``` + +The additional output from reporting is concise: + +``` +timestamp = ..., time = 2804 ms +``` + +##### AroundTryHook + +Wrapping the execution of a single try can be achieved by implementing +[`AroundTryHook`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AroundTryHook.html). +This hook can be used for a lot of things. An incomplete list: + +- Closely watch each execution of a property method +- Reset a resource for each call +- Swallow certain exceptions +- Filter out tricky (and invalid) parameter constellations +- Let a try fail depending on external circumstances + +The following example shows how to fail if a single try will take longer than 100 ms: + +```java +@Property(tries = 10) +@AddLifecycleHook(FailIfTooSlow.class) +void sleepingProperty(@ForAll Random random) throws InterruptedException { + Thread.sleep(random.nextInt(101)); +} + +class FailIfTooSlow implements AroundTryHook { + @Override + public TryExecutionResult aroundTry( + final TryLifecycleContext context, + final TryExecutor aTry, + final List parameters + ) { + long before = System.currentTimeMillis(); + TryExecutionResult result = aTry.execute(parameters); + long after = System.currentTimeMillis(); + long time = after - before; + if (time >= 100) { + String message = String.format("%s was too slow: %s ms", context.label(), time); + return TryExecutionResult.falsified(new AssertionFailedError(message)); + } + return result; + } +} +``` + +Since the sleep time is chosen randomly the property will fail from time to time +with the following error: + +``` +org.opentest4j.AssertionFailedError: sleepingProperty was too slow: 100 ms +``` + +#### Other Hooks + +##### ResolveParameterHook + +Besides the well-known `@ForAll`-parameters, property methods and [annotated lifecycle methods](#annotated-lifecycle-methods) +can take other parameters as well. These can be injected by concrete implementations of +[`ResolveParameterHook`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/ResolveParameterHook.html). + +Consider this stateful `Calculator`: + +```java +public class Calculator { + private int result = 0; + + public int result() { + return result; + } + + public void plus(int addend) { + result += addend; + } +} +``` + +When going to check its behaviour with properties you'll need a fresh calculator instance +in each try. This can be achieved by adding a resolver hook that creates a freshly +instantiated calculator per try. + +```java +@AddLifecycleHook(CalculatorResolver.class) +class CalculatorProperties { + @Property + void addingANumberTwice(@ForAll int aNumber, Calculator calculator) { + calculator.plus(aNumber); + calculator.plus(aNumber); + Assertions.assertThat(calculator.result()).isEqualTo(aNumber * 2); + } +} + +class CalculatorResolver implements ResolveParameterHook { + @Override + public Optional resolve( + final ParameterResolutionContext parameterContext, + final LifecycleContext lifecycleContext + ) { + return Optional.of(optionalTry -> new Calculator()); + } + @Override + public PropagationMode propagateTo() { + // Allow annotation on container level + return PropagationMode.ALL_DESCENDANTS; + } +} +``` + +There are a few constraints regarding parameter resolution of which you should be aware: + +- Parameters annotated with `@ForAll` or with `@ForAll` present as a meta annotation + (see [Self-Made Annotations](#self-made-annotations)) cannot be resolved; + they are fully controlled by jqwik's arbitrary-based generation mechanism. +- If more than one applicable hook returns a non-empty instance of `Optional` + the property will throw an instance of `CannotResolveParameterException`. +- If you want to keep the same object around to inject it in more than a single method invocation, + e.g. for setting it up in a `@BeforeTry`-method, you are supposed to use jqwik's + [lifecycle storage mechanism](#lifecycle-storage). + + +##### RegistrarHook + +Use [`RegistrarHook`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/RegistrarHook.html) +if you need to apply several hook implementations that implement the desired behaviour together +but cannot be implemented in a single class. +For example, more than one implementation of the same hook type is needed, +but those implementations have a different proximity or require a different propagation mode. + +This is really advanced stuff, the mechanism of which will probably evolve or change in the future. +If you really really want to see an example, look at +[`JqwikSpringExtension`](#https://github.com/jlink/jqwik-spring/blob/master/src/main/java/net/jqwik/spring/JqwikSpringExtension.java) + +#### Lifecycle Storage + +As [described above](#principles-of-lifecycle-hooks) one of the fundamental principles +is that there will be only a single instance of any lifecycle hook implementation +during runtime. +Since -- depending on configuration and previous rung -- containers and properties are +not run in a strict sequential order this guarantee comes with a drawback: +You cannot use a hook instance's member variables to hold state that should be shared +across all tries of a property or across all properties of a container or across +different lifecycle phases of a single try. +That's when lifecycle storage management enters the stage in the form of type +[`net.jqwik.api.lifecycle.Store`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/Store.html). + +A `Store` object... + +- holds a single piece of shared state +- has a _globally unique identifier_ of your choice. + The identifier can be just a string or you compose whatever you deem necessary to make it unique. +- has a [`Lifespan`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/Lifespan.html). + The lifespan determines when the initializer of a store will be called: + - `Lifespan.RUN`: Only on first access + - `Lifespan.PROPERTY`: On first access of each single property method (or one of its lifecycle hook methods) + - `Lifespan.TRY`: On first access of each single try (or one of its lifecycle hook methods) + +You create a store like this: + +```java +Store myObjectStore = Store.create("myObjectStore", Lifespan.PROPERTY, () -> new MyObject()); +``` + +And you retrieve a store similarly: + +```java +Store myObjectStore = Store.get("myObjectStore"); +``` + +A store with the same identifier can only be created once, that's why there is also a convenience +method for creating or retrieving it: + +```java +Store myObjectStore = Store.getOrCreate("myObjectStore", Lifespan.PROPERTY, () -> new MyObject()); +``` + +You now have the choice to use or update the shared state: + +```java +Store myObjectStore = ...; + +myObjectStore.get().doSomethingWithMyObject(); +myObjectStore.update(old -> { + old.changeState(); + return old; +}); +``` + +Let's look at an example... + +##### TemporaryFileHook + +The following hook implementation gives you the capability to access _one_ (and only one) +temporary file per try using [parameter resolution](#resolveparameterhook): + +```java +class TemporaryFileHook implements ResolveParameterHook { + + public static final Tuple.Tuple2 STORE_IDENTIFIER = Tuple.of(TemporaryFileHook.class, "temporary files"); + + @Override + public Optional resolve(ParameterResolutionContext parameterContext, LifecycleContext lifecycleContext) { + if (parameterContext.typeUsage().isOfType(File.class)) { + return Optional.of(ignoreTry -> getTemporaryFileForTry()); + } + return Optional.empty(); + } + + private File getTemporaryFileForTry() { + Store tempFileStore = Store.getOrCreate(STORE_IDENTIFIER, Lifespan.TRY, this::createTempFile); + tempFileStore.onClose(file -> file.delete()); + return tempFileStore.get(); + } + + private File createTempFile() { + try { + return File.createTempFile("temp", ".txt"); + } catch (IOException e) { + throw new RuntimeException(e); + } + } +} +``` + +There are a few interesting things going on: + +- The identifier is a tuple of the `TemporaryFileHook.class` object and a string. + This makes sure that no other hook will use the same identifier accidentally. +- The temporary file is created only once per try. + That means that all parameters in the scope of this try will contain _the same file_. +- A callback is added through + [`onClose(..)`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/Store.html#onClose-java.util.function.Consumer-) + which takes care of deleting the file as soon as the lifespan's scope (the try) is finished. + +With this information you can probably figure out how the following test container works -- +especially why the assertion in `@AfterTry`-method `assertFileNotEmpty()` succeeds. + +```java +@AddLifecycleHook(value = TemporaryFileHook.class, propagateTo = PropagationMode.ALL_DESCENDANTS) +class TemporaryFilesExample { + @Property(tries = 10) + void canWriteToFile(File anyFile, @ForAll @AlphaChars @StringLength(min = 1) String fileContents) throws Exception { + assertThat(anyFile).isEmpty(); + writeToFile(anyFile, fileContents); + assertThat(anyFile).isNotEmpty(); + } + + @AfterTry + void assertFileNotEmpty(File anyFile) { + assertThat(anyFile).isNotEmpty(); + } + + private void writeToFile(File anyFile, String contents) throws IOException { + BufferedWriter writer = new BufferedWriter(new FileWriter(anyFile)); + writer.write(contents); + writer.close(); + } +} +``` + +## API Evolution + +In agreement with the JUnit 5 platform _jqwik_ uses the +[@API Guardian project](https://github.com/apiguardian-team/apiguardian) +to communicate version and status of all parts of its API. +The different types of status are: + +-`STABLE`: Intended for features that will not be changed in a backwards-incompatible way in the current major version (1.*). + +-`MAINTAINED`: Intended for features that will not be changed in a backwards-incompatible way for at least the current minor release of the current major version. If scheduled for removal, it will be demoted to `DEPRECATED` first. + +-`EXPERIMENTAL`: Intended for new, experimental features where we are looking for feedback. Use this element with caution; it might be promoted to `MAINTAINED` or `STABLE` in the future, but might also be removed without prior notice, even in a patch. + +-`DEPRECATED`: Should no longer be used; might disappear in the next minor release. + +-`INTERNAL`: Must not be used by any code other than _jqwik_ itself. Might be removed without prior notice. + +Since annotation `@API` has runtime retention you find the actual API status in an element's source code, +its [Javadoc](/docs/1.3.0/javadoc) but also through reflection. +If a certain element, e.g. a method, is not annotated itself, then it carries the status of its containing class. + + +## Release Notes + +Read this version's [release notes](/release-notes.html#130). diff --git a/docs/docs/current/javadoc/index.html b/docs/docs/current/javadoc/index.html index 0be5db36e..e042cc5a7 100644 --- a/docs/docs/current/javadoc/index.html +++ b/docs/docs/current/javadoc/index.html @@ -2,10 +2,10 @@ jqwik Javadoc - + -

Redirect to latest version

+

Redirect to latest version

diff --git a/docs/docs/current/user-guide.md b/docs/docs/current/user-guide.md index 2b0a90891..eea5d4261 100644 --- a/docs/docs/current/user-guide.md +++ b/docs/docs/current/user-guide.md @@ -1,8 +1,8 @@ --- -title: jqwik User Guide - 1.2.7 +title: jqwik User Guide - 1.3.0 ---

The jqwik User Guide -1.2.7 +1.3.0

@@ -17,14 +17,15 @@ title: jqwik User Guide - 1.2.7 - [Maven](#maven) - [Snapshot Releases](#snapshot-releases) - [Project without Build Tool](#project-without-build-tool) -- [Creating an Example-based Test](#creating-an-example-based-test) - [Creating a Property](#creating-a-property) - [Optional `@Property` Parameters](#optional-property-parameters) - [Additional Reporting](#additional-reporting) +- [Creating an Example-based Test](#creating-an-example-based-test) - [Assertions](#assertions) - [Lifecycle](#lifecycle) - [Simple Property Lifecycle](#simple-property-lifecycle) - [Annotated Lifecycle Methods](#annotated-lifecycle-methods) + - [Single Property Lifecycle](#single-property-lifecycle) - [Grouping Tests](#grouping-tests) - [Naming and Labeling Tests](#naming-and-labeling-tests) - [Tagging Tests](#tagging-tests) @@ -46,16 +47,16 @@ title: jqwik User Guide - 1.2.7 - [Providing Arbitraries for Embedded Types](#providing-arbitraries-for-embedded-types) - [Static `Arbitraries` methods](#static-arbitraries-methods) - [Generate values yourself](#generate-values-yourself) - - [Select values randomly](#select-values-randomly) + - [Select or generate values randomly](#select-or-generate-values-randomly) - [Select randomly with Weights](#select-randomly-with-weights) - - [Integers](#integers) - - [Decimals](#decimals) - [Characters and Strings](#characters-and-strings) - [java.util.Random](#javautilrandom) - - [Constants](#constants) - - [Create](#create) - [Shuffling Permutations](#shuffling-permutations) - [Default Types](#default-types) + - [Numeric Arbitrary Types](#numeric-arbitrary-types) + - [Integrals](#integrals) + - [Decimals](#decimals) + - [Random Numeric Distribution](#random-numeric-distribution) - [Collections, Streams, Arrays and Optional](#collections-streams-arrays-and-optional) - [Collecting Values in a List](#collecting-values-in-a-list) - [Tuples of same base type](#tuples-of-same-base-type) @@ -99,7 +100,8 @@ title: jqwik User Guide - 1.2.7 - [Labeled Statistics](#labeled-statistics) - [Statistics Report Formatting](#statistics-report-formatting) - [Switch Statistics Reporting Off](#switch-statistics-reporting-off) - - [Plug in Your Own Statistics Report Format](#plug-in-your-own-statistics-report-format) + - [Histograms](#histograms) + - [Make Your Own Statistics Report Format](#make-your-own-statistics-report-format) - [Checking Coverage of Collected Statistics](#checking-coverage-of-collected-statistics) - [Check Percentages and Counts](#check-percentages-and-counts) - [Check Ad-hoc Query Coverage](#check-ad-hoc-query-coverage) @@ -112,11 +114,21 @@ title: jqwik User Guide - 1.2.7 - [Domain and Domain Context](#domain-and-domain-context) - [Domain example: American Addresses](#domain-example-american-addresses) - [Generation from a Type's Interface](#generation-from-a-types-interface) -- [Implement your own Arbitraries and Generators](#implement-your-own-arbitraries-and-generators) +- [Generation of Edge Cases](#generation-of-edge-cases) + - [Tuning Edge Cases](#tuning-edge-cases) - [Exhaustive Generation](#exhaustive-generation) - [Data-Driven Properties](#data-driven-properties) - [Rerunning Falsified Properties](#rerunning-falsified-properties) - [jqwik Configuration](#jqwik-configuration) +- [Advanced Topics](#advanced-topics) + - [Implement your own Arbitraries and Generators](#implement-your-own-arbitraries-and-generators) + - [Lifecycle Hooks](#lifecycle-hooks) + - [Principles of Lifecycle Hooks](#principles-of-lifecycle-hooks) + - [Lifecycle Hook Types](#lifecycle-hook-types) + - [Lifecycle Execution Hooks](#lifecycle-execution-hooks) + - [Other Hooks](#other-hooks) + - [Lifecycle Storage](#lifecycle-storage) +- [API Evolution](#api-evolution) - [Release Notes](#release-notes) @@ -159,7 +171,7 @@ repositories { ext.junitPlatformVersion = '1.6.2' ext.junitJupiterVersion = '5.6.2' -ext.jqwikVersion = '1.2.7' +ext.jqwikVersion = '1.3.0' test { useJUnitPlatform { @@ -227,7 +239,11 @@ mypackage.MyClassProperties > myPropertyMethod STANDARD_OUT |-----------------------jqwik----------------------- tries = 1000 | # of calls to property checks = 1000 | # of not rejected calls - generation-mode = RANDOMIZED | parameters are randomly generated + generation = RANDOMIZED | parameters are randomly generated + after-failure = PREVIOUS_SEED | use the previous seed + edge-cases#mode = MIXIN | edge cases are generated first + edge-cases#total = 0 | # of all combined edge cases + edge-cases#tried = 0 | # of edge cases tried in current run seed = 1685744359484719817 | random seed to reproduce generated values ``` @@ -246,7 +262,7 @@ Additionally you have to add the following dependency to your `pom.xml` file: net.jqwik jqwik - 1.2.7 + 1.3.0 test @@ -274,58 +290,22 @@ will allow you to use _jqwik_'s snapshot release which contains all the latest f I've never tried it but using jqwik without gradle or some other tool to manage dependencies should also work. You will have to add _at least_ the following jars to your classpath: -- `jqwik-1.2.7.jar` +- `jqwik-1.3.0.jar` - `junit-platform-engine-1.6.2.jar` - `junit-platform-commons-1.6.2.jar` - `opentest4j-1.1.1.jar` - `assertj-core-3.11.x.jar` in case you need assertion support -## Creating an Example-based Test - -Just annotate a `public`, `protected` or package-scoped method with -[`@Example`](/docs/1.2.7/javadoc/net/jqwik/api/Example.html). -Example-based tests work just like plain JUnit-style test cases and -are not supposed to take any parameters. - -A test case method must -- either return a `boolean` value that signifies success (`true`) - or failure (`false`) of this test case. -- or return nothing (`void`) in which case you will probably - use [assertions](#assertions) in order to verify the test condition. - -[Here](https://github.com/jlink/jqwik/blob/1.2.7/documentation/src/test/java/net/jqwik/docs/ExampleBasedTests.java) -is a test class with two example-based tests: - -```java -import static org.assertj.core.api.Assertions.*; - -import net.jqwik.api.*; -import org.assertj.core.data.*; - -class ExampleBasedTests { - - @Example - void squareRootOf16is4() { - assertThat(Math.sqrt(16)).isCloseTo(4.0, Offset.offset(0.01)); - } - - @Example - boolean add1plu3is4() { - return (1 + 3) == 4; - } -} -``` - ## Creating a Property _Properties_ are the core concept of [property-based testing](/#properties). You create a _Property_ by annotating a `public`, `protected` or package-scoped method with -[`@Property`](/docs/1.2.7/javadoc/net/jqwik/api/Property.html). +[`@Property`](/docs/1.3.0/javadoc/net/jqwik/api/Property.html). In contrast to examples a property method is supposed to have one or more parameters, all of which must be annotated with -[`@ForAll`](/docs/1.2.7/javadoc/net/jqwik/api/ForAll.html). +[`@ForAll`](/docs/1.3.0/javadoc/net/jqwik/api/ForAll.html). At test runtime the exact parameter values of the property method will be filled in by _jqwik_. @@ -343,7 +323,7 @@ The first failed execution will stop value generation and be reported as failure - usually followed by an attempt to [shrink](#result-shrinking) the falsified parameter set. -[Here](https://github.com/jlink/jqwik/blob/1.2.7/documentation/src/test/java/net/jqwik/docs/PropertyBasedTests.java) +[Here](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/PropertyBasedTests.java) are two properties whose failures might surprise you: ```java @@ -374,7 +354,7 @@ in future versions. ### Optional `@Property` Parameters -The [`@Property`](/docs/1.2.7/javadoc/net/jqwik/api/Property.html) +The [`@Property`](/docs/1.3.0/javadoc/net/jqwik/api/Property.html) annotation has a few optional values: - `int tries`: The number of times _jqwik_ tries to generate parameter values for this method. @@ -391,7 +371,7 @@ annotation has a few optional values: The default is `5` which can be overridden in [`jqwik.properties`](#jqwik-configuration). -- `ShrinkingMode shrinking`: You can influence the way shrinking is done +- `ShrinkingMode shrinking`: You can influence the way [shrinking](#result-shrinking) is done - `ShrinkingMode.OFF`: No shrinking at all - `ShrinkingMode.FULL`: Shrinking continues until no smaller value can be found that also falsifies the property. @@ -417,22 +397,48 @@ annotation has a few optional values: - `GenerationMode.DATA_DRIVEN` directs _jqwik_ to feed values from a data provider specified with `@FromData`. See [data-driven properties](#data-driven-properties) for more information. + +- `AfterFailureMode afterFailure`: Determines how jqwik will generate values of a property + that has failed in the previous run. - The actual generation mode being used is reported for each property - together with the other information: + - `AfterFailureMode.PREVIOUS_SEED` is the default. jqwik will use the same seed and thereby generate + the same sequence of parameters as in the previous, failing run. + - `AfterFailureMode.SAMPLE_ONLY` means that jqwik will only use the last shrunk example of parameters. + This requires that all parameters can be serialized. + - `AfterFailureMode.SAMPLE_FIRST` means that jqwik will use the last shrunk example of parameters first + and then, if successful, go for a new randomly generated set of parameters. + - `AfterFailureMode.RANDOM_SEED` makes jqwik use a new random seed even directly after a failure. + This might lead to a "flaky" property that sometimes fails and sometimes succeeds. + +- `EdgeCasesMode edgeCases`: Determines if and when jqwik will generate + the permutation of [edge cases](#generation-of-edge-cases). - ``` - tries = 10 - checks = 10 - generation-mode = EXHAUSTIVE - seed = 42859154278924201 - ``` + - `EdgeCasesMode.MIXIN` is the default. Edge cases will be mixed with randomly generated parameter sets + until all known permutations have been mixed in. + - `EdgeCasesMode.FIRST` results in all edge cases being generated before jqwik starts with randomly + generated samples. + - `EdgeCasesMode.NONE` will not generate edge cases for the full parameter set at all. However, + edge cases for individual parameters are still being mixed into the set from time to time. + +The effective values for tries, seed, after-failure mode, generation mode edge-cases mode +and edge cases numbers are reported after each run property: + +``` +tries = 10 +checks = 10 +generation = EXHAUSTIVE +after-failure = PREVIOUS_SEED +edge-cases#mode = MIXIN +edge-cases#total = 2 +edge-cases#tried = 2 +seed = 42859154278924201 +``` ### Additional Reporting You can switch on additional reporting aspects by adding a -[`@Report(Reporting[])` annotation](/docs/1.2.7/javadoc/net/jqwik/api/Property.html) +[`@Report(Reporting[])` annotation](/docs/1.3.0/javadoc/net/jqwik/api/Property.html) to a property method. The following reporting aspects are available: @@ -441,6 +447,46 @@ The following reporting aspects are available: - `Reporting.FALSIFIED` will report each set of parameters that is falsified during shrinking. +## Creating an Example-based Test + +_jqwik_ also supports example-based testing. +In order to write an example test annotate a `public`, `protected` or package-scoped method with +[`@Example`](/docs/1.3.0/javadoc/net/jqwik/api/Example.html). +Example-based tests work just like plain JUnit-style test cases. + +A test case method must +- either return a `boolean` value that signifies success (`true`) + or failure (`false`) of this test case. +- or return nothing (`void`) in which case you will probably + use [assertions](#assertions) in order to verify the test condition. + +[Here](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/ExampleBasedTests.java) +is a test class with two example-based tests: + +```java +import static org.assertj.core.api.Assertions.*; + +import net.jqwik.api.*; +import org.assertj.core.data.*; + +class ExampleBasedTests { + + @Example + void squareRootOf16is4() { + assertThat(Math.sqrt(16)).isCloseTo(4.0, Offset.offset(0.01)); + } + + @Example + boolean add1plu3is4() { + return (1 + 3) == 4; + } +} +``` + +Internally _jqwik_ treats examples as properties with the number of tries hardcoded to `1`. +Thus, everything that works for property methods also works for example methods -- +including random generation of parameters annotated with `@ForAll`. + ## Assertions __jqwik__ does not come with any assertions, so you have to use one of the @@ -458,8 +504,8 @@ consists of two main types of elements: - __Containers__: The root engine container, container classes and embedded container classes (those annotated with `@Group`) - __Properties__: Methods annotated with - [`@Property`](/docs/1.2.7/javadoc/net/jqwik/api/Property.html) or - [`@Example`](/docs/1.2.7/javadoc/net/jqwik/api/Example.html). + [`@Property`](/docs/1.3.0/javadoc/net/jqwik/api/Property.html) or + [`@Example`](/docs/1.3.0/javadoc/net/jqwik/api/Example.html). An _example_ is just a property with a single _try_ (see below). So a typical tree might look like: @@ -536,22 +582,22 @@ The other way to influence all elements of a test run is through annotated lifec methods, which you might already know from JUnit 4 and 5. _jqwik_ currently has eight annotations: -- [`@BeforeContainer`](/docs/1.2.7/javadoc/net/jqwik/api/lifecycle/BeforeContainer.html): +- [`@BeforeContainer`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/BeforeContainer.html): _Static_ methods with this annotation will run exactly once before any property of a container class will be executed, even before the first instance of this class will be created. -- [`@AfterContainer`](/docs/1.2.7/javadoc/net/jqwik/api/lifecycle/AfterContainer.html): +- [`@AfterContainer`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AfterContainer.html): _Static_ methods with this annotation will run exactly once after all properties of a container class have run. -- [`@BeforeProperty`](/docs/1.2.7/javadoc/net/jqwik/api/lifecycle/BeforeProperty.html): +- [`@BeforeProperty`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/BeforeProperty.html): Methods with this annotation will run once before each property or example. `@BeforeExample` is an alias with the same functionality. -- [`@AfterProperty`](/docs/1.2.7/javadoc/net/jqwik/api/lifecycle/AfterProperty.html): +- [`@AfterProperty`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AfterProperty.html): Methods with this annotation will run once after each property or example. `@AfterExample` is an alias with the same functionality. -- [`@BeforeTry`](/docs/1.2.7/javadoc/net/jqwik/api/lifecycle/BeforeTry.html): +- [`@BeforeTry`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/BeforeTry.html): Methods with this annotation will run once before each try, i.e. execution of a property or example method. -- [`@AfterTry`](/docs/1.2.7/javadoc/net/jqwik/api/lifecycle/AfterTry.html): +- [`@AfterTry`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AfterTry.html): Methods with this annotation will run once after each try, i.e. execution of a property or example method. @@ -619,8 +665,41 @@ after container ``` All those lifecycle methods are being run through _jqwik_'s mechanism for -writing _lifecycle hooks_ under the hood. This mechanism is not yet published and -not ready for external usage yet. +writing [_lifecycle hooks_](#lifecycle-hooks) under the hood. + + +### Single Property Lifecycle + +All [lifecycle methods](#annotated-lifecycle-methods) described in the previous section +apply to all property methods of a container class. +In rare cases, however, you may feel the need to hook into the lifecycle of a single property, +for example when you expect a property to fail. + +Here is one example that checks that a property will fail with an `AssertionError` +and succeed in that case: + +```java +@Property +@PerProperty(SucceedIfThrowsAssertionError.class) +void expectToFail(@ForAll int aNumber) { + Assertions.assertThat(aNumber).isNotEqualTo(1); +} + +private class SucceedIfThrowsAssertionError implements PerProperty.Lifecycle { + @Override + public PropertyExecutionResult onFailure(PropertyExecutionResult propertyExecutionResult) { + if (propertyExecutionResult.throwable().isPresent() && + propertyExecutionResult.throwable().get() instanceof AssertionError) { + return propertyExecutionResult.mapToSuccessful(); + } + return propertyExecutionResult; + } +} +``` + +Have a look at [`PerProperty.Lifecycle`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/PerProperty.Lifecycle.html) +to find out which aspects of a property's lifecycle you can control. + ## Grouping Tests @@ -631,7 +710,7 @@ maintainability of your tests. Groups can be nested and there lifecycle is also nested, that means that the lifecycle of a test class is also applied to inner groups of that container. -Have a look at [this example](https://github.com/jlink/jqwik/blob/1.2.7/documentation/src/test/java/net/jqwik/docs/TestsWithGroups.java): +Have a look at [this example](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/TestsWithGroups.java): ```java import net.jqwik.api.*; @@ -679,7 +758,7 @@ If you want to tweak display names even more, test container classes, groups, example methods and property methods can be labeled using the annotation `@Label("a label")`. This label will be used to display the element in test reports or within the IDE. -[In the following example](https://github.com/jlink/jqwik/blob/1.2.7/documentation/src/test/java/net/jqwik/docs/NamingExamples.java), +[In the following example](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/NamingExamples.java), every test relevant element has been labeled: ```java @@ -721,7 +800,7 @@ Those tag can be used to filter the set of tests Tags are handed down from container (class or group) to its children (test methods or groups). Have a look at -[the following example](https://github.com/jlink/jqwik/blob/1.2.7/documentation/src/test/java/net/jqwik/docs/TaggingExamples.java). +[the following example](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/TaggingExamples.java). Including the tag `integration-test` will include all tests of the class. @@ -740,13 +819,13 @@ class TaggingExamples { ``` Tags must follow certain rules as described -[here](/docs/1.2.7/javadoc/net/jqwik/api/Tag.html) +[here](/docs/1.3.0/javadoc/net/jqwik/api/Tag.html) ## Disabling Tests From time to time you might want to disable a test or all tests in a container temporarily. You can do that by adding the -[`@Disabled`](/docs/1.2.7/javadoc/net/jqwik/api/Disabled.html) annotation +[`@Disabled`](/docs/1.3.0/javadoc/net/jqwik/api/Disabled.html) annotation to a property method or a container class. ```java @@ -772,7 +851,7 @@ _Jqwik_ will refuse to execute methods that have Jupiter annotations. ## Default Parameter Generation _jqwik_ tries to generate values for those property method parameters that are -annotated with [`@ForAll`](/docs/1.2.7/javadoc/net/jqwik/api/ForAll.html). If the annotation does not have a `value` parameter, +annotated with [`@ForAll`](/docs/1.3.0/javadoc/net/jqwik/api/ForAll.html). If the annotation does not have a `value` parameter, jqwik will use default generation for the following types: - `Object` @@ -793,7 +872,7 @@ jqwik will use default generation for the following types: - `java.util.Random` - [Functional Types](#functional-types) -If you use [`@ForAll`](/docs/1.2.7/javadoc/net/jqwik/api/ForAll.html) +If you use [`@ForAll`](/docs/1.3.0/javadoc/net/jqwik/api/ForAll.html) with a value, e.g. `@ForAll("aMethodName")`, the method referenced by `"aMethodName"` will be called to provide an Arbitrary of the required type (see [Parameter Provider Methods](#parameter-provider-methods)). @@ -805,14 +884,14 @@ depending on the requested parameter type. #### Allow Null Values -- [`@WithNull(double value = 0.1)`](/docs/1.2.7/javadoc/net/jqwik/api/constraints/WithNull.html): +- [`@WithNull(double value = 0.1)`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/WithNull.html): Inject `null` into generated values with a probability of `value`. Works for all generated types. #### Unique Values -- [`@Unique`](/docs/1.2.7/javadoc/net/jqwik/api/constraints/Unique.html): +- [`@Unique`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/Unique.html): Prevent duplicate values to be generated _per try_. That means that there can still be duplicate values across several tries. That also means that `@Unique` only makes sense as annotation for a parameter type, e.g.: @@ -831,10 +910,10 @@ depending on the requested parameter type. #### String Length -- [`@StringLength(int value = 0, int min = 0, int max = 0)`](/docs/1.2.7/javadoc/net/jqwik/api/constraints/StringLength.html): +- [`@StringLength(int value = 0, int min = 0, int max = 0)`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/StringLength.html): Set either fixed length through `value` or configure the length range between `min` and `max`. -- [`@NotEmpty`](/docs/1.2.7/javadoc/net/jqwik/api/constraints/NotEmpty.html): +- [`@NotEmpty`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/NotEmpty.html): Set minimum length to `1`. #### Character Sets @@ -849,65 +928,65 @@ will not be generated unless you explicitly include them using You can use the following annotations to restrict the set of allowed characters and even combine several of them: -- [`@Chars(chars[] value = {})`](/docs/1.2.7/javadoc/net/jqwik/api/constraints/Chars.html): +- [`@Chars(chars[] value = {})`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/Chars.html): Specify a set of characters. This annotation can be repeated which will add up all allowed chars. -- [`@CharRange(char from = 0, char to = 0)`](/docs/1.2.7/javadoc/net/jqwik/api/constraints/CharRange.html): +- [`@CharRange(char from = 0, char to = 0)`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/CharRange.html): Specify a start and end character. This annotation can be repeated which will add up all allowed chars. -- [`@NumericChars`](/docs/1.2.7/javadoc/net/jqwik/api/constraints/NumericChars.html): +- [`@NumericChars`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/NumericChars.html): Use digits `0` through `9` -- [`@LowerChars`](/docs/1.2.7/javadoc/net/jqwik/api/constraints/LowerChars.html): +- [`@LowerChars`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/LowerChars.html): Use lower case chars `a` through `z` -- [`@UpperChars`](/docs/1.2.7/javadoc/net/jqwik/api/constraints/UpperChars.html): +- [`@UpperChars`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/UpperChars.html): Use upper case chars `A` through `Z` -- [`@AlphaChars`](/docs/1.2.7/javadoc/net/jqwik/api/constraints/AlphaChars.html): +- [`@AlphaChars`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/AlphaChars.html): Lower and upper case chars are allowed. -- [`@Whitespace`](/docs/1.2.7/javadoc/net/jqwik/api/constraints/Whitespace.html): +- [`@Whitespace`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/Whitespace.html): All whitespace characters are allowed. They work for generated `String`s and `Character`s. #### List, Set, Stream, Map and Array Size -- [`@Size(int value = 0, int min = 0, int max = 0)`](/docs/1.2.7/javadoc/net/jqwik/api/constraints/Size.html): +- [`@Size(int value = 0, int min = 0, int max = 0)`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/Size.html): Set either fixed size through `value` or configure the size range between `min` and `max`. -- [`@NotEmpty`](/docs/1.2.7/javadoc/net/jqwik/api/constraints/NotEmpty.html): +- [`@NotEmpty`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/NotEmpty.html): Set minimum size to `1`. #### Integer Constraints -- [`@ByteRange(byte min = 0, byte max = Byte.MAX_VALUE)`](/docs/1.2.7/javadoc/net/jqwik/api/constraints/ByteRange.html): +- [`@ByteRange(byte min = 0, byte max = Byte.MAX_VALUE)`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/ByteRange.html): For `Byte` and `byte` only. -- [`@ShortRange(short min = 0, short max = Short.MAX_VALUE)`](/docs/1.2.7/javadoc/net/jqwik/api/constraints/ShortRange.html): +- [`@ShortRange(short min = 0, short max = Short.MAX_VALUE)`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/ShortRange.html): For `Short` and `short` only. -- [`@IntRange(int min = 0, int max = Integer.MAX_VALUE)`](/docs/1.2.7/javadoc/net/jqwik/api/constraints/IntRange.html): +- [`@IntRange(int min = 0, int max = Integer.MAX_VALUE)`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/IntRange.html): For `Integer` and `int` only. -- [`@LongRange(long min = 0L, long max = Long.MAX_VALUE)`](/docs/1.2.7/javadoc/net/jqwik/api/constraints/LongRange.html): +- [`@LongRange(long min = 0L, long max = Long.MAX_VALUE)`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/LongRange.html): For `Long` and `long` only. -- [`@BigRange(String min = "", String max = "")`](/docs/1.2.7/javadoc/net/jqwik/api/constraints/BigRange.html): +- [`@BigRange(String min = "", String max = "")`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/BigRange.html): For `BigInteger` generation. -- [`@Positive`](/docs/1.2.7/javadoc/net/jqwik/api/constraints/Positive.html): +- [`@Positive`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/Positive.html): Numbers larger than `0`. For all integral types. -- [`@Negative`](/docs/1.2.7/javadoc/net/jqwik/api/constraints/Negative.html): +- [`@Negative`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/Negative.html): Numbers lower than `0`. For all integral types. #### Decimal Constraints -- [`@FloatRange(float min = 0.0f, minIncluded = true, float max = Float.MAX_VALUE, maxIncluded = true)`](/docs/1.2.7/javadoc/net/jqwik/api/constraints/FloatRange.html): +- [`@FloatRange(float min = 0.0f, minIncluded = true, float max = Float.MAX_VALUE, maxIncluded = true)`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/FloatRange.html): For `Float` and `float` only. -- [`@DoubleRange(double min = 0.0, minIncluded = true, double max = Double.MAX_VALUE, boolean maxIncluded = true)`](/docs/1.2.7/javadoc/net/jqwik/api/constraints/DoubleRange.html): +- [`@DoubleRange(double min = 0.0, minIncluded = true, double max = Double.MAX_VALUE, boolean maxIncluded = true)`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/DoubleRange.html): For `Double` and `double` only. -- [`@BigRange(String min = "", minIncluded = true, String max = "", maxIncluded = true)`](/docs/1.2.7/javadoc/net/jqwik/api/constraints/BigRange.html): +- [`@BigRange(String min = "", minIncluded = true, String max = "", maxIncluded = true)`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/BigRange.html): For `BigDecimal` generation. -- [`@Scale(int value)`](/docs/1.2.7/javadoc/net/jqwik/api/constraints/Scale.html): +- [`@Scale(int value)`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/Scale.html): Specify the maximum number of decimal places. For all decimal types. -- [`@Positive`](/docs/1.2.7/javadoc/net/jqwik/api/constraints/Positive.html): +- [`@Positive`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/Positive.html): Numbers larger than `0.0`. For all decimal types. -- [`@Negative`](/docs/1.2.7/javadoc/net/jqwik/api/constraints/Negative.html): +- [`@Negative`](/docs/1.3.0/javadoc/net/jqwik/api/constraints/Negative.html): Numbers lower than `0.0`. For all decimal types. ### Constraining parameterized types @@ -930,7 +1009,7 @@ _jqwik_ can also handle type variables and wildcard types. The handling of upper bounds works mostly as you would expect it. Consider -[the following examples](https://github.com/jlink/jqwik/blob/1.2.7/documentation/src/test/java/net/jqwik/docs/VariableTypedPropertyExamples.java): +[the following examples](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/VariableTypedPropertyExamples.java): ```java class VariableTypedPropertyExamples { @@ -970,7 +1049,7 @@ _in the same call to the method_! ## Self-Made Annotations You can [make your own annotations](http://junit.org/junit5/docs/5.0.0/user-guide/#writing-tests-meta-annotations) -instead of using _jqwik_'s built-in ones. BTW, '@Example' is nothing but a plain annotation using [`@Property`](/docs/1.2.7/javadoc/net/jqwik/api/Property.html) +instead of using _jqwik_'s built-in ones. BTW, '@Example' is nothing but a plain annotation using [`@Property`](/docs/1.3.0/javadoc/net/jqwik/api/Property.html) as "meta"-annotation. The following example provides an annotation to constrain String or Character generation to German letters only: @@ -1002,7 +1081,7 @@ of values programmatically. The means to do that are _provider methods_. ### Parameter Provider Methods Look at the -[following example](https://github.com/jlink/jqwik/blob/1.2.7/documentation/src/test/java/net/jqwik/docs/ProvideMethodExamples.java): +[following example](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/ProvideMethodExamples.java): ```java @Property @@ -1026,14 +1105,14 @@ Arbitrary numbers() { } ``` -The String value of the [`@ForAll`](/docs/1.2.7/javadoc/net/jqwik/api/ForAll.html) +The String value of the [`@ForAll`](/docs/1.3.0/javadoc/net/jqwik/api/ForAll.html) annotation serves as a reference to a method within the same class (or one of its superclasses or owning classes). This reference refers to either the method's name or the String value of the method's `@Provide` annotation. The providing method has to return an object of type -[`@Arbitrary`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitrary.html) +[`@Arbitrary`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html) where `T` is the static type of the parameter to be provided. Optionally the provider method can take tow optional parameters: @@ -1079,11 +1158,11 @@ String elements are generated using the arbitrary from the method `shortStrings` ### Static `Arbitraries` methods The starting point for generation usually is a static method call on class -[`Arbitraries`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitraries.html). +[`Arbitraries`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html). #### Generate values yourself -- [`Arbitrary randomValue(Function generator)`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitraries.html#randomValue-java.util.function.Function-): +- [`Arbitrary randomValue(Function generator)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#randomValue-java.util.function.Function-): Take a `random` instance and create an object from it. Those values cannot be [shrunk](#result-shrinking), though. @@ -1103,40 +1182,34 @@ The starting point for generation usually is a static method call on class } ``` -- [`Arbitrary fromGenerator(RandomGenerator generator)`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitraries.html#fromGenerator-net.jqwik.api.RandomGenerator-): +- [`Arbitrary fromGenerator(RandomGenerator generator)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#fromGenerator-net.jqwik.api.RandomGenerator-): If the number of _tries_ influences value generation or if you want to allow for [shrinking](#result-shrinking) you have to provide your own `RandomGenerator` implementation. -#### Select values randomly +#### Select or generate values randomly -- [`Arbitrary of(U... values)`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitraries.html#of-U...-): +- [`Arbitrary of(U... values)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#of-U...-): Choose randomly from a list of values. Shrink towards the first one. -- [`Arbitrary samples(T... samples)`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitraries.html#samples-T...-): - Go through samples from first to last. Shrink towards the first sample. - - If instead you want to _add_ samples to an existing arbitrary you'd rather use - [`Arbitrary.withSamples(T... samples)`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitrary.html#withSamples-T...-). - The following arbitrary: - - ```java - @Provide - Arbitrary integersWithPrimes() { - return Arbitraries.integers(- 1000, 1000).withSamples(2,3,5,7,11,13,17); - } - ``` +- [`Arbitrary ofSuppliers(Supplier... valueSuppliers)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#ofSuppliers-java.util.function.Supplier...-): + Choose randomly from a list of value suppliers and get the object from this supplier. + This is useful when dealing with mutable objects where `Arbitrary.of(..)` would reuse a potentially changed object. - will first generate the 7 enumerated prime numbers and only then generate random - integers between -1000 and +1000. - -- [`Arbitrary of(Class enumClass)`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitraries.html#of-java.lang.Class-): +- [`Arbitrary constant(T constantValue)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#constant-T-): + Always provide the same constant value in each try. Mostly useful to combine with other arbitraries. + +- [`Arbitrary of(Class enumClass)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#of-java.lang.Class-): Choose randomly from all values of an `enum`. Shrink towards first enum value. +- [`Arbitrary create(Supplier supplier)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#constant-java.util.function.Supplier-): + In each try use a new unshrinkable instance of type `T` using `supplier` to freshly create it. + This is useful when dealing with mutable objects where `Arbitrary.constant()` may reuse a changed object. + #### Select randomly with Weights If you have a set of values to choose from with weighted probabilities, use ` -[`Arbitraries.frequency(...)`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitraries.html#frequency-net.jqwik.api.Tuple.Tuple2...-): +[`Arbitraries.frequency(...)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#frequency-net.jqwik.api.Tuple.Tuple2...-): ```java @Property @@ -1157,62 +1230,38 @@ Arbitrary abcdWeighted() { The first value of the tuple specifies the frequency of a particular value in relation to the sum of all frequencies. In -[the given example](https://github.com/jlink/jqwik/blob/1.2.7/documentation/src/test/java/net/jqwik/docs/ChoosingExamples.java#L17) +[the given example](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/ChoosingExamples.java#L17) the sum is 36, thus `"a"` will be generated with a probability of `1/36` whereas `"d"` has a generation probability of `20/36` (= `5/9`). Shrinking moves towards the start of the frequency list. -#### Integers - -- [`ByteArbitrary bytes()`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitraries.html#bytes--) -- [`ShortArbitrary shorts()`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitraries.html#shorts--) -- [`IntegerArbitrary integers()`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitraries.html#integers--) -- [`LongArbitrary longs()`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitraries.html#longs--) -- [`BigIntegerArbitrary bigIntegers()`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitraries.html#bigIntegers--) - -#### Decimals - -- [`FloatArbitrary floats()`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitraries.html#floats--) -- [`DoubleArbitrary doubles()`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitraries.html#doubles--) -- [`BigDecimalArbitrary bigDecimals()`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitraries.html#bigDecimals--) - #### Characters and Strings -- [`StringArbitrary strings()`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitraries.html#strings--) -- [`CharacterArbitrary chars()`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitraries.html#chars--) +- [`StringArbitrary strings()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#strings--) +- [`CharacterArbitrary chars()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#chars--) #### java.util.Random -- [`Arbitrary randoms()`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitraries.html#randoms--): +- [`Arbitrary randoms()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#randoms--): Random instances will never be shrunk -#### Constants - -- [`Arbitrary constant(T value)`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitraries.html#constant-T-): - In each try use the same unshrinkable `value` of type `T`. - -#### Create - -- [`Arbitrary create(Supplier supplier)`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitraries.html#constant-java.util.function.Supplier-): - In each try use a new unshrinkable instance of type `T` using `supplier` to freshly create it. - #### Shuffling Permutations -- [`Arbitrary> shuffle(T ... values)`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitraries.html#shuffle-T...-): +- [`Arbitrary> shuffle(T ... values)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#shuffle-T...-): Return unshrinkable permutations of the `values` handed in. -- [`Arbitrary> shuffle(List values)`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitraries.html#shuffle-java.util.List-): +- [`Arbitrary> shuffle(List values)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#shuffle-java.util.List-): Return unshrinkable permutations of the `values` handed in. #### Default Types -- [`Arbitrary defaultFor(Class type, Class ... parameterTypes)`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitraries.html#defaultFor-java.lang.Class-java.lang.Class...-): +- [`Arbitrary defaultFor(Class type, Class ... parameterTypes)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#defaultFor-java.lang.Class-java.lang.Class...-): Return the default arbitrary available for type `type` [if one is provided](#providing-default-arbitraries) by default. For parameterized types you can also specify the parameter types. Keep in mind, though, that the parameter types are lost in the type signature and therefore - cannot be used in the respective [`@ForAll`](/docs/1.2.7/javadoc/net/jqwik/api/ForAll.html) property method parameter. Raw types and wildcards, + cannot be used in the respective [`@ForAll`](/docs/1.3.0/javadoc/net/jqwik/api/ForAll.html) property method parameter. Raw types and wildcards, however, match; thus the following example will work: ```java @@ -1227,23 +1276,137 @@ Shrinking moves towards the start of the frequency list. } ``` +### Numeric Arbitrary Types + +Creating an arbitrary for numeric values also starts by calling a static method +on class `Arbitraries`. There are two fundamental types of numbers: _integral_ numbers +and _decimal_ numbers. _jqwik_ supports all of Java's built-in number types. + +Each type has its own [fluent interface](https://en.wikipedia.org/wiki/Fluent_interface) +but all numeric arbitrary types share some things: + +- You can constrain their minimum and maximum values using `between(min, max)`, + `greaterOrEqual(min)` and `lessOrEqual(max)`. +- You can determine the _target value_ through `shrinkTowards(target)`. + This value is supposed to be the "center" of all possible values used for shrinking + and as a mean for [random distributions](random-numeric-distribution). + +#### Integrals + +- [`ByteArbitrary bytes()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#bytes--) +- [`ShortArbitrary shorts()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#shorts--) +- [`IntegerArbitrary integers()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#integers--) +- [`LongArbitrary longs()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#longs--) +- [`BigIntegerArbitrary bigIntegers()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#bigIntegers--) + +#### Decimals + +- [`FloatArbitrary floats()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#floats--) +- [`DoubleArbitrary doubles()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#doubles--) +- [`BigDecimalArbitrary bigDecimals()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#bigDecimals--) + +Decimal arbitrary types come with a few additional capabilities: + +- You can include or exclude the borders using `between(min, minIncluded, max, maxIncluded)`, + `greaterThan(minExcluded)` and `lessThan(maxExclude)`. +- You can set the _scale_, i.e. number of significant decimal places with `ofScale(scale)`. + The default scale is `2`. + +#### Random Numeric Distribution + +With release `1.3.0` jqwik provides you with a means to influence the probability distribution +of randomly generated numbers. The way to do that is by calling +[`withDistribution(distribution)`](https://jqwik.net/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/NumericalArbitrary.html#withDistribution-net.jqwik.api.RandomDistribution-). +Currently three different distributions are supported: + +- [`RandomDistribution.biased()`](https://jqwik.net/docs/1.3.0/javadoc/net/jqwik/api/RandomDistribution.html#biased--): + This is the default. + It generates values closer to the center of a numerical range with a higher probability. + The bigger the range the stronger the bias. + +- [`RandomDistribution.uniform()`](https://jqwik.net/docs/1.3.0/javadoc/net/jqwik/api/RandomDistribution.html#uniform--): + This distribution will generate values across the allowed range + with a uniform probability distribution. + +- [`RandomDistribution.gaussian(borderSigma)`](https://jqwik.net/docs/1.3.0/javadoc/net/jqwik/api/RandomDistribution.html#gaussian-double-): + A (potentially asymmetric) gaussian distribution -- + aka "normal distribution" -- the mean of which is the specified center + and the probability at the borders is `borderSigma` times _standard deviation_. + Gaussian generation is approximately 10 times slower than biased or uniform generation. + +- [`RandomDistribution.gaussian()`](https://jqwik.net/docs/1.3.0/javadoc/net/jqwik/api/RandomDistribution.html#gaussian--): + A gaussian distribution with `borderSigma` of 3, i.e. approximately 99.7% of values are within the borders. + +The specified distribution does not influence the generation of [edge cases](#generation-of-edge-cases). + +The following example generates numbers between 0 and 20 using a gaussian probability distribution +with its mean at 10 and a standard deviation of about 3.3: + +```java +@Property(generation = GenerationMode.RANDOMIZED) +@StatisticsReport(format = Histogram.class) +void gaussianDistributedIntegers(@ForAll("gaussians") int aNumber) { + Statistics.collect(aNumber); +} + +@Provide +Arbitrary gaussians() { + return Arbitraries + .integers() + .between(0, 20) + .shrinkTowards(10) + .withDistribution(RandomDistribution.gaussian()); +} +``` + +Look at the statistics to see if it fits your expectation: +``` +[RandomDistributionExamples:gaussianDistributedIntegers] (1000) statistics = + # | label | count | + -----|-------|-------|--------------------------------------------------------------------------------- + 0 | 0 | 15 | ■■■■■ + 1 | 1 | 8 | ■■ + 2 | 2 | 12 | ■■■■ + 3 | 3 | 9 | ■■■ + 4 | 4 | 14 | ■■■■ + 5 | 5 | 28 | ■■■■■■■■■ + 6 | 6 | 38 | ■■■■■■■■■■■■■ + 7 | 7 | 67 | ■■■■■■■■■■■■■■■■■■■■■■■ + 8 | 8 | 77 | ■■■■■■■■■■■■■■■■■■■■■■■■■■ + 9 | 9 | 116 | ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ + 10 | 10 | 231 | ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ + 11 | 11 | 101 | ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ + 12 | 12 | 91 | ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ + 13 | 13 | 60 | ■■■■■■■■■■■■■■■■■■■■ + 14 | 14 | 45 | ■■■■■■■■■■■■■■■ + 15 | 15 | 36 | ■■■■■■■■■■■■ + 16 | 16 | 19 | ■■■■■■ + 17 | 17 | 10 | ■■■ + 18 | 18 | 7 | ■■ + 19 | 19 | 1 | + 20 | 20 | 15 | ■■■■■ +``` + +You can notice that values `0` and `20` should have the lowest probability but they do not. +This is because they will be generated a few times as edge cases. + ### Collections, Streams, Arrays and Optional Generating types who have generic type parameters, requires to start with an `Arbitrary` instance for the generic type. You can create the corresponding collection arbitrary from there: -- [`Arbitrary.list()`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitrary.html#list--) -- [`Arbitrary.set()`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitrary.html#set--) -- [`Arbitrary.streamOf()`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitrary.html#stream--) -- [`Arbitrary.array(Class arrayClass)`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitrary.html#array-java.lang.Class-) -- [`Arbitrary.optional()`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitrary.html#optional--) +- [`Arbitrary.list()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html#list--) +- [`Arbitrary.set()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html#set--) +- [`Arbitrary.streamOf()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html#stream--) +- [`Arbitrary.array(Class arrayClass)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html#array-java.lang.Class-) +- [`Arbitrary.optional()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html#optional--) ### Collecting Values in a List If you do not want any random combination of values in your list - as can be done with `Arbitrary.list()` - you have the possibility to collect random values in a list until a certain condition is fulfilled. -[`Arbitrary.collect(Predicate condition)`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitrary.html#collect-java.util.function.Predicate-) +[`Arbitrary.collect(Predicate condition)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html#collect-java.util.function.Predicate-) is what you need in those cases. Imagine you need a list of integers the sum of which should be at least `1000`. @@ -1264,10 +1427,10 @@ Arbitrary integerPair = Arbitrary.integers().between(1, 25).tuple2 There's a method for tuples of length 1 to 4: -- [`Arbitrary.tuple1()`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitrary.html#tuple1--) -- [`Arbitrary.tuple2()`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitrary.html#tuple2--) -- [`Arbitrary.tuple3()`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitrary.html#tuple3--) -- [`Arbitrary.tuple4()`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitrary.html#tuple4--) +- [`Arbitrary.tuple1()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html#tuple1--) +- [`Arbitrary.tuple2()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html#tuple2--) +- [`Arbitrary.tuple3()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html#tuple3--) +- [`Arbitrary.tuple4()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html#tuple4--) @@ -1276,7 +1439,7 @@ There's a method for tuples of length 1 to 4: Generating instances of type `Map` is a bit different since two arbitraries are needed, one for the key and one for the value. Therefore you have to use -[`Arbitraries.maps(...)`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitraries.html#maps-net.jqwik.api.Arbitrary-net.jqwik.api.Arbitrary-) like this: +[`Arbitraries.maps(...)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#maps-net.jqwik.api.Arbitrary-net.jqwik.api.Arbitrary-) like this: ```java @Property @@ -1294,7 +1457,7 @@ Arbitrary> numberMaps() { ``` For generating individual `Map.Entry` instances there is -[`Arbitraries.entries(...)`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitraries.html#maps-net.jqwik.api.Arbitrary-net.jqwik.api.Arbitrary-). +[`Arbitraries.entries(...)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#maps-net.jqwik.api.Arbitrary-net.jqwik.api.Arbitrary-). ### Functional Types @@ -1355,23 +1518,23 @@ all other cases. Most specialized arbitrary interfaces provide special methods to configure things like size, length, boundaries etc. Have a look at the Java doc for the following types: -- [BigDecimalArbitrary](/docs/1.2.7/javadoc/net/jqwik/api/arbitraries/BigDecimalArbitrary.html) -- [BigIntegerArbitrary](/docs/1.2.7/javadoc/net/jqwik/api/arbitraries/BigIntegerArbitrary.html) -- [ByteArbitrary](/docs/1.2.7/javadoc/net/jqwik/api/arbitraries/ByteArbitrary.html) -- [CharacterArbitrary](/docs/1.2.7/javadoc/net/jqwik/api/arbitraries/CharacterArbitrary.html) -- [DoubleArbitrary](/docs/1.2.7/javadoc/net/jqwik/api/arbitraries/DoubleArbitrary.html) -- [FloatArbitrary](/docs/1.2.7/javadoc/net/jqwik/api/arbitraries/FloatArbitrary.html) -- [IntegerArbitrary](/docs/1.2.7/javadoc/net/jqwik/api/arbitraries/IntegerArbitrary.html) -- [LongArbitrary](/docs/1.2.7/javadoc/net/jqwik/api/arbitraries/LongArbitrary.html) -- [ShortArbitrary](/docs/1.2.7/javadoc/net/jqwik/api/arbitraries/ShortArbitrary.html) -- [SizableArbitrary](/docs/1.2.7/javadoc/net/jqwik/api/arbitraries/SizableArbitrary.html) -- [StreamableArbitrary](/docs/1.2.7/javadoc/net/jqwik/api/arbitraries/StreamableArbitrary.html) -- [StringArbitrary](/docs/1.2.7/javadoc/net/jqwik/api/arbitraries/StringArbitrary.html) -- [FunctionArbitrary](/docs/1.2.7/javadoc/net/jqwik/api/arbitraries/FunctionArbitrary.html) +- [BigDecimalArbitrary](/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/BigDecimalArbitrary.html) +- [BigIntegerArbitrary](/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/BigIntegerArbitrary.html) +- [ByteArbitrary](/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/ByteArbitrary.html) +- [CharacterArbitrary](/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/CharacterArbitrary.html) +- [DoubleArbitrary](/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/DoubleArbitrary.html) +- [FloatArbitrary](/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/FloatArbitrary.html) +- [IntegerArbitrary](/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/IntegerArbitrary.html) +- [LongArbitrary](/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/LongArbitrary.html) +- [ShortArbitrary](/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/ShortArbitrary.html) +- [SizableArbitrary](/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/SizableArbitrary.html) +- [StreamableArbitrary](/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/StreamableArbitrary.html) +- [StringArbitrary](/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/StringArbitrary.html) +- [FunctionArbitrary](/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/FunctionArbitrary.html) Here are a -[two examples](https://github.com/jlink/jqwik/blob/1.2.7/documentation/src/test/java/net/jqwik/docs/FluentConfigurationExamples.java) +[two examples](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/FluentConfigurationExamples.java) to give you a hint of what you can do: ```java @@ -1389,7 +1552,7 @@ Arbitrary> fixedSizedListOfPositiveIntegers() { ### Generate `null` values Predefined generators will never create `null` values. If you want to allow that, -call [`Arbitrary.injectNull(double probability)`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitrary.html#injectNull-double-). +call [`Arbitrary.injectNull(double probability)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html#injectNull-double-). The following provider method creates an arbitrary that will return a `null` String in about 1 of 100 generated values. @@ -1479,7 +1642,7 @@ for the two String values - using `tuple2()` does that. If you want to include only part of all the values generated by an arbitrary, use -[`Arbitrary.filter(Predicate filterPredicate)`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitrary.html#filter-java.util.function.Predicate-). +[`Arbitrary.filter(Predicate filterPredicate)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html#filter-java.util.function.Predicate-). The following arbitrary will filter out all even numbers from the stream of generated integers: @@ -1498,7 +1661,7 @@ the current property will be abandoned by throwing an exception. If you want to make sure that all the values generated by an arbitrary are unique, use -[`Arbitrary.unique()`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitrary.html#unique--). +[`Arbitrary.unique()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html#unique--). The following arbitrary will generate integers between 1 and 1000 but never the same integer twice: ```java @@ -1516,7 +1679,7 @@ the current property will be abandoned by throwing an exception. Sometimes it's easier to start with an existing arbitrary and use its generated values to build other objects from them. In that case, use -[`Arbitrary.map(Function mapper)`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitrary.html#map-java.util.function.Function-). +[`Arbitrary.map(Function mapper)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html#map-java.util.function.Function-). The following example uses generated integers to create numerical Strings: ```java @@ -1536,7 +1699,7 @@ will move towards the lowest allowed number, that is `10000`. Similar as in the case of `Arbitrary.map(..)` there are situations in which you want to use a generated value in order to create another Arbitrary from it. Sounds complicated? Have a look at the -[following example](https://github.com/jlink/jqwik/blob/1.2.7/documentation/src/test/java/net/jqwik/docs/FlatMappingExamples.java#L26): +[following example](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/FlatMappingExamples.java#L26): ```java @Property @@ -1569,9 +1732,9 @@ However, both have dependencies: - `end` must not be larger than the string size - `begin` must not be larger than `end` You can make _jqwik_ create all three values by using -[`flatMap`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitrary.html#flatMap-java.util.function.Function-) +[`flatMap`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html#flatMap-java.util.function.Function-) combined with a tuple type -[like this](https://github.com/jlink/jqwik/blob/1.2.7/documentation/src/test/java/net/jqwik/docs/FlatMappingExamples.java#L32): +[like this](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/FlatMappingExamples.java#L32): ```java @@ -1627,7 +1790,7 @@ Arbitrary oneOfThree() { } ``` -[In this example](https://github.com/jlink/jqwik/blob/1.2.7/documentation/src/test/java/net/jqwik/docs/OneOfExamples.java) +[In this example](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/OneOfExamples.java) the statistics should also give you an equal distribution between the three types of integers. @@ -1662,11 +1825,11 @@ Arbitrary oneOfThree() { Sometimes just mapping a single stream of generated values is not enough to generate a more complicated domain object. In those cases you can combine several arbitraries to a single result arbitrary using -[`Combinators.combine()`](/docs/1.2.7/javadoc/net/jqwik/api/Combinators.html#combine-net.jqwik.api.Arbitrary-net.jqwik.api.Arbitrary-) +[`Combinators.combine()`](/docs/1.3.0/javadoc/net/jqwik/api/Combinators.html#combine-net.jqwik.api.Arbitrary-net.jqwik.api.Arbitrary-) with up to eight arbitraries. [Create an issue on github](https://github.com/jlink/jqwik/issues) if you need more than eight. -[The following example](https://github.com/jlink/jqwik/blob/1.2.7/documentation/src/test/java/net/jqwik/docs/MappingAndCombinatorExamples.java#L25) +[The following example](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/MappingAndCombinatorExamples.java#L25) generates `Person` instances from three arbitraries as inputs. ```java @@ -1762,8 +1925,8 @@ Arbitrary validPeopleWithBuilder() { ``` Have a look at -[Combinators.withBuilder(Supplier)](/docs/1.2.7/javadoc/net/jqwik/api/Combinators.html#withBuilder-java.util.function.Supplier-) -and [Combinators.withBuilder(Arbitrary)](/docs/1.2.7/javadoc/net/jqwik/api/Combinators.html#withBuilder-net.jqwik.api.Arbitrary-) +[Combinators.withBuilder(Supplier)](/docs/1.3.0/javadoc/net/jqwik/api/Combinators.html#withBuilder-java.util.function.Supplier-) +and [Combinators.withBuilder(Arbitrary)](/docs/1.3.0/javadoc/net/jqwik/api/Combinators.html#withBuilder-net.jqwik.api.Arbitrary-) to check the API. #### Flat Combination @@ -1810,7 +1973,7 @@ Some generators (e.g. most number generators) are sensitive to the The default value for `genSize` is the number of tries configured for the property they are used in. If there is a need to influence the behaviour of generators you can do so by using -[`Arbitrary.fixGenSize(int)`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitrary.html#fixGenSize-int-).. +[`Arbitrary.fixGenSize(int)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html#fixGenSize-int-).. ## Recursive Arbitraries @@ -1821,7 +1984,7 @@ is one application field but you can also use it for other stuff. ### Probabilistic Recursion Look at the -[following example](https://github.com/jlink/jqwik/blob/1.2.7/documentation/src/test/java/net/jqwik/docs/RecursiveExamples.java) +[following example](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/RecursiveExamples.java) which generates sentences by recursively adding words to a sentence: ```java @@ -1851,7 +2014,7 @@ private StringArbitrary word() { There are two things to which you must pay attention: -- Use [`Arbitraries.lazy(Supplier>)`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitraries.html#lazy-java.util.function.Supplier-) +- Use [`Arbitraries.lazy(Supplier>)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#lazy-java.util.function.Supplier-) to wrap the recursive call itself. Otherwise _jqwik_'s attempt to build the arbitrary will quickly result in a stack overflow. - Every recursion needs one or more base cases in order to stop recursion at some point. @@ -1891,7 +2054,7 @@ Arbitrary deterministic(int length, Arbitrary sentence) { ### Deterministic Recursion with `recursive()` To further simplify this _jqwik_ provides a helper function: -[`Arbitraries.recursive(...)`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitraries.html#recursive-java.util.function.Supplier-java.util.function.Function-int-). +[`Arbitraries.recursive(...)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#recursive-java.util.function.Supplier-java.util.function.Function-int-). Using that further simplifies the example: ```java @@ -1922,7 +2085,7 @@ in which you might want to generate values directly. ### Generating a Single Value Getting a single random value out of an arbitrary is easy and can be done -with [`Arbitrary.sample()`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitrary.html#sample--): +with [`Arbitrary.sample()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html#sample--): ```java Arbitrary strings = Arbitraries.of("string1", "string2", "string3"); @@ -1938,7 +2101,7 @@ freshly instantiated if used outside a property. ### Generating a Stream of Values -Getting a stream of generated values is just as easy with [`Arbitrary.sampleStream()`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitrary.html#sampleStream--): +Getting a stream of generated values is just as easy with [`Arbitrary.sampleStream()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html#sampleStream--): ```java List values = Arrays.asList("string1", "string2", "string3"); @@ -1952,7 +2115,7 @@ assertThat(streamOfStrings).allMatch(values::contains); There are a few cases when you don't want to generate individual values from an arbitrary but use all possible values to construct another arbitrary. This can be achieved through -[`Arbitrary.allValues()`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitrary.html#allValues--). +[`Arbitrary.allValues()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html#allValues--). Return type is `Optional>` because _jqwik_ can only perform this task if [exhaustive generation](#exhaustive-generation) is doable. @@ -1962,7 +2125,7 @@ Return type is `Optional>` because _jqwik_ can only perform this task You can also use an arbitrary to iterate through all values it specifies. Use -[`Arbitrary.forEachValue(Consumer action)`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitrary.html#forEachValue-java.util.function.Consumer-). +[`Arbitrary.forEachValue(Consumer action)`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitrary.html#forEachValue-java.util.function.Consumer-). for that purpose. This only works when [exhaustive generation](#exhaustive-generation) is possible. In other cases the attempt to iterate will result in an exception. @@ -2047,7 +2210,7 @@ when they can be invoked and some objects have invariants that should never be v of the sequence of performed actions. To make this abstract concept concrete, let's look at a -[simple stack implementation](https://github.com/jlink/jqwik/blob/1.2.7/documentation/src/test/java/net/jqwik/docs/stateful/mystack/MyStringStack.java): +[simple stack implementation](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/stateful/mystack/MyStringStack.java): ```java public class MyStringStack { @@ -2064,7 +2227,7 @@ public class MyStringStack { We can see at least three _actions_ with their preconditions and expected state changes: -- [`Push`](https://github.com/jlink/jqwik/blob/1.2.7/documentation/src/test/java/net/jqwik/docs/stateful/mystack/PushAction.java): +- [`Push`](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/stateful/mystack/PushAction.java): Push a string onto the stack. The string should be on top afterwards and the size should have increased by 1. @@ -2094,7 +2257,7 @@ We can see at least three _actions_ with their preconditions and expected state } ``` -- [`Pop`](https://github.com/jlink/jqwik/blob/1.2.7/documentation/src/test/java/net/jqwik/docs/stateful/mystack/PopAction.java): +- [`Pop`](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/stateful/mystack/PopAction.java): If (and only if) the stack is not empty, pop the element on top off the stack. The size of the stack should have decreased by 1. @@ -2122,7 +2285,7 @@ We can see at least three _actions_ with their preconditions and expected state } ``` -- [`Clear`](https://github.com/jlink/jqwik/blob/1.2.7/documentation/src/test/java/net/jqwik/docs/stateful/mystack/ClearAction.java): +- [`Clear`](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/stateful/mystack/ClearAction.java): Remove all elements from the stack which should be empty afterwards. ```java @@ -2148,7 +2311,7 @@ The fundamental property that _jqwik_ should try to falsify is: (aka postconditions) should be fulfilled. We can formulate that quite easily as a -[_jqwik_ property](https://github.com/jlink/jqwik/blob/1.2.7/documentation/src/test/java/net/jqwik/docs/stateful/mystack/MyStringStackProperties.java): +[_jqwik_ property](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/stateful/mystack/MyStringStackProperties.java): ```java class MyStringStackProperties { @@ -2178,11 +2341,11 @@ class MyStringStackProperties { ``` The interesting API elements are -- [`ActionSequence`](/docs/1.2.7/javadoc/net/jqwik/api/stateful/ActionSequence.html): +- [`ActionSequence`](/docs/1.3.0/javadoc/net/jqwik/api/stateful/ActionSequence.html): A generic collection type especially crafted for holding and shrinking of a list of actions. As a convenience it will apply the actions to a state-based object when you call `run(state)`. -- [`Arbitraries.sequences()`](/docs/1.2.7/javadoc/net/jqwik/api/Arbitraries.html#sequences-net.jqwik.api.Arbitrary-): +- [`Arbitraries.sequences()`](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#sequences-net.jqwik.api.Arbitrary-): This method will create the arbitrary for generating an `ActionSequence` given the arbitrary for generating actions. @@ -2263,7 +2426,7 @@ If you want to constrain the set of generated values in a way that embraces more than one parameter, [filtering](#filtering) does not work. What you can do instead is putting one or more assumptions at the beginning of your property. -[The following property](https://github.com/jlink/jqwik/blob/1.2.7/documentation/src/test/java/net/jqwik/docs/AssumptionExamples.java) +[The following property](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/AssumptionExamples.java) works only on strings that are not equal: ```java @@ -2279,7 +2442,7 @@ boolean comparingUnequalStrings( // ``` This is a reasonable use of -[`Assume.that(boolean condition)`](/docs/1.2.7/javadoc/net/jqwik/api/Assume.html#that-boolean-) +[`Assume.that(boolean condition)`](/docs/1.3.0/javadoc/net/jqwik/api/Assume.html#that-boolean-) because most generated value sets will pass through. Have a look at a seemingly similar example: @@ -2305,6 +2468,9 @@ org.opentest4j.AssertionFailedError: tries = 1000 checks = 20 +generation = RANDOMIZED +after-failure = PREVIOUS_SEED +edge-cases#mode = MIXIN seed = 1066117555581106850 ``` @@ -2312,7 +2478,7 @@ The problem is that - given a random generation of two strings - only in very fe one string will be contained in the other. _jqwik_ will report a property as `exhausted` if the ratio between generated and accepted parameters is higher than 5. You can change the maximum discard ratio by specifying a parameter `maxDiscardRatio` in the -[`@Property`](/docs/1.2.7/javadoc/net/jqwik/api/Property.html) annotation. +[`@Property`](/docs/1.3.0/javadoc/net/jqwik/api/Property.html) annotation. That's why changing to `@Property(maxDiscardRatio = 100)` in the previous example will probably result in a successful property run, even though only a handful cases - of 1000 generated - will actually be checked. @@ -2320,7 +2486,7 @@ cases - of 1000 generated - will actually be checked. In many cases turning up the accepted discard ration is a bad idea. With some creativity we can often avoid the problem by generating out test data a bit differently. Look at this variant of the above property, which also uses -[`Assume.that()`](/docs/1.2.7/javadoc/net/jqwik/api/Assume.html#that-boolean-) +[`Assume.that()`](/docs/1.3.0/javadoc/net/jqwik/api/Assume.html#that-boolean-) but with a much lower discard ratio: ```java @@ -2358,7 +2524,7 @@ AssertionFailedError: Property [stringShouldBeShrunkToAA] falsified with sample tries = 38 checks = 38 -seed = -633877439388930932 +... sample = ["AA"] original-sample ["LVtyB"] ``` @@ -2375,7 +2541,7 @@ The general idea and its advantages are explained [here](http://hypothesis.works/articles/integrated-shrinking/). Consider a somewhat -[more complicated example](https://github.com/jlink/jqwik/blob/1.2.7/documentation/src/test/java/net/jqwik/docs/ShrinkingExamples.java#L15): +[more complicated example](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/ShrinkingExamples.java#L15): ```java @Property @@ -2407,7 +2573,7 @@ AssertionFailedError: Property [shrinkingCanTakeLong] falsified with sample ["h" checks = 20 tries = 20 -seed = -5596810132893895291 +... sample = ["h", "0"] original-sample ["gh", "774"] ``` @@ -2451,8 +2617,8 @@ even if it never ends... ### Change the Shrinking Target By default shrinking of numbers will move towards zero (0). -If zero is outside the bounds of generation the closest number to zero -- either the min or max value - is used as a target for shrinking. +If zero is outside the bounds of generation the closest number to zero - +either the min or max value - is used as a target for shrinking. There are cases, however, when you'd like _jqwik_ to choose a different shrinking target, usually when the default value of a number is not 0. @@ -2473,8 +2639,7 @@ Arbitrary> signals() { } ``` -Currently shrinking targets are supported for integral numbers and decimal numbers, i.e., -bytes, shorts, integers, longs, floats, doubles, BigIntegers and BigDecimals. +Currently shrinking targets are supported for all [number types](#numeric-arbitrary-types). ## Collecting and Reporting Statistics @@ -2482,7 +2647,7 @@ bytes, shorts, integers, longs, floats, doubles, BigIntegers and BigDecimals. In many situations you'd like to know if _jqwik_ will really generate the kind of values you expect and if the frequency and distribution of certain value classes meets your testing needs. -[`Statistics.collect()`](/docs/1.2.7/javadoc/net/jqwik/api/statistics/Statistics.html#collect-java.lang.Object...-) +[`Statistics.collect()`](/docs/1.3.0/javadoc/net/jqwik/api/statistics/Statistics.html#collect-java.lang.Object...-) is made for this exact purpose. In the most simple case you'd like to know how often a certain value @@ -2570,7 +2735,7 @@ void twoParameterStats( As you can see, collected `null` values are not being reported. -[Here](https://github.com/jlink/jqwik/blob/1.2.7/documentation/src/test/java/net/jqwik/docs/statistics/StatisticsExamples.java) +[Here](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/statistics/StatisticsExamples.java) are a couple of examples to try out. ### Labeled Statistics @@ -2609,13 +2774,13 @@ produces the following reports: ### Statistics Report Formatting There is a -[`@StatisticsReport`](/docs/1.2.7/javadoc/net/jqwik/api/statistics/StatisticsReport.html) +[`@StatisticsReport`](/docs/1.3.0/javadoc/net/jqwik/api/statistics/StatisticsReport.html) annotation that allows to change statistics report formats or to even switch it off. The annotation can be used on property methods or on container classes. The `value` attribute is of type -[StatisticsReportMode.OFF](/docs/1.2.7/javadoc/net/jqwik/api/statistics/StatisticsReport.StatisticsReportMode.html) and can have one of: +[StatisticsReportMode.OFF](/docs/1.3.0/javadoc/net/jqwik/api/statistics/StatisticsReport.StatisticsReportMode.html) and can have one of: - __`STANDARD`__: Use jqwik's standard reporting format. This is used anyway if you leave the annotation away. @@ -2637,11 +2802,101 @@ void queryStatistics(@ForAll int anInt) { } ``` -#### Plug in Your Own Statistics Report Format +#### Histograms + +_jqwik_ comes with two report formats to display collected data as histograms: +[`Histogram`](/docs/1.3.0/javadoc/net/jqwik/api/statistics/Histogram.html) +and [`NumberRangeHistogram`](/docs/1.3.0/javadoc/net/jqwik/api/statistics/NumberRangeHistogram.html). + +`Histogram` displays the collected raw data as a histogram: + +```java +@Property(generation = GenerationMode.RANDOMIZED) +@StatisticsReport(format = Histogram.class) +void integers(@ForAll("gaussians") int aNumber) { + Statistics.collect(aNumber); +} + +@Provide +Arbitrary gaussians() { + return Arbitraries + .integers() + .between(0, 20) + .shrinkTowards(10) + .withDistribution(RandomDistribution.gaussian()); +} +``` + +``` +[HistogramExamples:integers] (1000) statistics = + # | label | count | + -----|-------|-------|--------------------------------------------------------------------------------- + 0 | 0 | 13 | ■■■■ + 1 | 1 | 13 | ■■■■ + 2 | 2 | 15 | ■■■■■ + 3 | 3 | 6 | ■■ + 4 | 4 | 10 | ■■■ + 5 | 5 | 22 | ■■■■■■■ + 6 | 6 | 49 | ■■■■■■■■■■■■■■■■ + 7 | 7 | 60 | ■■■■■■■■■■■■■■■■■■■■ + 8 | 8 | 102 | ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ + 9 | 9 | 100 | ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ + 10 | 10 | 233 | ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ + 11 | 11 | 114 | ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ + 12 | 12 | 74 | ■■■■■■■■■■■■■■■■■■■■■■■■■ + 13 | 13 | 64 | ■■■■■■■■■■■■■■■■■■■■■ + 14 | 14 | 43 | ■■■■■■■■■■■■■■ + 15 | 15 | 32 | ■■■■■■■■■■ + 16 | 16 | 16 | ■■■■■ + 17 | 17 | 8 | ■■ + 18 | 18 | 7 | ■■ + 19 | 20 | 19 | ■■■■■■ +``` + +`NumberRangeHistogram` clusters the collected raw data into ranges: + +```java +@Property(generation = GenerationMode.RANDOMIZED) +@StatisticsReport(format = NumberRangeHistogram.class) +void integersInRanges(@ForAll @IntRange(min = -1000, max = 1000) int aNumber) { + Statistics.collect(aNumber); +} +``` + +``` +[HistogramExamples:integersInRanges] (1000) statistics = + # | label | count | + -----|---------------|-------|--------------------------------------------------------------------------------- + 0 | [-1000..-900[ | 20 | ■■■■■ + 1 | [-900..-800[ | 17 | ■■■■ + 2 | [-800..-700[ | 16 | ■■■■ + 3 | [-700..-600[ | 8 | ■■ + 4 | [-600..-500[ | 12 | ■■■ + 5 | [-500..-400[ | 14 | ■■■ + 6 | [-400..-300[ | 17 | ■■■■ + 7 | [-300..-200[ | 46 | ■■■■■■■■■■■ + 8 | [-200..-100[ | 59 | ■■■■■■■■■■■■■■ + 9 | [-100..0[ | 315 | ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ + 10 | [0..100[ | 276 | ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ + 11 | [100..200[ | 47 | ■■■■■■■■■■■ + 12 | [200..300[ | 49 | ■■■■■■■■■■■■ + 13 | [300..400[ | 25 | ■■■■■■ + 14 | [400..500[ | 14 | ■■■ + 15 | [500..600[ | 13 | ■■■ + 16 | [600..700[ | 15 | ■■■ + 17 | [700..800[ | 14 | ■■■ + 18 | [800..900[ | 11 | ■■ + 19 | [900..1000] | 12 | ■■■ +``` + +Both types can be subclassed to override behaviour like the number of buckets, +the maximum drawing range of the bar, the order of elements and the label of a bucket. + +#### Make Your Own Statistics Report Format In order to format statistics to your own liking you have to create an implementation of type -[StatisticsReportFormat](/docs/1.2.7/javadoc/net/jqwik/api/statistics/StatisticsReportFormat.html) and +[StatisticsReportFormat](/docs/1.3.0/javadoc/net/jqwik/api/statistics/StatisticsReportFormat.html) and ```java @Property @@ -2714,7 +2969,7 @@ void labeledStatistics(@ForAll @IntRange(min = 1, max = 10) Integer anInt) { ``` Start by looking at -[`Statistics.coverage()`](/docs/1.2.7/javadoc/net/jqwik/api/statistics/Statistics.html#coverage-java.util.function.Consumer-) +[`Statistics.coverage()`](/docs/1.3.0/javadoc/net/jqwik/api/statistics/Statistics.html#coverage-java.util.function.Consumer-) to see all the options you have for checking percentages and counts. #### Check Ad-hoc Query Coverage @@ -2747,7 +3002,7 @@ classes, in all of your properties, and without having to add `@Provide` method to all test classes. _jqwik_ enables this feature by using Java’s `java.util.ServiceLoader` mechanism. All you have to do is: -- Implement the interface [`ArbitraryProvider`](/docs/1.2.7/javadoc/net/jqwik/api/providers/ArbitraryProvider.html).
+- Implement the interface [`ArbitraryProvider`](/docs/1.3.0/javadoc/net/jqwik/api/providers/ArbitraryProvider.html).
The implementing class _must_ have a default constructor without parameters. - Register the implementation class in file @@ -2757,14 +3012,14 @@ Java’s `java.util.ServiceLoader` mechanism. All you have to do is: _jqwik_ will then add an instance of your arbitrary provider into the list of its default providers. Those default providers are considered for every test parameter annotated -with [`@ForAll`](/docs/1.2.7/javadoc/net/jqwik/api/ForAll.html) that has no explicit `value`. +with [`@ForAll`](/docs/1.3.0/javadoc/net/jqwik/api/ForAll.html) that has no explicit `value`. By using this mechanism you can also replace the default providers packaged into _jqwik_. ### Simple Arbitrary Providers A simple provider is one that delivers arbitraries for types without type variables. -Consider the class [`Money`](https://github.com/jlink/jqwik/blob/1.2.7/documentation/src/test/java/net/jqwik/docs/defaultprovider/Money.java): +Consider the class [`Money`](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/defaultprovider/Money.java): ```java public class Money { @@ -2788,7 +3043,7 @@ public class Money { ``` If you register the following class -[`MoneyArbitraryProvider`](https://github.com/jlink/jqwik/blob/1.2.7/documentation/src/test/java/net/jqwik/docs/defaultprovider/MoneyArbitraryProvider.java): +[`MoneyArbitraryProvider`](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/defaultprovider/MoneyArbitraryProvider.java): ```java package my.own.provider; @@ -2811,7 +3066,7 @@ public class MoneyArbitraryProvider implements ArbitraryProvider { ``` in file -[`META-INF/services/net.jqwik.api.providers.ArbitraryProvider`](https://github.com/jlink/jqwik/blob/1.2.7/documentation/src/test/resources/META-INF/services/net.jqwik.api.providers.ArbitraryProvider) +[`META-INF/services/net.jqwik.api.providers.ArbitraryProvider`](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/resources/META-INF/services/net.jqwik.api.providers.ArbitraryProvider) with such an entry: ``` @@ -2819,7 +3074,7 @@ my.own.provider.MoneyArbitraryProvider ``` The -[following property](https://github.com/jlink/jqwik/blob/1.2.7/documentation/src/test/java/net/jqwik/docs/defaultprovider/MoneyProperties.java) +[following property](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/defaultprovider/MoneyProperties.java) will run without further ado - regardless the class you put it in: ```java @@ -2899,16 +3154,16 @@ The mechanism you can plug into is similar to what you do when [providing your own default arbitrary providers](#providing-default-arbitraries). That means: 1. Create an implementation of an interface, in this case - [`ArbitraryConfigurator`](/docs/1.2.7/javadoc/net/jqwik/api/configurators/ArbitraryConfigurator.html). + [`ArbitraryConfigurator`](/docs/1.3.0/javadoc/net/jqwik/api/configurators/ArbitraryConfigurator.html). 2. Register the implementation using using Java’s `java.util.ServiceLoader` mechanism. ### Arbitrary Configuration Example: `@Odd` To demonstrate the idea let's create an annotation `@Odd` which will constrain any integer generation to only generate odd numbers. First things first, so here's -the [`@Odd` annotation](https://github.com/jlink/jqwik/blob/1.2.7/documentation/src/test/java/net/jqwik/docs/arbitraryconfigurator/Odd.java) +the [`@Odd` annotation](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/arbitraryconfigurator/Odd.java) together with the -[configurator implementation](https://github.com/jlink/jqwik/blob/1.2.7/documentation/src/test/java/net/jqwik/docs/arbitraryconfigurator/OddConfigurator.java): +[configurator implementation](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/arbitraryconfigurator/OddConfigurator.java): ```java @Target({ ElementType.ANNOTATION_TYPE, ElementType.PARAMETER, ElementType.TYPE_USE }) @@ -2927,8 +3182,8 @@ Mind that the implementation uses an abstract base class - instead of the interf which simplifies implementation if you're only interested in a single annotation. If you now -[register the implementation](https://github.com/jlink/jqwik/blob/1.2.7/documentation/src/test/resources/META-INF/services/net.jqwik.api.configurators.ArbitraryConfigurator), -the [following example](https://github.com/jlink/jqwik/blob/1.2.7/documentation/src/test/java/net/jqwik/docs/arbitraryconfigurator/OddProperties.java) +[register the implementation](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/resources/META-INF/services/net.jqwik.api.configurators.ArbitraryConfigurator), +the [following example](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/arbitraryconfigurator/OddProperties.java) will work: ```java @@ -2994,8 +3249,8 @@ a property method or container to only use providers and configurators from thos that are explicitly stated in a `@Domain(Class)` annotation. As for ways to implement domain context classes have a look at -[DomainContext](/docs/1.2.7/javadoc/net/jqwik/api/domains/DomainContext.html) -and [AbstractDomainContextBase](/docs/1.2.7/javadoc/net/jqwik/api/domains/AbstractDomainContextBase.html). +[DomainContext](/docs/1.3.0/javadoc/net/jqwik/api/domains/DomainContext.html) +and [AbstractDomainContextBase](/docs/1.3.0/javadoc/net/jqwik/api/domains/AbstractDomainContextBase.html). ### Domain example: American Addresses @@ -3004,9 +3259,9 @@ Let's say that US postal addresses play a crucial role in the software that we'r That's why there are a couple of classes that represent important domain concepts: `Street`, `State`, `City` and `Address`. Since we have to generate instances of those classes for our properties, we collect all arbitrary provision code in -[AmericanAddresses](https://github.com/jlink/jqwik/blob/1.2.7/documentation/src/test/java/net/jqwik/docs/domains/AmericanAddresses.java). +[AmericanAddresses](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/domains/AmericanAddresses.java). Now look at -[this example](https://github.com/jlink/jqwik/blob/1.2.7/documentation/src/test/java/net/jqwik/docs/domains/AddressProperties.java): +[this example](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/domains/AddressProperties.java): ```java class AddressProperties { @@ -3087,14 +3342,85 @@ the class in order to generate instances. Whenever there's an exception during generation they will be ignored; that way you'll only get valid instances. There are quite a few ways usage and configuration options. Have a look -at the [complete example](https://github.com/jlink/jqwik/blob/1.2.7/documentation/src/test/java/net/jqwik/docs/types/TypeArbitraryExamples.java) +at the [complete example](https://github.com/jlink/jqwik/blob/1.3.0/documentation/src/test/java/net/jqwik/docs/types/TypeArbitraryExamples.java) and check the following api entry points: -- [UseType](/docs/1.2.7/javadoc/net/jqwik/api/constraints/UseType.html) -- [UseTypeMode](/docs/1.2.7/javadoc/net/jqwik/api/constraints/UseTypeMode.html) -- [Arbitraries.forType()](/docs/1.2.7/javadoc/net/jqwik/api/Arbitraries.html#forType-java.lang.Class-) -- [TypeArbitrary](/docs/1.2.7/javadoc/net/jqwik/api/arbitraries/TypeArbitrary.html) +- [UseType](/docs/1.3.0/javadoc/net/jqwik/api/constraints/UseType.html) +- [UseTypeMode](/docs/1.3.0/javadoc/net/jqwik/api/constraints/UseTypeMode.html) +- [Arbitraries.forType()](/docs/1.3.0/javadoc/net/jqwik/api/Arbitraries.html#forType-java.lang.Class-) +- [TypeArbitrary](/docs/1.3.0/javadoc/net/jqwik/api/arbitraries/TypeArbitrary.html) + +## Generation of Edge Cases + +It's well-known that many programming bugs and specification gaps happen at the border +of allowed value ranges. For example, in the domain of integer numbers the minimum +(`Integer.MIN_VALUE`) and maximum (`Integer.MAX_VALUE`) belong in the set of those +[_edge cases_](https://en.wikipedia.org/wiki/Edge_case). Many people use the term a bit +more loosely and also include other special values that tend to have a higher chance +of revealing implementation problems, like `0` for numbers or an empty string. + +_jqwik_ has special treatment for edge cases. Most base type arbitraries come with +their set of edge cases. You can find out about edge cases by asking an arbitrary +about it. Run the following example + +```java +@Example +void printEdgeCases() { + System.out.println(Arbitraries.integers().edgeCases()); + System.out.println(Arbitraries.strings().withCharRange('a', 'z').edgeCases()); + System.out.println(Arbitraries.floats().list().edgeCases()); +} +``` + +and you will see this output: + +``` +EdgeCases[-2, -1, 0, 2, 1, -2147483648, 2147483647] +EdgeCases["a", "z", ""] +EdgeCases[[], [0.0], [1.0], [-1.0], [0.01], [-0.01], [-3.4028235E38], [3.4028235E38]] +``` + +You may notice that edge cases are not just hard-coded values but also make use +of underlying arbitraries' edge cases to arrive at new ones. +That's why a list of floats arbitrary has single element lists of floats as edge cases. +Edge cases are also being combined and permuted when +[`Combinators`](#combining-arbitraries) are used. +Also, most methods from `Arbitrary` - like `map()`, `filter()` and `flatMap()` - provide +sensible edge cases behaviour. +Thus, your self-made domain-specific arbitraries get edge cases automatically. + +_jqwik_ makes use of edge cases in two ways: + +1. Whenever an arbitrary is asked to produce a value it will mix-in edge cases + from time to time. +2. By default jqwik will mix the _combination of permutations of edge cases_ + of a property's parameters with purely randomized generation of parameters. + You can even try all edge case combinations first as the next property shows. + +```java +@Property(edgeCases = EdgeCasesMode.FIRST) +void combinedEdgeCasesOfTwoParameters( + @ForAll List intList, + @ForAll @IntRange(min = -100, max = 0) int anInt +) { + String parameters = String.format("%s, %s", intList, anInt); + System.out.println(parameters); +} +``` +Run it and have a look at the output. + +How jqwik handles edge cases generation can be controlled with +[an annotation property](#optional-property-parameters) and +[a configuration parameter](#jqwik-configuration). + + +### Tuning Edge Cases + +Currently there is only one way to change which edge cases a specific arbitrary generates: +You can switch them off with `Arbitrary.withoutEdgeCases()`. +It would be desirable, though, to optimize edge cases for your domain. +Stay tuned for enhancements! ## Exhaustive Generation @@ -3123,6 +3449,7 @@ This is exactly what _jqwik_ will do: all combinations will be generated. - You can also enforce an exhaustive or randomized generation mode by using the [Property.generation attribute](#optional-property-parameters). + The default generation mode can be set in the [configuration file](jqwik-configuration). - If _jqwik_ cannot figure out how to do exhaustive generation for one of the participating arbitraries it will switch to randomized generation if in auto mode or throw an exception if in exhaustive mode. @@ -3177,7 +3504,7 @@ void fizzBuzzWorks(@ForAll int index, @ForAll String result) { All you have to do is annotate the property method with `@FromData("dataProviderReference")`. The method you reference must be annotated with `@Data` and return an object of type `Iterable`. -The [`Table` class](/docs/1.2.7/javadoc/net/jqwik/api/Table.html) +The [`Table` class](/docs/1.3.0/javadoc/net/jqwik/api/Table.html) is just a convenient way to create such an object, but you can return any collection or create an implementation of your own. @@ -3236,21 +3563,6 @@ You can also determine the default behaviour of all properties by setting the `defaultAfterFailure` property in the [configuration file](jqwik-configuration) to one of those enum values. - -## Implement your own Arbitraries and Generators - -Looking at _jqwik_'s most prominent interfaces -- `Arbitrary` and `RandomGenerator` -- you might -think that rolling your own implementations can be a reasonable thing to do. -I'd like to tell you that it _never_ is but I've learned that "never" is a word you should never use. -There's just too many things to consider when implementing a new type of `Arbitrary` -to make it work smoothly with the rest of the framework. - -Therefore, use the innumerable features to combine existing arbitraries into your special one. -If you cannot figure out how to create an arbitrary with the desired behaviour -either [ask on stack overflow](https://stackoverflow.com/questions/tagged/jqwik) -or [open a Github issue](https://github.com/jlink/jqwik/issues). - - ## jqwik Configuration _jqwik_ will look for a file `jqwik.properties` in your classpath in which you can configure @@ -3267,8 +3579,512 @@ defaultAfterFailure = PREVIOUS_SEED # Set default behaviour for falsified proper reportOnlyFailures = false # Set to true if only falsified properties should be reported defaultGeneration = AUTO # Set default behaviour for generation: # AUTO, RANDOMIZED, or EXHAUSTIVE +defaultEdgeCases = MIXIN # Set default behaviour for edge cases generation: + # FIRST, MIXIN, or NONE ``` +## Advanced Topics + +### Implement your own Arbitraries and Generators + +Looking at _jqwik_'s most prominent interfaces -- `Arbitrary` and `RandomGenerator` -- you might +think that rolling your own implementations is a reasonable thing to do. +I'd like to tell you that it _never_ is, but I've learned that "never" is a word you should never use. +There's just too many things to consider when implementing a new type of `Arbitrary` +to make it work smoothly with the rest of the framework. + +Therefore, use the innumerable features to combine existing arbitraries into your special one. +If you cannot figure out how to create an arbitrary with the desired behaviour +either [ask on stack overflow](https://stackoverflow.com/questions/tagged/jqwik) +or [open a Github issue](https://github.com/jlink/jqwik/issues). + +### Lifecycle Hooks + +Similar to [Jupiter's Extension Model](https://junit.org/junit5/docs/current/user-guide/#extensions) +_jqwik_ provides a means to extend and change the way how properties and containers are being +configured, run and reported on. The API -- interfaces, classes and annotations -- for accessing +those _lifecycle hooks_ lives in the package `net.jqwik.api.lifecycle` and is -- as of this release -- +still in the [API evolution status](#api-evolution) `EXPERIMENTAL`: Some parts of it will probably +change without notice in later versions. + +#### Principles of Lifecycle Hooks + +There are a few fundamental principles that determine and constrain the lifecycle hook API: + +1. There are several [types of lifecycle hooks](#lifecycle-hook-types), + each of which is an interface that extends + [`net.jqwik.api.lifecycle.LifecycleHook`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/LifecycleHook.html). +2. A concrete lifecycle hook is an implementation of one or more lifecycle hook interfaces. +3. You can add a concrete lifecycle hook to a container class or a property method with the annotation + [`@AddLifecycleHook`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AddLifecycleHook.html). + By default, a lifecycle hook is only added to the annotated element, not to its children. + However, you can override this behaviour by either: + - Override `LifecycleHook.propagateTo()` + - Use the annotation attribute `@AddLifecycleHook.propagateTo()` +4. To add a global lifecycle use Java’s `java.util.ServiceLoader` mechanism and add the concrete lifecylcle hook + class to file `META-INF/services/net.jqwik.api.lifecycle.LifecycleHook`. + Do not forget to override `LifecycleHook.propagateTo()` if the global hook should be applied to all test elements. +5. In a single test run there will only be a single instance of each concrete lifecycle hook implementation. + That's why you have to use jqwik's [lifecycle storage](#lifecycle-storage) mechanism if shared state + across several calls to lifecycle methods is necessary. +6. Since all instances of lifecycle hooks are created before the whole test run is started, + you cannot use non-static inner classes of test containers to implement lifecycle interfaces. +7. If relevant, the order in which hook methods are being applied is determined by dedicated methods + in the hook interface, e.g. + [`BeforeContainerHook.beforeContainerProximity()`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/BeforeContainerHook.html#beforeContainerProximity--). + +Mind that much of what you can do with hooks can also be done using the simpler +mechanisms of [annotated lifecycle methods](#annotated-lifecycle-methods) or +a [property lifecycle class](#single-property-lifecycle). +You usually start to consider using lifecycle hooks when you want to +reuse generic behaviour in many places or even across projects. + + +#### Lifecycle Hook Types + +All lifecycle hook interfaces extend `net.jqwik.api.lifecycle.LifecycleHook` which +has two methods that may be overridden: + +- [`propagateTo()`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/LifecycleHook.html#propagateTo--): + Determine if and how a hook will be propagated to an element's children. + +- [`appliesTo(Optional)`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/LifecycleHook.html#appliesTo-java.util.Optional-): + Determine if a hook will be applied to a concrete element. For example, you might want to constrain a certain hook + to apply only to property methods and not to containers: + + ```java + @Override + public boolean appliesTo(final Optional element) { + return element + .map(annotatedElement -> annotatedElement instanceof Method) + .orElse(false); + } + ``` + +_jqwik_ currently supports eight types of lifecycle hooks: + +- [Lifecycle execution hooks](#lifecycle-execution-hooks): + - `SkipExecutionHook` + - `BeforeContainerHook` + - `AfterContainerHook` + - `AroundContainerHook` + - `AroundPropertyHook` + - `AroundTryHook` + +- [Other hooks](#other-hooks) + - `ResolveParameterHook` + - `RegistrarHook` + +#### Lifecycle Execution Hooks + +With these hooks you can determine if a test element will be run at all, +and what potential actions should be done before or after running it. + +##### SkipExecutionHook + +Implement [`SkipExecutionHook`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/SkipExecutionHook.html) +to filter out a test container or property method depending on some runtime condition. + +Given this hook implementation: + +```java +public class OnMacOnly implements SkipExecutionHook { + @Override + public SkipResult shouldBeSkipped(final LifecycleContext context) { + if (System.getProperty("os.name").equals("Mac OS X")) { + return SkipResult.doNotSkip(); + } + return SkipResult.skip("Only on Mac"); + } +} +``` + +The following property will only run on a Mac: + +```java +@Property +@AddLifecycleHook(OnMacOnly.class) +void macSpecificProperty(@ForAll int anInt) { +} +``` + +##### BeforeContainerHook + +Implement [`BeforeContainerHook`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/BeforeContainerHook.html) +for a hook that's supposed to do some work exactly once before any of its property methods and child containers +will be run. +This is typically used to set up a resource to share among all properties within this container. + +##### AfterContainerHook + +Implement [`AfterContainerHook`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AfterContainerHook.html) +for a hook that's supposed to do some work exactly once after all of its property methods and child containers +have been run. +This is typically used to tear down a resource that has been shared among all properties within this container. + +##### AroundContainerHook + +[`AroundContainerHook`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AroundContainerHook.html) +is a convenience interface to implement both [`BeforeContainerHook`](#beforecontainerhook) and +[`AfterContainerHook`](#aftercontainerhook) in one go. +This is typically used to set up and tear down a resource that is intended to be shared across all the container's children. + +Here's an example that shows how to start and stop an external server once for all +properties of a test container: + +```java +@AddLifecycleHook(ExternalServerResource.class) +class AroundContainerHookExamples { + @Example + void example1() { + System.out.println("Running example 1"); + } + @Example + void example2() { + System.out.println("Running example 2"); + } +} + +class ExternalServerResource implements AroundContainerHook { + @Override + public void beforeContainer(final ContainerLifecycleContext context) { + System.out.println("Starting server..."); + } + + @Override + public void afterContainer(final ContainerLifecycleContext context) { + System.out.println("Stopping server..."); + } +} +``` + +Running this example should output + +``` +Starting server... + +Running example 1 + +Running example 2 + +Stopping server... +``` + +If you wanted to do something before and/or after _the whole jqwik test run_, +using a container hook and registering it globally is probably the easiest way. + +##### AroundPropertyHook + +[`AroundPropertyHook`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AroundPropertyHook.html) +comes in handy if you need to define behaviour that should "wrap" the execution of a property, +i.e., do something directly before or after running a property - or both. +Since you have access to an object that describes the final result of a property +you can also change the result, e.g. make a failed property successful or vice versa. + +Here is a hook implementation that will measure the time spent on running a property +and publish the result using a [`Reporter`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/Reporter.html): + +```java +@Property(tries = 100) +@AddLifecycleHook(MeasureTime.class) +void measureTimeSpent(@ForAll Random random) throws InterruptedException { + Thread.sleep(random.nextInt(50)); +} + +class MeasureTime implements AroundPropertyHook { + @Override + public PropertyExecutionResult aroundProperty(PropertyLifecycleContext context, PropertyExecutor property) { + long before = System.currentTimeMillis(); + PropertyExecutionResult executionResult = property.execute(); + long after = System.currentTimeMillis(); + context.reporter().publish("time", String.format("%d ms", after - before)); + return executionResult; + } +} +``` + +The additional output from reporting is concise: + +``` +timestamp = ..., time = 2804 ms +``` + +##### AroundTryHook + +Wrapping the execution of a single try can be achieved by implementing +[`AroundTryHook`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/AroundTryHook.html). +This hook can be used for a lot of things. An incomplete list: + +- Closely watch each execution of a property method +- Reset a resource for each call +- Swallow certain exceptions +- Filter out tricky (and invalid) parameter constellations +- Let a try fail depending on external circumstances + +The following example shows how to fail if a single try will take longer than 100 ms: + +```java +@Property(tries = 10) +@AddLifecycleHook(FailIfTooSlow.class) +void sleepingProperty(@ForAll Random random) throws InterruptedException { + Thread.sleep(random.nextInt(101)); +} + +class FailIfTooSlow implements AroundTryHook { + @Override + public TryExecutionResult aroundTry( + final TryLifecycleContext context, + final TryExecutor aTry, + final List parameters + ) { + long before = System.currentTimeMillis(); + TryExecutionResult result = aTry.execute(parameters); + long after = System.currentTimeMillis(); + long time = after - before; + if (time >= 100) { + String message = String.format("%s was too slow: %s ms", context.label(), time); + return TryExecutionResult.falsified(new AssertionFailedError(message)); + } + return result; + } +} +``` + +Since the sleep time is chosen randomly the property will fail from time to time +with the following error: + +``` +org.opentest4j.AssertionFailedError: sleepingProperty was too slow: 100 ms +``` + +#### Other Hooks + +##### ResolveParameterHook + +Besides the well-known `@ForAll`-parameters, property methods and [annotated lifecycle methods](#annotated-lifecycle-methods) +can take other parameters as well. These can be injected by concrete implementations of +[`ResolveParameterHook`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/ResolveParameterHook.html). + +Consider this stateful `Calculator`: + +```java +public class Calculator { + private int result = 0; + + public int result() { + return result; + } + + public void plus(int addend) { + result += addend; + } +} +``` + +When going to check its behaviour with properties you'll need a fresh calculator instance +in each try. This can be achieved by adding a resolver hook that creates a freshly +instantiated calculator per try. + +```java +@AddLifecycleHook(CalculatorResolver.class) +class CalculatorProperties { + @Property + void addingANumberTwice(@ForAll int aNumber, Calculator calculator) { + calculator.plus(aNumber); + calculator.plus(aNumber); + Assertions.assertThat(calculator.result()).isEqualTo(aNumber * 2); + } +} + +class CalculatorResolver implements ResolveParameterHook { + @Override + public Optional resolve( + final ParameterResolutionContext parameterContext, + final LifecycleContext lifecycleContext + ) { + return Optional.of(optionalTry -> new Calculator()); + } + @Override + public PropagationMode propagateTo() { + // Allow annotation on container level + return PropagationMode.ALL_DESCENDANTS; + } +} +``` + +There are a few constraints regarding parameter resolution of which you should be aware: + +- Parameters annotated with `@ForAll` or with `@ForAll` present as a meta annotation + (see [Self-Made Annotations](#self-made-annotations)) cannot be resolved; + they are fully controlled by jqwik's arbitrary-based generation mechanism. +- If more than one applicable hook returns a non-empty instance of `Optional` + the property will throw an instance of `CannotResolveParameterException`. +- If you want to keep the same object around to inject it in more than a single method invocation, + e.g. for setting it up in a `@BeforeTry`-method, you are supposed to use jqwik's + [lifecycle storage mechanism](#lifecycle-storage). + + +##### RegistrarHook + +Use [`RegistrarHook`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/RegistrarHook.html) +if you need to apply several hook implementations that implement the desired behaviour together +but cannot be implemented in a single class. +For example, more than one implementation of the same hook type is needed, +but those implementations have a different proximity or require a different propagation mode. + +This is really advanced stuff, the mechanism of which will probably evolve or change in the future. +If you really really want to see an example, look at +[`JqwikSpringExtension`](#https://github.com/jlink/jqwik-spring/blob/master/src/main/java/net/jqwik/spring/JqwikSpringExtension.java) + +#### Lifecycle Storage + +As [described above](#principles-of-lifecycle-hooks) one of the fundamental principles +is that there will be only a single instance of any lifecycle hook implementation +during runtime. +Since -- depending on configuration and previous rung -- containers and properties are +not run in a strict sequential order this guarantee comes with a drawback: +You cannot use a hook instance's member variables to hold state that should be shared +across all tries of a property or across all properties of a container or across +different lifecycle phases of a single try. +That's when lifecycle storage management enters the stage in the form of type +[`net.jqwik.api.lifecycle.Store`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/Store.html). + +A `Store` object... + +- holds a single piece of shared state +- has a _globally unique identifier_ of your choice. + The identifier can be just a string or you compose whatever you deem necessary to make it unique. +- has a [`Lifespan`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/Lifespan.html). + The lifespan determines when the initializer of a store will be called: + - `Lifespan.RUN`: Only on first access + - `Lifespan.PROPERTY`: On first access of each single property method (or one of its lifecycle hook methods) + - `Lifespan.TRY`: On first access of each single try (or one of its lifecycle hook methods) + +You create a store like this: + +```java +Store myObjectStore = Store.create("myObjectStore", Lifespan.PROPERTY, () -> new MyObject()); +``` + +And you retrieve a store similarly: + +```java +Store myObjectStore = Store.get("myObjectStore"); +``` + +A store with the same identifier can only be created once, that's why there is also a convenience +method for creating or retrieving it: + +```java +Store myObjectStore = Store.getOrCreate("myObjectStore", Lifespan.PROPERTY, () -> new MyObject()); +``` + +You now have the choice to use or update the shared state: + +```java +Store myObjectStore = ...; + +myObjectStore.get().doSomethingWithMyObject(); +myObjectStore.update(old -> { + old.changeState(); + return old; +}); +``` + +Let's look at an example... + +##### TemporaryFileHook + +The following hook implementation gives you the capability to access _one_ (and only one) +temporary file per try using [parameter resolution](#resolveparameterhook): + +```java +class TemporaryFileHook implements ResolveParameterHook { + + public static final Tuple.Tuple2 STORE_IDENTIFIER = Tuple.of(TemporaryFileHook.class, "temporary files"); + + @Override + public Optional resolve(ParameterResolutionContext parameterContext, LifecycleContext lifecycleContext) { + if (parameterContext.typeUsage().isOfType(File.class)) { + return Optional.of(ignoreTry -> getTemporaryFileForTry()); + } + return Optional.empty(); + } + + private File getTemporaryFileForTry() { + Store tempFileStore = Store.getOrCreate(STORE_IDENTIFIER, Lifespan.TRY, this::createTempFile); + tempFileStore.onClose(file -> file.delete()); + return tempFileStore.get(); + } + + private File createTempFile() { + try { + return File.createTempFile("temp", ".txt"); + } catch (IOException e) { + throw new RuntimeException(e); + } + } +} +``` + +There are a few interesting things going on: + +- The identifier is a tuple of the `TemporaryFileHook.class` object and a string. + This makes sure that no other hook will use the same identifier accidentally. +- The temporary file is created only once per try. + That means that all parameters in the scope of this try will contain _the same file_. +- A callback is added through + [`onClose(..)`](/docs/1.3.0/javadoc/net/jqwik/api/lifecycle/Store.html#onClose-java.util.function.Consumer-) + which takes care of deleting the file as soon as the lifespan's scope (the try) is finished. + +With this information you can probably figure out how the following test container works -- +especially why the assertion in `@AfterTry`-method `assertFileNotEmpty()` succeeds. + +```java +@AddLifecycleHook(value = TemporaryFileHook.class, propagateTo = PropagationMode.ALL_DESCENDANTS) +class TemporaryFilesExample { + @Property(tries = 10) + void canWriteToFile(File anyFile, @ForAll @AlphaChars @StringLength(min = 1) String fileContents) throws Exception { + assertThat(anyFile).isEmpty(); + writeToFile(anyFile, fileContents); + assertThat(anyFile).isNotEmpty(); + } + + @AfterTry + void assertFileNotEmpty(File anyFile) { + assertThat(anyFile).isNotEmpty(); + } + + private void writeToFile(File anyFile, String contents) throws IOException { + BufferedWriter writer = new BufferedWriter(new FileWriter(anyFile)); + writer.write(contents); + writer.close(); + } +} +``` + +## API Evolution + +In agreement with the JUnit 5 platform _jqwik_ uses the +[@API Guardian project](https://github.com/apiguardian-team/apiguardian) +to communicate version and status of all parts of its API. +The different types of status are: + +-`STABLE`: Intended for features that will not be changed in a backwards-incompatible way in the current major version (1.*). + +-`MAINTAINED`: Intended for features that will not be changed in a backwards-incompatible way for at least the current minor release of the current major version. If scheduled for removal, it will be demoted to `DEPRECATED` first. + +-`EXPERIMENTAL`: Intended for new, experimental features where we are looking for feedback. Use this element with caution; it might be promoted to `MAINTAINED` or `STABLE` in the future, but might also be removed without prior notice, even in a patch. + +-`DEPRECATED`: Should no longer be used; might disappear in the next minor release. + +-`INTERNAL`: Must not be used by any code other than _jqwik_ itself. Might be removed without prior notice. + +Since annotation `@API` has runtime retention you find the actual API status in an element's source code, +its [Javadoc](/docs/1.3.0/javadoc) but also through reflection. +If a certain element, e.g. a method, is not annotated itself, then it carries the status of its containing class. + + ## Release Notes -Read this version's [release notes](/release-notes.html#127). +Read this version's [release notes](/release-notes.html#130). diff --git a/docs/release-notes.md b/docs/release-notes.md index a4790e532..f2e58928a 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -9,7 +9,7 @@ title: jqwik Release Notes ### Table of Contents -- [1.3.0-SNAPSHOT](#130-snapshot) +- [1.3.0](#130) - [1.2.x](#12x) - [1.1.x](#11x) - [1.0.0](#100) @@ -18,27 +18,27 @@ title: jqwik Release Notes -## 1.3.0-SNAPSHOT +## 1.3.0

-User guide +User guide and -javadoc +javadoc

#### New and Enhanced Features -- Added user-guide documentation for [Lifecycle Hooks](/docs/snapshot/user-guide.html#lifecycle-hooks) +- Added user-guide documentation for [Lifecycle Hooks](/docs/1.3.0/user-guide.html#lifecycle-hooks) - Added new statistics report formats: - [Histogram and NumberRangeHistogram](/docs/snapshot/user-guide.html#histograms) + [Histogram and NumberRangeHistogram](/docs/1.3.0/user-guide.html#histograms) - Improved shrinking of dependent parameters. - Added `Arbitraries.ofSuppliers(..)` to choose among a set of mutable objects. - You can now influence the - [distribution of random number generation](/docs/snapshot/user-guide.html#random-numeric-distribution): + [distribution of random number generation](/docs/1.3.0/user-guide.html#random-numeric-distribution): All numeric arbitraries now support `withDistribution(RandomDistribution)` to choose between `RandomDistribution.biased()` (default), `RandomDistribution.uniform()` and `RandomDistribution.gaussian(borderSigma)`. @@ -49,7 +49,7 @@ and - Using a faster implementation of `java.util.Random` under the hood - Massively improved and enhanced - [generation of edge cases](/docs/snapshot/user-guide.html#generation-of-edge-cases) + [generation of edge cases](/docs/1.3.0/user-guide.html#generation-of-edge-cases) - Edge Cases Mode is now being reported per property diff --git a/documentation/src/docs/user-guide.template.md b/documentation/src/docs/user-guide.template.md index a89220d92..b110e8158 100644 --- a/documentation/src/docs/user-guide.template.md +++ b/documentation/src/docs/user-guide.template.md @@ -3960,7 +3960,7 @@ The different types of status are: -`INTERNAL`: Must not be used by any code other than _jqwik_ itself. Might be removed without prior notice. -Since annotation `@API` has runtime retention you find the actual API status in an elements source code, +Since annotation `@API` has runtime retention you find the actual API status in an element's source code, its [Javadoc](/docs/${docsVersion}/javadoc) but also through reflection. If a certain element, e.g. a method, is not annotated itself, then it carries the status of its containing class.