-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Core] Read rerun files from directories (#2710)
Fixes: #2708 Co-authored-by: M.P. Korstanje <[email protected]>
- Loading branch information
1 parent
5f929d3
commit 654cafc
Showing
15 changed files
with
246 additions
and
131 deletions.
There are no files selected for viewing
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
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
62 changes: 62 additions & 0 deletions
62
cucumber-core/src/main/java/io/cucumber/core/options/FeatureWithLinesOrRerunPath.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,62 @@ | ||
package io.cucumber.core.options; | ||
|
||
import io.cucumber.core.feature.FeatureWithLines; | ||
|
||
import java.nio.file.Path; | ||
import java.nio.file.Paths; | ||
import java.util.Collection; | ||
import java.util.Optional; | ||
|
||
/** | ||
* Identifies either: | ||
* <li> | ||
* <ul> | ||
* a single rerun file, | ||
* </ul> | ||
* <ul> | ||
* a directory of containing exclusively rerun files, | ||
* </ul> | ||
* <ul> | ||
* a directory containing feature files, | ||
* </ul> | ||
* <ul> | ||
* a specific feature, | ||
* </ul> | ||
* <ul> | ||
* or specific scenarios and examples (pickles) in a feature | ||
* </ul> | ||
* </li> | ||
* <p> | ||
* The syntax is either a {@link FeatureWithLines} or an {@code @} followed by a | ||
* {@link RerunPath}. | ||
*/ | ||
class FeatureWithLinesOrRerunPath { | ||
|
||
private final FeatureWithLines featureWithLines; | ||
private final Collection<FeatureWithLines> featuresWithLinesToRerun; | ||
|
||
FeatureWithLinesOrRerunPath( | ||
FeatureWithLines featureWithLines, Collection<FeatureWithLines> featuresWithLinesToRerun | ||
) { | ||
this.featureWithLines = featureWithLines; | ||
this.featuresWithLinesToRerun = featuresWithLinesToRerun; | ||
} | ||
|
||
static FeatureWithLinesOrRerunPath parse(String arg) { | ||
if (arg.startsWith("@")) { | ||
Path rerunFileOrDirectory = Paths.get(arg.substring(1)); | ||
return new FeatureWithLinesOrRerunPath(null, RerunPath.parse(rerunFileOrDirectory)); | ||
} else { | ||
return new FeatureWithLinesOrRerunPath(FeatureWithLines.parse(arg), null); | ||
} | ||
} | ||
|
||
Optional<Collection<FeatureWithLines>> getFeaturesToRerun() { | ||
return Optional.ofNullable(featuresWithLinesToRerun); | ||
} | ||
|
||
Optional<FeatureWithLines> getFeatureWithLines() { | ||
return Optional.ofNullable(featureWithLines); | ||
} | ||
|
||
} |
39 changes: 0 additions & 39 deletions
39
cucumber-core/src/main/java/io/cucumber/core/options/OptionsFileParser.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.