Code example for SQLTimeoutException

Methods: getCause, getErrorCode, getMessage, getSQLState

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