From 0698b9c84ec65bb3849c8a8d0c3dd804c8efe047 Mon Sep 17 00:00:00 2001 From: Antonin Delpeuch Date: Fri, 12 Oct 2018 12:42:01 +0100 Subject: [PATCH] Unify JSON testing in Wikidata extension --- .../src/org/openrefine/wikidata/operations/OperationTest.java | 3 ++- main/src/com/google/refine/importing/ImportingJob.java | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/extensions/wikidata/tests/src/org/openrefine/wikidata/operations/OperationTest.java b/extensions/wikidata/tests/src/org/openrefine/wikidata/operations/OperationTest.java index cfc04fb4e..a6969c0f0 100644 --- a/extensions/wikidata/tests/src/org/openrefine/wikidata/operations/OperationTest.java +++ b/extensions/wikidata/tests/src/org/openrefine/wikidata/operations/OperationTest.java @@ -42,6 +42,7 @@ import com.google.refine.model.AbstractOperation; import com.google.refine.model.Project; import com.google.refine.operations.OperationRegistry; import com.google.refine.tests.RefineTest; +import com.google.refine.tests.util.TestUtils; import com.google.refine.util.ParsingUtilities; import com.google.refine.util.Pool; @@ -78,7 +79,7 @@ public abstract class OperationTest extends RefineTest { AbstractOperation op = reconstruct(); StringWriter writer = new StringWriter(); ParsingUtilities.defaultWriter.writeValue(writer, op); - JacksonSerializationTest.assertJsonEquals(json.toString(), writer.toString()); + TestUtils.assertEqualAsJson(json.toString(), writer.toString()); } protected LineNumberReader makeReader(String input) { diff --git a/main/src/com/google/refine/importing/ImportingJob.java b/main/src/com/google/refine/importing/ImportingJob.java index 27b0c65e9..a19af621a 100644 --- a/main/src/com/google/refine/importing/ImportingJob.java +++ b/main/src/com/google/refine/importing/ImportingJob.java @@ -42,6 +42,7 @@ import org.apache.commons.io.FileUtils; import org.json.JSONArray; import org.json.JSONObject; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRawValue; @@ -86,6 +87,7 @@ public class ImportingJob { return config.toString(); } + @JsonIgnore public JSONObject getOrCreateDefaultConfig() { return config; } @@ -137,6 +139,7 @@ public class ImportingJob { } + @JsonIgnore public JSONObject getRetrievalRecord() { synchronized(config) { return JSONUtilities.getObject(config,"retrievalRecord"); @@ -152,6 +155,7 @@ public class ImportingJob { return fileRecordObject.has("metaDataFormat"); } + @JsonIgnore public List getSelectedFileRecords() { List results = new ArrayList();