Package com.google.refine.model

Examples of com.google.refine.model.Row


        Assert.assertTrue(row.isEmpty());
    }

    @Test
    public void notEmptyRow() {
        Row row = new Row(1);
        row.setCell(0, new Cell("I'm not empty", null));
        Assert.assertFalse(row.isEmpty());
    }
View Full Code Here


        Assert.assertFalse(row.isEmpty());
    }

    @Test
    public void duplicateRow() {
        Row row = new Row(5);
        row.flagged = true;
        Row duplicateRow = row.dup();
        Assert.assertTrue(duplicateRow.flagged);
    }
View Full Code Here

        Assert.assertTrue(duplicateRow.flagged);
    }

    @Test
    public void saveRow() {
        Row row = new Row(5);
        row.setCell(0, new Cell("I'm not empty", null));
        row.save(writer, options);
        Assert.assertEquals(writer.getBuffer().toString(),
                "{\"flagged\":false,\"starred\":false,\"cells\":[{\"v\":\"I'm not empty\"}]}");
    }
View Full Code Here

                "{\"flagged\":false,\"starred\":false,\"cells\":[{\"v\":\"I'm not empty\"}]}");
    }

    @Test
    public void saveRowWithRecordIndex() {
        Row row = new Row(5);
        row.setCell(0, new Cell("I'm not empty", null));
        when(options.containsKey("rowIndex")).thenReturn(true);
        when(options.get("rowIndex")).thenReturn(0);
        when(options.containsKey("recordIndex")).thenReturn(true);
        when(options.get("recordIndex")).thenReturn(1);
        row.save(writer, options);
        Assert.assertEquals(
                writer.getBuffer().toString(),
                "{\"flagged\":false,\"starred\":false,\"cells\":[{\"v\":\"I'm not empty\"}],\"i\":0,\"j\":1}");
    }
View Full Code Here

                "{\"flagged\":false,\"starred\":false,\"cells\":[{\"v\":\"I'm not empty\"}],\"i\":0,\"j\":1}");
    }

    @Test
    public void toStringTest() {
        Row row = new Row(5);
        row.setCell(0, new Cell(1, null));
        row.setCell(1, new Cell(2, null));
        row.setCell(2, new Cell(3, null));
        row.setCell(3, new Cell(4, null));
        row.setCell(4, new Cell(5, null));
        Assert.assertEquals(row.toString(), "1,2,3,4,5,");
    }
View Full Code Here

        Assert.assertEquals(row.toString(), "1,2,3,4,5,");
    }

    @Test
    public void blankCell() {
        Row row = new Row(5);
        Assert.assertTrue(row.isCellBlank(0));
    }
View Full Code Here

        Assert.assertTrue(row.isCellBlank(0));
    }

    @Test
    public void nonBlankCell() {
        Row row = new Row(5);
        row.setCell(0, new Cell("I'm not empty", null));
        Assert.assertFalse(row.isCellBlank(0));
        row.setCell(3, new Cell("I'm not empty", null));
        Assert.assertFalse(row.isCellBlank(3));
    }
View Full Code Here

        Assert.assertFalse(row.isCellBlank(3));
    }

    @Test
    public void getFlaggedField() {
        Row row = new Row(5);
        row.flagged = true;
        Assert.assertTrue((Boolean) row.getField("flagged", options));
    }
View Full Code Here

        Assert.assertTrue((Boolean) row.getField("flagged", options));
    }

    @Test
    public void getStarredField() {
        Row row = new Row(5);
        row.starred = true;
        Assert.assertTrue((Boolean) row.getField("starred", options));
    }
View Full Code Here

    protected void CreateGrid(int noOfRows, int noOfColumns){
        CreateColumns(noOfColumns);

        for(int i = 0; i < noOfRows; i++){
            Row row = new Row(noOfColumns);
            for(int j = 0; j < noOfColumns; j++){
                row.cells.add(new Cell("row" + i + "cell" + j, null));
            }
            project.rows.add(row);
        }
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.