Code example for SQLTransientException

Methods: getCause, getErrorCode, getMessage, getSQLState

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