Search in sources :

Example 1 with MarshallableColumnTypes

use of org.pentaho.commons.connection.marshal.MarshallableColumnTypes in project pentaho-platform by pentaho.

the class ResultSetTest method validate.

private void validate(MarshallableResultSet result) {
    MarshallableColumnNames colNames = result.getColumnNames();
    assertNotNull(colNames);
    String[] cols = colNames.getColumnName();
    assertNotNull(cols);
    assertEquals(2, cols.length);
    assertEquals("col1", cols[0]);
    assertEquals("col2", cols[1]);
    MarshallableColumnTypes colTypes = result.getColumnTypes();
    assertNotNull(colTypes);
    String[] types = colTypes.getColumnType();
    assertNotNull(types);
    assertEquals(2, types.length);
    assertEquals("string", types[0]);
    assertEquals("integer", types[1]);
    MarshallableRow[] rows = result.getRows();
    assertNotNull(rows);
    assertEquals(3, rows.length);
    MarshallableRow row = rows[0];
    assertNotNull(row);
    String[] cells = row.getCell();
    assertEquals(2, cells.length);
    assertEquals("a", cells[0]);
    assertEquals("1", cells[1]);
    row = rows[1];
    assertNotNull(row);
    cells = row.getCell();
    assertEquals(2, cells.length);
    assertEquals("b", cells[0]);
    assertEquals("2", cells[1]);
    row = rows[2];
    assertNotNull(row);
    cells = row.getCell();
    assertEquals(2, cells.length);
    assertEquals("c", cells[0]);
    assertEquals("3", cells[1]);
}
Also used : MarshallableRow(org.pentaho.commons.connection.marshal.MarshallableRow) MarshallableColumnNames(org.pentaho.commons.connection.marshal.MarshallableColumnNames) MarshallableColumnTypes(org.pentaho.commons.connection.marshal.MarshallableColumnTypes)

Aggregations

MarshallableColumnNames (org.pentaho.commons.connection.marshal.MarshallableColumnNames)1 MarshallableColumnTypes (org.pentaho.commons.connection.marshal.MarshallableColumnTypes)1 MarshallableRow (org.pentaho.commons.connection.marshal.MarshallableRow)1