Code example for SQLRecoverableException

Methods: getCause, getErrorCode, getMessage, getSQLState

0
    /** 
     * @test java.sql.SQLRecoverableException(Throwable) 
     */ 
    public void test_Constructor_LThrowable() { 
        Throwable cause = new Exception("MYTHROWABLE");
        SQLRecoverableException sQLRecoverableException = new SQLRecoverableException(
                cause);
        assertNotNull(sQLRecoverableException);
        assertEquals(
                "The reason of SQLRecoverableException should be equals to cause.toString()", 
                "java.lang.Exception: MYTHROWABLE", sQLRecoverableException
                        .getMessage());
        assertNull("The SQLState of SQLRecoverableException should be null",
                sQLRecoverableException.getSQLState());
        assertEquals("The error code of SQLRecoverableException should be 0",
                sQLRecoverableException.getErrorCode(), 0);
        assertEquals(
                "The cause of SQLRecoverableException set and get should be equivalent", 
                cause, sQLRecoverableException.getCause());
    } 
 
    /** 
     * @test java.sql.SQLRecoverableException(Throwable) 
     */