use of com.google.refine.expr.HasFieldsListImpl in project OpenRefine by OpenRefine.
the class CrossTests method crossFunctionBooleanArgumentTest1.
@Test
public void crossFunctionBooleanArgumentTest1() 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");
}
use of com.google.refine.expr.HasFieldsListImpl in project OpenRefine by OpenRefine.
the class CrossTests method crossFunctionDifferentColumnTest.
/**
* The result shouldn't depend on the based column in "bindings" when the first argument is a WrappedCell instance.
*/
@Test
public void crossFunctionDifferentColumnTest() throws Exception {
Project project = (Project) bindings.get("project");
// change the based column
bindings.put("columnName", "gift");
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.");
}
use of com.google.refine.expr.HasFieldsListImpl in project OpenRefine by OpenRefine.
the class CrossTests method crossFunctionLongArgumentTest.
@Test
public void crossFunctionLongArgumentTest() throws Exception {
Row row = (((WrappedRow) ((HasFieldsListImpl) invoke("cross", 123456789123456789L, "My Address Book", "friend")).get(0)).row);
String address = row.getCell(1).value.toString();
Assert.assertEquals(address, "long");
}
use of com.google.refine.expr.HasFieldsListImpl in project OpenRefine by OpenRefine.
the class CrossTests method crossFunctionOneToManyTest.
/**
* To demonstrate that the cross function can look up multiple rows.
*/
@Test
public void crossFunctionOneToManyTest() throws Exception {
Row row = (((WrappedRow) ((HasFieldsListImpl) invoke("cross", "john", "My Address Book", "friend")).get(1)).row);
String address = row.getCell(1).value.toString();
Assert.assertEquals(address, "999 XXXXXX St.");
}
use of com.google.refine.expr.HasFieldsListImpl in project OpenRefine by OpenRefine.
the class CrossTests method crossFunctionDoubleArgumentTest.
@Test
public void crossFunctionDoubleArgumentTest() 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");
}
Aggregations