Code example for SQLTransientException

Methods: getCause, getErrorCode, getMessage, getSQLState

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