Code example for SQLRecoverableException

Methods: getCause, getErrorCode, getMessage, getSQLState

0
 
    /** 
     * @test java.sql.SQLRecoverableException(String, String, int, Throwable) 
     */ 
    public void test_Constructor_LStringLStringILThrowable_11() { 
        SQLRecoverableException sQLRecoverableException = new SQLRecoverableException(
                "MYTESTSTRING", null, -1, 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 -1",
                sQLRecoverableException.getErrorCode(), -1);
        assertNull("The cause of SQLRecoverableException should be null",
                sQLRecoverableException.getCause());
    } 
 
    /** 
     * @test java.sql.SQLRecoverableException(String, String, int, Throwable) 
     */