Code example for SQLFeatureNotSupportedException

Methods: getCause, getErrorCode, getMessage, getSQLState

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