Skip to content

Commit

Permalink
Rename FailedCriterion message field to description
Browse files Browse the repository at this point in the history
Signed-off-by: lisrte <[email protected]>
  • Loading branch information
Lisrte committed Dec 12, 2024
1 parent 5e80c5f commit ce808c6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

/**
* scenarioResults or loadIncreaseResults failed criterion
* @param message Failed criterion message
* @param description Failed criterion description
* @param time Failure time (in seconds)
* @author Laurent Issertial {@literal <laurent.issertial at rte-france.com>}
*/
public record FailedCriterion(String message, double time) {
public record FailedCriterion(String description, double time) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ static Optional<ScenarioResult> createScenarioResult(String id, String status, L
return Optional.empty();
}

static Optional<FailedCriterion> createFailedCriterion(String message, String time) {
if (message == null || time == null) {
LOGGER.warn("Inconsistent failed criterion entry (message: '{}', time: '{}')", message, time);
static Optional<FailedCriterion> createFailedCriterion(String description, String time) {
if (description == null || time == null) {
LOGGER.warn("Inconsistent failed criterion entry (description: '{}', time: '{}')", description, time);
} else {
try {
double timeD = Double.parseDouble(time);
return Optional.of(new FailedCriterion(message, timeD));
return Optional.of(new FailedCriterion(description, timeD));
} catch (NumberFormatException e) {
logInconsistentEntry("time", time);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ public static void readScenarioResult(String elementName, XMLStreamReader xmlRea
public static void readFailedCriterion(String elementName, XMLStreamReader xmlReader, Consumer<FailedCriterion> resultConsumer) {
try {
if (elementName.equals("criterionNonRespected")) {
String message = xmlReader.getAttributeValue(null, ID);
String description = xmlReader.getAttributeValue(null, ID);
String time = xmlReader.getAttributeValue(null, TIME);
XmlUtil.readEndElementOrThrow(xmlReader);
ResultsUtil.createFailedCriterion(message, time).ifPresent(resultConsumer);
ResultsUtil.createFailedCriterion(description, time).ifPresent(resultConsumer);
}
} catch (XMLStreamException e) {
throw new UncheckedXmlStreamException(e);
Expand Down

0 comments on commit ce808c6

Please sign in to comment.