Package com.google.refine.model

Examples of com.google.refine.model.Row


        RunTest(getSample());

        log(project);
        assertProjectCreated(project, 4, 6);

        Row row = project.rows.get(0);
        Assert.assertNotNull(row);
        Assert.assertNotNull(row.getCell(1));
        Assert.assertEquals(row.getCell(1).value, "Author 1, The");
    }
View Full Code Here


        RunTest(getSampleWithDuplicateNestedElements());

        log(project);
        assertProjectCreated(project, 4, 12);

        Row row = project.rows.get(0);
        Assert.assertNotNull(row);
        Assert.assertEquals(row.cells.size(), 4);
        Assert.assertNotNull(row.getCell(1));
        Assert.assertEquals(row.getCell(1).value, "Author 1, The");
        Assert.assertEquals(project.rows.get(1).getCell(1).value, "Author 1, Another");
    }
View Full Code Here

        RunTest(getSampleWithLineBreak());

        log(project);
        assertProjectCreated(project, 4, 6);

        Row row = project.rows.get(3);
        Assert.assertNotNull(row);
        Assert.assertEquals(row.cells.size(), 4);
        Assert.assertNotNull(row.getCell(1));
        Assert.assertEquals(row.getCell(1).value, "With line\n break");
    }
View Full Code Here

        log(project);
        assertProjectCreated(project, 5, 6);

        Assert.assertEquals( project.columnModel.getColumnByCellIndex(4).getName(), JsonImporter.ANONYMOUS + " - genre");

        Row row0 = project.rows.get(0);
        Assert.assertNotNull(row0);
        Assert.assertEquals(row0.cells.size(),4);

        Row row5  = project.rows.get(5);
        Assert.assertNotNull(row5);
        Assert.assertEquals(row5.cells.size(),5);
    }
View Full Code Here

        assertProjectCreated(project, 2, 21,4);

        Assert.assertEquals( project.columnModel.getColumnByCellIndex(0).getName(), JsonImporter.ANONYMOUS + " - id");
        Assert.assertEquals( project.columnModel.getColumnByCellIndex(1).getName(), JsonImporter.ANONYMOUS + " - cell - cell");

        Row row = project.rows.get(8);
        Assert.assertNotNull(row);
        Assert.assertEquals(row.cells.size(),2);
        Assert.assertEquals(row.cells.get(1).value,""); // Make sure empty strings are preserved

        // null, true, false 0,1,-2.1,0.23,-0.24,3.14e100
View Full Code Here

    @Test
    public void ensureColumnsInRowExist(){
        String VALUE_1 = "value1";
        String VALUE_2 = "value2";
        Row row = new Row(2);
        ArrayList<String> columnNames = new ArrayList<String>(2);
        columnNames.add(VALUE_1);
        columnNames.add(VALUE_2);

        ImporterUtilities.ensureColumnsInRowExist(columnNames, row);
View Full Code Here

        Assert.assertEquals(columnNames.get(1), VALUE_2);
    }

    @Test
    public void ensureColumnsInRowExistDoesExpand(){
        Row row = new Row(4);
        for(int i = 1; i < 5; i++) {
            row.cells.add(new Cell("value" + i, null));
        }

        ArrayList<String> columnNames = new ArrayList<String>(2);
View Full Code Here

            Assert.fail();
        }
        log(project);
        Assert.assertNotNull(project.rows);
        Assert.assertEquals(project.rows.size(), 1);
        Row row = project.rows.get(0);
        Assert.assertNotNull(row);
        Assert.assertNotNull(row.getCell(1));
        Assert.assertEquals(row.getCell(1).value, "author1");

    }
View Full Code Here

        }
        log(project);
        Assert.assertNotNull(project.rows);
        Assert.assertEquals(project.rows.size(), 2);

        Row row = project.rows.get(0);
        Assert.assertNotNull(row);
        Assert.assertEquals(row.cells.size(), 3);
        Assert.assertNotNull(row.getCell(1));
        Assert.assertEquals(row.getCell(1).value, "author1");

        row = project.rows.get(1);
        Assert.assertEquals(row.getCell(1).value, "author2");
    }
View Full Code Here

            Assert.fail();
        }
        log(project);
        Assert.assertNotNull(project.rows);
        Assert.assertEquals(project.rows.size(), 1);
        Row row = project.rows.get(0);
        Assert.assertNotNull(row);
        Assert.assertEquals(row.cells.size(), 4);
        Assert.assertNotNull(row.getCell(1));
        Assert.assertEquals(row.getCell(1).value, "author1");
        Assert.assertNotNull(row.getCell(2));
        Assert.assertEquals(row.getCell(2).value, "a date");
    }
View Full Code Here

TOP

Related Classes of com.google.refine.model.Row

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.