Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Core] Separate dry-run and skip execution strategies
- Loading branch information
1 parent
5a1794c
commit b855ba9
Showing
9 changed files
with
143 additions
and
72 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
core/src/main/java/io/cucumber/core/runner/ExecutionMode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package io.cucumber.core.runner; | ||
|
||
import io.cucumber.plugin.event.Status; | ||
|
||
enum ExecutionMode { | ||
|
||
RUN { | ||
@Override | ||
Status execute(StepDefinitionMatch stepDefinitionMatch, TestCaseState state) throws Throwable { | ||
stepDefinitionMatch.runStep(state); | ||
return Status.PASSED; | ||
} | ||
|
||
}, | ||
DRY_RUN { | ||
@Override | ||
Status execute(StepDefinitionMatch stepDefinitionMatch, TestCaseState state) throws Throwable { | ||
stepDefinitionMatch.dryRunStep(state); | ||
return Status.PASSED; | ||
} | ||
}, | ||
SKIP { | ||
@Override | ||
Status execute(StepDefinitionMatch stepDefinitionMatch, TestCaseState state) { | ||
return Status.SKIPPED; | ||
} | ||
}; | ||
|
||
abstract Status execute(StepDefinitionMatch stepDefinitionMatch, TestCaseState state) throws Throwable; | ||
|
||
ExecutionMode next(ExecutionMode current) { | ||
return current == SKIP ? current : this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.