Code example for SQLNonTransientException

Methods: getCause, getErrorCode, getMessage, getSQLState

0
    /** 
     * @test java.sql.SQLNonTransientException(Throwable) 
     */ 
    public void test_Constructor_LThrowable() { 
        Throwable cause = new Exception("MYTHROWABLE");
        SQLNonTransientException sQLNonTransientException = new SQLNonTransientException(
                cause);
        assertNotNull(sQLNonTransientException);
        assertEquals(
                "The reason of SQLNonTransientException should be equals to cause.toString()", 
                "java.lang.Exception: MYTHROWABLE", sQLNonTransientException
                        .getMessage());
        assertNull("The SQLState of SQLNonTransientException should be null",
                sQLNonTransientException.getSQLState());
        assertEquals("The error code of SQLNonTransientException should be 0",
                sQLNonTransientException.getErrorCode(), 0);
        assertEquals(
                "The cause of SQLNonTransientException set and get should be equivalent", 
                cause, sQLNonTransientException.getCause());
    } 
 
    /** 
     * @test java.sql.SQLNonTransientException(Throwable) 
     */