fix testng data path issue

This commit is contained in:
jackyq2015 2017-08-13 13:03:19 -05:00
parent f3463c332e
commit 45e3ea5e86
2 changed files with 9 additions and 5 deletions

View File

@ -93,6 +93,7 @@
<path refid="server.class.path"/> <path refid="server.class.path"/>
<pathelement location="${server.tests.classes.dir}"/> <pathelement location="${server.tests.classes.dir}"/>
<pathelement location="${server.tests.lib.dir}/testng-6.8.jar"/> <pathelement location="${server.tests.lib.dir}/testng-6.8.jar"/>
<pathelement location="${tests.dir}/data" />
<fileset dir="${server.tests.lib.dir}"> <fileset dir="${server.tests.lib.dir}">
<include name="**/*.jar" /> <include name="**/*.jar" />
</fileset> </fileset>

View File

@ -368,7 +368,7 @@ public class JsonImporterTests extends ImporterTest {
@Test @Test
public void testComplexJsonStructure() throws IOException{ public void testComplexJsonStructure() throws IOException{
String fileName = "grid_small.json"; String fileName = "grid_small.json";
RunTest(getComplexJSON(fileName)); RunComplexJSONTest(getComplexJSON(fileName));
log(project); log(project);
logger.info("************************ columnu number:" + project.columnModel.columns.size() + logger.info("************************ columnu number:" + project.columnModel.columns.size() +
@ -413,14 +413,13 @@ public class JsonImporterTests extends ImporterTest {
return sb.toString(); 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( JSONObject options = parser.createParserUIInitializationData(
job, new LinkedList<JSONObject>(), "text/json"); job, new LinkedList<JSONObject>(), "text/json");
JSONArray path = new JSONArray(); JSONArray path = new JSONArray();
JSONUtilities.append(path, JsonImporter.ANONYMOUS); JSONUtilities.append(path, JsonImporter.ANONYMOUS);
JSONUtilities.append(path, "institutes"); JSONUtilities.append(path, pathSelector);
// JSONUtilities.append(path, JsonImporter.ANONYMOUS);
JSONUtilities.safePut(options, "recordPath", path); JSONUtilities.safePut(options, "recordPath", path);
JSONUtilities.safePut(options, "trimStrings", false); JSONUtilities.safePut(options, "trimStrings", false);
@ -510,7 +509,11 @@ public class JsonImporterTests extends ImporterTest {
private void RunTest(String testString) { 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) { private void RunTest(String testString, JSONObject options) {