Examples of DBIException


Examples of org.skife.jdbi.v2.exceptions.DBIException

    @Test
    public void testSqlExceptionIsCause() throws Exception {
        StatementContext statementContext = mock(StatementContext.class);
        RuntimeException runtimeException = new RuntimeException("DB is down");
        SQLException sqlException = new SQLException("DB error", runtimeException);
        DBIException dbiException = new NoResultsException("Unable get a result set", sqlException, statementContext);

        dbiExceptionMapper.logException(9812, dbiException);

        verify(logger).error("Error handling a request: 0000000000002654", sqlException);
        verify(logger).error("Error handling a request: 0000000000002654", runtimeException);
View Full Code Here

Examples of org.skife.jdbi.v2.exceptions.DBIException

        verify(logger, never()).error("Error handling a request: 0000000000002654", dbiException);
    }

    @Test
    public void testPlainDBIException() throws Exception {
        DBIException dbiException = new TransactionFailedException("Transaction failed for unknown reason");

        dbiExceptionMapper.logException(9812, dbiException);

        verify(logger).error("Error handling a request: 0000000000002654", dbiException);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.