Code example for SQLTimeoutException

Methods: getCause, getErrorCode, getMessage, getSQLState

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