use of org.finra.herd.model.api.xml.JdbcStatementResultSet in project herd by FINRAOS.
the class JdbcDaoTest method testQueryNoMaxResults.
@Test
public void testQueryNoMaxResults() {
JdbcStatementResultSet resultSet = jdbcDao.query(null, MockJdbcOperations.CASE_1_SQL, null);
Assert.assertNotNull("resultSet", resultSet);
Assert.assertNotNull("resultSet columnNames", resultSet.getColumnNames());
Assert.assertEquals("resultSet columnNames", Arrays.asList("COL1", "COL2", "COL3"), resultSet.getColumnNames());
Assert.assertNotNull("resultSet rows", resultSet.getRows());
Assert.assertEquals("resultSet rows size", 2, resultSet.getRows().size());
{
JdbcStatementResultSetRow row = resultSet.getRows().get(0);
Assert.assertNotNull("resultSet rows[0]", row);
Assert.assertNotNull("resultSet rows[0] columns", row.getColumns());
Assert.assertEquals("resultSet rows[0] columns", Arrays.asList("A", "B", "C"), row.getColumns());
}
{
JdbcStatementResultSetRow row = resultSet.getRows().get(1);
Assert.assertNotNull("resultSet rows[1]", row);
Assert.assertNotNull("resultSet rows[1] columns", row.getColumns());
Assert.assertEquals("resultSet rows[1] columns", Arrays.asList("D", "E", "F"), row.getColumns());
}
}
use of org.finra.herd.model.api.xml.JdbcStatementResultSet in project herd by FINRAOS.
the class JdbcDaoTest method testQueryWithMaxResultsLimitsResults.
@Test
public void testQueryWithMaxResultsLimitsResults() {
JdbcStatementResultSet resultSet = jdbcDao.query(null, MockJdbcOperations.CASE_1_SQL, 1);
Assert.assertNotNull("resultSet", resultSet);
Assert.assertNotNull("resultSet columnNames", resultSet.getColumnNames());
Assert.assertEquals("resultSet columnNames", Arrays.asList("COL1", "COL2", "COL3"), resultSet.getColumnNames());
Assert.assertNotNull("resultSet rows", resultSet.getRows());
Assert.assertEquals("resultSet rows size", 1, resultSet.getRows().size());
{
JdbcStatementResultSetRow row = resultSet.getRows().get(0);
Assert.assertNotNull("resultSet rows[0]", row);
Assert.assertNotNull("resultSet rows[0] columns", row.getColumns());
Assert.assertEquals("resultSet rows[0] columns", Arrays.asList("A", "B", "C"), row.getColumns());
}
}
use of org.finra.herd.model.api.xml.JdbcStatementResultSet in project herd by FINRAOS.
the class JdbcDaoTest method testQueryWithMaxResults.
@Test
public void testQueryWithMaxResults() {
JdbcStatementResultSet resultSet = jdbcDao.query(null, MockJdbcOperations.CASE_1_SQL, 2);
Assert.assertNotNull("resultSet", resultSet);
Assert.assertNotNull("resultSet columnNames", resultSet.getColumnNames());
Assert.assertEquals("resultSet columnNames", Arrays.asList("COL1", "COL2", "COL3"), resultSet.getColumnNames());
Assert.assertNotNull("resultSet rows", resultSet.getRows());
Assert.assertEquals("resultSet rows size", 2, resultSet.getRows().size());
}
Aggregations