Groovy Documentation

## org.codehaus.groovy.grails.test.support
[Groovy] Class GrailsTestTransactionInterceptor

    java.lang.Object
      org.codehaus.groovy.grails.test.support.GrailsTestTransactionInterceptor

    class GrailsTestTransactionInterceptor

Establishes a rollback only transaction for running a test in.

Field Summary
`protected java.lang.Object` | `transactionManager`
`protected java.lang.Object` | `transactionStatus`

Property Summary
`static java.lang.String` | `TRANSACTIONAL`
`ApplicationContext` | `applicationContext`

Constructor Summary
`GrailsTestTransactionInterceptor(ApplicationContext applicationContext)`

Method Summary
`void` | `destroy()` Rolls back the current transaction.
`void` | `doInTransaction(groovy.lang.Closure body)` Calls init() before and destroy() after invoking `body`.
`void` | `init()` Establishes a transaction.
`boolean` | `isTransactional(java.lang.Object test)` A test is non transactional if it defines an instance or static property name 'transactional' with a value of `false`.

Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()

Field Detail

### transactionManager

    protected final java.lang.Object transactionManager

### transactionStatus

    protected java.lang.Object transactionStatus

Property Detail

### TRANSACTIONAL

    static final java.lang.String TRANSACTIONAL

### applicationContext

    ApplicationContext applicationContext

Constructor Detail

### GrailsTestTransactionInterceptor

    GrailsTestTransactionInterceptor(ApplicationContext applicationContext)

Method Detail

### destroy

    void destroy()

  Rolls back the current transaction.

### doInTransaction

    void doInTransaction(groovy.lang.Closure body)

  Calls init() before and destroy() after invoking `body`. Note: it is the callers responsibility to verify that `body` should be run in a transaction.

### init

    void init()

  Establishes a transaction.

### isTransactional

    boolean isTransactional(java.lang.Object test)

  A test is non transactional if it defines an instance or static property name 'transactional' with a value of `false`.

Groovy Documentation