Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into 14-test-validation
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasNx committed Oct 28, 2024
2 parents 113933b + 4571253 commit 4a4c2fe
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,"));
Expand Down Expand Up @@ -446,6 +446,7 @@ public void validate_whenHbz() throws Exception {
iterator.start();

List<String> lines = getFileLines("issue-summary.csv");
System.err.println(StringUtils.join(lines, "\n"));
assertEquals(3, lines.size());
List<String> undefinedFields = lines.stream()
.filter(line -> line.contains("undefined field"))
Expand Down

0 comments on commit 4a4c2fe

Please sign in to comment.