From 5a81deec0d89168d23ab1f4c6d76c301c6f1628e Mon Sep 17 00:00:00 2001 From: Jordan Padams Date: Wed, 3 Jul 2024 09:22:58 -0700 Subject: [PATCH 1/3] Add test for disabling context ref mismatch Adding test that currently fails per #950 --- src/test/resources/features/developer.feature | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/test/resources/features/developer.feature b/src/test/resources/features/developer.feature index a1b03fd39..aa11007f2 100644 --- a/src/test/resources/features/developer.feature +++ b/src/test/resources/features/developer.feature @@ -15,6 +15,9 @@ Scenario Outline: Execute validate command for tests below. # Validate#915 |"NASA-PDS/validate#915 Failure context ref mismatch" | "github915" | 4 | "4 warnings expected" | "CONTEXT_REFERENCE_FOUND_MISMATCH_WARN" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github915.json -s json --skip-content-validation -R pds4.collection -t {resourceDir}/github915/collection.xml" | "report_github915.json" | +# Validate#950 +|"NASA-PDS/validate#950 Disable context ref mismatch collection" | "github915" | 0 | "0 warnings expected" | "CONTEXT_REFERENCE_FOUND_MISMATCH_WARN" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github950.json -s json --skip-content-validation -R pds4.collection -t {resourceDir}/github915/collection.xml" | "report_github950.json" | + # Validate#905 |"NASA-PDS/validate#905 Success no duplicates in non-observational;" | "github905" | 0 | "0 errors expected" | "totalErrors" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github905.json -s json --skip-context-validation -t {resourceDir}/github905/dsn_0159-science.2008-02-29.xml {resourceDir}/github905/dsn_0159-science.2009-05-18.xml" | "report_github905.json" | From 524d51c789a6e911eeee47127ff6bb45f5e06fe4 Mon Sep 17 00:00:00 2001 From: Al Niessner Date: Thu, 8 Aug 2024 09:18:13 -0700 Subject: [PATCH 2/3] add the disable to the test --- src/test/resources/features/developer.feature | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/resources/features/developer.feature b/src/test/resources/features/developer.feature index aa11007f2..bee2b9309 100644 --- a/src/test/resources/features/developer.feature +++ b/src/test/resources/features/developer.feature @@ -9,15 +9,15 @@ Scenario Outline: Execute validate command for tests below. Examples: | testName | testDir | messageCount | messageText | problemEnum | resourceDir | reportDir | commandArgs | refOutputValue | +# Validate#950 +|"NASA-PDS/validate#950 Disable context ref mismatch collection" | "github915" | 0 | "0 warnings expected" | "CONTEXT_REFERENCE_FOUND_MISMATCH_WARN" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github950.json -s json --skip-content-validation --disable-context-mismatch-warnings -R pds4.collection -t {resourceDir}/github915/collection.xml" | "report_github950.json" | + # Validate#919 |"NASA-PDS/validate#919 Success with 61 bit value" | "github919" | 0 | "0 errors expected" | "totalErrors" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github919.json -s json --skip-context-validation -t {resourceDir}/github919/uh0003b_draft.xml" | "report_github919.json" | # Validate#915 |"NASA-PDS/validate#915 Failure context ref mismatch" | "github915" | 4 | "4 warnings expected" | "CONTEXT_REFERENCE_FOUND_MISMATCH_WARN" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github915.json -s json --skip-content-validation -R pds4.collection -t {resourceDir}/github915/collection.xml" | "report_github915.json" | -# Validate#950 -|"NASA-PDS/validate#950 Disable context ref mismatch collection" | "github915" | 0 | "0 warnings expected" | "CONTEXT_REFERENCE_FOUND_MISMATCH_WARN" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github950.json -s json --skip-content-validation -R pds4.collection -t {resourceDir}/github915/collection.xml" | "report_github950.json" | - # Validate#905 |"NASA-PDS/validate#905 Success no duplicates in non-observational;" | "github905" | 0 | "0 errors expected" | "totalErrors" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github905.json -s json --skip-context-validation -t {resourceDir}/github905/dsn_0159-science.2008-02-29.xml {resourceDir}/github905/dsn_0159-science.2009-05-18.xml" | "report_github905.json" | From c508de49a5fdc1eeadf05af8c366b89acda56a7b Mon Sep 17 00:00:00 2001 From: Al Niessner Date: Thu, 8 Aug 2024 09:50:28 -0700 Subject: [PATCH 3/3] propigate values --- .../nasa/pds/tools/validate/rule/AbstractValidationRule.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/gov/nasa/pds/tools/validate/rule/AbstractValidationRule.java b/src/main/java/gov/nasa/pds/tools/validate/rule/AbstractValidationRule.java index 3a9a3dd83..93e877528 100644 --- a/src/main/java/gov/nasa/pds/tools/validate/rule/AbstractValidationRule.java +++ b/src/main/java/gov/nasa/pds/tools/validate/rule/AbstractValidationRule.java @@ -113,7 +113,8 @@ protected RuleContext getChildContext(URL child) newContext.setLabelExtension(context.getLabelExtension()); newContext.setLabelPattern(context.getLabelPattern()); newContext.setLastDirectoryFlag(context.isLastDirectory()); - + newContext.setEveryN(this.context.getEveryN()); + newContext.setContextMismatchAsWarn(this.context.getContextMismatchAsWarn()); return newContext; }