Code example for SQLTransientConnectionException

Methods: getCause, getErrorCode, getMessage, getSQLState

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