Skip to content

Commit

Permalink
issue #75: add tag 596
Browse files Browse the repository at this point in the history
  • Loading branch information
pkiraly committed Dec 7, 2020
1 parent 806af47 commit 9e5b088
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

### Added

- British Library tags: 039, 091, 509, 539, 590, 591, 592, 594, 595
- British Library tags: 039, 091, 509, 539, 590, 591, 592, 594, 595, 596
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package de.gwdg.metadataqa.marc.definition.tags.bltags;

import de.gwdg.metadataqa.marc.definition.Cardinality;
import de.gwdg.metadataqa.marc.definition.DataFieldDefinition;
import de.gwdg.metadataqa.marc.definition.Indicator;
import de.gwdg.metadataqa.marc.definition.general.validator.RegexValidator;

/**
* National Bibliography Issue Number
*/
public class Tag596 extends DataFieldDefinition {

private static Tag596 uniqueInstance;

private Tag596() {
initialize();
postCreation();
}

public static Tag596 getInstance() {
if (uniqueInstance == null)
uniqueInstance = new Tag596();
return uniqueInstance;
}

private void initialize() {

tag = "596";
label = "Temporary Note";
mqTag = "temporaryNote";
cardinality = Cardinality.Repeatable;
// descriptionUrl = "https://www.loc.gov/marc/bibliographic/bd037.html";
// setCompilanceLevels("O");

ind1 = new Indicator();
ind2 = new Indicator();

setSubfieldsWithCardinality(
"a", "Temporary note", "NR"
);

getSubfield("a")
.setMqTag("note");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package de.gwdg.metadataqa.marc.definition.tags.bltags;

import org.junit.Test;

public class Tag596Test extends BLTagTest {

public Tag596Test() {
super(Tag596.getInstance());
}

@Test
public void testValidFields() {
validField("a", "Publisher deposit filename:CTEERCS052018R04.pdf");
}

@Test
public void testInvalidFields() {
invalidField("b", "NLS copy dimensions: 16 cm.");
invalidField("1", "a", "NLS copy dimensions: 16 cm.");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public void testListTag() {
List<Class<? extends DataFieldDefinition>> tags = MarcTagLister.listTags();
assertNotNull(tags);
assertNotEquals(0, tags.size());
assertEquals(332, tags.size());
assertEquals(333, tags.size());
assertEquals("Tag010", tags.get(0).getSimpleName());
Map<String, Integer> versionCounter = new HashMap<>();
Map<MarcVersion, Integer> versionCounter2 = new HashMap<>();
Expand Down

0 comments on commit 9e5b088

Please sign in to comment.