Search in sources :

Example 11 with HasFieldsListImpl

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

the class CrossTests method crossFunctionOneArgumentTest1.

@Test
public void crossFunctionOneArgumentTest1() throws Exception {
    Row row = (((WrappedRow) ((HasFieldsListImpl) invoke("cross", 0, "")).get(0)).row);
    String address = row.getCell(1).value.toString();
    Assert.assertEquals(address, "mary");
}
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 12 with HasFieldsListImpl

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

the class CrossTests method crossFunctionDoubleArgumentTest1.

@Test
public void crossFunctionDoubleArgumentTest1() throws Exception {
    Row row = (((WrappedRow) ((HasFieldsListImpl) invoke("cross", 3.14f, "My Address Book", "friend")).get(0)).row);
    String address = row.getCell(1).value.toString();
    Assert.assertEquals(address, "double");
}
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 13 with HasFieldsListImpl

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

the class CrossTests method crossFunctionSameColumnTest.

@Test
public void crossFunctionSameColumnTest() throws Exception {
    Project project = (Project) bindings.get("project");
    Cell c = project.rows.get(0).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, "50 Broadway Ave.");
}
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 14 with HasFieldsListImpl

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

the class CrossTests method crossFunctionDoubleArgumentTest2.

@Test
public void crossFunctionDoubleArgumentTest2() throws Exception {
    Row row = (((WrappedRow) ((HasFieldsListImpl) invoke("cross", "3.14", "My Address Book", "friend")).get(0)).row);
    String address = row.getCell(1).value.toString();
    Assert.assertEquals(address, "double");
}
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 15 with HasFieldsListImpl

use of com.google.refine.expr.HasFieldsListImpl 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)

Aggregations

RefineTest (com.google.refine.RefineTest)25 HasFieldsListImpl (com.google.refine.expr.HasFieldsListImpl)25 WrappedRow (com.google.refine.expr.WrappedRow)25 Row (com.google.refine.model.Row)25 BeforeTest (org.testng.annotations.BeforeTest)25 Test (org.testng.annotations.Test)25 WrappedCell (com.google.refine.expr.WrappedCell)5 Cell (com.google.refine.model.Cell)5 Project (com.google.refine.model.Project)5