Search in sources :

Example 6 with HasFieldsListImpl

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

the class CrossTests method crossFunctionLongArgumentTest1.

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

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

the class CrossTests method crossFunctionOneArgumentTest.

@Test
public // lookup the row with index 0 in the current project
void crossFunctionOneArgumentTest() 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 8 with HasFieldsListImpl

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

the class CrossTests method crossFunctionTwoArgumentTest.

@Test
public void crossFunctionTwoArgumentTest() throws Exception {
    Row row = (((WrappedRow) ((HasFieldsListImpl) invoke("cross", "lamp", "", "gift")).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 9 with HasFieldsListImpl

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

the class CrossTests method crossFunctionTwoArgumentTest1.

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

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

the class CrossTests method crossFunctionTwoArgumentTest2.

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