Skip to content

Commit

Permalink
Ignore created time during CGMES files comparison (#2038)
Browse files Browse the repository at this point in the history
Signed-off-by: VEDELAGO MIORA <miora.ralambotiana@rte-france.com>
  • Loading branch information
miovd authored Mar 25, 2022
1 parent dc75e6f commit e7c3e24
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ private void compareFiles(String export1, String export2) throws IOException {
}
DifferenceEvaluator knownDiffs = DifferenceEvaluators.chain(
DifferenceEvaluators.Default,
ExportXmlCompare::ignoringCreatedTime,
ExportXmlCompare::numericDifferenceEvaluator,
ExportXmlCompare::ignoringFullModelAbout,
ExportXmlCompare::ignoringCurrentLimitIds,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,17 @@ static ComparisonResult sameScenarioTime(Comparison comparison, ComparisonResult
return result;
}

static ComparisonResult ignoringCreatedTime(Comparison comparison, ComparisonResult result) {
if (result == ComparisonResult.DIFFERENT && comparison.getType() == ComparisonType.TEXT_VALUE) {
Node control = comparison.getControlDetails().getTarget();
Node test = comparison.getTestDetails().getTarget();
if (test != null && control != null && control.getParentNode().getLocalName().equals("Model.created")) {
return ComparisonResult.EQUAL;
}
}
return result;
}

static ComparisonResult ignoringStaticVarCompensatorDiffq(Comparison comparison, ComparisonResult result) {
if (result == ComparisonResult.DIFFERENT) {
Node control = comparison.getControlDetails().getTarget();
Expand Down

0 comments on commit e7c3e24

Please sign in to comment.