mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
jetCheck: update doc, make API more permissive
This commit is contained in:
@@ -101,7 +101,7 @@ public interface ImperativeCommand {
|
||||
* @param command a supplier for a top-level command. This supplier should not have any side effects.
|
||||
* @see #checkScenarios
|
||||
*/
|
||||
static Generator<Scenario> scenarios(@NotNull Supplier<ImperativeCommand> command) {
|
||||
static Generator<Scenario> scenarios(@NotNull Supplier<? extends ImperativeCommand> command) {
|
||||
return Generator.from(data -> new ScenarioImpl(command.get(), data));
|
||||
}
|
||||
|
||||
@@ -109,16 +109,19 @@ public interface ImperativeCommand {
|
||||
* Performs a check that the scenarios generated by the given command are successful. Default {@link PropertyChecker} settings are used.
|
||||
* @param command a supplier for a top-level command. This supplier should not have any side effects.
|
||||
*/
|
||||
static void checkScenarios(@NotNull Supplier<ImperativeCommand> command) {
|
||||
static void checkScenarios(@NotNull Supplier<? extends ImperativeCommand> command) {
|
||||
PropertyChecker.forAll(scenarios(command)).shouldHold(Scenario::ensureSuccessful);
|
||||
}
|
||||
|
||||
/**
|
||||
* An analog of {@link PropertyChecker#recheckingIteration} in the imperative command world.
|
||||
* Performs a check that the scenario generated by the given command with given seed/sizeHint parameter is successful.
|
||||
* Performs a check that the scenario generated by the given command is successful with given data (as serialized and printed by {@link PropertyFalsified} exception).
|
||||
* @param command a supplier for a top-level command. This supplier should not have any side effects.
|
||||
* @deprecated To catch your attention. It's fine to call this method during test debugging, but it should not be committed to version control
|
||||
* and used in regression tests, because any changes in the test itself or the framework can render the passed data obsolete.
|
||||
* For regression testing, it's recommended to code the failing scenario explicitly.
|
||||
*/
|
||||
static void checkScenario(@NotNull String serializedData, @NotNull Supplier<ImperativeCommand> command) {
|
||||
static void checkScenario(@NotNull String serializedData, @NotNull Supplier<? extends ImperativeCommand> command) {
|
||||
//noinspection deprecation
|
||||
PropertyChecker.forAll(scenarios(command)).rechecking(serializedData).shouldHold(Scenario::ensureSuccessful);
|
||||
}
|
||||
|
||||
@@ -83,6 +83,7 @@ public class StatefulGeneratorTest extends PropertyCheckerTestCase {
|
||||
|
||||
PropertyFailure<?> failure = e.getFailure();
|
||||
try {
|
||||
//noinspection deprecation
|
||||
ImperativeCommand.checkScenario(failure.getMinimalCounterexample().getSerializedData(), command);
|
||||
fail();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user