Arquillian Transaction Extension 1.0.0.Alpha1 Released

Since we wrote this post we didn't laze around. Check our latest announcement.

The Arquillian team is proud to announce the 1.0.0.Alpha1 release of the Arquillian Transaction Extension component!

Motivation

Until this point, the only special transaction support in Arquillian has come from the Arquillian Persistence Extension. But as the extension universe expand, the need for other extensions to interact with transactions expand as well. To avoid you having to deal with the individual extensions transaction support in different ways, different apis, we concluded it was time to make Transactions it’s own top level extension.

Usage

The current API takes a declarative approach to configure the transactional behavior of the Test case. By annotating the TestClass or the TestMethod with @Transactional you control how the transaction should be handled after TestMethod execution.
Should Arquillian COMMIT, ROLLBACK or DISABLE the transaction for this method?

Example:

@RunWith(Arquillian.class)
@Transactional
public class GreeterTestClass {

    public void defaultTest() throws Exception {
        // test code
    }

    @Transactional(TransactionMode.ROLLBACK)
    public void rollbackTest() throws Exception {
        // test code
    }
}

SPI integration

The extension itself does not come with any implementation for a concrete transaction API, the implementations will be provided by separate modules. During execution, the transactional handling is delegated to a TransactionProvider service implementation which is registered within Arquillian. The SPI defines a set of transaction lifecycle events ((Before|After)Transaction(Started|Ended)) and a separate transactional scope (@TransactionScope) which is bound to the executing transaction.

Implementations

Besides the JTA implementation provided by the Arquillian Persistence Extension, the next extensions which will provide support is the Spring Extension. More details to come.

What is Arquillian?

Arquillian is open source software that empowers you to test JVM-based applications more effectively. Created to defend the software galaxy from bugs, Arquillian brings your test to the runtime so you can focus on testing your application's behavior rather than managing the runtime. Using Arquillian, you can develop a comprehensive suite of tests from the convenience of your IDE and run them in any IDE, build tool or continuous integration environment.

Release details

Component Arquillian Transaction Extension
Version 1.0.0.Alpha1 view tag
Release date 2012-08-13
Released by Aslak Knutsen
Compiled against

Published artifacts org.jboss.arquillian.extension

  • org.jboss.arquillian.extension » arquillian-transaction-api jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-transaction-spi jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-transaction-impl-base jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-transaction-bom pom

Release notes and resolved issues 2

The basic setup for rollback/commit on a TestClass with multiple Manager implementation

Feature Request
  • ARQ-1033 - Extract the transaction support out of Arquillian Persistence Extension

Thanks to the following list of contributors: Aslak Knutsen, Jakub Narloch