-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fine grain test inclusion/exclusion (#104)
- Adds new always aborting evaluator - Adds override keyword to all evaluators (to allow naming and referencing evaluators) - Adds additional properties to allow evaluator based abortion or suppression - Adds override keyword to the Flight Evaluation Report - Adds new properties to the Readme Resolves #102 {minor} Signed-off-by: Esta Nagy <[email protected]>
- Loading branch information
Showing
21 changed files
with
888 additions
and
33 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
64 changes: 64 additions & 0 deletions
64
...agyesta/abortmission/core/healthcheck/impl/AlwaysAbortingMissionHealthCheckEvaluator.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,64 @@ | ||
package com.github.nagyesta.abortmission.core.healthcheck.impl; | ||
|
||
import com.github.nagyesta.abortmission.core.matcher.MissionHealthCheckMatcher; | ||
|
||
import java.util.Objects; | ||
|
||
/** | ||
* {@link com.github.nagyesta.abortmission.core.healthcheck.MissionHealthCheckEvaluator} implementation intended to always abort. | ||
*/ | ||
@SuppressWarnings("checkstyle:FinalClass") | ||
public class AlwaysAbortingMissionHealthCheckEvaluator extends AbstractMissionHealthCheckEvaluator { | ||
|
||
private AlwaysAbortingMissionHealthCheckEvaluator(final Builder builder) { | ||
super(Objects.requireNonNull(builder, "Builder cannot be null.").matcher, | ||
builder.statisticsCollector, builder.overrideKeyword); | ||
} | ||
|
||
public static Builder builder(final MissionHealthCheckMatcher matcher, | ||
final MissionStatisticsCollector statisticsCollector) { | ||
return new Builder(matcher, statisticsCollector); | ||
} | ||
|
||
@Override | ||
public int getBurnInTestCount() { | ||
return Integer.MAX_VALUE; | ||
} | ||
|
||
@Override | ||
protected boolean shouldAbortInternal() { | ||
return true; | ||
} | ||
|
||
@Override | ||
protected boolean shouldAbortCountdownInternal() { | ||
return true; | ||
} | ||
|
||
@SuppressWarnings({"checkstyle:HiddenField", "checkstyle:DesignForExtension"}) | ||
public static final class Builder { | ||
private final MissionHealthCheckMatcher matcher; | ||
private final MissionStatisticsCollector statisticsCollector; | ||
private String overrideKeyword; | ||
|
||
private Builder(final MissionHealthCheckMatcher matcher, | ||
final MissionStatisticsCollector statisticsCollector) { | ||
this.matcher = Objects.requireNonNull(matcher, "Matcher cannot be null."); | ||
this.statisticsCollector = Objects.requireNonNull(statisticsCollector, "Statistic collector cannot be null."); | ||
} | ||
|
||
public Builder overrideKeyword(final String overrideKeyword) { | ||
if (overrideKeyword == null || overrideKeyword.isBlank()) { | ||
throw new IllegalArgumentException("Override keyword must br non-blank."); | ||
} else if (!overrideKeyword.matches("[\\da-zA-Z\\-]+")) { | ||
throw new IllegalArgumentException("Override keyword must contain only alpha-numeric characters and dash (a-zA-Z0-9\\-)."); | ||
} | ||
this.overrideKeyword = overrideKeyword; | ||
return this; | ||
} | ||
|
||
public AlwaysAbortingMissionHealthCheckEvaluator build() { | ||
return new AlwaysAbortingMissionHealthCheckEvaluator(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
Oops, something went wrong.