Code example for SQLRecoverableException

Methods: getCause, getErrorCode, getMessage, getSQLState

0
 
    /** 
     * @test java.sql.SQLRecoverableException(String, String, Throwable) 
     */ 
    public void test_Constructor_LStringLStringLThrowable_3() { 
        SQLRecoverableException sQLRecoverableException = new SQLRecoverableException(
                "MYTESTSTRING", null, null); 
        assertNotNull(sQLRecoverableException);
        assertNull("The SQLState of SQLRecoverableException should be null",
                sQLRecoverableException.getSQLState());
        assertEquals(
                "The reason of SQLRecoverableException set and get should be equivalent", 
                "MYTESTSTRING", sQLRecoverableException.getMessage());
        assertEquals("The error code of SQLRecoverableException should be 0",
                sQLRecoverableException.getErrorCode(), 0);
        assertNull("The cause of SQLRecoverableException should be null",
                sQLRecoverableException.getCause());
    } 
 
    /** 
     * @test java.sql.SQLRecoverableException(String, String, Throwable) 
     */