Red Hat
Aug 17, 2012
by Arquillian Project Team

The Arquillian team is proud to announce the 1.0.0.Beta1 release of the Arquillian Spring Framework Extension component!

The first Beta release of the Arquillian Spring extension is here.

Some of the highlights in this release

Client side application context registration

Spring transaction support

Client side tests with Spring

So far the Spring extension has only allowed application context creation and bean injection to occure when the tests were deployed in a container. We wanted to bring the same functionality to the client side. With the two new annotations @SpringClientConfiguration and @SpringClientAnnotationConfiguration it is now possible to set up the application context and inject beans into Arquillian tests that are running on the client.

An example of use would be to test a deployed REST service using the Spring RestTemplate configured in the client context.

      public class ClientRestServiceTestCase {

          @Deployment(testable = false)
          @OverProtocol("Servlet 3.0")
          public static Archive createTestArchive() {
              return Deployments.createWebApplication()
                      .addAsWebInfResource("mvc/web.xml", "web.xml")

          private URL contextPath;

          private RestTemplate restTemplate;

          public void testGetEmployees() {

              Employee result = restTemplate.getForObject(contextPath + "/Employees/1", Employee.class);

              assertEquals("The returned employee has invalid name.", "John Smith", result.getName());

Spring transaction support

The recent release of the Arquillian Transaction Extension allow us to control the transactional behavior of our test methods. With the help of the Spring Extension you can now control your Spring configured transaction manager using the same API. The set up is done in the normal Spring way by defining a transaction manager in the application context.

<?xml version="1.0" encoding="UTF-8"?>
      <beans xmlns=""

         <!-- Creates local entity manager factory -->
         <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean">
             <property name="persistenceUnitName" value="ArquillianTestUnit"/>

         <!-- Enables the declarative transaction support -->
         <tx:annotation-driven transaction-manager="txManager"/>

         <!-- Creates transaction manager -->
         <bean id="txManager" class="org.springframework.orm.jpa.JpaTransactionManager">
             <property name="entityManagerFactory" ref="entityManagerFactory"/>


You define which transaction manager to use in your test class via the manager attribute on the @Transactional annotation.

      @Transactional(manager = "txManager")
      public class JpaEmployeeRepositoryTestCase {

          private EmployeeRepository employeeRepository;

          private EntityManager entityManager;

          public void testSave() {

              Employee employee = new Employee();
              employee.setName("Test employee");


              List<Employee> result = entityManager.createQuery("from Employee").getResultList();

              assertEquals("Two employees were expected.", 1, result.size());

Migrating from 1.0.0.Alpha2

  • Artifact arquillian-container-spring has been renamed to arquillian-service-container-spring

We look forward to your feedback on this new release on the community forums !

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 Spring Framework Extension
Version 1.0.0.Beta1 view tag
Release date 2012-08-17
Released by Aslak Knutsen
Compiled against
  • Arquillian Core – 1.0.1.Final
  • JUnit – 4.8.1

Release notes and resolved issues 3

Arquillian Transaction Extension support and Client side ApplicationContext creation

Feature Request
  • ARQ-958 - Provide support for Spring transactions
  • ARQ-985 - Register the Spring Extension on client side.

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

Original Post