diff --git a/src/main/java/de/gwdg/metadataqa/marc/cli/parameters/CommonParameters.java b/src/main/java/de/gwdg/metadataqa/marc/cli/parameters/CommonParameters.java index 532930fa..b38c9a7b 100644 --- a/src/main/java/de/gwdg/metadataqa/marc/cli/parameters/CommonParameters.java +++ b/src/main/java/de/gwdg/metadataqa/marc/cli/parameters/CommonParameters.java @@ -47,7 +47,9 @@ public class CommonParameters implements Serializable { protected boolean lineSeparated = false; protected boolean trimId = false; private String outputDir = DEFAULT_OUTPUT_DIR; + @JsonIgnore protected RecordIgnorator recordIgnorator; + protected String ignorableRecords; protected RecordFilter recordFilter; protected IgnorableFields ignorableFields = new IgnorableFields(); protected InputStream stream = null; @@ -194,7 +196,7 @@ private void readDefaultEncoding() { } private void readIgnorableRecords() { - String ignorableRecords = cmd.hasOption("ignorableRecords") ? cmd.getOptionValue("ignorableRecords") : ""; + ignorableRecords = cmd.hasOption("ignorableRecords") ? cmd.getOptionValue("ignorableRecords") : ""; setRecordIgnorator(ignorableRecords); } diff --git a/src/test/java/de/gwdg/metadataqa/marc/cli/ClassificationAnalysisTest.java b/src/test/java/de/gwdg/metadataqa/marc/cli/ClassificationAnalysisTest.java index d08e1752..4ca05d00 100644 --- a/src/test/java/de/gwdg/metadataqa/marc/cli/ClassificationAnalysisTest.java +++ b/src/test/java/de/gwdg/metadataqa/marc/cli/ClassificationAnalysisTest.java @@ -7,6 +7,7 @@ import de.gwdg.metadataqa.marc.cli.utils.RecordIterator; import de.gwdg.metadataqa.marc.utils.ReadMarc; import org.apache.commons.io.FileUtils; +import org.apache.commons.lang3.StringUtils; import org.junit.Before; import org.junit.Test; import org.marc4j.marc.Record; @@ -158,7 +159,7 @@ public void marcxml() throws IOException { "--collectCollocations", "--marcxml", "--outputDir", outputDir, - inputFile = TestUtils.getPath("marcxml/marcxml.xml") + TestUtils.getPath("marcxml/marcxml.xml") }; ClassificationAnalysis.main(args); diff --git a/src/test/java/de/gwdg/metadataqa/marc/cli/CompletenessTest.java b/src/test/java/de/gwdg/metadataqa/marc/cli/CompletenessTest.java index c5eb858a..4d2fb818 100644 --- a/src/test/java/de/gwdg/metadataqa/marc/cli/CompletenessTest.java +++ b/src/test/java/de/gwdg/metadataqa/marc/cli/CompletenessTest.java @@ -321,7 +321,6 @@ public void completeness_pica_groupBy_file() throws Exception { assertTrue(line.contains("\"trimId\":false,")); assertTrue(line.contains("\"outputDir\":\"/")); assertTrue(line.contains("/qa-catalogue/src/test/resources/output\",")); - assertTrue(line.contains("\"recordIgnorator\":{\"criteria\":[],\"booleanCriteria\":null,\"empty\":true},")); assertTrue(line.contains("\"recordFilter\":{\"criteria\":[],\"booleanCriteria\":null,\"empty\":true},")); assertTrue(line.contains("\"ignorableFields\":{\"fields\":null,\"empty\":true},")); assertTrue(line.contains("\"stream\":null,")); diff --git a/src/test/java/de/gwdg/metadataqa/marc/cli/ValidatorCliTest.java b/src/test/java/de/gwdg/metadataqa/marc/cli/ValidatorCliTest.java index fa6b359c..6e74fe8c 100644 --- a/src/test/java/de/gwdg/metadataqa/marc/cli/ValidatorCliTest.java +++ b/src/test/java/de/gwdg/metadataqa/marc/cli/ValidatorCliTest.java @@ -12,6 +12,7 @@ import java.util.Arrays; import java.util.List; import java.util.regex.Pattern; +import java.util.stream.Collectors; import static junit.framework.TestCase.assertTrue; import static org.junit.Assert.assertEquals; @@ -229,7 +230,6 @@ public void validate_pica_groupBy() throws Exception { assertTrue(line.contains("\"trimId\":true,")); assertTrue(line.contains("\"outputDir\":\"")); assertTrue(line.contains("qa-catalogue/src/test/resources/output\",")); - assertTrue(line.contains("\"recordIgnorator\":{\"criteria\":[],\"booleanCriteria\":null,\"empty\":true},")); assertTrue(line.contains("\"recordFilter\":{\"criteria\":[],\"booleanCriteria\":null,\"empty\":true},")); assertTrue(line.contains("\"ignorableFields\":{\"fields\":null,\"empty\":true},")); assertTrue(line.contains("\"stream\":null,")); @@ -446,6 +446,7 @@ public void validate_whenHbz() throws Exception { iterator.start(); List lines = getFileLines("issue-summary.csv"); + System.err.println(StringUtils.join(lines, "\n")); assertEquals(3, lines.size()); List undefinedFields = lines.stream() .filter(line -> line.contains("undefined field"))