Search in sources :

Example 16 with WrappedRow

use of com.google.refine.expr.WrappedRow in project OpenRefine by OpenRefine.

the class CrossTests method crossFunctionBooleanArgumentTest.

@Test
public void crossFunctionBooleanArgumentTest() throws Exception {
    Row row = (((WrappedRow) ((HasFieldsListImpl) invoke("cross", true, "My Address Book", "friend")).get(0)).row);
    String address = row.getCell(1).value.toString();
    Assert.assertEquals(address, "boolean");
}
Also used : HasFieldsListImpl(com.google.refine.expr.HasFieldsListImpl) WrappedRow(com.google.refine.expr.WrappedRow) Row(com.google.refine.model.Row) RefineTest(com.google.refine.RefineTest) Test(org.testng.annotations.Test) BeforeTest(org.testng.annotations.BeforeTest)

Example 17 with WrappedRow

use of com.google.refine.expr.WrappedRow in project OpenRefine by OpenRefine.

the class CrossTests method crossFunctionOneArgumentTest2.

@Test
public void crossFunctionOneArgumentTest2() throws Exception {
    Row row = (((WrappedRow) ((HasFieldsListImpl) invoke("cross", 1, "", "")).get(0)).row);
    String address = row.getCell(1).value.toString();
    Assert.assertEquals(address, "john");
}
Also used : HasFieldsListImpl(com.google.refine.expr.HasFieldsListImpl) WrappedRow(com.google.refine.expr.WrappedRow) Row(com.google.refine.model.Row) RefineTest(com.google.refine.RefineTest) Test(org.testng.annotations.Test) BeforeTest(org.testng.annotations.BeforeTest)

Example 18 with WrappedRow

use of com.google.refine.expr.WrappedRow in project OpenRefine by OpenRefine.

the class CrossTests method crossFunctionDateTimeArgumentTest1.

@Test
public void crossFunctionDateTimeArgumentTest1() throws Exception {
    Row row = (((WrappedRow) ((HasFieldsListImpl) invoke("cross", dateTimeValue.toString(), "My Address Book", "friend")).get(0)).row);
    String address = row.getCell(1).value.toString();
    Assert.assertEquals(address, "dateTime");
}
Also used : HasFieldsListImpl(com.google.refine.expr.HasFieldsListImpl) WrappedRow(com.google.refine.expr.WrappedRow) Row(com.google.refine.model.Row) RefineTest(com.google.refine.RefineTest) Test(org.testng.annotations.Test) BeforeTest(org.testng.annotations.BeforeTest)

Example 19 with WrappedRow

use of com.google.refine.expr.WrappedRow in project OpenRefine by OpenRefine.

the class CrossTests method crossFunctionBooleanTest.

@Test
public void crossFunctionBooleanTest() throws Exception {
    Project project = (Project) bindings.get("project");
    Cell c = project.rows.get(5).cells.get(1);
    WrappedCell lookup = new WrappedCell(project, "recipient", c);
    Row row = (((WrappedRow) ((HasFieldsListImpl) invoke("cross", lookup, "My Address Book", "friend")).get(0)).row);
    String address = row.getCell(1).value.toString();
    Assert.assertEquals(address, "boolean");
}
Also used : Project(com.google.refine.model.Project) WrappedCell(com.google.refine.expr.WrappedCell) HasFieldsListImpl(com.google.refine.expr.HasFieldsListImpl) WrappedRow(com.google.refine.expr.WrappedRow) Row(com.google.refine.model.Row) Cell(com.google.refine.model.Cell) WrappedCell(com.google.refine.expr.WrappedCell) RefineTest(com.google.refine.RefineTest) Test(org.testng.annotations.Test) BeforeTest(org.testng.annotations.BeforeTest)

Example 20 with WrappedRow

use of com.google.refine.expr.WrappedRow in project OpenRefine by OpenRefine.

the class CrossTests method crossFunctionDateTimeTest.

@Test
public void crossFunctionDateTimeTest() throws Exception {
    Project project = (Project) bindings.get("project");
    Cell c = project.rows.get(2).cells.get(1);
    WrappedCell lookup = new WrappedCell(project, "recipient", c);
    Row row = (((WrappedRow) ((HasFieldsListImpl) invoke("cross", lookup, "My Address Book", "friend")).get(0)).row);
    String address = row.getCell(1).value.toString();
    Assert.assertEquals(address, "dateTime");
}
Also used : Project(com.google.refine.model.Project) WrappedCell(com.google.refine.expr.WrappedCell) HasFieldsListImpl(com.google.refine.expr.HasFieldsListImpl) WrappedRow(com.google.refine.expr.WrappedRow) Row(com.google.refine.model.Row) Cell(com.google.refine.model.Cell) WrappedCell(com.google.refine.expr.WrappedCell) RefineTest(com.google.refine.RefineTest) Test(org.testng.annotations.Test) BeforeTest(org.testng.annotations.BeforeTest)

Aggregations

WrappedRow (com.google.refine.expr.WrappedRow)26 Row (com.google.refine.model.Row)26 RefineTest (com.google.refine.RefineTest)25 HasFieldsListImpl (com.google.refine.expr.HasFieldsListImpl)25 BeforeTest (org.testng.annotations.BeforeTest)25 Test (org.testng.annotations.Test)25 Project (com.google.refine.model.Project)6 WrappedCell (com.google.refine.expr.WrappedCell)5 Cell (com.google.refine.model.Cell)5 Column (com.google.refine.model.Column)1 LookupException (com.google.refine.util.LookupException)1