Code example for SQLTransactionRollbackException

Methods: getCause, getErrorCode, getMessage, getSQLState

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