Code example for SQLTimeoutException

Methods: getCause, getErrorCode, getMessage, getSQLState

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