Code example for SQLTransientConnectionException

Methods: getCause, getErrorCode, getMessage, getSQLState

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