Skip to content

Commit

Permalink
Merge pull request #740 from NASA-PDS/i681_bug
Browse files Browse the repository at this point in the history
Fix bug in #681 test
  • Loading branch information
jordanpadams authored Oct 27, 2023
2 parents 5c54071 + f110ce9 commit 3d4ed6e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 116 deletions.
115 changes: 0 additions & 115 deletions src/test/java/cucumber/StepDefs.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,121 +143,6 @@ private int getMessageCountBasedOnProblemType(String problemEnum, JsonObject rep
count = this.getMessageCount(reportJson,
ProblemType.valueOf(ProblemType.class, strTemp).getKey());
}
// if (strTemp.equals("MISSING_REFERENCED_FILE")) {
// count = this.getMessageCount(reportJson, ProblemType.MISSING_REFERENCED_FILE.getKey());
// } else if (strTemp.equals("NON_PDFA_FILE")) {
// count = this.getMessageCount(reportJson, ProblemType.NON_PDFA_FILE.getKey());
// } else if (strTemp.equals("NON_JPEG_FILE")) {
// count = this.getMessageCount(reportJson, ProblemType.NON_JPEG_FILE.getKey());
// } else if (strTemp.equals("NON_PNG_FILE")) {
// count = this.getMessageCount(reportJson, ProblemType.NON_PNG_FILE.getKey());
// } else if (strTemp.equals("NON_HTML_FILE")) {
// count = this.getMessageCount(reportJson, ProblemType.NON_HTML_FILE.getKey());
// } else if (strTemp.equals("NON_MSWORD_FILE")) {
// count = this.getMessageCount(reportJson, ProblemType.NON_MSWORD_FILE.getKey());
// } else if (strTemp.equals("NON_MSEXCEL_FILE")) {
// count = this.getMessageCount(reportJson, ProblemType.NON_MSEXCEL_FILE.getKey());
// } else if (strTemp.equals("NON_LATEX_FILE")) {
// count = this.getMessageCount(reportJson, ProblemType.NON_LATEX_FILE.getKey());
// } else if (strTemp.equals("NON_POSTSCRIPT_FILE")) {
// count = this.getMessageCount(reportJson, ProblemType.NON_POSTSCRIPT_FILE.getKey());
// } else if (strTemp.equals("NON_ENCAPSULATED_POSTSCRIPT_FILE")) {
// count =
// this.getMessageCount(reportJson, ProblemType.NON_ENCAPSULATED_POSTSCRIPT_FILE.getKey());
// } else if (strTemp.equals("NON_RICHTEXT_FILE")) {
// count = this.getMessageCount(reportJson, ProblemType.NON_RICHTEXT_FILE.getKey());
// } else if (strTemp.equals("NON_GIF_FILE")) {
// count = this.getMessageCount(reportJson, ProblemType.NON_GIF_FILE.getKey());
// } else if (strTemp.equals("NON_TIFF_FILE")) {
// count = this.getMessageCount(reportJson, ProblemType.NON_TIFF_FILE.getKey());
// } else if (strTemp.equals("NON_MP4_FILE")) {
// count = this.getMessageCount(reportJson, ProblemType.NON_MP4_FILE.getKey());
// } else if (strTemp.equals("LABEL_UNRESOLVABLE_RESOURCE")) {
// count = this.getMessageCount(reportJson, ProblemType.LABEL_UNRESOLVABLE_RESOURCE.getKey());
// } else if (strTemp.equals("CONTEXT_REFERENCE_NOT_FOUND")) {
// count = this.getMessageCount(reportJson, ProblemType.CONTEXT_REFERENCE_NOT_FOUND.getKey());
// } else if (strTemp.equals("CONTEXT_REFERENCE_FOUND")) {
// count = this.getMessageCount(reportJson, ProblemType.CONTEXT_REFERENCE_FOUND.getKey());
// } else if (strTemp.equals("CONTEXT_REFERENCE_FOUND_MISMATCH")) {
// count =
// this.getMessageCount(reportJson, ProblemType.CONTEXT_REFERENCE_FOUND_MISMATCH.getKey());
// } else if (strTemp.equals("FIELD_VALUE_DATA_TYPE_MISMATCH")) {
// count =
// this.getMessageCount(reportJson, ProblemType.FIELD_VALUE_DATA_TYPE_MISMATCH.getKey());
// } else if (strTemp.equals("RECORDS_MISMATCH")) {
// count = this.getMessageCount(reportJson, ProblemType.RECORDS_MISMATCH.getKey());
// } else if (strTemp.equals("GENERAL_INFO")) {
// count = this.getMessageCount(reportJson, ProblemType.GENERAL_INFO.getKey());
// } else if (strTemp.equals("MISSING_VERSION")) {
// count = this.getMessageCount(reportJson, ProblemType.MISSING_VERSION.getKey());
// } else if (strTemp.equals("INVALID_LABEL")) {
// count = this.getMessageCount(reportJson, ProblemType.INVALID_LABEL.getKey());
// } else if (strTemp.equals("CHECKSUM_MISMATCH")) {
// count = this.getMessageCount(reportJson, ProblemType.CHECKSUM_MISMATCH.getKey());
// } else if (strTemp.equals("FILESIZE_MISMATCH")) {
// count = this.getMessageCount(reportJson, ProblemType.FILESIZE_MISMATCH.getKey());
// } else if (strTemp.equals("FILE_NAME_HAS_INVALID_CHARS")) {
// count = this.getMessageCount(reportJson, ProblemType.FILE_NAME_HAS_INVALID_CHARS.getKey());
// } else if (strTemp.equals("UNALLOWED_FILE_NAME")) {
// count = this.getMessageCount(reportJson, ProblemType.UNALLOWED_FILE_NAME.getKey());
// } else if (strTemp.equals("DIR_NAME_HAS_INVALID_CHARS")) {
// count = this.getMessageCount(reportJson, ProblemType.DIR_NAME_HAS_INVALID_CHARS.getKey());
// } else if (strTemp.equals("UNALLOWED_BUNDLE_SUBDIR_NAME")) {
// count = this.getMessageCount(reportJson,
// ProblemType.UNALLOWED_BUNDLE_SUBDIR_NAME.getKey());
// } else if (strTemp.equals("UNALLOWED_BASE_NAME")) {
// count = this.getMessageCount(reportJson, ProblemType.UNALLOWED_BASE_NAME.getKey());
// } else if (strTemp.equals("FIELD_VALUE_OVERLAP")) {
// count = this.getMessageCount(reportJson, ProblemType.FIELD_VALUE_OVERLAP.getKey());
// } else if (strTemp.equals("BAD_FIELD_READ")) {
// count = this.getMessageCount(reportJson, ProblemType.BAD_FIELD_READ.getKey());
// } else if (strTemp.equals("BAD_SCHEMATYPENS")) {
// count = this.getMessageCount(reportJson, ProblemType.BAD_SCHEMATYPENS.getKey());
// } else if (strTemp.equals("MISSING_SCHEMATRON_SPEC")) {
// count = this.getMessageCount(reportJson, ProblemType.MISSING_SCHEMATRON_SPEC.getKey());
// } else if (strTemp.equals("RECORD_LENGTH_MISMATCH")) {
// count = this.getMessageCount(reportJson, ProblemType.RECORD_LENGTH_MISMATCH.getKey());
// } else if (strTemp.equals("INTEGRITY_PDS4_VERSION_MISMATCH")) {
// count =
// this.getMessageCount(reportJson, ProblemType.INTEGRITY_PDS4_VERSION_MISMATCH.getKey());
// } else if (strTemp.equals("MISSING_LF")) {
// count = this.getMessageCount(reportJson, ProblemType.MISSING_LF.getKey());
// } else if (strTemp.equals("MISSING_CRLF")) {
// count = this.getMessageCount(reportJson, ProblemType.MISSING_CRLF.getKey());
// } else if (strTemp.equals("INVALID_FIELD_VALUE")) {
// count = this.getMessageCount(reportJson, ProblemType.INVALID_FIELD_VALUE.getKey());
// } else if (strTemp.equals("FIELDS_MISMATCH")) {
// count = this.getMessageCount(reportJson, ProblemType.FIELDS_MISMATCH.getKey());
// } else if (strTemp.equals("MISSING_CONTEXT_REFERENCE")) {
// count = this.getMessageCount(reportJson, ProblemType.MISSING_CONTEXT_REFERENCE.getKey());
// } else if (strTemp.equals("UNREFERENCED_MEMBER")) {
// count = this.getMessageCount(reportJson, ProblemType.UNREFERENCED_MEMBER.getKey());
// } else if (strTemp.equals("BAD_EXTENSION")) {
// count = this.getMessageCount(reportJson, ProblemType.BAD_EXTENSION.getKey());
// } else if (strTemp.equals("ARRAY_VALUE_OUT_OF_MIN_MAX_RANGE")) {
// count =
// this.getMessageCount(reportJson, ProblemType.ARRAY_VALUE_OUT_OF_MIN_MAX_RANGE.getKey());
// } else if (strTemp.equals("NO_PRODUCTS_FOUND")) {
// count = this.getMessageCount(reportJson, ProblemType.NO_PRODUCTS_FOUND.getKey());
// } else if (strTemp.equals("TABLE_FILE_READ_ERROR")) {
// count = this.getMessageCount(reportJson, ProblemType.TABLE_FILE_READ_ERROR.getKey());
// } else if (strTemp.equals("FIELD_VALUE_OUT_OF_MIN_MAX_RANGE")) {
// count =
// this.getMessageCount(reportJson, ProblemType.FIELD_VALUE_OUT_OF_MIN_MAX_RANGE.getKey());
// } else if (strTemp.equals("totalWarnings")) {
// count = reportJson.getAsJsonObject("summary").get("totalWarnings").getAsInt();
// } else if (strTemp.equals("totalErrors")) {
// count = reportJson.getAsJsonObject("summary").get("totalErrors").getAsInt();
// } else if (strTemp.equals("summary_message_only")) {
// count = reportJson.getAsJsonObject("summary").get("totalErrors").getAsInt();
// } else {
// StepDefs.LOG.error(
// "getMessageCountBasedOnProblemType:ERROR: This program does not yet support problem type
// (strTemp) "
// + strTemp);
// System.exit(1);
// // Exit to allow developer to add new error type.
// }
StepDefs.LOG.info("getMessageCountBasedOnProblemType: strTemp, count " + strTemp + " "
+ Integer.toString(count));
totalCount += count;
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/features/validate.feature
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Scenario Outline: Execute validate command for tests below.
|"NASA-PDS/validate#690 Success new constant expression" | "github690" | 0 | "0 errors expected" | "totalErrors" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github690.json -s json --skip-context-validation -t {resourceDir}/github690/rs_20160518_014000_udsc64_l3_e_v10.xml" | "report_github690.json" |

# Validate#681
|"NASA-PDS/validate#681 Success and Failure of ASCII table with space in number" | "github681" | 1 | "1 errors expected" | "FIELD_VALUE_DATA_TYPE_MISMATCH" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github681.json -s json --skip-context-validation -t {resourceDir}/github681/ff_char.xml {resourceDir}/github681/ff_del.xml" | "report_github681.json" |
|"NASA-PDS/validate#681 Success and Failure of ASCII table with space in number" | "github681" | 1 | "1 errors expected" | "FIELD_VALUE_FORMAT_PRECISION_MISMATCH" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github681.json -s json --skip-context-validation -t {resourceDir}/github681/ff_char.xml {resourceDir}/github681/ff_del.xml" | "report_github681.json" |

# Validate#680
|"NASA-PDS/validate#680 Success char table correct length" | "github680" | 0 | "0 errors expected" | "totalErrors" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github680.1.json -s json --skip-context-validation -t {resourceDir}/github680/ORB12_EUR_EPHIO_reclen96.xml" | "report_github680.1.json" |
Expand Down

0 comments on commit 3d4ed6e

Please sign in to comment.