Search in sources :

Example 1 with ImportColumn

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);
}
Also used : ImportColumnGroup(com.google.refine.importers.tree.ImportColumnGroup) ImportColumn(com.google.refine.importers.tree.ImportColumn) Test(org.testng.annotations.Test) BeforeTest(org.testng.annotations.BeforeTest) RefineTest(com.google.refine.tests.RefineTest)

Aggregations

ImportColumn (com.google.refine.importers.tree.ImportColumn)1 ImportColumnGroup (com.google.refine.importers.tree.ImportColumnGroup)1 RefineTest (com.google.refine.tests.RefineTest)1 BeforeTest (org.testng.annotations.BeforeTest)1 Test (org.testng.annotations.Test)1