net.jqwik.engine.properties.stateful.ActionSequenceGenerator Maven / Gradle / Ivy
package net.jqwik.engine.properties.stateful;
import java.util.*;
import net.jqwik.api.*;
import net.jqwik.api.stateful.*;
class ActionSequenceGenerator implements RandomGenerator> {
private final int genSize;
private final int maxSize;
private final Arbitrary> actionArbitrary;
ActionSequenceGenerator(Arbitrary> actionArbitrary, int genSize, int maxSize) {
this.actionArbitrary = actionArbitrary;
this.genSize = genSize;
this.maxSize = maxSize;
}
@Override
public Shrinkable> next(Random random) {
ActionGenerator actionGenerator = new RandomActionGenerator<>(actionArbitrary, genSize, random);
return new ShrinkableActionSequence<>(actionGenerator, maxSize, ShrinkingDistance.of(maxSize));
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy