Release Notes
Table of Contents
1.2.2-SNAPSHOT
New and Enhanced Features
-
When configuration parameter
database
is set to empty, test run recording is now completely disabled. -
Exhaustive generation of single decimals and floats
Breaking Changes
Bug Fixes
1.2.1
User guide and javadoc
New and Enhanced Features
- New configuration parameter
defaultGeneration
forjqwik.properties
file - Added
CharacterArbitrary.with(CharSequence allowedChars)
- Added
StringArbitrary.withChars(CharSequence allowedChars)
- Arbitraries of List, Set, Stream und arrays are now of type
StreamableArray
- Introduced
StreamableArray.reduce()
HashMap
can now be generated by default
Breaking Changes
-
Arbitrary.exhaustive()
must no longer be overridden in implementors of Arbitrary. OverrideArbitrary.exhaustive(long maxNumberOfGeneratedSamples)
instead. -
TypeUsage.getTypeArguments()
: In case of type variables or wildcard types this method will now return the upper bound’s type arguments if there is a single upper bound and no lower bound. This enables correct generation of variables likeT extends Map<Integer, String>
.
Bug Fixes
-
@ForAll
annotation could not be replaced by self-made annotation. Now it can. -
Annotations in type parameters of bounds of type variables are now correctly recognized.
-
Annotations in type parameters of bounds of wildcards are now correctly recognized.
1.2.0
User guide and javadoc
New and Enhanced Features
- Introduced Labeled Statistics
- Added
Arbitraries.entries()
- Added default generation for
Map.Entry
instances - Enhanced statistics reporting by absolute count
- jqwik can now generate instances of functions and other functional types
- Provider methods do now accept two optional parameters
- New
@From
annotation to provide arbitraries for embedded type parameters
Breaking Changes
- Removed
CharacterArbitrary.between(min, max)
which had been deprecated in 1.1.3
API Promotions
-
Promoted from
API.Status.EXPERIMENTAL
toAPI.Status.MAINTAINED
:Arbitraries.forType(Class<T> targetType)
and interfaceTypeArbitrary
- Annotation
@UseType
and enumUseTypeMode
Arbitrary.fixGenSize(int genSize)
Combinators.withBuilder(Supplier<B> builderSupplier)
andCombinators.withBuilder(Arbitrary<B> builderArbitrary)
- Annotation
@Domain
and interfaceDomainContext
Dependency Upgrades and Bug Fixes
- Upgrade to JUnit platform 1.5.1
- Upgrade to Gradle 5.5.1
- Default character generation now excludes codepoints
0xd800
through0xdfff
- Fixed set generation bug https://github.com/jlink/jqwik/issues/65
- Fixed bug in Unshrinkable.equals. Many thanks to mhyeon-lee for that pull request!
- List and array generation from unique arbitraries now have a default max size that makes sense
1.1.x
1.1.6
User guide and javadoc
- Removed dependencies to internal classes in JUnit platform
- Added
Arbitraries.maps()
- Added default generation for
Map
instances @Domain
annotation can now also refer to inner class of test container’s base class. Many thanks to larsrh for that pull request!
1.1.5
User guide and javadoc
- Added
shrinkTowards(value)
to all decimal number arbitraries: FloatArbitrary, DoubleArbitrary, BigDecimalArbitrary - Exceptions during test class instance creation are now reported as failures
- Removed caching of engine descriptor in JqwikTestEngine
1.1.4
User guide and javadoc
- Upgrade to junit-platform 1.4.2
- Added
Arbitrary.collect(Predicate<List<T>> until)
in order to collect values in a list - Added
shrinkTowards(value)
to all integral number arbitraries: ByteArbitrary, ShortArbitrary, IntegerArbitrary, LongArbitrary, BigIntegerArbitrary in order to change the shrinking target - Upgrade Gradle to 5.4.2
- Improved shrinking of collections
1.1.3
User guide and javadoc
- Whitespace characters for generation of Strings and chars are now platform and JDK version dependent. See this Github issue.
- Missing
@ForAll
annotation will now fail test - instead of skipping it. See this Github issue. - Added
CharacterArbitrary.with(char ... allowedChars)
- Added
CharacterArbitrary.range(char min, char max)
- Deprecated
CharacterArbitrary.between(char min, char max)
1.1.2
User guide and javadoc
- Added
Arbitrary.forEachValue(Consumer action)
- Fixed Kotlin compatibility issue
- Fixed decimal generation bug
- Update to JUnit Platform 5.4.1
1.1.1
User guide and javadoc
-
Added
Combinators.withBuilder
to enable a different way for combining arbitraries. -
You can configure if you want to report only failures.
-
The reporting format for run properties has changed.
-
Added
@Domain.priority()
to enable prioritisation of domain context classes. -
Added
Arbitraries.create
. -
Fixed problem with double and float conversion in range constraints. My thanks go to blairdye for that!
-
Annotation
@Provide
can now be placed on a “super method” i.e. a method from a superclass or super interface that is overridden. -
Annotation
@Provide
can now be placed on another annotation for composite annotations. -
Loosened matching of return type of
@Provide
to enable generic provider method’s in derived container classes.
1.1.0
User guide and javadoc
-
Added capability to collect arbitrary providers and configurators in domains
-
Added
Arbitraries.defaultFor(TypeUsage typeUsage)
-
Added capability to generate objects from their type’s constructors and factories
-
Breaking Change: Best fit search for provider methods is no longer supported. Reason: Using
@Domain
requires less magic and is a better abstraction for automatic arbitrary provision. -
Update to JUnit Platform 5.4
1.0.0
User guide and javadoc
- Removed all deprecated APIs
- Annotation attribute
net.jqwik.api.Property.reporting()
- Class
net.jqwik.api.Tuples
- Method
net.jqwik.api.providers.TypeUsage.getAnnotation()
- Annotation attribute
-
jqwik now produces three artefacts: jqwik-api, jqwik-engine, jqwik
-
Filled in some missing parts in API Javadoc
-
Introduced
Arbitrary.allValues()
-
Adding annotations from JUnit Jupiter or Vintage engine will lead to warnings being logged
-
Range annotations (
IntRange
etc.) don’t needmax
attribute any more -
@Positive
and@Negative
constraints no longer include 0 as possible value -
Added
@org.apiguardian.api.API
annotation to all types innet.jqwik.api.**
- Added annotation
@Disabled
as a means to temporarily skip test methods or test containers
0.9.x
0.9.3
User guide and javadoc
- The probability of edge cases being generated is now higher
- New constraint annotation
@NotEmpty
- Arrays and varargs parameters hand configuration annotations down to their component type arbitrary
- Properties with unconstrained wildcards will now use any registered arbitrary for value generation
- Added
Arbitraries.frequencyOf()
- Added
Arbitraries.recursive()
- Integral number generation generates a few more edge cases
- You can use
@Size
to constrain the generation ofActionSequence
parameters - Some incompatible changes to the
ActionSequence
interface - jqwik.jar does no longer deliver a jqwik.properties file in its classpath
- jqwik logs WARNING if unsupported property is used in
jqwik.properties
file - Replaced configuration file property
rerunFailuresWithSameSeed
by `defaultAfterFailure’ - Introduced
@Property(afterFailure)
ArbitraryConfiguratorBase
has new methodacceptType(TypeUsage)
, which can be overridden.- Added two new after-failure-modes:
SAMPLE_ONLY
andSAMPLE_FIRST
- Action sequences for state-based properties are serializable now
in order to enable
SAMPLE_ONLY
andSAMPLE_FIRST
0.9.2
- Exhaustive generation works for ambiguous arbitrary resolution if each arbitrary can be generated exhaustively
- Fixed bug related to correct throwable propagation when shrinking
- Erroneous properties will also be shrunk now
0.9.1
- Container shrinking tries one more thing to get smaller results
- Removed
RandomGenerator.reset()
since it’s no longer needed for uniqueness behaviourThis is an incompatible API change!
Arbitrary.unique()
does no longer propagate uniqueness across usages of same arbitrary.- Implemented exhaustive generation for
Arbitrary.unique()
- Fixed bug when resolving recursive types
- Added
Arbitraries.shuffle()
as a way to generate permutations - Implemented exhaustive generation for
Arbitraries.frequency()
- Changed display name of test engine to “jqwik for Java”
- Per default jqwik no longer uses the JUnit platform reporter for reporting because Gradle does not support it yet
- Using JUnit platform reporter can now be configured
@Size
: min and max values can be used without the other@StringLength
: min and max values can be used without the other- Implemented exhaustive generation for
Arbitrary.flatMap()
- Implemented exhaustive generation for
Arbitraries.oneOf()
- Implemented exhaustive generation for
Arbitraries.strings()
- Support default generation of Iterables and Iterators
0.9.0
- Removed deprecated static methods in
Arbitraries
- Removed deprecated method
ArbitraryProvider.provideFor(TypeUsage targetType, Function<TypeUsage, Optional<Arbitrary<?>>> subtypeProvider)
- Removed default implementation of
ArbitraryProvider.provideFor(TypeUsage targetType, SubtypeProvider subtypeProvider)
- Removed deprecated annotation
@Digits
- Renamed
TypeUsage.getAnnotation(Class annotationClass)
tofindAnnotation
- Added
TypeUsage.isAnnotated(Class annotationClass)
- Added
Arbitrary.unique()
- Added constraint
@Unique
- Implementations of
ArbitraryConfigurator
can optionally implementint order()
- It’s now possible to “flat combine” arbitraries
- Deprecated all types and methods in
net.jqwik.api.Tuples.*
in favour ofnet.jqwik.api.Tuple.*
- There are new tuple types
Tuple5
up toTuple8
- Data-Driven Properties: Feed data into your properties instead of randomized generation
- Display names of test containers and properties will now automatically be prettified, i.e. each underscore will be replaced by a single space.
- Added
@Report
annotation to replaceProperty.reporting
- Added exhaustive value generation
0.8.x
0.8.15
StringArbitrary.withChars()
now accepts varargs.- Added
StringArbitrary.whitespace()
- Added
@Whitespace
annotation - Improved shrinking of action sequences
- Default String generation does no longer generate Unicode “noncharacters” or “private use characters”
- Added
StringArbitrary.all()
for also generating Unicode “noncharacters” and “private use characters”
0.8.14
- Some potentially incompatible stuff has changed for
default arbitrary providers:
- Introduced
ArbitraryProvider.priority()
- The old
ArbitraryProvider.provideFor(TypeUsage, Function)
is now deprecated, overrideArbitraryProvider.provideFor(TypeUsage, SubtypeProvider)
instead - If more than one provider fits a given type, one of the will be chosen randomly
- Introduced
Arbitraries.defaultFor()
will randomly choose one arbitrary if there is more than one fitting registered arbitrary provider
0.8.13
Faulty release. Do not use!
0.8.12
- Implemented generic type resolution to enable contract tests
- Renamed
GenericType
toTypeUsage
This is an incompatible API change!
0.8.11
- Reporting with
Reporting.FALSIFIED
now reports much less, and hopefully no wrong values anymore. - Shrinking with filtered values finds simpler values in some circumstance
- Generation of strings will allow any unicode character by default
Combinators.combine()
can now take a list of arbitraries of same return type.- Generated edge cases are now injected again and again and not only in the beginning.
- Complete re-implementation of shrinking with a few implications:
- Shrinking should work better and more efficient overall. There might be situations, though, in which shrinking does no longer find the simplest example.
ShrinkingMode.BOUNDED
might interrupt shrinking with completely different results.- When using
Reporting.FALSIFIED
you will see different inbetween shrinking steps that before. - The public interface of
Shrinkable
has changed in an incompatible way, but that shouldn’t affect anyone but myself.
0.8.10
- Fixed shrinking bug that could result in integers not being shrunk as far as possible
- Integer shrinking should be faster in most cases and cover more cases
0.8.9
- Some minor but potentially incompatible API changes in
GenericType
. - Tags from parent (e.g. container class) are now also present in children (methods)
- Renamed
ShrinkingMode.ON
toShrinkingMode.FULL
This is an incompatible API change!
- Introduced
ShrinkingMode.BOUNDED
and made it the default - Introduced
ShrinkingMode.FULL
- Some bounded wildcard types and type variables can be provided automatically
0.8.8
- Added
Arbitraries.lazy()
to allow recursive value generation - Added
Arbitrary.fixGenSize()
to enable a fixed genSize when creating random generators - Added
Arbitrary.sequences()
to create sequences of actions for stateful testing
0.8.7
- Property methods that also have Jupiter annotations are skipped
- Added
@Label
to allow the labeling of examples, properties and containers - Changed license from EPL 1.0 to EPL 2.0
- Added
@Tag
to allow the tagging of examples, properties and containers - User guide: Added links to example sources on github
- Added
Arbitraries.frequency()
to enable choosing values with weighted probabilities - Collection and String generation now explores a wider range of sizes and lengths
0.8.6
- BigInteger generation does no longer support
@LongRange
but only@BigRange
This is an incompatible API change!
- BigDecimal generation does no longer support
@DoubleRange
but only@BigRange
This is an incompatible API change!
- BigInteger generation now supports numbers outside long range
- Property.seed is now of type String
This is an incompatible API change!
- Property methods without @ForAll parameters are now also tried as many times as
specified by
tries
parameter. - Added new method
Arbitraries.constant()
- Added new method
Arbitraries.defaultFor()
@WithNull.target()
has been removedThis is an incompatible API change!
- Parameterized types can now be annotated directly
- Added
@Size.value()
for fixed size collections - Added
@StringLength.value()
for fixed size Strings
0.8.5
- All decimal generation (float, double, BigDecimal) now uses BigDecimal under the hood
- All integral generation (int, short, byte, long, BigInteger) now uses BigInteger under the hood
- Numbers are now generated within their full domain (min, max)
- Decimal shrinking improved
- Fixed bug: Reporting.FALSIFIED now also works for falsification through exception
- Added support for running all tests in a module (Java 9 only). I HAVE NOT TESTED IT!
0.8.4
- Completely rebuild the annotation-based configuration of registered arbitrary providers
- Introduced fluent configuration interfaces
- Introduced Arbitrary.list/set/stream/optional/array
- Combinators.combine() now allows up to 8 parameters
- Character creation does no longer support
@Chars
but only@CharRange
This is an incompatible API change!
- ‘Arbitraries.chars(char[] validChars)’ does no longer exist
This is an incompatible API change!
- Added
Arbitraries.oneOf
@Char
cannot takefrom
andto
any longer. Replaced by@CharRange
- Deprecated many methods in
Arbitraries
class. Replaced by fluent interface methods. - Deprecated
@Digits
constraint. Replaced by@NumericChars
. - Upgrade to JUnit 5.1.0
0.8.3
- Bugfix: Injected empty list samples are now mutable
- Bugfix: Injected empty set samples are now mutable
- Unbound type variables in properties can now be provided
0.8.2
- Added support for
java.util.Random
generation. - Added Tuple types
(
Tuple2
,Tuple3
,Tuple4
) to use inArbitrary.flatMap()
. - Renamed
ReportingMode
toReporting
and removedReporting.MINIMAL
.This is an incompatible API change!
- Added
Reporting.FALSIFIED
. See section on optional property parameters
0.8.1
- Added support for default arbitrary providers.
- Added support for
byte
andByte
generation. - Added support for
short
andShort
generation.
0.8.0
The first release published on maven central.