-
Notifications
You must be signed in to change notification settings - Fork 11
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
validate does not flag <CR> within lid_reference #401
Comments
First inspection of the code reveals something interesting. The call to node.getTextContent() at line 258 does contains the CR but when the trim() function is applied, the CR is removed. The bug is identified and can indeed be fixed.
|
qchaupds
pushed a commit
that referenced
this issue
Sep 16, 2021
…l integrity checks. 1. Add new test resources : src/test/resources/github401 2. Add logic to check for extraneous carriage returns for references : src/main/java/gov/nasa/pds/tools/util/LabelUtil.java 3. Add new regression test : src/test/resources/features/validate.feature Refs: #401 validate does not flag <CR> within lid_reference
jordanpadams
added a commit
that referenced
this issue
Sep 24, 2021
jordanpadams
added a commit
that referenced
this issue
Sep 24, 2021
* Check all documents specified in Product_Document tags for correct mime types. 1. Add new test resources :src/test/resources/github367 2. Add needed dependency for group com.sun.activation, which is the implementation jar :pom.xml 3. Add default mime type resource file :src/main/resources/validate_default_mime_types.txt 4. Add new class to validate JPEG and PNG image file content :src/main/java/gov/nasa/pds/tools/util/ImageUtil.java 5. Add new class to check if the mime type of a given file matches its file extension :src/main/java/gov/nasa/pds/tools/util/DocumentsChecker.java 6. Add new problem types :src/main/java/gov/nasa/pds/tools/validate/ProblemType.java 7. Add check for all file_name tags in Product_Document tags :src/main/java/gov/nasa/pds/tools/validate/rule/pds4/FileReferenceValidationRule.java 8. Add new regression test :src/test/resources/features/validate.feature Refs: #367 As a user, I want to validate all files referenced by a Product_Document * Using alternative method to get the parent * Fix sonatype-lift complaints: unused variables * Check all references for extraneous carriage return in the referential integrity checks. 1. Add new test resources : src/test/resources/github401 2. Add logic to check for extraneous carriage returns for references : src/main/java/gov/nasa/pds/tools/util/LabelUtil.java 3. Add new regression test : src/test/resources/features/validate.feature Refs: #401 validate does not flag <CR> within lid_reference * Add missing feature file in previous commit * Make function getIdentifiersCommon() synchronized to avoid threads error Co-authored-by: Qui T Chau <qchau@pds-dev3.jpl.nasa.gov> Co-authored-by: Jordan Padams <33492486+jordanpadams@users.noreply.github.com>
jordanpadams
added a commit
that referenced
this issue
Sep 24, 2021
* Check all documents specified in Product_Document tags for correct mime types. 1. Add new test resources :src/test/resources/github367 2. Add needed dependency for group com.sun.activation, which is the implementation jar :pom.xml 3. Add default mime type resource file :src/main/resources/validate_default_mime_types.txt 4. Add new class to validate JPEG and PNG image file content :src/main/java/gov/nasa/pds/tools/util/ImageUtil.java 5. Add new class to check if the mime type of a given file matches its file extension :src/main/java/gov/nasa/pds/tools/util/DocumentsChecker.java 6. Add new problem types :src/main/java/gov/nasa/pds/tools/validate/ProblemType.java 7. Add check for all file_name tags in Product_Document tags :src/main/java/gov/nasa/pds/tools/validate/rule/pds4/FileReferenceValidationRule.java 8. Add new regression test :src/test/resources/features/validate.feature Refs: #367 As a user, I want to validate all files referenced by a Product_Document * Using alternative method to get the parent * Fix sonatype-lift complaints: unused variables * Check all references for extraneous carriage return in the referential integrity checks. 1. Add new test resources : src/test/resources/github401 2. Add logic to check for extraneous carriage returns for references : src/main/java/gov/nasa/pds/tools/util/LabelUtil.java 3. Add new regression test : src/test/resources/features/validate.feature Refs: #401 validate does not flag <CR> within lid_reference * Add missing feature file in previous commit * Make function getIdentifiersCommon() synchronized to avoid threads error * Check .tab file for records of same length and correct ERROR printing to debug for DocumentsChecker 1. Add new test resources : src/test/resources/github390 2. Correct ERROR printing to debug : src/main/java/gov/nasa/pds/tools/util/DocumentsChecker.java 3. Add check for .tab file for records of same length : src/main/java/gov/nasa/pds/tools/validate/rule/pds4/TableDataContentValidationRule.java 4. Add new regression test : src/test/resources/features/validate.feature Refs: #390 validate does not flag *.tab files with variable length records Co-authored-by: Qui T Chau <qchau@pds-dev3.jpl.nasa.gov> Co-authored-by: Jordan Padams <33492486+jordanpadams@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🐛 Describe the bug
I'm not 100% sure if this is a validate bug, or that something in the IM needs to be better constrained, but I'm assuming for now the former. Products declaring
[lid_reference](https://pds.nasa.gov/datastandards/documents/dd/current/PDS4_PDS_DD_1G00.html#d5e44434)
(e.g. inInternal_Reference
) currently allow according to validate, e.g. this is valid:However, oXygen reports:
📜 To Reproduce
Steps to reproduce the behavior:
🕵️ Expected behavior
I would not expect that carriage return would be allowed within an internal reference, and would expect a validation error.
📚 Version of Software Used
validate 2.0.7
🖥 System Info
🦄 Related requirements
⚙️ Engineering Details
The text was updated successfully, but these errors were encountered: