use of com.google.refine.importers.tree.ImportParameters in project OpenRefine by OpenRefine.
the class XmlImportUtilitiesTests method findRecordTestXmlDeprecated.
/**
* Test of deprecated wrapper method which can go away when it does
*/
@Test
public void findRecordTestXmlDeprecated() {
loadSampleXml();
createXmlParser();
ParserSkip();
String[] recordPath = new String[] { "library", "book" };
int pathIndex = 0;
try {
SUT.findRecordWrapper(project, parser, recordPath, pathIndex, columnGroup, -1, new ImportParameters(false, false, false));
} catch (Exception e) {
Assert.fail();
}
assertProjectCreated(project, 0, 6);
Assert.assertEquals(project.rows.get(0).cells.size(), 4);
// TODO
}
use of com.google.refine.importers.tree.ImportParameters in project OpenRefine by OpenRefine.
the class XmlImportUtilitiesTests method processSubRecordTestXml.
@Test
public void processSubRecordTestXml() {
loadData("<?xml version=\"1.0\"?><library><book id=\"1\"><author>author1</author><genre>genre1</genre></book></library>");
createXmlParser();
ParserSkip();
try {
SUT.processSubRecordWrapper(project, parser, columnGroup, record, 0, new ImportParameters(false, false, false));
} catch (Exception e) {
Assert.fail();
}
Assert.assertEquals(columnGroup.subgroups.size(), 1);
Assert.assertEquals(columnGroup.name, "");
Assert.assertNotNull(columnGroup.subgroups.get("library"));
Assert.assertEquals(columnGroup.subgroups.get("library").subgroups.size(), 1);
ImportColumnGroup book = columnGroup.subgroups.get("library").subgroups.get("book");
Assert.assertNotNull(book);
Assert.assertEquals(book.subgroups.size(), 2);
Assert.assertNotNull(book.subgroups.get("author"));
Assert.assertNotNull(book.subgroups.get("genre"));
// TODO check record
}
Aggregations