Arquillian Persistence Extension 1.0.0.Alpha5 Released

The Arquillian team is proud to announce the 1.0.0.Alpha5 release of the Arquillian Persistence Extension component!

We are back with a bunch of handy new additions and some bug fixes, so keep on reading..

Big kudos goes to Tomas Hradec for his great contribution on the “JPA Cache Eviction” support. You can now control your second level cache directly from the Arquillian tests. I would also like to thank Adrian Gonzalez, Alex Holmansky, Anton Shaykin and Christoph Rohr for their feedback which led us to fix some minor annoyances and shortcomings of APE. We are proud of the vibrant and active community around Arquillian!

Some of the highlights in this release

Instead of relying on the JPA provider you can now use your custom scripts to create the schema and populate data for each test. The only thing you have to do is decorate your test class with the following annotation:

@CreateSchema({"create-schema.sql", "populate-data.sql"})

Thanks to Tomas Hradec we have taken control over the Second Level JPA cache eviction. This initial implementation gives you a possibility to evict the cache before or after your test. Just specify which persistence unit(s) should be used by APE:

@JpaCacheEviction(entityManager = { "java:comp/env/MyPersistenceUnit" })

One of the shortcomings of the previous versions was the fact that you were always forced to provide the data source name explicitly. Either through arquillian.xml or by using the @DataSource annotation. With Alpha 5 you won’t have to. If you only use one data source in the test case, it will be inferred automatically from the persistence.xml used by your test.

You can also tell DBUnit which schema needs to be used for seeding the database. Just add the schema property to your arquillian.xml configuration as illustrated in the snippet below:

arquillian.xml
<extension qualifier="persistence-dbunit">
    <property name="schema">ape</property>
</extension>

We’ve also extended our test suite by adding the following databases to our continuous integration pipeline

  • MySQL 5.5.24
  • PostgreSQL 9.1.4

Important change: We renamed two properties used in arquillian.xml giving them more appropriate names:
initStatement became scriptsToExecuteBeforeTest
cleanupStatement became scriptsToExecuteAfterTest
Moreover you can now specify list of scripts (or files) seperated by comma.

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.Alpha5 view tag
Release date 2012-08-31
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
  • org.jboss.arquillian.extension » arquillian-persistence-integration-tests-testng jar javadoc pom

Release notes and resolved issues 23

Enhancement
  • ARQ-763 - Introduce TestNG tests
  • ARQ-873 - Provide flexible maven configuration for handling combination of different containers and databases
  • ARQ-877 - Improve DBUnit cleanup handling
  • ARQ-882 - Should be possible to specify data insert strategy per @Test
  • ARQ-885 - Improve init/cleanupStatement handling
  • ARQ-1017 - Update APE to Core 1.0.1.Final
  • ARQ-1084 - Fix failing tests in JDK7
Feature Request
  • ARQ-884 - Should be possible to globally define columns to be excluded when comparing data sets.
  • ARQ-899 - Should be able to read data source name from persistence.xml attached to test archive
  • ARQ-900 - Should be able to prepare database using custom scripts
  • ARQ-1029 - Arquillian Persistence Extension: Use specific Schema
  • ARQ-1058 - Implement JPA Cache eviction control
  • ARQ-1065 - Improve SQL script handling
Bug
  • ARQ-872 - Integration tests are failing with Glassfish 3.1.2 embedded
  • ARQ-901 - NPE when using @Cleanup(strategy=CleanupStrategy.USED_ROWS_ONLY)
  • ARQ-1083 - Closing connection might cause memory leak
  • ARQ-1294 - Caught exception in beforeCompletion()
Sub-task
  • ARQ-878 - Make default cleanup phase globally configurable
  • ARQ-879 - Change default cleanup strategy back to AFTER test execution
  • ARQ-881 - Should be possible to exclude arbitrary tables from cleanup procedure
  • ARQ-886 - Rename properties to more meaningful ones
  • ARQ-887 - Allow to use to more than one SQL script file

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