diff options
author | Carlo Zancanaro <carlo@zancanaro.id.au> | 2015-06-05 14:51:03 +1000 |
---|---|---|
committer | Carlo Zancanaro <carlo@zancanaro.id.au> | 2015-06-05 14:51:03 +1000 |
commit | 20b1226b4eb10e85497862bd73fe9e9a2f05191d (patch) | |
tree | cfc2cf01032515af4adba2a659f3da9734f5bb48 /src/main/java/au/id/zancanaro/javacheck/statem/Command.java | |
parent | 821f5a2c711d748a95d8f5d54266069c5378b556 (diff) |
First cut of a stateful testing framework (it's pretty hacky at the moment, but all the pieces are there)
Diffstat (limited to 'src/main/java/au/id/zancanaro/javacheck/statem/Command.java')
-rw-r--r-- | src/main/java/au/id/zancanaro/javacheck/statem/Command.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/main/java/au/id/zancanaro/javacheck/statem/Command.java b/src/main/java/au/id/zancanaro/javacheck/statem/Command.java new file mode 100644 index 0000000..a741f0a --- /dev/null +++ b/src/main/java/au/id/zancanaro/javacheck/statem/Command.java @@ -0,0 +1,23 @@ +package au.id.zancanaro.javacheck.statem; + +import au.id.zancanaro.javacheck.Generator; + +public abstract class Command<State,Args,Result> { + public Generator<Args> argsGenerator(State state) { + return Generator.pure(null); + } + + public boolean preCondition(State state, Args args) { + return true; + } + + public abstract Result runCommand(Args args); + + public State nextState(State state, Args args, CommandValue<Result> result) { + return state; + } + + public boolean postCondition(State oldState, State newState, Args args, Result result) { + return true; + } +} |