Skip to content

Commit

Permalink
issue #75: add tag 960
Browse files Browse the repository at this point in the history
  • Loading branch information
pkiraly committed Dec 8, 2020
1 parent 23951bc commit b0ee25c
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
### Added

- British Library tags: 039, 091, 509, 539, 590, 591, 592, 594, 595, 596, 597, 598, 599,
690, 692, 852$a (code list), 859, 909, 916, 917, 945, 950, 954, 955, 957, 959
690, 692, 852$a (code list), 859, 909, 916, 917, 945, 950, 954, 955, 957, 959, 960
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
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;

/**
* Normalised Place of Publication
*/
public class Tag960 extends DataFieldDefinition {

private static Tag960 uniqueInstance;

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

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

private void initialize() {

tag = "960";
label = "Normalised Place of Publication";
mqTag = "normalisedPlaceOfPublication";
cardinality = Cardinality.Repeatable;
// descriptionUrl = "https://www.loc.gov/marc/bibliographic/bd037.html";
// setCompilanceLevels("O");

ind1 = new Indicator("Printing instruction")
.setCodes(
"0", "Printing data",
"1", "Non-printing data"
)
.setMqTag("printingInstruction");

ind2 = new Indicator();

setSubfieldsWithCardinality(
"a", "Normalised place of publication", "NR"
);

getSubfield("a")
.setMqTag("place");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void validField(DataField field) {
tag.getTag(), subfield.getCode(), subfield.getValue()),
field.validate(MarcVersion.MARC21));
assertTrue(
String.format("%s$%s=%s should be valid in normal case",
String.format("%s$%s=%s should be valid in BL case",
tag.getTag(), subfield.getCode(), subfield.getValue()),
field.validate(MarcVersion.BL));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package de.gwdg.metadataqa.marc.definition.tags.bltags;

import org.junit.Test;

public class Tag960Test extends BLTagTest {

public Tag960Test() {
super(Tag960.getInstance());
}

@Test
public void testValidFields() {
validField("0", "a", "Warsaw");
validField("1", "a", "Warsaw");
validField("0", "a", "Lund");
}

@Test
public void testInvalidFields() {
invalidField("2", "a", "Priority processing");
invalidField("b", "Priority processing");
}
}
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(348, tags.size());
assertEquals(349, 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 b0ee25c

Please sign in to comment.