Skip to content

Commit

Permalink
issue #75: add tag LET
Browse files Browse the repository at this point in the history
  • Loading branch information
pkiraly committed Dec 18, 2020
1 parent 63d2826 commit f39d814
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
- 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, 960,
961, 962, 963, 964, 966, 968, 970, 975, 976, 979, 980, 985, 990, 992, 996, 997,
A02, AQN, BGT, BUF, CFI, CNF, DGM, DRT, EST, EXP, FFP, FIN, LAS, LCS, LDO, LEO
A02, AQN, BGT, BUF, CFI, CNF, DGM, DRT, EST, EXP, FFP, FIN, LAS, LCS, LDO, LEO, LET

Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
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;

/**
* Serials claim letter title
*/
public class TagLET extends DataFieldDefinition {

private static TagLET uniqueInstance;

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

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

private void initialize() {

tag = "LET";
label = "Serials claim letter title";
mqTag = "SerialsClaimLetterTitle";
cardinality = Cardinality.Nonrepeatable;
// descriptionUrl = "https://www.loc.gov/marc/bibliographic/bd037.html";
// setCompilanceLevels("O");

ind1 = new Indicator();

ind2 = new Indicator("Number of non-filing characters")
.setCodes("0-9", "0-9")
.setMqTag("nonFilingCharacters");
ind2.getCode("0-9").setRange(true);

setSubfieldsWithCardinality(
"a", "Serial claim letter title", "NR"
);

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

import de.gwdg.metadataqa.marc.DataField;
import org.junit.Test;

public class TagLETTest extends BLTagTest {

public TagLETTest() {
super(TagLET.getInstance());
}

@Test
public void testValidFields() {
validField(new DataField(tag, " ", "0", "a", "British farmer and grower. West Midlands ed."));
validField(new DataField(tag, " ", "1", "a", "British farmer and grower. West Midlands ed."));
validField(new DataField(tag, " ", "2", "a", "British farmer and grower. West Midlands ed."));
validField(new DataField(tag, " ", "3", "a", "British farmer and grower. West Midlands ed."));
validField(new DataField(tag, " ", "4", "a", "British farmer and grower. West Midlands ed."));
validField(new DataField(tag, " ", "5", "a", "British farmer and grower. West Midlands ed."));
validField(new DataField(tag, " ", "6", "a", "British farmer and grower. West Midlands ed."));
validField(new DataField(tag, " ", "7", "a", "British farmer and grower. West Midlands ed."));
validField(new DataField(tag, " ", "8", "a", "British farmer and grower. West Midlands ed."));
validField(new DataField(tag, " ", "9", "a", "British farmer and grower. West Midlands ed."));
}

@Test
public void testInvalidFields() {
invalidField("1", "a", "Y");
invalidField("e", "20050944");
}
}
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(381, tags.size());
assertEquals(382, 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 f39d814

Please sign in to comment.