Ejemplo n.º 1
0
 private static void checkRow(int rowIndex, UntypedResultSet results, Integer... expectedValues) {
   List<UntypedResultSet.Row> rows = newArrayList(results.iterator());
   UntypedResultSet.Row row = rows.get(rowIndex);
   Iterator<ColumnSpecification> columns = row.getColumns().iterator();
   for (Integer expected : expectedValues) {
     String columnName = columns.next().name.toString();
     int actual = row.getInt(columnName);
     assertEquals(
         String.format(
             "Expected value %d for column %s in row %d, but got %s",
             actual, columnName, rowIndex, expected),
         (long) expected,
         actual);
   }
 }