use of com.google.refine.importers.tree.ImportColumn in project OpenRefine by OpenRefine.
the class XmlImportUtilitiesTests method createColumnsFromImportTest.
@Test
public void createColumnsFromImportTest() {
ImportColumnGroup columnGroup = new ImportColumnGroup();
ImportColumnGroup subGroup = new ImportColumnGroup();
columnGroup.columns.put("a", new ImportColumn("hello"));
columnGroup.columns.put("b", new ImportColumn("world"));
subGroup.columns.put("c", new ImportColumn("foo"));
subGroup.columns.put("d", new ImportColumn("bar"));
columnGroup.subgroups.put("e", subGroup);
XmlImportUtilitiesStub.createColumnsFromImport(project, columnGroup);
log(project);
assertProjectCreated(project, 4, 0);
Assert.assertEquals(project.columnModel.columns.get(0).getName(), "hello");
Assert.assertEquals(project.columnModel.columns.get(1).getName(), "world");
Assert.assertEquals(project.columnModel.columns.get(2).getName(), "foo");
Assert.assertEquals(project.columnModel.columns.get(3).getName(), "bar");
Assert.assertEquals(project.columnModel.columnGroups.get(0).keyColumnIndex, 2);
Assert.assertEquals(project.columnModel.columnGroups.get(0).startColumnIndex, 2);
Assert.assertEquals(project.columnModel.columnGroups.get(0).columnSpan, 2);
}
Aggregations