From 45e3ea5e860cd2dfa2ec73a1c81fd13e8dba25c6 Mon Sep 17 00:00:00 2001 From: jackyq2015 Date: Sun, 13 Aug 2017 13:03:19 -0500 Subject: [PATCH] fix testng data path issue --- build.xml | 1 + .../refine/tests/importers/JsonImporterTests.java | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/build.xml b/build.xml index eed298a84..1ab5bc239 100644 --- a/build.xml +++ b/build.xml @@ -93,6 +93,7 @@ + diff --git a/main/tests/server/src/com/google/refine/tests/importers/JsonImporterTests.java b/main/tests/server/src/com/google/refine/tests/importers/JsonImporterTests.java index 742b604e3..35b911a85 100644 --- a/main/tests/server/src/com/google/refine/tests/importers/JsonImporterTests.java +++ b/main/tests/server/src/com/google/refine/tests/importers/JsonImporterTests.java @@ -368,7 +368,7 @@ public class JsonImporterTests extends ImporterTest { @Test public void testComplexJsonStructure() throws IOException{ String fileName = "grid_small.json"; - RunTest(getComplexJSON(fileName)); + RunComplexJSONTest(getComplexJSON(fileName)); log(project); logger.info("************************ columnu number:" + project.columnModel.columns.size() + @@ -413,14 +413,13 @@ public class JsonImporterTests extends ImporterTest { return sb.toString(); } - private static JSONObject getOptions(ImportingJob job, TreeImportingParserBase parser) { + private static JSONObject getOptions(ImportingJob job, TreeImportingParserBase parser, String pathSelector) { JSONObject options = parser.createParserUIInitializationData( job, new LinkedList(), "text/json"); JSONArray path = new JSONArray(); JSONUtilities.append(path, JsonImporter.ANONYMOUS); - JSONUtilities.append(path, "institutes"); -// JSONUtilities.append(path, JsonImporter.ANONYMOUS); + JSONUtilities.append(path, pathSelector); JSONUtilities.safePut(options, "recordPath", path); JSONUtilities.safePut(options, "trimStrings", false); @@ -510,7 +509,11 @@ public class JsonImporterTests extends ImporterTest { private void RunTest(String testString) { - RunTest(testString, getOptions(job, SUT)); + RunTest(testString, getOptions(job, SUT, JsonImporter.ANONYMOUS)); + } + + private void RunComplexJSONTest(String testString) { + RunTest(testString, getOptions(job, SUT, "institutes")); } private void RunTest(String testString, JSONObject options) {