From bc23ae9083f6faec2ca04c8053954ba243f30a51 Mon Sep 17 00:00:00 2001 From: Al Niessner Date: Thu, 19 Dec 2024 09:58:23 -0800 Subject: [PATCH 01/10] turn 153 back on > > One of the errors is from PDFUtils trying to convert a URL to URI. For reasons unknown, Java does not handle spaces well during this conversion. Helped it out some. --- src/main/java/gov/nasa/pds/tools/util/PDFUtil.java | 4 +++- src/test/resources/features/pre.3.6.x.feature | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/gov/nasa/pds/tools/util/PDFUtil.java b/src/main/java/gov/nasa/pds/tools/util/PDFUtil.java index 5d7566feb..5babde4d3 100644 --- a/src/main/java/gov/nasa/pds/tools/util/PDFUtil.java +++ b/src/main/java/gov/nasa/pds/tools/util/PDFUtil.java @@ -7,6 +7,8 @@ import java.net.URI; import java.net.URISyntaxException; import java.net.URL; +import java.net.URLDecoder; +import java.net.URLEncoder; import java.nio.file.Paths; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -150,7 +152,7 @@ public synchronized boolean validateFileStandardConformity(String baseDir, Strin // Get the location of the PDF file. URI uri = null; try { - uri = target.toURI(); + uri = new URI(URLEncoder.encode(URLDecoder.decode(target.toString(), "UTF-8"), "UTF-8")); } catch (URISyntaxException e) { // Should never happen // but if it does, print an error message and returns false for pdfValidateFlag. diff --git a/src/test/resources/features/pre.3.6.x.feature b/src/test/resources/features/pre.3.6.x.feature index 77ea00869..e3da1e0e5 100644 --- a/src/test/resources/features/pre.3.6.x.feature +++ b/src/test/resources/features/pre.3.6.x.feature @@ -179,8 +179,7 @@ Scenario Outline: # The number of errors increase from 1 to 2 due to https://github.com/NASA-PDS/validate/issues/374 Refactor PDF/A check handling to match with similar product checks # The function validateFileStandardConformity() in PDFUtil cannot build the URI from a URL that contains spaces. # So, the 1st error is the file name contains spaces from FileAndDirectoryNamingRule and the 2nd error comes from function validateFileStandardConformity(). -# FIXME 1058: 153 1 needs to be re-enabled and errors added for non-conformity instead of internal error -# |"NASA-PDS/validate#153 1" | "github153" | 2 | "2 error messages expected." | "totalErrors" | "src/test/resources" | "target/test" | "--skip-context-validation -R pds4.label -r {reportDir}/report_github153_invalid.json -s json -t {resourceDir}/github153/iue_asteroid_spectra/document/3juno_lwr01896_ines_fits_headers.pdfa%.xml" | "report_github153_invalid.json" | +|"NASA-PDS/validate#153 1" | "github153" | 2 | "2 error messages expected." | "FILE_NAME_HAS_INVALID_CHARS,SCHEMATRON_ERROR" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github153_invalid.json -s json --skip-context-validation -R pds4.label -t {resourceDir}/github153/iue_asteroid_spectra/document/3juno_lwr01896_ines_fits_headers.pdfa%.xml" | "report_github153_invalid.json" | | NASA-PDS/validate#153 |"NASA-PDS/validate#153 2" | "github153" | 0 | "No error messages expected." | "totalErrors" | "src/test/resources" | "target/test" | "--skip-context-validation -R pds4.label -r {reportDir}/report_github153_valid.json -s json -t {resourceDir}/github153/iue_asteroid_spectra/document/collection_iue_asteroid_spectra_document.xml" | "report_github153_valid.json" | | NASA-PDS/validate#17 |"NASA-PDS/validate#17 1" | "github17" | 3 | "3 warning expected." | "totalWarnings" | "src/test/resources" | "target/test" | "--skip-context-validation -R pds4.label -r {reportDir}/report_github17_invalid.json -s json -t {resourceDir}/github17/delimited_table_bad.xml" | "report_github17_invalid.json" | | NASA-PDS/validate#17-1 |"NASA-PDS/validate#17 2" | "github17" | 0 | "No error messages expected." | "totalErrors" | "src/test/resources" | "target/test" | "--skip-context-validation -R pds4.label -r {reportDir}/report_github17_valid.json -s json -t {resourceDir}/github17/delimited_table_good.xml" | "report_github17_valid.json" | From 8515eba21542aa74d384fd6178ff199b00b54740 Mon Sep 17 00:00:00 2001 From: Al Niessner Date: Thu, 19 Dec 2024 10:03:41 -0800 Subject: [PATCH 02/10] fix feature typo --- src/test/resources/features/pre.3.6.x.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/resources/features/pre.3.6.x.feature b/src/test/resources/features/pre.3.6.x.feature index e3da1e0e5..d96eb450a 100644 --- a/src/test/resources/features/pre.3.6.x.feature +++ b/src/test/resources/features/pre.3.6.x.feature @@ -179,7 +179,7 @@ Scenario Outline: # The number of errors increase from 1 to 2 due to https://github.com/NASA-PDS/validate/issues/374 Refactor PDF/A check handling to match with similar product checks # The function validateFileStandardConformity() in PDFUtil cannot build the URI from a URL that contains spaces. # So, the 1st error is the file name contains spaces from FileAndDirectoryNamingRule and the 2nd error comes from function validateFileStandardConformity(). -|"NASA-PDS/validate#153 1" | "github153" | 2 | "2 error messages expected." | "FILE_NAME_HAS_INVALID_CHARS,SCHEMATRON_ERROR" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github153_invalid.json -s json --skip-context-validation -R pds4.label -t {resourceDir}/github153/iue_asteroid_spectra/document/3juno_lwr01896_ines_fits_headers.pdfa%.xml" | "report_github153_invalid.json" | +|"NASA-PDS/validate#153 1" |"NASA-PDS/validate#153 1" | "github153" | 2 | "2 error messages expected." | "FILE_NAME_HAS_INVALID_CHARS,SCHEMATRON_ERROR" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github153_invalid.json -s json --skip-context-validation -R pds4.label -t {resourceDir}/github153/iue_asteroid_spectra/document/3juno_lwr01896_ines_fits_headers.pdfa%.xml" | "report_github153_invalid.json" | | NASA-PDS/validate#153 |"NASA-PDS/validate#153 2" | "github153" | 0 | "No error messages expected." | "totalErrors" | "src/test/resources" | "target/test" | "--skip-context-validation -R pds4.label -r {reportDir}/report_github153_valid.json -s json -t {resourceDir}/github153/iue_asteroid_spectra/document/collection_iue_asteroid_spectra_document.xml" | "report_github153_valid.json" | | NASA-PDS/validate#17 |"NASA-PDS/validate#17 1" | "github17" | 3 | "3 warning expected." | "totalWarnings" | "src/test/resources" | "target/test" | "--skip-context-validation -R pds4.label -r {reportDir}/report_github17_invalid.json -s json -t {resourceDir}/github17/delimited_table_bad.xml" | "report_github17_invalid.json" | | NASA-PDS/validate#17-1 |"NASA-PDS/validate#17 2" | "github17" | 0 | "No error messages expected." | "totalErrors" | "src/test/resources" | "target/test" | "--skip-context-validation -R pds4.label -r {reportDir}/report_github17_valid.json -s json -t {resourceDir}/github17/delimited_table_good.xml" | "report_github17_valid.json" | From 93dcffba679119c98bd030083eb0f2fa99b7313c Mon Sep 17 00:00:00 2001 From: Al Niessner Date: Thu, 19 Dec 2024 10:50:51 -0800 Subject: [PATCH 03/10] turn on test 6 Mostly resetting the expected errors because software has changed and become more pedantic over time. --- src/main/java/gov/nasa/pds/tools/util/PDFUtil.java | 8 +++++++- src/test/resources/features/pre.3.6.x.feature | 8 ++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/main/java/gov/nasa/pds/tools/util/PDFUtil.java b/src/main/java/gov/nasa/pds/tools/util/PDFUtil.java index 5babde4d3..3f883a263 100644 --- a/src/main/java/gov/nasa/pds/tools/util/PDFUtil.java +++ b/src/main/java/gov/nasa/pds/tools/util/PDFUtil.java @@ -10,6 +10,7 @@ import java.net.URLDecoder; import java.net.URLEncoder; import java.nio.file.Paths; +import org.apache.commons.io.FileUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.verapdf.gf.foundry.VeraGreenfieldFoundryProvider; @@ -92,6 +93,11 @@ private boolean validatePDF(String baseDir, URI uri, String pdfRef) throws IOExc boolean pdfValidateFlag = false; try { + // make sure file is not 0 bytes in length + if (FileUtils.sizeOf(new File(pdfRef)) == 0) { + this.errorMessage = "Zero length file is an invalid PDF file."; + return pdfValidateFlag; + } // Create a parser and auto-detect flavour PDFAParser parser = Foundries.defaultInstance().createParser(new FileInputStream(pdfRef)); PDFAFlavour detectedFlavour = parser.getFlavour(); @@ -175,7 +181,7 @@ public synchronized boolean validateFileStandardConformity(String baseDir, Strin } // Build the full pathname of the PDF file. - String pdfRef = parent + (parent.endsWith(File.separator) ? "" : File.separator) + pdfBase; + String pdfRef = parent + (parent.endsWith(File.separator) ? "" : File.separator) + URLDecoder.decode(pdfBase, "UTF-8"); LOG.debug("validateFileStandardConformity:parent,pdfBase,pdfRef [{}],[{}],[{}]", parent, pdfBase, pdfRef); LOG.debug("validateFileStandardConformity:parent,pdfBase,pdfRef,uri [{}],[{}],[{}],{}", parent, diff --git a/src/test/resources/features/pre.3.6.x.feature b/src/test/resources/features/pre.3.6.x.feature index d96eb450a..fcec19076 100644 --- a/src/test/resources/features/pre.3.6.x.feature +++ b/src/test/resources/features/pre.3.6.x.feature @@ -179,7 +179,7 @@ Scenario Outline: # The number of errors increase from 1 to 2 due to https://github.com/NASA-PDS/validate/issues/374 Refactor PDF/A check handling to match with similar product checks # The function validateFileStandardConformity() in PDFUtil cannot build the URI from a URL that contains spaces. # So, the 1st error is the file name contains spaces from FileAndDirectoryNamingRule and the 2nd error comes from function validateFileStandardConformity(). -|"NASA-PDS/validate#153 1" |"NASA-PDS/validate#153 1" | "github153" | 2 | "2 error messages expected." | "FILE_NAME_HAS_INVALID_CHARS,SCHEMATRON_ERROR" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github153_invalid.json -s json --skip-context-validation -R pds4.label -t {resourceDir}/github153/iue_asteroid_spectra/document/3juno_lwr01896_ines_fits_headers.pdfa%.xml" | "report_github153_invalid.json" | +|"NASA-PDS/validate#153 1" |"NASA-PDS/validate#153 1" | "github153" | 1 | "1 error messages expected." | "FILE_NAME_HAS_INVALID_CHARS" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github153_invalid.json -s json --skip-context-validation -R pds4.label -t {resourceDir}/github153/iue_asteroid_spectra/document/3juno_lwr01896_ines_fits_headers.pdfa%.xml" | "report_github153_invalid.json" | | NASA-PDS/validate#153 |"NASA-PDS/validate#153 2" | "github153" | 0 | "No error messages expected." | "totalErrors" | "src/test/resources" | "target/test" | "--skip-context-validation -R pds4.label -r {reportDir}/report_github153_valid.json -s json -t {resourceDir}/github153/iue_asteroid_spectra/document/collection_iue_asteroid_spectra_document.xml" | "report_github153_valid.json" | | NASA-PDS/validate#17 |"NASA-PDS/validate#17 1" | "github17" | 3 | "3 warning expected." | "totalWarnings" | "src/test/resources" | "target/test" | "--skip-context-validation -R pds4.label -r {reportDir}/report_github17_invalid.json -s json -t {resourceDir}/github17/delimited_table_bad.xml" | "report_github17_invalid.json" | | NASA-PDS/validate#17-1 |"NASA-PDS/validate#17 2" | "github17" | 0 | "No error messages expected." | "totalErrors" | "src/test/resources" | "target/test" | "--skip-context-validation -R pds4.label -r {reportDir}/report_github17_valid.json -s json -t {resourceDir}/github17/delimited_table_good.xml" | "report_github17_valid.json" | @@ -194,11 +194,11 @@ Scenario Outline: | NASA-PDS/validate#51-1 |"NASA-PDS/validate#51 2" | "github51" | 2 | "2 errors expected for GENERAL_INFO." | "GENERAL_INFO" | "src/test/resources" | "target/test" | "-R pds4.bundle --alternate_file_paths src/test/resources/github51_additionals/additional_dir1/data_spectra,src/test/resources/github51_additionals/additional_dir2/data_spectra --skip-product-validation --skip-content-validation -r {reportDir}/report_github51_2.json -s json -t {resourceDir}/github51/valid" | "report_github51_2.json" | # # FIXME 1058: 6, 1 and 2 need re-enabled and correct file name processing needs to be done -# |"NASA-PDS/validate#6 1" | "github6" | 7 | "7 errors expected for FILE_NAME_HAS_INVALID_CHARS,UNALLOWED_BASE_NAME,UNALLOWED_FILE_NAME,DIR_NAME_HAS_INVALID_CHARS." | "FILE_NAME_HAS_INVALID_CHARS,UNALLOWED_BASE_NAME,UNALLOWED_FILE_NAME,DIR_NAME_HAS_INVALID_CHARS" | "src/test/resources" | "target/test" | "-R pds4.bundle -r {reportDir}/report_github6_bundle_invalid_cucumber.json -s json --skip-context-validation {resourceDir}/github6/invalid/bundle_kaguya_derived.xml" | "report_github6_bundle_invalid_cucumber.json" | -# |"NASA-PDS/validate#6 2" | "github6" | 7 | "7 warnings expected for warning.file.not_referenced_in_label." | "UNLABELED_FILE" | "src/test/resources" | "target/test" | "-R pds4.bundle -r {reportDir}/report_github6_2.json -s json --skip-context-validation {resourceDir}/github6/invalid/bundle_kaguya_derived_7.xml" | "report_github6_2.json" | +|"NASA-PDS/validate#6 1" |"NASA-PDS/validate#6 1" | "github6" | 8 | "7 errors expected." | "FILE_NAME_HAS_INVALID_CHARS,UNALLOWED_BASE_NAME,NON_PDFA_FILE" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github6_bundle_invalid_cucumber.json -s json --skip-context-validation -R pds4.bundle {resourceDir}/github6/invalid/bundle_kaguya_derived.xml" | "report_github6_bundle_invalid_cucumber.json" | +|"NASA-PDS/validate#6 2" |"NASA-PDS/validate#6 2" | "github6" | 8 | "15 warnings expected." | "UNREFERENCED_MEMBER,UNLABELED_FILE,REFERENCE_NOT_FOUND,MEMBER_NOT_FOUND,INTEGRITY_PDS4_VERSION_MISMATCH" | "src/test/resources" | "target/test" | "-R pds4.bundle -r {reportDir}/report_github6_2.json -s json --skip-context-validation {resourceDir}/github6/invalid/bundle_kaguya_derived_7.xml" | "report_github6_2.json" | | NASA-PDS/validate#6 |"NASA-PDS/validate#6 3" | "github6" | 0 | "0 errors expected for totalErrors." | "totalErrors" | "src/test/resources" | "target/test" | "-R pds4.bundle -r {reportDir}/report_github6_3.json -s json --skip-context-validation {resourceDir}/github6/valid/bundle_kaguya_derived.xml" | "report_github6_3.json" | | NASA-PDS/validate#240 |"NASA-PDS/validate#240 1" | "github240" | 0 | "0 errors expected for totalErrors." | "totalErrors" | "src/test/resources" | "target/test" | "-R pds4.bundle -r {reportDir}/report_github240_bundle_valid_cucumber.json -s json --skip-context-validation {resourceDir}/github240/valid/bundle_kaguya_derived.xml" | "report_github240_bundle_valid_cucumber.json" | -| NASA-PDS/validate#240-1 |"NASA-PDS/validate#240 2" | "github240" | 3 | "3 warnings expected for UNALLOWED_BUNDLE_SUBDIR_NAME." | "UNALLOWED_BUNDLE_SUBDIR_NAME" | "src/test/resources" | "target/test" | "-R pds4.bundle -r {reportDir}/report_github240_bundle_invalid_cucumber.json -s json --skip-context-validation {resourceDir}/github240/invalid/bundle_kaguya_derived.xml" | "report_github240_bundle_invalid_cucumber.json" | +| NASA-PDS/validate#240-1 |"NASA-PDS/validate#240 2" | "github240" | 3 | "3 warnings expected." | "UNALLOWED_BUNDLE_SUBDIR_NAME" | "src/test/resources" | "target/test" | "-R pds4.bundle -r {reportDir}/report_github240_bundle_invalid_cucumber.json -s json --skip-context-validation {resourceDir}/github240/invalid/bundle_kaguya_derived.xml" | "report_github240_bundle_invalid_cucumber.json" | # https://github.com/NASA-PDS/validate/issues/15 Verify that all name/type attribute values correspond to names denoted context products | NASA-PDS/validate#15 |"NASA-PDS/validate#15 1" | "github15" | 0 | "0 valid context references should be found" | "CONTEXT_REFERENCE_NOT_FOUND" | "src/test/resources" | "target/test" | "-v1 -r {reportDir}/report_github15_pass.json -s json --disable-context-mismatch-warnings -R pds4.label -t {resourceDir}/github15/test_check-pass_context_products.xml" | "report_github15_pass.json" | From 612ada4380e6a7e6fd6fd2b982ee1a7ad92230d5 Mon Sep 17 00:00:00 2001 From: Al Niessner Date: Thu, 19 Dec 2024 13:46:52 -0800 Subject: [PATCH 04/10] features are exhausting to right --- src/test/resources/features/pre.3.6.x.feature | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/test/resources/features/pre.3.6.x.feature b/src/test/resources/features/pre.3.6.x.feature index fcec19076..acd1bf6e1 100644 --- a/src/test/resources/features/pre.3.6.x.feature +++ b/src/test/resources/features/pre.3.6.x.feature @@ -193,7 +193,6 @@ Scenario Outline: # | NASA-PDS/validate#51-1 |"NASA-PDS/validate#51 2" | "github51" | 2 | "2 errors expected for GENERAL_INFO." | "GENERAL_INFO" | "src/test/resources" | "target/test" | "-R pds4.bundle --alternate_file_paths src/test/resources/github51_additionals/additional_dir1/data_spectra,src/test/resources/github51_additionals/additional_dir2/data_spectra --skip-product-validation --skip-content-validation -r {reportDir}/report_github51_2.json -s json -t {resourceDir}/github51/valid" | "report_github51_2.json" | # -# FIXME 1058: 6, 1 and 2 need re-enabled and correct file name processing needs to be done |"NASA-PDS/validate#6 1" |"NASA-PDS/validate#6 1" | "github6" | 8 | "7 errors expected." | "FILE_NAME_HAS_INVALID_CHARS,UNALLOWED_BASE_NAME,NON_PDFA_FILE" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github6_bundle_invalid_cucumber.json -s json --skip-context-validation -R pds4.bundle {resourceDir}/github6/invalid/bundle_kaguya_derived.xml" | "report_github6_bundle_invalid_cucumber.json" | |"NASA-PDS/validate#6 2" |"NASA-PDS/validate#6 2" | "github6" | 8 | "15 warnings expected." | "UNREFERENCED_MEMBER,UNLABELED_FILE,REFERENCE_NOT_FOUND,MEMBER_NOT_FOUND,INTEGRITY_PDS4_VERSION_MISMATCH" | "src/test/resources" | "target/test" | "-R pds4.bundle -r {reportDir}/report_github6_2.json -s json --skip-context-validation {resourceDir}/github6/invalid/bundle_kaguya_derived_7.xml" | "report_github6_2.json" | | NASA-PDS/validate#6 |"NASA-PDS/validate#6 3" | "github6" | 0 | "0 errors expected for totalErrors." | "totalErrors" | "src/test/resources" | "target/test" | "-R pds4.bundle -r {reportDir}/report_github6_3.json -s json --skip-context-validation {resourceDir}/github6/valid/bundle_kaguya_derived.xml" | "report_github6_3.json" | @@ -213,8 +212,8 @@ Scenario Outline: ## Note that the reference code re-use the JSON report file for both tests but we won't # FIXME 1058: both of these generate internal errors because a hashmap is returning null -# |"NASA-PDS/validate#47 1" | "github47" | 0 | "No errors expected. Context validation disabled" | "CONTEXT_REFERENCE_NOT_FOUND" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github47_disable-valid.json -s json --disable-context-mismatch-warnings -R pds4.label --skip-content-validation --skip-context-validation {resourceDir}/github47/test_context_products.xml" | "report_github47_disable-valid.json" | -# |"NASA-PDS/validate#47 2" | "github47" | 4 | "4 errors expected. Context validation enabled." | "CONTEXT_REFERENCE_NOT_FOUND,CONTEXT_REFERENCE_FOUND_MISMATCH_INFO" | "src/test/resources" | "target/test" | "-v1 --skip-content-validation -r {reportDir}/report_github47_enable-valid.json -s json --disable-context-mismatch-warnings -R pds4.label {resourceDir}/github47/test_context_products.xml" | "report_github47_enable-valid.json" | +# |"NASA-PDS/validate#47 1" |"NASA-PDS/validate#47 1" | "github47" | 0 | "0 errors expected." | "CONTEXT_REFERENCE_NOT_FOUND" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github47_disable-valid.json -s json --disable-context-mismatch-warnings -R pds4.label --skip-content-validation --skip-context-validation {resourceDir}/github47/test_context_products.xml" | "report_github47_disable-valid.json" | +# |"NASA-PDS/validate#47 2" |"NASA-PDS/validate#47 2" | "github47" | 4 | "4 errors expected. Context validation enabled." | "CONTEXT_REFERENCE_NOT_FOUND,CONTEXT_REFERENCE_FOUND_MISMATCH_INFO" | "src/test/resources" | "target/test" | "-v1 --skip-content-validation -r {reportDir}/report_github47_enable-valid.json -s json --disable-context-mismatch-warnings -R pds4.label {resourceDir}/github47/test_context_products.xml" | "report_github47_enable-valid.json" | | NASA-PDS/validate#62 |"NASA-PDS/validate#62 1" | "github62" | 4 | "4 info.label.context_ref_found info messages expected.\n" | "CONTEXT_REFERENCE_FOUND" | "src/test/resources" | "target/test" | "-v1 -r {reportDir}/report_github62_1.json -s json --no-data-check -t {resourceDir}/github62/ele_mom_tblChar.xml" | "report_github62_1.json" | | NASA-PDS/validate#62-1 |"NASA-PDS/validate#62 2" | "github62" | 8 | "8 info/error messages expected.\n" | "CONTEXT_REFERENCE_FOUND,CONTEXT_REFERENCE_NOT_FOUND" | "src/test/resources" | "target/test" | "-v1 -r {reportDir}/report_github62_2.json -s json --no-data-check -t {resourceDir}/github62/spacecraft.orex_1.1.xml" | "report_github62_2.json" | From 75206ae9d8e089f62d9cea1f374f73d225f01d84 Mon Sep 17 00:00:00 2001 From: Al Niessner Date: Thu, 19 Dec 2024 14:00:28 -0800 Subject: [PATCH 05/10] features are exhausting to right --- src/test/resources/features/pre.3.6.x.feature | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/resources/features/pre.3.6.x.feature b/src/test/resources/features/pre.3.6.x.feature index acd1bf6e1..7c9d27c28 100644 --- a/src/test/resources/features/pre.3.6.x.feature +++ b/src/test/resources/features/pre.3.6.x.feature @@ -193,8 +193,8 @@ Scenario Outline: # | NASA-PDS/validate#51-1 |"NASA-PDS/validate#51 2" | "github51" | 2 | "2 errors expected for GENERAL_INFO." | "GENERAL_INFO" | "src/test/resources" | "target/test" | "-R pds4.bundle --alternate_file_paths src/test/resources/github51_additionals/additional_dir1/data_spectra,src/test/resources/github51_additionals/additional_dir2/data_spectra --skip-product-validation --skip-content-validation -r {reportDir}/report_github51_2.json -s json -t {resourceDir}/github51/valid" | "report_github51_2.json" | # -|"NASA-PDS/validate#6 1" |"NASA-PDS/validate#6 1" | "github6" | 8 | "7 errors expected." | "FILE_NAME_HAS_INVALID_CHARS,UNALLOWED_BASE_NAME,NON_PDFA_FILE" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github6_bundle_invalid_cucumber.json -s json --skip-context-validation -R pds4.bundle {resourceDir}/github6/invalid/bundle_kaguya_derived.xml" | "report_github6_bundle_invalid_cucumber.json" | -|"NASA-PDS/validate#6 2" |"NASA-PDS/validate#6 2" | "github6" | 8 | "15 warnings expected." | "UNREFERENCED_MEMBER,UNLABELED_FILE,REFERENCE_NOT_FOUND,MEMBER_NOT_FOUND,INTEGRITY_PDS4_VERSION_MISMATCH" | "src/test/resources" | "target/test" | "-R pds4.bundle -r {reportDir}/report_github6_2.json -s json --skip-context-validation {resourceDir}/github6/invalid/bundle_kaguya_derived_7.xml" | "report_github6_2.json" | +|"NASA-PDS/validate#6 1" |"NASA-PDS/validate#6 1" | "github6" | 8 | "8 errors expected." | "FILE_NAME_HAS_INVALID_CHARS,UNALLOWED_BASE_NAME,NON_PDFA_FILE" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github6_bundle_invalid_cucumber.json -s json --skip-context-validation -R pds4.bundle {resourceDir}/github6/invalid/bundle_kaguya_derived.xml" | "report_github6_bundle_invalid_cucumber.json" | +|"NASA-PDS/validate#6 2" |"NASA-PDS/validate#6 2" | "github6" | 15 | "15 warnings expected." | "UNREFERENCED_MEMBER,UNLABELED_FILE,REFERENCE_NOT_FOUND,MEMBER_NOT_FOUND,INTEGRITY_PDS4_VERSION_MISMATCH" | "src/test/resources" | "target/test" | "-R pds4.bundle -r {reportDir}/report_github6_2.json -s json --skip-context-validation {resourceDir}/github6/invalid/bundle_kaguya_derived_7.xml" | "report_github6_2.json" | | NASA-PDS/validate#6 |"NASA-PDS/validate#6 3" | "github6" | 0 | "0 errors expected for totalErrors." | "totalErrors" | "src/test/resources" | "target/test" | "-R pds4.bundle -r {reportDir}/report_github6_3.json -s json --skip-context-validation {resourceDir}/github6/valid/bundle_kaguya_derived.xml" | "report_github6_3.json" | | NASA-PDS/validate#240 |"NASA-PDS/validate#240 1" | "github240" | 0 | "0 errors expected for totalErrors." | "totalErrors" | "src/test/resources" | "target/test" | "-R pds4.bundle -r {reportDir}/report_github240_bundle_valid_cucumber.json -s json --skip-context-validation {resourceDir}/github240/valid/bundle_kaguya_derived.xml" | "report_github240_bundle_valid_cucumber.json" | | NASA-PDS/validate#240-1 |"NASA-PDS/validate#240 2" | "github240" | 3 | "3 warnings expected." | "UNALLOWED_BUNDLE_SUBDIR_NAME" | "src/test/resources" | "target/test" | "-R pds4.bundle -r {reportDir}/report_github240_bundle_invalid_cucumber.json -s json --skip-context-validation {resourceDir}/github240/invalid/bundle_kaguya_derived.xml" | "report_github240_bundle_invalid_cucumber.json" | From 3d75deb4f791dc9e39d5b7544ec19958a491db14 Mon Sep 17 00:00:00 2001 From: Al Niessner Date: Thu, 19 Dec 2024 14:25:41 -0800 Subject: [PATCH 06/10] enable 47 Turned of context mismatch that fixed 3 of the errors that we do not care about and then tested the missing ref which is explicit. Shows that skipping works. --- src/test/resources/features/pre.3.6.x.feature | 5 ++--- src/test/resources/github47/test_context_products.xml | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/test/resources/features/pre.3.6.x.feature b/src/test/resources/features/pre.3.6.x.feature index 7c9d27c28..a8e4dd97c 100644 --- a/src/test/resources/features/pre.3.6.x.feature +++ b/src/test/resources/features/pre.3.6.x.feature @@ -211,9 +211,8 @@ Scenario Outline: | NASA-PDS/validate#137-1 |"NASA-PDS/validate#137 1" | "github137" | 2 | "FIELD_VALUE_DATA_TYPE_MISMATCH info/error messages not expected." | "FIELD_VALUE_DATA_TYPE_MISMATCH" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github137_2.json -s json -t {resourceDir}/github137/delimited_table_bad.xml" | "report_github137_2.json" | ## Note that the reference code re-use the JSON report file for both tests but we won't -# FIXME 1058: both of these generate internal errors because a hashmap is returning null -# |"NASA-PDS/validate#47 1" |"NASA-PDS/validate#47 1" | "github47" | 0 | "0 errors expected." | "CONTEXT_REFERENCE_NOT_FOUND" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github47_disable-valid.json -s json --disable-context-mismatch-warnings -R pds4.label --skip-content-validation --skip-context-validation {resourceDir}/github47/test_context_products.xml" | "report_github47_disable-valid.json" | -# |"NASA-PDS/validate#47 2" |"NASA-PDS/validate#47 2" | "github47" | 4 | "4 errors expected. Context validation enabled." | "CONTEXT_REFERENCE_NOT_FOUND,CONTEXT_REFERENCE_FOUND_MISMATCH_INFO" | "src/test/resources" | "target/test" | "-v1 --skip-content-validation -r {reportDir}/report_github47_enable-valid.json -s json --disable-context-mismatch-warnings -R pds4.label {resourceDir}/github47/test_context_products.xml" | "report_github47_enable-valid.json" | +|"NASA-PDS/validate#47 1" |"NASA-PDS/validate#47 1" | "github47" | 0 | "0 errors expected." | "CONTEXT_REFERENCE_NOT_FOUND" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github47_disable-valid.json -s json --disable-context-mismatch-warnings -R pds4.label --skip-content-validation --skip-context-validation {resourceDir}/github47/test_context_products.xml" | "report_github47_disable-valid.json" | +|"NASA-PDS/validate#47 2" |"NASA-PDS/validate#47 2" | "github47" | 1 | "1 errors expected." | "CONTEXT_REFERENCE_NOT_FOUND" | "src/test/resources" | "target/test" | "-v1 --skip-content-validation -r {reportDir}/report_github47_enable-valid.json -s json --disable-context-mismatch-warnings -R pds4.label {resourceDir}/github47/test_context_products.xml" | "report_github47_enable-valid.json" | | NASA-PDS/validate#62 |"NASA-PDS/validate#62 1" | "github62" | 4 | "4 info.label.context_ref_found info messages expected.\n" | "CONTEXT_REFERENCE_FOUND" | "src/test/resources" | "target/test" | "-v1 -r {reportDir}/report_github62_1.json -s json --no-data-check -t {resourceDir}/github62/ele_mom_tblChar.xml" | "report_github62_1.json" | | NASA-PDS/validate#62-1 |"NASA-PDS/validate#62 2" | "github62" | 8 | "8 info/error messages expected.\n" | "CONTEXT_REFERENCE_FOUND,CONTEXT_REFERENCE_NOT_FOUND" | "src/test/resources" | "target/test" | "-v1 -r {reportDir}/report_github62_2.json -s json --no-data-check -t {resourceDir}/github62/spacecraft.orex_1.1.xml" | "report_github62_2.json" | diff --git a/src/test/resources/github47/test_context_products.xml b/src/test/resources/github47/test_context_products.xml index 500e95556..ab30d1d01 100644 --- a/src/test/resources/github47/test_context_products.xml +++ b/src/test/resources/github47/test_context_products.xml @@ -11,8 +11,7 @@ http://pds.nasa.gov/pds4/sp/v1 http://pds.nasa.gov/pds4/sp/v1/PDS4_SP_1100.xsd"> - urn:nasa:pds:mer_pancam_photometry:mer2:a0708_p242914_02_02v01 - + urn:nasa:pds:mer_pancam_photometry:mer2:a0708_p242914_02_02v01 1.0 MER Photometry Cube: a0708_p242914_02_02v01.qub 1.4.0.0 From a79d54f0935f15490baf0c31ee3a55296c5e0893 Mon Sep 17 00:00:00 2001 From: Al Niessner Date: Fri, 20 Dec 2024 09:02:17 -0800 Subject: [PATCH 07/10] enable 278 ignoring zero length PDF error --- src/test/resources/features/pre.3.6.x.feature | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/resources/features/pre.3.6.x.feature b/src/test/resources/features/pre.3.6.x.feature index a8e4dd97c..1922480e0 100644 --- a/src/test/resources/features/pre.3.6.x.feature +++ b/src/test/resources/features/pre.3.6.x.feature @@ -218,9 +218,9 @@ Scenario Outline: | NASA-PDS/validate#62-1 |"NASA-PDS/validate#62 2" | "github62" | 8 | "8 info/error messages expected.\n" | "CONTEXT_REFERENCE_FOUND,CONTEXT_REFERENCE_NOT_FOUND" | "src/test/resources" | "target/test" | "-v1 -r {reportDir}/report_github62_2.json -s json --no-data-check -t {resourceDir}/github62/spacecraft.orex_1.1.xml" | "report_github62_2.json" | # Move github278 before github71 as it causing issues -# FIXME 1058: PDF file streams appear to be empty -# |"NASA-PDS/validate#278 1" | "github278" | 1 | "1 errors expected for CONTEXT_REFERENCE_NOT_FOUND." | "CONTEXT_REFERENCE_NOT_FOUND" | "src/test/resources" | "target/test" | "-R pds4.label -r {reportDir}/report_github278_label_invalid_cucumber.json -s json {resourceDir}/github278/invalid/trk-2-34-revn-l5_tnf_invalid.xml" | "report_github278_label_invalid_cucumber.json" | -# |"NASA-PDS/validate#278 2" | "github278" | 0 | "0 errors expected for CONTEXT_REFERENCE_NOT_FOUND." | "CONTEXT_REFERENCE_NOT_FOUND" | "src/test/resources" | "target/test" | "-R pds4.label -r {reportDir}/report_github278_label_valid_cucumber.json -s json {resourceDir}/github278/valid/trk-2-34-revn-l5_tnf.xml" | "report_github278_label_valid_cucumber.json" | +# By declaring the error type, should allow the zero length PDF file to go unnoticed. +|"NASA-PDS/validate#278 1" |"NASA-PDS/validate#278 1" | "github278" | 1 | "1 errors expected for CONTEXT_REFERENCE_NOT_FOUND." | "CONTEXT_REFERENCE_NOT_FOUND" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github278_label_invalid_cucumber.json -s json -R pds4.label {resourceDir}/github278/invalid/trk-2-34-revn-l5_tnf_invalid.xml" | "report_github278_label_invalid_cucumber.json" | +|"NASA-PDS/validate#278 2" |"NASA-PDS/validate#278 2" | "github278" | 0 | "0 errors expected for CONTEXT_REFERENCE_NOT_FOUND." | "CONTEXT_REFERENCE_NOT_FOUND" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github278_label_valid_cucumber.json -s json -R pds4.label {resourceDir}/github278/valid/trk-2-34-revn-l5_tnf.xml" | "report_github278_label_valid_cucumber.json" | | NASA-PDS/validate#9 |"NASA-PDS/validate#9 1" | "github09" | 0 | "info/error messages expected." | "FIELD_VALUE_DATA_TYPE_MISMATCH" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github09_1.json -s json -t {resourceDir}/github09/minimal_test_product_good2.xml" | "report_github09_1.json" | | NASA-PDS/validate#9-1 |"NASA-PDS/validate#9 2" | "github09" | 0 | "0 info/error messages not expected." | "FIELD_VALUE_DATA_TYPE_MISMATCH" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github09_2.json -s json -t {resourceDir}/github09/minimal_test_product_good.xml" | "report_github09_2.json" | From 435be359072950487f8365b2d9f81f0511262174 Mon Sep 17 00:00:00 2001 From: Al Niessner Date: Fri, 20 Dec 2024 13:48:17 -0800 Subject: [PATCH 08/10] enable 84 --- src/test/resources/features/pre.3.6.x.feature | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/test/resources/features/pre.3.6.x.feature b/src/test/resources/features/pre.3.6.x.feature index 1922480e0..d3ebba5e0 100644 --- a/src/test/resources/features/pre.3.6.x.feature +++ b/src/test/resources/features/pre.3.6.x.feature @@ -179,7 +179,7 @@ Scenario Outline: # The number of errors increase from 1 to 2 due to https://github.com/NASA-PDS/validate/issues/374 Refactor PDF/A check handling to match with similar product checks # The function validateFileStandardConformity() in PDFUtil cannot build the URI from a URL that contains spaces. # So, the 1st error is the file name contains spaces from FileAndDirectoryNamingRule and the 2nd error comes from function validateFileStandardConformity(). -|"NASA-PDS/validate#153 1" |"NASA-PDS/validate#153 1" | "github153" | 1 | "1 error messages expected." | "FILE_NAME_HAS_INVALID_CHARS" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github153_invalid.json -s json --skip-context-validation -R pds4.label -t {resourceDir}/github153/iue_asteroid_spectra/document/3juno_lwr01896_ines_fits_headers.pdfa%.xml" | "report_github153_invalid.json" | +| NASA-PDS/validate#153-1 |"NASA-PDS/validate#153 1" | "github153" | 1 | "1 error messages expected." | "FILE_NAME_HAS_INVALID_CHARS" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github153_invalid.json -s json --skip-context-validation -R pds4.label -t {resourceDir}/github153/iue_asteroid_spectra/document/3juno_lwr01896_ines_fits_headers.pdfa%.xml" | "report_github153_invalid.json" | | NASA-PDS/validate#153 |"NASA-PDS/validate#153 2" | "github153" | 0 | "No error messages expected." | "totalErrors" | "src/test/resources" | "target/test" | "--skip-context-validation -R pds4.label -r {reportDir}/report_github153_valid.json -s json -t {resourceDir}/github153/iue_asteroid_spectra/document/collection_iue_asteroid_spectra_document.xml" | "report_github153_valid.json" | | NASA-PDS/validate#17 |"NASA-PDS/validate#17 1" | "github17" | 3 | "3 warning expected." | "totalWarnings" | "src/test/resources" | "target/test" | "--skip-context-validation -R pds4.label -r {reportDir}/report_github17_invalid.json -s json -t {resourceDir}/github17/delimited_table_bad.xml" | "report_github17_invalid.json" | | NASA-PDS/validate#17-1 |"NASA-PDS/validate#17 2" | "github17" | 0 | "No error messages expected." | "totalErrors" | "src/test/resources" | "target/test" | "--skip-context-validation -R pds4.label -r {reportDir}/report_github17_valid.json -s json -t {resourceDir}/github17/delimited_table_good.xml" | "report_github17_valid.json" | @@ -193,8 +193,8 @@ Scenario Outline: # | NASA-PDS/validate#51-1 |"NASA-PDS/validate#51 2" | "github51" | 2 | "2 errors expected for GENERAL_INFO." | "GENERAL_INFO" | "src/test/resources" | "target/test" | "-R pds4.bundle --alternate_file_paths src/test/resources/github51_additionals/additional_dir1/data_spectra,src/test/resources/github51_additionals/additional_dir2/data_spectra --skip-product-validation --skip-content-validation -r {reportDir}/report_github51_2.json -s json -t {resourceDir}/github51/valid" | "report_github51_2.json" | # -|"NASA-PDS/validate#6 1" |"NASA-PDS/validate#6 1" | "github6" | 8 | "8 errors expected." | "FILE_NAME_HAS_INVALID_CHARS,UNALLOWED_BASE_NAME,NON_PDFA_FILE" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github6_bundle_invalid_cucumber.json -s json --skip-context-validation -R pds4.bundle {resourceDir}/github6/invalid/bundle_kaguya_derived.xml" | "report_github6_bundle_invalid_cucumber.json" | -|"NASA-PDS/validate#6 2" |"NASA-PDS/validate#6 2" | "github6" | 15 | "15 warnings expected." | "UNREFERENCED_MEMBER,UNLABELED_FILE,REFERENCE_NOT_FOUND,MEMBER_NOT_FOUND,INTEGRITY_PDS4_VERSION_MISMATCH" | "src/test/resources" | "target/test" | "-R pds4.bundle -r {reportDir}/report_github6_2.json -s json --skip-context-validation {resourceDir}/github6/invalid/bundle_kaguya_derived_7.xml" | "report_github6_2.json" | +| NASA-PDS/validate#6-1 |"NASA-PDS/validate#6 1" | "github6" | 8 | "8 errors expected." | "FILE_NAME_HAS_INVALID_CHARS,UNALLOWED_BASE_NAME,NON_PDFA_FILE" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github6_bundle_invalid_cucumber.json -s json --skip-context-validation -R pds4.bundle {resourceDir}/github6/invalid/bundle_kaguya_derived.xml" | "report_github6_bundle_invalid_cucumber.json" | +| NASA-PDS/validate#6-2 |"NASA-PDS/validate#6 2" | "github6" | 15 | "15 warnings expected." | "UNREFERENCED_MEMBER,UNLABELED_FILE,REFERENCE_NOT_FOUND,MEMBER_NOT_FOUND,INTEGRITY_PDS4_VERSION_MISMATCH" | "src/test/resources" | "target/test" | "-R pds4.bundle -r {reportDir}/report_github6_2.json -s json --skip-context-validation {resourceDir}/github6/invalid/bundle_kaguya_derived_7.xml" | "report_github6_2.json" | | NASA-PDS/validate#6 |"NASA-PDS/validate#6 3" | "github6" | 0 | "0 errors expected for totalErrors." | "totalErrors" | "src/test/resources" | "target/test" | "-R pds4.bundle -r {reportDir}/report_github6_3.json -s json --skip-context-validation {resourceDir}/github6/valid/bundle_kaguya_derived.xml" | "report_github6_3.json" | | NASA-PDS/validate#240 |"NASA-PDS/validate#240 1" | "github240" | 0 | "0 errors expected for totalErrors." | "totalErrors" | "src/test/resources" | "target/test" | "-R pds4.bundle -r {reportDir}/report_github240_bundle_valid_cucumber.json -s json --skip-context-validation {resourceDir}/github240/valid/bundle_kaguya_derived.xml" | "report_github240_bundle_valid_cucumber.json" | | NASA-PDS/validate#240-1 |"NASA-PDS/validate#240 2" | "github240" | 3 | "3 warnings expected." | "UNALLOWED_BUNDLE_SUBDIR_NAME" | "src/test/resources" | "target/test" | "-R pds4.bundle -r {reportDir}/report_github240_bundle_invalid_cucumber.json -s json --skip-context-validation {resourceDir}/github240/invalid/bundle_kaguya_derived.xml" | "report_github240_bundle_invalid_cucumber.json" | @@ -211,8 +211,8 @@ Scenario Outline: | NASA-PDS/validate#137-1 |"NASA-PDS/validate#137 1" | "github137" | 2 | "FIELD_VALUE_DATA_TYPE_MISMATCH info/error messages not expected." | "FIELD_VALUE_DATA_TYPE_MISMATCH" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github137_2.json -s json -t {resourceDir}/github137/delimited_table_bad.xml" | "report_github137_2.json" | ## Note that the reference code re-use the JSON report file for both tests but we won't -|"NASA-PDS/validate#47 1" |"NASA-PDS/validate#47 1" | "github47" | 0 | "0 errors expected." | "CONTEXT_REFERENCE_NOT_FOUND" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github47_disable-valid.json -s json --disable-context-mismatch-warnings -R pds4.label --skip-content-validation --skip-context-validation {resourceDir}/github47/test_context_products.xml" | "report_github47_disable-valid.json" | -|"NASA-PDS/validate#47 2" |"NASA-PDS/validate#47 2" | "github47" | 1 | "1 errors expected." | "CONTEXT_REFERENCE_NOT_FOUND" | "src/test/resources" | "target/test" | "-v1 --skip-content-validation -r {reportDir}/report_github47_enable-valid.json -s json --disable-context-mismatch-warnings -R pds4.label {resourceDir}/github47/test_context_products.xml" | "report_github47_enable-valid.json" | +| NASA-PDS/validate#47-1 |"NASA-PDS/validate#47 1" | "github47" | 0 | "0 errors expected." | "CONTEXT_REFERENCE_NOT_FOUND" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github47_disable-valid.json -s json --disable-context-mismatch-warnings -R pds4.label --skip-content-validation --skip-context-validation {resourceDir}/github47/test_context_products.xml" | "report_github47_disable-valid.json" | +| NASA-PDS/validate#47-2 |"NASA-PDS/validate#47 2" | "github47" | 1 | "1 errors expected." | "CONTEXT_REFERENCE_NOT_FOUND" | "src/test/resources" | "target/test" | "-v1 --skip-content-validation -r {reportDir}/report_github47_enable-valid.json -s json --disable-context-mismatch-warnings -R pds4.label {resourceDir}/github47/test_context_products.xml" | "report_github47_enable-valid.json" | | NASA-PDS/validate#62 |"NASA-PDS/validate#62 1" | "github62" | 4 | "4 info.label.context_ref_found info messages expected.\n" | "CONTEXT_REFERENCE_FOUND" | "src/test/resources" | "target/test" | "-v1 -r {reportDir}/report_github62_1.json -s json --no-data-check -t {resourceDir}/github62/ele_mom_tblChar.xml" | "report_github62_1.json" | | NASA-PDS/validate#62-1 |"NASA-PDS/validate#62 2" | "github62" | 8 | "8 info/error messages expected.\n" | "CONTEXT_REFERENCE_FOUND,CONTEXT_REFERENCE_NOT_FOUND" | "src/test/resources" | "target/test" | "-v1 -r {reportDir}/report_github62_2.json -s json --no-data-check -t {resourceDir}/github62/spacecraft.orex_1.1.xml" | "report_github62_2.json" | @@ -483,10 +483,10 @@ Scenario Outline: # BIG_NOTE: The tests for github6 has to be moved toward the beginning as leave them here results in error in information model. # BIG_NOTE: The tests for github240 has to be moved toward the beginning as leave them here results in error in information model. -# FIXME 1058: Oh boy. It seems clearing the cache has now broken these tests both 71 and 84 -# |"NASA-PDS/validate#71 1" | "github71" | 0 | "0 error message expected" | "LABEL_UNRESOLVABLE_RESOURCE" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github71_1.json -C {reportDir}/catalog.xml -s json --skip-content-validation -t {resourceDir}/github71/ELE_MOM.xml" | "report_github71_1.json" | -# |"NASA-PDS/validate#71 2" | "github71" | 0 | "0 error message expected" | "totalErrors" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github71_2.json -s json -C {reportDir}/catalog.xml -t {resourceDir}/github71/ELE_MOM_2.xml" | "report_github71_2.json" | -# |"NASA-PDS/validate#84 1" | "github84" | 0 | "0 error messages expected" | "totalErrors" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github84_1.json -s json --skip-content-validation -c {resourceDir}/github84/config.txt -t {resourceDir}/github71/ELE_MOM.xml" | "report_github84_1.json" | +# FIXME 1058: Oh boy. It seems clearing the cache has now broken these tests both 71 and 84 --> they also kill eclipse for scary reasons. Ignore them for now as the schema is not working with the test: namespace +#| NASA-PDS/validate#71-1 |"NASA-PDS/validate#71 1" | "github71" | 0 | "0 error messages expected" | "totalErrors" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github71_1.json -s json -C {reportDir}/github71/catalog.xml --skip-content-validation -t {resourceDir}/github71/ELE_MOM.xml" | "report_github71_1.json" | +#| NASA-PDS/validate#71-2 |"NASA-PDS/validate#71 2" | "github71" | 0 | "0 error messages expected" | "totalErrors" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github71_2.json -s json -C {reportDir}/github71/catalog.xml -t {resourceDir}/github71/ELE_MOM_2.xml" | "report_github71_2.json" | +| NASA-PDS/validate#84-1 |"NASA-PDS/validate#84 1" | "github84" | 0 | "0 error messages expected" | "totalErrors" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github84_1.json -s json --skip-content-validation --skip-context-validation -c {resourceDir}/github84/config.txt -t {resourceDir}/github71/ELE_MOM.xml" | "report_github84_1.json" | | NASA-PDS/validate#87 |"NASA-PDS/validate#87 1" | "github87" | 0 | "0 errors expected" | "LABEL_UNRESOLVABLE_RESOURCE" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github87_1.json -s json -R pds4.label --skip-content-validation -t {resourceDir}/github87/2t126632959btr0200p3002n0a1.xml {resourceDir}/github87/2t126646972btr0200p3001n0a1.xml -C {reportDir}/catalog.xml" | "report_github87_1.json" | @@ -502,10 +502,10 @@ Scenario Outline: # # Table_Delimited tests -| NASA-PDS/validate#292 |"NASA-PDS/validate#292 TABLE_DELIMITED VALID LF" | "github292" | 0 | "0 error messages expected." | "totalErrors" | "src/test/resources" | "target/test" | "--skip-context-validation -C {reportDir}/catalog.xml -schema src/test/resources/github292/pds/v1/PDS4_PDS_1G00.xsd -schematron src/test/resources/github292/pds/v1/PDS4_PDS_1G00.sch -r {reportDir}/report_github292_label_table_delimited_valid_lf.json -s json -R pds4.label -t {resourceDir}/github292/table_delimited/kgrs_calibrated_spectra_per1_LF_VALID.xml" | "report_github292_label_table_delimited_valid_lf.json" | -| NASA-PDS/validate#292-1 |"NASA-PDS/validate#292 TABLE_DELIMITED VALID CRLF" | "github292" | 0 | "0 error messages expected." | "totalErrors" | "src/test/resources" | "target/test" | "--skip-context-validation -C {reportDir}/catalog.xml -schema src/test/resources/github292/pds/v1/PDS4_PDS_1G00.xsd -schematron src/test/resources/github292/pds/v1/PDS4_PDS_1G00.sch -r {reportDir}/report_github292_label_table_delimited_valid_crlf.json -s json -R pds4.label -t {resourceDir}/github292/table_delimited/kgrs_calibrated_spectra_per1_CRLF_VALID.xml" | "report_github292_label_table_delimited_valid_crlf.json" | -| NASA-PDS/validate#292-2 |"NASA-PDS/validate#292 TABLE_DELIMITED INVALID LF" | "github292" | 1 | "1 error message expected for MISSING_LF." | "MISSING_LF" | "src/test/resources" | "target/test" | "--skip-context-validation -C {reportDir}/catalog.xml -schema src/test/resources/github292/pds/v1/PDS4_PDS_1G00.xsd -schematron src/test/resources/github292/pds/v1/PDS4_PDS_1G00.sch -r {reportDir}/report_github292_label_table_delimited_invalid_lf.json -s json -R pds4.label -t {resourceDir}/github292/table_delimited/kgrs_calibrated_spectra_per1_LF_FAIL.xml" | "report_github292_label_table_delimited_invalid_lf.json" | -| NASA-PDS/validate#292-3 |"NASA-PDS/validate#292 TABLE_DELIMITED INVALID CR" | "github292" | 1 | "1 error message expected for MISSING_CRLF." | "MISSING_CRLF" | "src/test/resources" | "target/test" | "--skip-context-validation -C {reportDir}/catalog.xml -schema src/test/resources/github292/pds/v1/PDS4_PDS_1G00.xsd -schematron src/test/resources/github292/pds/v1/PDS4_PDS_1G00.sch -r {reportDir}/report_github292_label_table_delimited_invalid_crlf.json -s json -R pds4.label -t {resourceDir}/github292/table_delimited/kgrs_calibrated_spectra_per1_CRLF_FAIL.xml" | "report_github292_label_table_delimited_invalid_crlf.json" | +| NASA-PDS/validate#292 |"NASA-PDS/validate#292 TABLE_DELIMITED VALID LF" | "github292" | 0 | "0 error messages expected." | "totalErrors" | "src/test/resources" | "target/test" | "--skip-context-validation -C {reportDir}/catalog.xml -schema src/test/resources/github292/pds/v1/PDS4_PDS_1G00.xsd -schematron src/test/resources/github292/pds/v1/PDS4_PDS_1G00.sch -r {reportDir}/report_github292_label_table_delimited_valid_lf.json -s json -R pds4.label -t {resourceDir}/github292/table_delimited/kgrs_calibrated_spectra_per1_LF_VALID.xml" | "report_github292_label_table_delimited_valid_lf.json" | +| NASA-PDS/validate#292-1 |"NASA-PDS/validate#292 TABLE_DELIMITED VALID CRLF" | "github292" | 0 | "0 error messages expected." | "totalErrors" | "src/test/resources" | "target/test" | "--skip-context-validation -C {reportDir}/catalog.xml -schema src/test/resources/github292/pds/v1/PDS4_PDS_1G00.xsd -schematron src/test/resources/github292/pds/v1/PDS4_PDS_1G00.sch -r {reportDir}/report_github292_label_table_delimited_valid_crlf.json -s json -R pds4.label -t {resourceDir}/github292/table_delimited/kgrs_calibrated_spectra_per1_CRLF_VALID.xml" | "report_github292_label_table_delimited_valid_crlf.json" | +| NASA-PDS/validate#292-2 |"NASA-PDS/validate#292 TABLE_DELIMITED INVALID LF" | "github292" | 1 | "1 error message expected for MISSING_LF." | "MISSING_LF" | "src/test/resources" | "target/test" | "--skip-context-validation -C {reportDir}/catalog.xml -schema src/test/resources/github292/pds/v1/PDS4_PDS_1G00.xsd -schematron src/test/resources/github292/pds/v1/PDS4_PDS_1G00.sch -r {reportDir}/report_github292_label_table_delimited_invalid_lf.json -s json -R pds4.label -t {resourceDir}/github292/table_delimited/kgrs_calibrated_spectra_per1_LF_FAIL.xml" | "report_github292_label_table_delimited_invalid_lf.json" | +| NASA-PDS/validate#292-3 |"NASA-PDS/validate#292 TABLE_DELIMITED INVALID CR" | "github292" | 1 | "1 error message expected for MISSING_CRLF." | "MISSING_CRLF" | "src/test/resources" | "target/test" | "--skip-context-validation -C {reportDir}/catalog.xml -schema src/test/resources/github292/pds/v1/PDS4_PDS_1G00.xsd -schematron src/test/resources/github292/pds/v1/PDS4_PDS_1G00.sch -r {reportDir}/report_github292_label_table_delimited_invalid_crlf.json -s json -R pds4.label -t {resourceDir}/github292/table_delimited/kgrs_calibrated_spectra_per1_CRLF_FAIL.xml" | "report_github292_label_table_delimited_invalid_crlf.json" | # Table_Character tests From 8237c734f29f28f8915b1a17dec0cf104f614ad8 Mon Sep 17 00:00:00 2001 From: Al Niessner Date: Fri, 20 Dec 2024 16:03:17 -0800 Subject: [PATCH 09/10] fixes on last bugfix Updated the pom to use a patched version of xml-resolver. Not sure why it is not published by the original authors, but it did fix the test killing eclipse. Moved the last set of problems to bottom of the test stack so that {reportDir}/catalog.xml will be for those three last troublesome tests. --- pom.xml | 12 +++++++++--- src/test/resources/features/pre.3.6.x.feature | 13 ++++++------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/pom.xml b/pom.xml index 062ca3c3b..ee03ce32d 100644 --- a/pom.xml +++ b/pom.xml @@ -162,7 +162,13 @@ - + + + OSGeo + OSGeo + https://repo.osgeo.org/repository/release/ + + org.verapdf @@ -276,8 +282,8 @@ xml-resolver - xml-resolver - 1.2 + xml-resolver-patched + 1.2.1 org.apache.logging.log4j diff --git a/src/test/resources/features/pre.3.6.x.feature b/src/test/resources/features/pre.3.6.x.feature index d3ebba5e0..13cb92dc9 100644 --- a/src/test/resources/features/pre.3.6.x.feature +++ b/src/test/resources/features/pre.3.6.x.feature @@ -481,13 +481,6 @@ Scenario Outline: | NASA-PDS/validate#7 |"NASA-PDS/validate#7 Success with ComplexLSB8" | "github7" | 0 | "0 errors expected" | "totalErrors" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github7.json -s json --skip-context-validation -t {resourceDir}/github7/ch2_sar_ncxs_20090107t163003745_d_sli_xx_fp_hh_pb1_19111.xml" | "report_github7.json" | -# BIG_NOTE: The tests for github6 has to be moved toward the beginning as leave them here results in error in information model. -# BIG_NOTE: The tests for github240 has to be moved toward the beginning as leave them here results in error in information model. -# FIXME 1058: Oh boy. It seems clearing the cache has now broken these tests both 71 and 84 --> they also kill eclipse for scary reasons. Ignore them for now as the schema is not working with the test: namespace -#| NASA-PDS/validate#71-1 |"NASA-PDS/validate#71 1" | "github71" | 0 | "0 error messages expected" | "totalErrors" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github71_1.json -s json -C {reportDir}/github71/catalog.xml --skip-content-validation -t {resourceDir}/github71/ELE_MOM.xml" | "report_github71_1.json" | -#| NASA-PDS/validate#71-2 |"NASA-PDS/validate#71 2" | "github71" | 0 | "0 error messages expected" | "totalErrors" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github71_2.json -s json -C {reportDir}/github71/catalog.xml -t {resourceDir}/github71/ELE_MOM_2.xml" | "report_github71_2.json" | -| NASA-PDS/validate#84-1 |"NASA-PDS/validate#84 1" | "github84" | 0 | "0 error messages expected" | "totalErrors" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github84_1.json -s json --skip-content-validation --skip-context-validation -c {resourceDir}/github84/config.txt -t {resourceDir}/github71/ELE_MOM.xml" | "report_github84_1.json" | - | NASA-PDS/validate#87 |"NASA-PDS/validate#87 1" | "github87" | 0 | "0 errors expected" | "LABEL_UNRESOLVABLE_RESOURCE" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github87_1.json -s json -R pds4.label --skip-content-validation -t {resourceDir}/github87/2t126632959btr0200p3002n0a1.xml {resourceDir}/github87/2t126646972btr0200p3001n0a1.xml -C {reportDir}/catalog.xml" | "report_github87_1.json" | # Moved github292 tests to the end as they interfer with other test with the following error message: @@ -520,3 +513,9 @@ Scenario Outline: | NASA-PDS/validate#292-5 |"NASA-PDS/validate#292 INVENTORY VALID CRLF" | "github292" | 0 | "0 error messages expected." | "totalErrors" | "src/test/resources" | "target/test" | "--skip-context-validation -C {reportDir}/catalog.xml -schema src/test/resources/github292/pds/v1/PDS4_PDS_1G00.xsd -schematron src/test/resources/github292/pds/v1/PDS4_PDS_1G00.sch -r {reportDir}/report_github292_label_inventory_valid_crlf.json -s json -R pds4.label -t {resourceDir}/github292/inventory/collection_eetable_inventory_CRLF_VALID.xml" | "report_github292_label_inventory_valid_crlf.json" | | NASA-PDS/validate#292-6 |"NASA-PDS/validate#292 INVENTORY INVALID LF" | "github292" | 3 | "3 error messages expected for MISSING_LF." | "MISSING_LF" | "src/test/resources" | "target/test" | "--skip-context-validation -C {reportDir}/catalog.xml -schema src/test/resources/github292/pds/v1/PDS4_PDS_1G00.xsd -schematron src/test/resources/github292/pds/v1/PDS4_PDS_1G00.sch -r {reportDir}/report_github292_label_inventory_invalid_lf.json -s json -R pds4.label -t {resourceDir}/github292/inventory/collection_eetable_inventory_LF_FAIL.xml" | "report_github292_label_inventory_invalid_lf.json" | | NASA-PDS/validate#292-7 |"NASA-PDS/validate#292 INVENTORY INVALID CRLF" | "github292" | 3 | "3 error messages expected for MISSING_CRLF." | "MISSING_CRLF" | "src/test/resources" | "target/test" | "--skip-context-validation -C {reportDir}/catalog.xml -schema src/test/resources/github292/pds/v1/PDS4_PDS_1G00.xsd -schematron src/test/resources/github292/pds/v1/PDS4_PDS_1G00.sch -r {reportDir}/report_github292_label_inventory_invalid_crlf.json -s json -R pds4.label -t {resourceDir}/github292/inventory/collection_eetable_inventory_CRLF_FAIL.xml" | "report_github292_label_inventory_invalid_crlf.json" | + +# FIXME 1058: Oh boy. It seems clearing the cache has now broken these tests both 71 and 84 --> they also kill eclipse for scary reasons. Ignore them for now as the schema is not working with the test: namespace +| NASA-PDS/validate#71-1 |"NASA-PDS/validate#71 1" | "github71" | 0 | "0 error messages expected" | "totalErrors" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github71_1.json -s json -C {reportDir}/catalog.xml --skip-content-validation --skip-context-validation -t {resourceDir}/github71/ELE_MOM.xml" | "report_github71_1.json" | +| NASA-PDS/validate#71-2 |"NASA-PDS/validate#71 2" | "github71" | 0 | "0 error messages expected" | "totalErrors" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github71_2.json -s json -C {reportDir}/catalog.xml --skip-context-validation -t {resourceDir}/github71/ELE_MOM_2.xml" | "report_github71_2.json" | +| NASA-PDS/validate#84-1 |"NASA-PDS/validate#84 1" | "github84" | 0 | "0 error messages expected" | "totalErrors" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github84_1.json -s json --skip-content-validation --skip-context-validation -c {resourceDir}/github84/config.txt -t {resourceDir}/github71/ELE_MOM.xml" | "report_github84_1.json" | + From 00145058eea044f0c2c5c95063d6ee4394c24c24 Mon Sep 17 00:00:00 2001 From: Al Niessner Date: Mon, 6 Jan 2025 10:53:10 -0800 Subject: [PATCH 10/10] cannot isolate these well enough to find the problem --- src/test/resources/features/pre.3.6.x.feature | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/test/resources/features/pre.3.6.x.feature b/src/test/resources/features/pre.3.6.x.feature index 13cb92dc9..c1cc8d282 100644 --- a/src/test/resources/features/pre.3.6.x.feature +++ b/src/test/resources/features/pre.3.6.x.feature @@ -515,7 +515,8 @@ Scenario Outline: | NASA-PDS/validate#292-7 |"NASA-PDS/validate#292 INVENTORY INVALID CRLF" | "github292" | 3 | "3 error messages expected for MISSING_CRLF." | "MISSING_CRLF" | "src/test/resources" | "target/test" | "--skip-context-validation -C {reportDir}/catalog.xml -schema src/test/resources/github292/pds/v1/PDS4_PDS_1G00.xsd -schematron src/test/resources/github292/pds/v1/PDS4_PDS_1G00.sch -r {reportDir}/report_github292_label_inventory_invalid_crlf.json -s json -R pds4.label -t {resourceDir}/github292/inventory/collection_eetable_inventory_CRLF_FAIL.xml" | "report_github292_label_inventory_invalid_crlf.json" | # FIXME 1058: Oh boy. It seems clearing the cache has now broken these tests both 71 and 84 --> they also kill eclipse for scary reasons. Ignore them for now as the schema is not working with the test: namespace -| NASA-PDS/validate#71-1 |"NASA-PDS/validate#71 1" | "github71" | 0 | "0 error messages expected" | "totalErrors" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github71_1.json -s json -C {reportDir}/catalog.xml --skip-content-validation --skip-context-validation -t {resourceDir}/github71/ELE_MOM.xml" | "report_github71_1.json" | -| NASA-PDS/validate#71-2 |"NASA-PDS/validate#71 2" | "github71" | 0 | "0 error messages expected" | "totalErrors" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github71_2.json -s json -C {reportDir}/catalog.xml --skip-context-validation -t {resourceDir}/github71/ELE_MOM_2.xml" | "report_github71_2.json" | -| NASA-PDS/validate#84-1 |"NASA-PDS/validate#84 1" | "github84" | 0 | "0 error messages expected" | "totalErrors" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github84_1.json -s json --skip-content-validation --skip-context-validation -c {resourceDir}/github84/config.txt -t {resourceDir}/github71/ELE_MOM.xml" | "report_github84_1.json" | +# FIXME: 1102: Could not resolve these 3 and it seems to be related to the catalog file while tests pass and use the catalog file. Unfortunately, the use of the catalog file causes cross talk among the tests. Once the cross talk is removed (#1102), then maybe these three can be reinstated or the problem with catalog handling be isolated and repaired. +#| NASA-PDS/validate#71-1 |"NASA-PDS/validate#71 1" | "github71" | 0 | "0 error messages expected" | "totalErrors" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github71_1.json -s json -C {resourceDir}/github71/catalog.xml --skip-content-validation --skip-context-validation -t {resourceDir}/github71/ELE_MOM.xml" | "report_github71_1.json" | +#| NASA-PDS/validate#71-2 |"NASA-PDS/validate#71 2" | "github71" | 0 | "0 error messages expected" | "totalErrors" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github71_2.json -s json -C {resourceDir}/github71/catalog.xml --skip-context-validation -t {resourceDir}/github71/ELE_MOM_2.xml" | "report_github71_2.json" | +#| NASA-PDS/validate#84-1 |"NASA-PDS/validate#84 1" | "github84" | 0 | "0 error messages expected" | "totalErrors" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github84_1.json -s json --skip-content-validation --skip-context-validation -c {resourceDir}/github84/config.txt -t {resourceDir}/github71/ELE_MOM.xml" | "report_github84_1.json" |