-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
75 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
src/main/java/de/gwdg/metadataqa/marc/definition/tags/bltags/TagSRC.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/test/java/de/gwdg/metadataqa/marc/definition/tags/bltags/TagSRCTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters