Code example for SQLTransientConnectionException

Methods: getCause, getErrorCode, getMessage, getSQLState

0
    /** 
     * @test java.sql.SQLTransientConnectionException(Throwable) 
     */ 
    public void test_Constructor_LThrowable() { 
        Throwable cause = new Exception("MYTHROWABLE");
        SQLTransientConnectionException sQLTransientConnectionException = new SQLTransientConnectionException(
                cause);
        assertNotNull(sQLTransientConnectionException);
        assertEquals(
                "The reason of SQLTransientConnectionException should be equals to cause.toString()", 
                "java.lang.Exception: MYTHROWABLE", 
                sQLTransientConnectionException.getMessage());
        assertNull(
                "The SQLState of SQLTransientConnectionException should be null", 
                sQLTransientConnectionException.getSQLState());
        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(Throwable) 
     */