Search in sources :

Example 1 with JdbcStatementResultSet

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());
    }
}
Also used : JdbcStatementResultSet(org.finra.herd.model.api.xml.JdbcStatementResultSet) JdbcStatementResultSetRow(org.finra.herd.model.api.xml.JdbcStatementResultSetRow) Test(org.junit.Test)

Example 2 with JdbcStatementResultSet

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());
    }
}
Also used : JdbcStatementResultSet(org.finra.herd.model.api.xml.JdbcStatementResultSet) JdbcStatementResultSetRow(org.finra.herd.model.api.xml.JdbcStatementResultSetRow) Test(org.junit.Test)

Example 3 with JdbcStatementResultSet

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());
}
Also used : JdbcStatementResultSet(org.finra.herd.model.api.xml.JdbcStatementResultSet) Test(org.junit.Test)

Aggregations

JdbcStatementResultSet (org.finra.herd.model.api.xml.JdbcStatementResultSet)3 Test (org.junit.Test)3 JdbcStatementResultSetRow (org.finra.herd.model.api.xml.JdbcStatementResultSetRow)2