Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update special constant min/max excursion error to be warning #678

Merged
merged 4 commits into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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