Arquillian Spring Framework 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 Spring Framework Extension component!

We’re moving the boundaries of Arquillian into a completely new area by including built-in support for testing applications that use the Spring Framework. This release is the first milestone for this extension. The focus so far has been on providing support for Spring’s core features (e.g., IoC container, data sources, persistence, transactions, javax.inject and EJB integration, etc.).

I’m working on the Spring extension for my Google Summer of Code 2012 project. This post also serves as my first status update. Coding began yesterday, but I’ve already been hard at work ;)

Some of the highlights in this release

Dependency injection

The extension provides three simple ways to enable Spring support in Arquillian test case. In other to create application context from XML simply add to the test @SpringConfiguration with locations of the XML files. Java-based config is supported as well with @SpringAnnotatedConfiguration which can be configured with concrete classes or names of packages to scan. The last possibility, @SpringWebConfiguration that allows to retrieve the application context of the specific DispatcherServlet running in the container, can be used only with web applications.

Custom context classes

There are situations when plain Spring context isn’t enough, so we allowed to register custom context classes that will be instantiated for each test. The context classes could be customized through annotations or through extension settings provided with arquillian.xml. A typical scenario would be for example running the Spring in JBoss AS using Snowdrop custom context classes.

Artifact packaging

The extension, by default, handles packaging of spring-context and spring-web automatically with each test.

Intuitive configuration

The extension can be easily configured through the arquillian.xml. All the settings like e.g. artifacts versions can be overridden here.

arquillian.xml
<extension qualifier="spring">
    <property name="autoPackage">true</property>
    <property name="springVersion">3.0.0.RELEASE</property>
    <property name="cglibVersion">2.2</property>

    <property name="includeSnowdrop">true</property>
    <property name="snowdropVersion">2.0.3.Final</property>

<property name=“customContextClass”>org.jboss.spring.vfs.context.VFSClassPathXmlApplicationContext</property>
</extension>

Here’s an example of a basic Spring test with Arquillian:

DefaultStockRepositoryTestCase.java
@RunWith(Arquillian.class)
@SpringConfiguration("applicationContext.xml")
public class DefaultStockRepositoryTestCase {

    @Deployment
    public static JavaArchive createTestArchive() {
        return ShrinkWrap.create(JavaArchive.class)
                .addClasses(Stock.class, StockRepository.class, StockService.class,
                        DefaultStockRepository.class, DefaultStockService.class)
                .addAsResource("applicationContext.xml");
    }

    @Autowired
    StockRepository stockRepository;

    @Test
    public void testSave() {
        Stock acme = createStock("Acme", "ACM", 123.21D, new Date());
        Stock redhat = createStock("Red Hat", "RHC", 59.61D, new Date());

        stockRepository.save(acme);
        stockRepository.save(redhat);

        assertTrue("The stock id hasn't been assigned.", acme.getId() > 0);
        assertTrue("The stock id hasn't been assigned.", redhat.getId() > 0);
    }
}

For more examples on how to use these extensions and quickly get started with development you can take a look at prepared showcase. Additionally, you can browse the integration tests that are part of project source code.

For help with preparing this release, I’d like to especially thank Dan Allen, Marius Bogoevici and Aslak Knutsen for sharing their knowledge and providing helping hand.

We look forward to hearing your feedback about this release in 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.Alpha1 view tag
Release date 2012-05-21
Released by Aslak Knutsen
Compiled against

Published artifacts org.jboss.arquillian.extension

  • org.jboss.arquillian.extension » arquillian-service-deployer-spring-common jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-service-deployer-spring-2.5 jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-service-deployer-spring-2.5-int-tests jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-service-deployer-spring-3 jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-service-deployer-spring-3-int-tests jar javadoc pom

Release notes and resolved issues 2

Support for Spring enrichment in other Containers

Feature Request
  • ARQ-301 - Create a Spring framework integration (for non-standalone containers)

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

Bug killing proposals accepted for 2012 Google Summer of Code!

The much anticipated announcement about which students were selected to participate in the 2012 Google Summer of Code program was published earlier today. In total, there are 1,212 students participating. We’d like to congratulate all the students accepted and wish you all best of luck this summer!

The JBoss Community is proud to be participating as an independent mentor organization for the first time this year. We were selected thanks to a strong showing of volunteer mentors and an overwhelming number of compelling and creative ideas. More than half of the ideas came from the Arquillian community ~:)

I’d like to extend a big thank you to everyone who came forward with ideas. Acceptances aside, these ideas are already helping shape the future of the various JBoss projects.

Accepted projects

The Arquillian project is excited to announce that we have 2 students participating this year!

Google granted the JBoss Community 8 student slots. From those 8 slots, Arquillian was allotted 2 slots—far less than the number of excellent proposals submitted. After much agonizing over the decision for the last week, the Arquillian mentors decided to award the slots to the following two student proposals:

Project #1

Title Extend Arquillian to support Spring testing (beans and MVC controllers)
Student Jakub Narloch
Mentor Marius Bogoevici
Summary Arquillian provides an extensible testing platform that can be used for testing any type of Java-based component. The initial focus for Arquillian was testing Java EE components, such as CDI beans, EJBs and JPA. However, Arquillian provides all the infrastructure and hooks necessary to make it an ideal testing platform for Spring applications. So the main of this project would be introducing suport for Spring testing.

Project #2

Title Automated Visual Verification
Student Jakub Dunia
Mentor Lukas Fryc
Summary Testing is important part of development. It is a procedure we need to perform many times, that is why there are many tools to automate it. There are cases where it is not that easy, like Visual Verification. Normally we need real person to check whether the web page looks good or not. The goal of this project is to write a tool that allows to easily review set of automatically collected screenshots generated by tests, and also improve existing comparision algorithms.

Jakub Narloch is already well on his way to bringing Spring testing support to Arquillian having implemented a prototype. You can read about the status of his prototype in the GSoC – Arquillian Spring integration forum thread.

Jakub Dunia, with his insight into problem solving, has already demonstrated he’ll be invaluable member of our community. The project he has chosen to support is extremely innovative, not only in scope of Arquillian, but in UI testing in general.

Congratulations Jakub * 2!

There’s an additional testing-related proposal, sponsored by the Errai team, that was also accepted:

Project #3

Title A Jenkins plugin to visualize Jacoco code coverage reports
Student Ognjen Bubalo
Mentor Jonathan Fuerth
Summary JaCoCo is a tool which generates code coverage reports based on Java unit tests. The project is about writing a Jenkins plugin to visualize JaCoCo code coverage reports.

Congratulations Ognjen!

Next steps

Jakub, Jakub and Ognjen, please contact your mentors immediately. Make a plan to communicate with your mentor regularly, at minimum, once each week. Since we’re big believers in openness, the best way to keep in touch is through a public channel such as the Arquillian development forum or the #arquillian channel on Freenode IRC.

We plan to publish status reports on these projects here at arquillian.org to allow the community to follow your progress and provide feedback. For those watching, stay tuned!

Promising proposals

Although we could only accept two proposals, there were many well-written proposals that truly deserved a slot (if only we had more to give). I’d like to thank the students for the time they spent preparing and submitting the proposals by highlighting them here. The rating shown under each proposal is the average rating (out of 5) given by the JBoss mentors who voted.

Unleash the Jester on integration tests by adding support for mutation testing in Arquillian

Student: Adam Sznajder
Rating: 5 / 5

Server-Side Performance Testing Framework reusing Arquillian Core

Student: Oliver Kišš
Rating: 4.8 / 5

RushEye Manager for Automated Visual Verification

Student: Udesh Liyanaarachchi
Rating: 4.5 / 5

Integrate Robotium into Arquillian Drone and Android extensions for complete automated application testing on Android

Student: Aleksey Shilin
Rating: 4.25 / 5

Provide an object-oriented format for defining test data for the Arquillian Persistence Extension

Student: Martin Skurla
Rating: 4 / 5

Automate JavaScript tests in an integration environment using Arquillian

Student: Chaitanya Nalla
Rating: 3.67 / 5

Provide an object-oriented format for defining test data for the Arquillian Persistence Extension

Student: Houssem
Rating: 3.67 / 5

Integrate Sahi into Arquillian Drone for automated browser testing

Student: Asanka Amarasinghe
Rating: 3.5 / 5

Despite the fact that these proposals were not accepted into GSoC, we really want to see them pursued. We view this program as an opportunity to interact with the next generation of the JBoss Community and to help them discover, or reinforce, their passion for open source. In fact, several students, including Chaitanya Nalla, have already expressed interest in contributing to Arquillian despite not being accepted to GSoC. That’s the spirit!

As Anil mentioned on the JBoss GSoC mailinglist, we’re exploring a diverse approach to enable students to continue their proposals, ranging from Red Hat summer internships to community-supported projects. Our plan is to closely track the GSoC schedule to keep the projects on track and to give you, the students, the experience the comes with completing a summer project (and likely increase your chance of being awarded a slot next year). Stay tuned for details.

What’s next?

Keep an eye on this blog for periodic progress reports about the GSoC student projects and any additional non-GSoC summer projects.

The first milestone is May 21st, when coding officially begins (trust me, these guys will be way ahead of that scheduled date). The mid-term evaluations happen mid July and the projects wrap up in mid August. See the official timeline for all the dates.

Even when GSoC ends, the community continues on! We hope summer students stay involved in the community long after the hacking days of summer.