Skip to content

Commit

Permalink
issue #75: add tag SRC
Browse files Browse the repository at this point in the history
  • Loading branch information
pkiraly committed Dec 18, 2020
1 parent a7009eb commit 1c466b4
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
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, LET,
MIS, MNI, MPX, NEG, NID, OBJ, OHC, ONS, ONX, PLR, RSC
MIS, MNI, MPX, NEG, NID, OBJ, OHC, ONS, ONX, PLR, RSC, SRC

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

/**
* Source
*/
public class TagSRC extends DataFieldDefinition {

private static TagSRC uniqueInstance;

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

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

private void initialize() {

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

ind1 = new Indicator();

ind2 = new Indicator();

setSubfieldsWithCardinality(
"a", "Source", "NR",
"b", "Physical file name", "NR"
);

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

import org.junit.Test;

public class TagSRCTest extends BLTagTest {

public TagSRCTest() {
super(TagSRC.getInstance());
}

@Test
public void testValidFields() {
validField("a", "HSS01", "b", "bibmp13.20030902.2.ac");
validField("a", "NETCAT", "b", "netcatprn.20110310");
validField("a", "Kozmenko Books - Supplier", "b", "inbl12062");
validField("a", "Ingrams");
validField("a", "ALDL");
validField("a", "EThOS", "b", "ethos.mds.20120401.mrc");
validField("a", "WW1", "b", "Europeana_Collections_1914-1918_20131010_1");
}

@Test
public void testInvalidFields() {
invalidField("1", "a", "Y");
invalidField("c", "a");
}
}
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(393, tags.size());
assertEquals(394, 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 1c466b4

Please sign in to comment.