Skip to content

Commit

Permalink
Rename error hasInvalidValue to invalidValue (#389)
Browse files Browse the repository at this point in the history
This solves the most crucial part of #383.
  • Loading branch information
nichtich authored Dec 20, 2023
1 parent ba32c86 commit 04b0fc8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -511,13 +511,13 @@ options:
* `ambiguousLinkage`: ambiguous linkage
* `obsoleteControlPosition`: obsolete code
* `controlValueContainsInvalidCode`: invalid code
* `hasInvalidValue`: invalid value
* `invalidValue`: invalid value
* `missingSubfield`: missing reference subfield (880$6)
* `nonrepeatableField`: repetition of non-repeatable field
* `undefinedField`: undefined field
* `obsoleteIndicator`: obsolete value
* `nonEmptyIndicator`: non-empty indicator
* `hasInvalidValue`: invalid value
* `invalidValue`: invalid value
* `undefinedSubfield`: undefined subfield
* `invalidLength`: invalid length
* `invalidReference`: invalid classification reference
Expand All @@ -527,7 +527,7 @@ options:
* `invalidISSN`: invalid ISSN
* `unparsableContent`: content is not well-formatted
* `nullCode`: null subfield code
* `hasInvalidValue`: invalid value
* `invalidValue`: invalid value

Outputs:
* `count.csv`: the count of bibliographic records in the source dataset
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public enum ValidationErrorType {
// control subfield
CONTROL_POSITION_OBSOLETE_CODE(4, "obsoleteControlPosition", "obsolete code", ValidationErrorCategory.CONTROLFIELD),
CONTROL_POSITION_INVALID_CODE(5, "controlValueContainsInvalidCode", "invalid code", ValidationErrorCategory.CONTROLFIELD),
CONTROL_POSITION_INVALID_VALUE(6, "hasInvalidValue", "invalid value", ValidationErrorCategory.CONTROLFIELD),
CONTROL_POSITION_INVALID_VALUE(6, "invalidValue", "invalid value", ValidationErrorCategory.CONTROLFIELD),

// field
FIELD_MISSING_REFERENCE_SUBFIELD(7, "missingSubfield", "missing reference subfield (880$6)", ValidationErrorCategory.DATAFIELD),
Expand All @@ -21,7 +21,7 @@ public enum ValidationErrorType {
// indicator
INDICATOR_OBSOLETE(10, "obsoleteIndicator", "obsolete value", ValidationErrorCategory.INDICATOR),
INDICATOR_NON_EMPTY(11, "nonEmptyIndicator", "non-empty indicator", ValidationErrorCategory.INDICATOR),
INDICATOR_INVALID_VALUE(12, "hasInvalidValue", "invalid value", ValidationErrorCategory.INDICATOR),
INDICATOR_INVALID_VALUE(12, "invalidValue", "invalid value", ValidationErrorCategory.INDICATOR),

// subfield
SUBFIELD_UNDEFINED(13, "undefinedSubfield", "undefined subfield", ValidationErrorCategory.SUBFIELD),
Expand All @@ -33,7 +33,7 @@ public enum ValidationErrorType {
SUBFIELD_ISSN(19, "invalidISSN", "invalid ISSN", ValidationErrorCategory.SUBFIELD),
SUBFIELD_UNPARSABLE_CONTENT(20, "unparsableContent", "content is not well-formatted", ValidationErrorCategory.SUBFIELD),
SUBFIELD_NULL_CODE(21, "nullCode", "null subfield code", ValidationErrorCategory.SUBFIELD),
SUBFIELD_INVALID_VALUE(22, "hasInvalidValue", "invalid value", ValidationErrorCategory.SUBFIELD),
SUBFIELD_INVALID_VALUE(22, "invalidValue", "invalid value", ValidationErrorCategory.SUBFIELD),
;

private final int id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void testHasInvalidValue() {
ValidationErrorType errorType = ValidationErrorType.SUBFIELD_INVALID_VALUE;
assertEquals("SUBFIELD_INVALID_VALUE", errorType.name());
assertEquals("SUBFIELD_INVALID_VALUE", errorType.toString());
assertEquals("hasInvalidValue", errorType.getCode());
assertEquals("invalidValue", errorType.getCode());
assertEquals("invalid value", errorType.getMessage());
assertEquals("subfield", errorType.getCategory().getName());
}
Expand Down
10 changes: 5 additions & 5 deletions src/test/java/de/gwdg/metadataqa/marc/dao/Control007Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void testMap() {
validator.getValidationErrors().get(0).getMarcPath());
assertEquals("c",
validator.getValidationErrors().get(0).getMessage());
assertEquals("hasInvalidValue",
assertEquals("invalidValue",
validator.getValidationErrors().get(0).getType().getCode());
assertEquals(ValidationErrorType.CONTROL_POSITION_INVALID_VALUE,
validator.getValidationErrors().get(0).getType());
Expand All @@ -89,7 +89,7 @@ public void testMap() {
validator.getValidationErrors().get(1).getMarcPath());
assertEquals(" ",
validator.getValidationErrors().get(1).getMessage());
assertEquals("hasInvalidValue",
assertEquals("invalidValue",
validator.getValidationErrors().get(1).getType().getCode());
assertEquals(ValidationErrorType.CONTROL_POSITION_INVALID_VALUE,
validator.getValidationErrors().get(1).getType());
Expand Down Expand Up @@ -809,7 +809,7 @@ public void testSoundRecording() {
validator.getValidationErrors().get(0).getMarcPath());
assertEquals(" ",
validator.getValidationErrors().get(0).getMessage());
assertEquals("hasInvalidValue",
assertEquals("invalidValue",
validator.getValidationErrors().get(0).getType().getCode());
assertEquals(ValidationErrorType.CONTROL_POSITION_INVALID_VALUE,
validator.getValidationErrors().get(0).getType());
Expand All @@ -820,7 +820,7 @@ public void testSoundRecording() {
validator.getValidationErrors().get(1).getMarcPath());
assertEquals(" ",
validator.getValidationErrors().get(1).getMessage());
assertEquals("hasInvalidValue",
assertEquals("invalidValue",
validator.getValidationErrors().get(1).getType().getCode());
assertEquals(ValidationErrorType.CONTROL_POSITION_INVALID_VALUE,
validator.getValidationErrors().get(1).getType());
Expand All @@ -831,7 +831,7 @@ public void testSoundRecording() {
validator.getValidationErrors().get(2).getMarcPath());
assertEquals(" ",
validator.getValidationErrors().get(2).getMessage());
assertEquals("hasInvalidValue",
assertEquals("invalidValue",
validator.getValidationErrors().get(2).getType().getCode());
assertEquals(ValidationErrorType.CONTROL_POSITION_INVALID_VALUE,
validator.getValidationErrors().get(2).getType());
Expand Down

0 comments on commit 04b0fc8

Please sign in to comment.