Skip to content

Commit

Permalink
Cleanup Avram schema files of K10plus and allow updating the schema #291
Browse files Browse the repository at this point in the history
  • Loading branch information
pkiraly committed Nov 6, 2023
1 parent fb25e00 commit 2b89051
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 33,190 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

public class RecordIgnoratorPicaTest {

PicaSchemaManager schema = PicaSchemaReader.createSchema(getPath("pica/avram-k10plus.json"));
PicaSchemaManager schema = PicaSchemaReader.createSchema(getPathFromMain("pica/avram-k10plus.json"));

@Test
public void parse_ex1() {
Expand Down Expand Up @@ -149,6 +149,10 @@ private String getPath(String fileName) {
return Paths.get("src/test/resources/" + fileName).toAbsolutePath().toString();
}

private String getPathFromMain(String fileName) {
return Paths.get("src/main/resources/" + fileName).toAbsolutePath().toString();
}

private void testParsing(String ignorableRecordsInput, int size, String path, Operator op, String value) {
RecordIgnorator ignorator = new RecordIgnoratorPica(ignorableRecordsInput);
assertFalse(ignorator.isEmpty());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ public class PicaSchemaReaderTest {

@Test
public void testFirst() {
PicaSchemaManager schema = PicaSchemaReader.createSchema(getPath("pica/avram-k10plus.json"));
assertEquals(438, schema.size());
PicaSchemaManager schema = PicaSchemaReader.createSchema(getPathFromMain("pica/avram-k10plus.json"));
assertEquals(437, schema.size());
PicaFieldDefinition field = schema.lookup("001A");
assertEquals("001A", field.getTag());
assertEquals("Kennung und Datum der Ersterfassung", field.getLabel());
Expand All @@ -35,8 +35,8 @@ public void testFirst() {

@Test
public void testOneWithPercent() {
PicaSchemaManager schema = PicaSchemaReader.createSchema(getPath("pica/avram-k10plus.json"));
assertEquals(438, schema.size());
PicaSchemaManager schema = PicaSchemaReader.createSchema(getPathFromMain("pica/avram-k10plus.json"));
assertEquals(437, schema.size());
PicaFieldDefinition field = schema.lookup("022A/00");
assertEquals("022A", field.getTag());
assertEquals("Werktitel und sonstige unterscheidende Merkmale des Werks", field.getLabel());
Expand All @@ -60,7 +60,7 @@ public void testOneWithPercent() {

@Test
public void testCloning() {
PicaSchemaManager schema = PicaSchemaReader.createSchema(getPath("pica/avram-k10plus-title.json"));
PicaSchemaManager schema = PicaSchemaReader.createSchema(getPathFromMain("pica/avram-k10plus-title.json"));
PicaFieldDefinition tag = schema.lookup("045B");
assertNotNull(tag);
assertEquals("045B", tag.getId());
Expand All @@ -70,4 +70,8 @@ public void testCloning() {
private String getPath(String fileName) {
return Paths.get("src/test/resources/" + fileName).toAbsolutePath().toString();
}

private String getPathFromMain(String fileName) {
return Paths.get("src/main/resources/" + fileName).toAbsolutePath().toString();
}
}
Loading

0 comments on commit 2b89051

Please sign in to comment.