All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.jqwik.engine.properties.stateful.ActionSequenceGenerator Maven / Gradle / Ivy

There is a newer version: 1.9.1
Show newest version
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