parent
0001d9f7b2
commit
00faf2a179
@ -1037,7 +1037,6 @@ public class ImportingUtilities {
|
|||||||
ProjectMetadata pm = new ProjectMetadata();
|
ProjectMetadata pm = new ProjectMetadata();
|
||||||
pm.setName(JSONUtilities.getString(optionObj, "projectName", "Untitled"));
|
pm.setName(JSONUtilities.getString(optionObj, "projectName", "Untitled"));
|
||||||
pm.setTags(JSONUtilities.getStringArray(optionObj, "projectTags"));
|
pm.setTags(JSONUtilities.getStringArray(optionObj, "projectTags"));
|
||||||
pm.appendImportOptionMetadata(optionObj);
|
|
||||||
|
|
||||||
String encoding = JSONUtilities.getString(optionObj, "encoding", "UTF-8");
|
String encoding = JSONUtilities.getString(optionObj, "encoding", "UTF-8");
|
||||||
if ("".equals(encoding)) {
|
if ("".equals(encoding)) {
|
||||||
|
@ -12,11 +12,10 @@ public class ImportingUtilitiesTests extends RefineTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void createProjectMetadataTest() throws Exception {
|
public void createProjectMetadataTest() throws Exception {
|
||||||
JSONObject optionObj = new JSONObject("{\"projectName\":\"acme\",\"projectTags\":[],\"created\":\"2017-12-18T13:28:40.659\",\"modified\":\"2017-12-20T09:28:06.654\",\"creator\":\"\",\"contributors\":\"\",\"subject\":\"\",\"description\":\"\",\"rowCount\":50,\"customMetadata\":{},\"importOptionMetadata\":[{\"guessCellValueTypes\":false,\"projectTags\":[\"\"],\"ignoreLines\":-1,\"processQuotes\":true,\"fileSource\":\"acme.txt\",\"encoding\":\"\",\"separator\":\"|\",\"storeBlankCellsAsNulls\":true,\"storeBlankRows\":true,\"skipDataLines\":0,\"includeFileSources\":false,\"headerLines\":1,\"limit\":-1,\"projectName\":\"acme\"},{\"guessCellValueTypes\":false,\"projectTags\":[\"\"],\"ignoreLines\":-1,\"processQuotes\":true,\"fileSource\":\"acme.txt\",\"encoding\":\"\",\"separator\":\"|\",\"storeBlankCellsAsNulls\":true,\"storeBlankRows\":true,\"skipDataLines\":0,\"includeFileSources\":false,\"headerLines\":1,\"limit\":-1,\"projectName\":\"acme\"}]}");
|
JSONObject optionObj = new JSONObject("{\"projectName\":\"acme\",\"projectTags\":[],\"created\":\"2017-12-18T13:28:40.659\",\"modified\":\"2017-12-20T09:28:06.654\",\"creator\":\"\",\"contributors\":\"\",\"subject\":\"\",\"description\":\"\",\"rowCount\":50,\"customMetadata\":{}}");
|
||||||
ProjectMetadata pm = ImportingUtilities.createProjectMetadata(optionObj);
|
ProjectMetadata pm = ImportingUtilities.createProjectMetadata(optionObj);
|
||||||
Assert.assertEquals(pm.getName(), "acme");
|
Assert.assertEquals(pm.getName(), "acme");
|
||||||
Assert.assertEquals(pm.getEncoding(), "UTF-8");
|
Assert.assertEquals(pm.getEncoding(), "UTF-8");
|
||||||
Assert.assertTrue(pm.getTags().length == 0);
|
Assert.assertTrue(pm.getTags().length == 0);
|
||||||
Assert.assertTrue(pm.getImportOptionMetadata().length() > 0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user