Skip to content

Commit

Permalink
Merge pull request #678 from NASA-PDS/issue_673
Browse files Browse the repository at this point in the history
#673: change special constant min/max excursion error to warning
  • Loading branch information
jordanpadams authored Aug 8, 2023
2 parents d6e7c04 + 769a1a2 commit 0572d9a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
2 changes: 2 additions & 0 deletions src/main/java/gov/nasa/pds/tools/validate/ProblemType.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ public enum ProblemType {
ARRAY_VALUE_OUT_OF_DATA_TYPE_RANGE("error.array.value_out_of_data_type_range"),

ARRAY_VALUE_OUT_OF_MIN_MAX_RANGE("error.array.value_out_of_min_max_range"),
ARRAY_VALUE_OUT_OF_SPECIAL_CONSTANT_MIN_MAX_RANGE("warning.array.value_out_of_special_constant_min_max_range"),

ARRAY_VALUE_OUT_OF_SCALED_MIN_MAX_RANGE("error.array.value_out_of_scaled_min_max_range"),

Expand All @@ -139,6 +140,7 @@ public enum ProblemType {
FIELDS_MISMATCH("error.table.fields_mismatch"),

FIELD_VALUE_OUT_OF_MIN_MAX_RANGE("error.table.field_value_out_of_min_max_range"),
FIELD_VALUE_OUT_OF_SPECIAL_CONSTANT_MIN_MAX_RANGE("warning.table.field_value_out_of_special_constant_min_max_range"),

FIELD_VALUE_TOO_LONG("error.table.field_value_too_long"),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@ private void validatePosition(Array array, ArrayObject arrayObject, ArrayLocatio

boolean isSpecialConstant = false;
if (array.getSpecialConstants() != null) {
ProblemReporter reporter = new ArrayProblemReporter(this, ExceptionType.ERROR,
ProblemType.ARRAY_VALUE_OUT_OF_DATA_TYPE_RANGE, ArrayContentValidator.tableNameReportStr,
ProblemReporter reporter = new ArrayProblemReporter(this, ExceptionType.WARNING,
ProblemType.ARRAY_VALUE_OUT_OF_SPECIAL_CONSTANT_MIN_MAX_RANGE, ArrayContentValidator.tableNameReportStr,
location);
isSpecialConstant = isSpecialConstant(value, array.getSpecialConstants(), reporter);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,8 @@ private void checkSpecialMinMax(String value, SpecialConstants specialConstants,

boolean isSpecialConstant = false;
if (specialConstants != null) {
FieldProblemReporter reporter = new FieldProblemReporter(this, ExceptionType.ERROR,
ProblemType.FIELD_VALUE_OUT_OF_MIN_MAX_RANGE, recordLocation, fieldIndex);
FieldProblemReporter reporter = new FieldProblemReporter(this, ExceptionType.WARNING,
ProblemType.FIELD_VALUE_OUT_OF_SPECIAL_CONSTANT_MIN_MAX_RANGE, recordLocation, fieldIndex);
isSpecialConstant = ArrayContentValidator.isSpecialConstant(number.stripTrailingZeros(),
specialConstants, reporter);
}
Expand Down
13 changes: 6 additions & 7 deletions src/test/resources/features/validate.feature
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ Scenario Outline: Execute validate command for tests below.
# Validate#616
|"NASA-PDS/validate#616 Success Multiple Tables One File" | "github616" | 0 | "0 errors expected" | "totalErrors" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github616.json -s json --skip-context-validation -t {resourceDir}/github616/mre_cal_sc_ttcp_delay_schulte_01s_2021069.xml" | "report_github616.json" |

# Validate#614
|"NASA-PDS/validate#616 Success out of order offsets" | "github614" | 0 | "0 errors expected" | "totalErrors" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github614.json -s json -t {resourceDir}/github614/ss__0505_0711794861_465rmo__0261222srlc10000w0__cgnj02.xml" | "report_github614.json" |

# Validate#611
|"NASA-PDS/validate#611 Detect Special Constants Max/Min out of range" | "github611" | 9 | "9 warnings expected" | "FIELD_VALUE_OUT_OF_SPECIAL_CONSTANT_MIN_MAX_RANGE" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github611.json -s json -t {resourceDir}/github611/GRD-L1A-150313-150319_150625-BGO.xml" | "report_github611.json" |

# Validate#605
|"NASA-PDS/validate#605 Success Video+Audio" | "github605" | 0 | "0 errors expected" | "totalErrors" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github605.json -s json --skip-context-validation -t {resourceDir}/github605/video_and_audio.xml" | "report_github605.json" |

Expand All @@ -48,13 +54,6 @@ Scenario Outline: Execute validate command for tests below.
#|"NASA-PDS/validate#599 Failure Override Schematron" | "github599" | 1 | "1 errors expected" | "SCHEMA_ERROR" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github599_3.json -s json -S {resourceDir}/github599/PDS4_PDS_1I00.sch -t {resourceDir}/github599/AREA_Camelot_1radii.xml" | "report_github599_3.json" |
#|"NASA-PDS/validate#599 Failure Override Schema+Schematron" | "github599" | 1 | "1 errors expected" | "SCHEMA_ERROR" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github599_4.json -s json -S {resourceDir}/github599/PDS4_PDS_1I00.sch -x {resourceDir}/github599/PDS4_PDS_1I00.xsd -t {resourceDir}/github599/AREA_Camelot_1radii.xml" | "report_github599_4.json" |


# Validate#614
|"NASA-PDS/validate#616 Success out of order offsets" | "github614" | 0 | "0 errors expected" | "totalErrors" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github614.json -s json -t {resourceDir}/github614/ss__0505_0711794861_465rmo__0261222srlc10000w0__cgnj02.xml" | "report_github614.json" |

# Validate#611
|"NASA-PDS/validate#611 Detect Special Constants Max/Min out of range" | "github611" | 9 | "9 errors expected" | "FIELD_VALUE_OUT_OF_MIN_MAX_RANGE" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github611.json -s json -t {resourceDir}/github611/GRD-L1A-150313-150319_150625-BGO.xml" | "report_github611.json" |

# Validate#597
|"NASA-PDS/validate#597 Success Find Resources in Older/Skipped Bundles/Collections" | "github597" | 0 | "0 errors expected" | "totalErrors" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github597_1.json -s json -R pds4.bundle -t {resourceDir}/github597" | "report_github597_1.json" |

Expand Down

0 comments on commit 0572d9a

Please sign in to comment.