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

Arquillian Extension Jacoco 1.0.0.Alpha3 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.Alpha3 release of the Arquillian Extension Jacoco component!

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 Extension Jacoco
Version 1.0.0.Alpha3 view tag
Release date 2012-04-24
Released by Aslak Knutsen
Compiled against

Published artifacts org.jboss.arquillian.extension

  • org.jboss.arquillian.extension » arquillian-jacoco jar javadoc pom

Release notes and resolved issues 2

Upgrade Jacoco version

Feature Request
  • ARQ-738 - Update integration Jacoco integration to 0.5.6 level

Thanks to the following list of contributors: Aslak Knutsen, Samuel Santos

Arquillian Persistence Extension 1.0.0.Alpha4 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.Alpha4 release of the Arquillian Persistence Extension component!

It’s been a while since the Alpha3 release. After three long months, we’re excited to announce Alpha 4 with a lot of improvements and enhancements suggested by our great community. Best of all, we finally have complete documentation in the reference guide!

I would especially like to thank Michael Brill for nailing down DBUnit clean up strategies, Pål Oliver Kristiansen and Jarek Gilewski for suggesting customization of DBUnit behaviour and Juergen Zimmermann for spotting a bug with transactional support. Last, but not least, many thanks to all who actively discussed the roadmap for next releases. There is plenty of great stuff on the way! Thank you very much for your feedback!

Some of the highlights in this release

Custom SQL scripts for cleanup
You can now use custom SQL scripts to clean your database before or after the test. For this purpose use the @CleanupUsingScript annotation and specify SQL files which have to be executed.
More flexible custom SQL scripts execution
We’ve removed the @UsingScript annotation and replaced it with the @ApplyScriptBefore and @ApplyScriptAfter annotations.
DBUnit insert strategies

You can tell DBUnit how it should insert your data. The following strategies are available:

  • INSERT – Performs insert of the data defined in provided data sets. This is the default strategy.
  • CLEAN_INSERT – Performs insert of the data defined in provided data sets, after removal of all data present in the tables referred in provided files.
  • REFRESH – During this operation, existing rows are updated and new ones are inserted. Entries already existing in the database which are not defined in the provided data set are not affected.
  • UPDATE – This strategy updates existing rows using data provided in the datasets. If the dataset contains a row which is not present in the database (identified by its primary key) then an exception is thrown.
DBUnit cleanup modes

You can specify when and how you would like your database to be cleaned. By default, your database is erased entirely before each test. If you want to control this behavior, use the @Cleanup annotation for this purpose. The following modes are currently supported:

  • STRICT – Cleans the entire database. This strategy might require turning off database constraints (e.g. referential integrity).
  • USED_ROWS_ONLY – Deletes only those entries that are defined in the datasets used for seeding.
  • USED_TABLES_ONLY – Deletes only those tables that are referenced in datasets.

You can also specify when you would like to invoke the cleanup procedure. For instance:

@Cleanup(phase = TestExecutionPhase.AFTER, strategy = CleanupStrategy.USED_ROWS_ONLY)

You can invoke cleanup BEFORE or AFTER the test. You can also disable cleanup by using TestExecutionPhase.NONE.

Column filtering for data set matching
@ShouldMatchDatSet has been enhanced with columnsToExclude list, where you can specify which columns shouldn’t be used for database content verification.
Nullable columns
For XML, JSON and YAML you can now set arbitary columns to null using [null] placeholder.
Separated configuration for core and (enhanced) DBUnit specific features

We provide configuration for all DBUnit properties and features as of Alpha 4! Moreover there is a split for core properties (such as default data source or JNDI of UserTransaction) and DBUnit related settings, as the example below illustrates:

arquillian.xml
<extension qualifier="persistence">
    <property name="defaultDataSource">java:app/datasources/mssql_ds</property>
    <property name="userTransactionJndi">java:jboss/UserTransaction</property>
    <property name="initStatement">scripts/mssql-identity-insert-on.sql</property>
    <property name="cleanupStatement">scripts/mssql-identity-insert-off.sql</property>
</extension>
          
          <extension qualifier=“persistence-dbunit”>
<property name=“datatypeFactory”>org.dbunit.ext.mssql.MsSqlDataTypeFactory</property>
<property name=“useIdentityInsert”>true</property>
</extension>

For complete list, please refer to the reference guide.

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 Persistence Extension
Version 1.0.0.Alpha4 view tag
Release date 2012-04-12
Released by Aslak Knutsen
Compiled against

Published artifacts org.jboss.arquillian.extension

  • org.jboss.arquillian.extension » arquillian-persistence-api jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-persistence-impl jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-persistence-integration-tests jar javadoc pom

Release notes and resolved issues 21

Enhancement
  • ARQ-755 - Introduce annotation based db cleanup configuration
  • ARQ-756 - Improve error messages
  • ARQ-805 - Convert test method names from camel to underscore
  • ARQ-859 - Cleanup configuration - move dbunit related settings to its own configuration.
Feature Request
  • ARQ-718 - Customization for DBUnit
  • ARQ-719 - Enable column sensing for FlatXmlDataSet
  • ARQ-720 - Enable nulls for FlatXmlDataSet
  • ARQ-764 - Using DBUnit with IDENTITY or auto-increment columns
  • ARQ-777 - Should be possible to run custom scripts before and after test
  • ARQ-804 - Should be able to clean database using custom SQL script
  • ARQ-869 - Move JavaDoc from Field level to Method level for Configuration objects
Bug
  • ARQ-721 - Compilation error in older version of JDK 6
  • ARQ-723 - TransactionalWrapper.afterTest() ignores SessionContext.setRollbackOnly()
  • ARQ-751 - Empty YML file is causing error whereas it should be simply skipped
  • ARQ-752 - Persistence extension is failing to enrich archive when there is no dataset defined
  • ARQ-765 - Update ShrinkWrap Descriptors dependency
Task
  • ARQ-757 - Document extension in confluence.
Sub-task
  • ARQ-771 - Global DBUnit configuration should be exposed in arquillian.xml
  • ARQ-772 - Introduce column filtering for data set matching
  • ARQ-806 - Should provide cleanup strategies to control what needs to be removed for the given test

Thanks to the following list of contributors: Bartosz Majsak, Aslak Knutsen

Graphene 1.0.0.Final 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.Final release of the Graphene component!

Graphene is joining rest of the Arquillian party, building on top of Arquillian testing platform Drone extension, both which reached their first stable version yesterday.

The Mission

Arquillian Graphene focuses on making real-browser automation a breeze.

The project was started to address simplification of covering AJAX-enabled applications with browser automation tests.

While Selenium project is focusing on unified API, integration with variety of browsers, Graphene project is addressing the real-world testing challenges:

  • rapid development
    • straight-forward
    • readable API
    • fast turnaround
  • object-oriented
    • type-safe API
    • dependency injection of thread-local context
  • instabilities and speed of execution in continuous integration
    • jQuery selectors
    • request guards

Availability

The Graphene bits are available in JBoss Community artifact repository, dual-licensed under LGPL v2.1 (backward-compatibility) and ASL v2.0 (which uses rest of the Arquillian sub-projects).

For those who are already using Graphene in a Maven project, you can simply update the version to 1.0.0.Final.

You can start with the tests using our Getting Started with the JBoss Maven repository guide.

The Future

Right now we are heavily working on making the new version of Graphene 2 on the road.

Selenium 2 with its WebDriver API made huge progress with API accessibility and readability. It’s already pleasure to work with this API in Java world.

However still there are many shortcomings we are going to address with Graphene 2, building on top of concepts brought in Graphene 1 and adding new features, which opens world of new possibilities:

  • dependency injection of thread-local context
  • fast development turnaround
  • cross-cutting concerns (command interception)
  • request guards
  • page extensions
  • component objects
    • extension of page objects concept
  • JavaScript test execution from within Selenium test

If you enjoy testing and you are unsatisfied with the current browser automation tooling, it’s perfect time to step in and help us to bring the future!

Project Links

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 Graphene
Version 1.0.0.Final view tag
Release date 2012-04-11
Released by Lukas Fryc
Compiled against

Published artifacts org.jboss.arquillian.graphene

  • org.jboss.arquillian.graphene » graphene-parent pom
  • org.jboss.arquillian.graphene » graphene-selenium-parent pom
  • org.jboss.arquillian.graphene » graphene-selenium-api jar javadoc pom
  • org.jboss.arquillian.graphene » graphene-selenium-impl jar javadoc pom
  • org.jboss.arquillian.graphene » graphene-selenium-drone jar javadoc pom
  • org.jboss.arquillian.graphene » graphene-selenium pom
  • org.jboss.arquillian.graphene » arquillian-graphene pom

Release notes and resolved issues 8

Component Upgrade
  • ARQGRA-140 - Upgrade to Arquillian Core/Drone 1.0.0.Final
Feature Request
  • ARQGRA-142 - Refactor Graphene 1 to allow addition of Graphene 2 bits
  • ARQGRA-143 - Add license file to the project
  • ARQGRA-144 - Add section about Drone/Graphene usage in Getting Started guide
Bug
Task
  • ARQGRA-93 - Add README to the GitHub repository
  • ARQGRA-139 - Blog about releasing Graphene 1 Final
  • ARQGRA-145 - Update dependency versions in docs

Thanks to the following list of contributors: Lukas Fryc

Arquillian Drone Extension 1.0.0.Final 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.Final release of the Arquillian Drone Extension component!

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 Drone Extension
Version 1.0.0.Final view tag
Release date 2012-04-10
Released by Aslak Knutsen
Compiled against

Published artifacts org.jboss.arquillian.extension

  • org.jboss.arquillian.extension » arquillian-drone-bom pom
  • org.jboss.arquillian.extension » arquillian-drone-selenium-depchain pom
  • org.jboss.arquillian.extension » arquillian-drone-webdriver-depchain pom
  • org.jboss.arquillian.extension » arquillian-drone-api jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-drone-spi jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-drone-configuration jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-drone-impl jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-drone-selenium-server jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-drone-selenium jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-drone-webdriver jar javadoc pom

Release notes and resolved issues 3

Extension Drone - Final

Enhancement
  • ARQ-551 - Update Arquillian Drone docs
Task
  • ARQ-843 - Remove parent artifact from Arquillian-Drone-BOM

Thanks to the following list of contributors: Karel Piwko, Aslak Knutsen