com.google.api.services.bigquery.model.TableCell

Here are the examples of the java api class com.google.api.services.bigquery.model.TableCell taken from open source projects.

1. BigQueryImplTest#testListTableData()

Project: gcloud-java
Source File: BigQueryImplTest.java
View license
@Test
public void testListTableData() {
    String cursor = "cursor";
    com.google.api.services.bigquery.model.TableCell cell1 = new com.google.api.services.bigquery.model.TableCell().setV("Value1");
    com.google.api.services.bigquery.model.TableCell cell2 = new com.google.api.services.bigquery.model.TableCell().setV("Value2");
    ImmutableList<List<FieldValue>> tableData = ImmutableList.of((List<FieldValue>) ImmutableList.of(FieldValue.fromPb(cell1)), ImmutableList.of(FieldValue.fromPb(cell2)));
    Tuple<String, Iterable<com.google.api.services.bigquery.model.TableRow>> result = Tuple.<String, Iterable<com.google.api.services.bigquery.model.TableRow>>of(cursor, ImmutableList.of(new com.google.api.services.bigquery.model.TableRow().setF(ImmutableList.of(new com.google.api.services.bigquery.model.TableCell().setV("Value1"))), new com.google.api.services.bigquery.model.TableRow().setF(ImmutableList.of(new com.google.api.services.bigquery.model.TableCell().setV("Value2")))));
    EasyMock.expect(bigqueryRpcMock.listTableData(DATASET, TABLE, EMPTY_RPC_OPTIONS)).andReturn(result);
    EasyMock.replay(bigqueryRpcMock);
    bigquery = options.service();
    Page<List<FieldValue>> page = bigquery.listTableData(DATASET, TABLE);
    assertEquals(cursor, page.nextPageCursor());
    assertArrayEquals(tableData.toArray(), Iterables.toArray(page.values(), List.class));
}

2. BigQueryImplTest#testListTableDataFromTableId()

Project: gcloud-java
Source File: BigQueryImplTest.java
View license
@Test
public void testListTableDataFromTableId() {
    String cursor = "cursor";
    com.google.api.services.bigquery.model.TableCell cell1 = new com.google.api.services.bigquery.model.TableCell().setV("Value1");
    com.google.api.services.bigquery.model.TableCell cell2 = new com.google.api.services.bigquery.model.TableCell().setV("Value2");
    ImmutableList<List<FieldValue>> tableData = ImmutableList.of((List<FieldValue>) ImmutableList.of(FieldValue.fromPb(cell1)), ImmutableList.of(FieldValue.fromPb(cell2)));
    Tuple<String, Iterable<com.google.api.services.bigquery.model.TableRow>> result = Tuple.<String, Iterable<com.google.api.services.bigquery.model.TableRow>>of(cursor, ImmutableList.of(new com.google.api.services.bigquery.model.TableRow().setF(ImmutableList.of(new com.google.api.services.bigquery.model.TableCell().setV("Value1"))), new com.google.api.services.bigquery.model.TableRow().setF(ImmutableList.of(new com.google.api.services.bigquery.model.TableCell().setV("Value2")))));
    EasyMock.expect(bigqueryRpcMock.listTableData(DATASET, TABLE, EMPTY_RPC_OPTIONS)).andReturn(result);
    EasyMock.replay(bigqueryRpcMock);
    bigquery = options.service();
    Page<List<FieldValue>> page = bigquery.listTableData(TableId.of(DATASET, TABLE));
    assertEquals(cursor, page.nextPageCursor());
    assertArrayEquals(tableData.toArray(), Iterables.toArray(page.values(), List.class));
}

3. BigQueryImplTest#testListTableDataWithOptions()

Project: gcloud-java
Source File: BigQueryImplTest.java
View license
@Test
public void testListTableDataWithOptions() {
    String cursor = "cursor";
    com.google.api.services.bigquery.model.TableCell cell1 = new com.google.api.services.bigquery.model.TableCell().setV("Value1");
    com.google.api.services.bigquery.model.TableCell cell2 = new com.google.api.services.bigquery.model.TableCell().setV("Value2");
    ImmutableList<List<FieldValue>> tableData = ImmutableList.of((List<FieldValue>) ImmutableList.of(FieldValue.fromPb(cell1)), ImmutableList.of(FieldValue.fromPb(cell2)));
    Tuple<String, Iterable<com.google.api.services.bigquery.model.TableRow>> result = Tuple.<String, Iterable<com.google.api.services.bigquery.model.TableRow>>of(cursor, ImmutableList.of(new com.google.api.services.bigquery.model.TableRow().setF(ImmutableList.of(new com.google.api.services.bigquery.model.TableCell().setV("Value1"))), new com.google.api.services.bigquery.model.TableRow().setF(ImmutableList.of(new com.google.api.services.bigquery.model.TableCell().setV("Value2")))));
    EasyMock.expect(bigqueryRpcMock.listTableData(DATASET, TABLE, TABLE_DATA_LIST_OPTIONS)).andReturn(result);
    EasyMock.replay(bigqueryRpcMock);
    bigquery = options.service();
    Page<List<FieldValue>> page = bigquery.listTableData(DATASET, TABLE, TABLE_DATA_LIST_PAGE_SIZE, TABLE_DATA_LIST_PAGE_TOKEN, TABLE_DATA_LIST_START_INDEX);
    assertEquals(cursor, page.nextPageCursor());
    assertArrayEquals(tableData.toArray(), Iterables.toArray(page.values(), List.class));
}