Code example for SQLFeatureNotSupportedException

Methods: getCause, getErrorCode, getMessage, getSQLState

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