@Test
public void testSerializationReadFrom() throws Exception {
byte[] buf = new byte[]
{ 0,0,2,2,4,99,111,108,49,4,99,111,108,50,0,0,0,2,0,9,114,111,119,49,95,99,111,108,49,0,9,114,111,119,49,95,99,111,108,50,0,9,114,111,119,50,95,99,111,108,49,0,9,114,111,119,50,95,99,111,108,50,0,1,0,0,0,2,4,4};
BytesStreamInput in = new BytesStreamInput(buf, false);
SQLResponse resp = new SQLResponse();
resp.readFrom(in);
assertThat(resp.cols(), is(new String[] { "col1", "col2" }));
assertThat(resp.rows(), is(new Object[][] {
new Object[] {"row1_col1", "row1_col2"},
new Object[] {"row2_col1", "row2_col2"},
}));
assertThat(resp.columnTypes(), is(new DataType[] { DataTypes.STRING, DataTypes.STRING }));
assertThat(resp.rowCount(), is(2L));
assertThat(resp.duration(), is(-1L));
}