Arquillian Persistence Extension 1.0.0.Alpha6 Released

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

Arquillian Persistence Extension is back on the release train and the future plan is stronger than ever. The Alpha6 release brings a lot of improvements and fixes thanks to invaluable feedback from the community.

Big thanks go to Marco Cella, Matti Linnanvuori, Bernard Łabno, Tiago Wanke Marques, Karsten Ohme, Vineet Reynolds, Cyrill Ruettimann, Bryan Saunders, Anton Shaykin, Nicolas-Xavier Vanderlinden and Noah White 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

Transaction support has been replaced with Transaction Extension. By default the JTA implementation is included. The only thing you will need to change in your tests is the import sttement for the @Transactional annotation. From now on it’s under org.jboss.arquillian.transaction.api.annotation.

Support for row ordering when comparing datasets. When using Generated ID’s for instance, such as UUID’s, the rows need to be sorted in order for the DbUnit comparison to pass. If they are not ordered, then the assertion is unreliable.

Improved error reporting, including rows comparision and misconfigured entries.

DTD support for flat XML data sets (DBUnit feature).

Proper support for multiple line SQL scripts with comments (ANSI SQL compliant)

We’ve also extended our test suite by adding Apache Derby to our continuous integration pipeline.

Important change: We re-groupped configuration entries arquillian.xml giving them more qualifiers:
persistence – for all basic settings
persistence-dbunit – for DBUnit specific configuration
persistence-script – for SQL related things
Please refer to our confluence documentation for detailed description.

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.Alpha6 view tag
Release date 2013-03-07
Released by Aslak Knutsen
Compiled against
  • Arquillian Core – 1.0.3.Final

Published artifacts org.jboss.arquillian.extension

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

Release notes and resolved issues 25

Bug
  • ARQ-1028 - @ShouldMatchDataSet before persist
  • ARQ-1081 - DTD not supported by APE
  • ARQ-1086 - @CleanuUsingScript with phase NONE
  • ARQ-1087 - Wrong dump directory path
  • ARQ-1094 - @ShouldMatchDataSet Not Properly Comparing Datasets
  • ARQ-1100 - Datetime conversion does not work as expected for YAML data sets
  • ARQ-1101 - Exception with nested transaction with MySQL
  • ARQ-1127 - Order of scripts and data sets should be preserved when defined on class level
  • ARQ-1146 - Single statement which spans multiple lines is not handled properly
  • ARQ-1167 - Transactional support from Seam 3 interfere Persistence Extension resulting in ExclusiveTransactionException
  • ARQ-1208 - Multiple line statements are not handled properly
  • ARQ-1300 - Execute script handler does not properly ignore /* */ and {} ANSI compliant SQL comments
Enhancement
  • ARQ-1085 - Unify JPA Cache eviction events with APE
  • ARQ-1215 - Clean slf4j dependency
Feature Request
  • ARQ-1093 - Support for Row Ordering when Comparing Datasets
  • ARQ-1149 - Dataset comparision should collect all differences in the rows instead of failing on the first column
  • ARQ-1157 - Replace Persistence internal Transaction management with Transaction Extension
  • ARQ-1231 - Should observe required object ArquillianDescriptor instead of assuming Lifecycle
  • ARQ-1248 - Add Derby to the testing matrix
Task
  • ARQ-1342 - Clean up POM
  • ARQ-1343 - Schema creation scripts should be repeatable
Sub-task
  • ARQ-1158 - Extract JTA from APE and replace with Transaction Extension dependency
  • ARQ-1334 - Should inform if table defined for exclusion is not defined in the schema
  • ARQ-1335 - Should inform when non-defined configuration key encountered in arquillian.xml

Thanks to the following list of contributors: Bartosz Majsak, Aslak Knutsen, Vineet Reynolds, Jakub Narloch, Artur Dryomov

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
  • Arquillian Core – 1.0.2.Final

Published artifacts org.jboss.arquillian.extension

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

Release notes and resolved issues 22

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
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
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

Arquillian Persistence Extension 1.0.0.Alpha4 Released

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
  • Arquillian Core – 1.0.0.Final

Published artifacts org.jboss.arquillian.extension

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

Release notes and resolved issues 21

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
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
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

Arquillian Persistence Extension 1.0.0.Alpha3 Released

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

Some of the highlights in this release

Support for JSON. If you prefer this well known format over YAML/EXCEL/XML, you can now define your data sets in JSON too!

users.json
{
    "useraccount":
    [
        {
            "id" : 1,
            "firstname" : "John",
            "lastname" : "Smith",
            "username" : "doovde",
            "password" : "password"
        },
        {
            "id" : 2,
            "firstname" : "Clark",
            "lastname" : "Kent",
            "username" : "superman",
            "password" : "kryptonite"
        }
    ]
}

Introduced ability to seed database using plain SQL scripts.

@Test
@UsingScript("users.sql")
@ShouldMatchDataSet("expected-users.yml")
public void shouldChangeUserPassword() throws Exception {
    // given
    String expectedPassword = "LexLuthor";
    UserAccount user = em.find(UserAccount.class, 2L);

    // when
    user.setPassword("LexLuthor");
    em.merge(user);

    // then
    assertThat(user.getPassword()).isEqualTo(expectedPassword);
}

New feature – Apache POI exclusion. If you are not using excel based data sets you can exclude
Apache POI archive in arquillian.xml file. This will reduce deployment size quite significantly.

arquillian.xml
<extension qualifier="persistence">
    <property name="excludePoi">true</property>
</extension>

Fixed WAR and EAR packaging.

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.Alpha3 view tag
Release date 2011-12-30
Released by Aslak Knutsen
Compiled against
  • Arquillian Core – 1.0.0.CR6

Published artifacts org.jboss.arquillian.extension

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

Release notes and resolved issues 6

Bug
  • ARQ-685 - Failing to locate datasets when deploying as WAR archive.
Enhancement
  • ARQ-693 - Custom SQL statements / scripts to be run before and after test execution
Feature Request
  • ARQ-694 - Seeding database using SQL scripts
  • ARQ-695 - Investigate possibility of excluding Apache POI library
  • ARQ-711 - Add support for JSON data sets

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

Arquillian Persistence Extension 1.0.0.Alpha2 Released

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

Some of the highlights in this release

Renamed @Data and @Expected annotation to more meaningful @UsingDataSet and @ShouldMatchDataSet.

datasets folder is now a default location for all data set files. Files specified in @UsingDataSet and @ShouldMatchDataSet will be first lookup in this directory. If not found search will be performed starting from root folder.

@Test
@UsingDataSet("users.yml")
@ShouldMatchDataSet("expected-users.yml")
public void shouldChangeUserPassword() throws Exception {
   // given
   String expectedPassword = "LexLuthor";
   UserAccount user = em.find(UserAccount.class, 2L);

   // when
   user.setPassword("LexLuthor");
   em.merge(user);

   // then
   assertThat(user.getPassword()).isEqualTo(expectedPassword);
}

New feature of dumping database state during test execution has been added. Following phases are covered:

  • Before seed (before test execution).
  • After seed (before test execution).
  • Ater test.
  • After clean.

This can be configured in arquillian.xml as follows:

arquillian.xml
<extension qualifier="persistence">
	<property name="dumpData">true</property>
</extension>

@Transactional support can be now used standalone either on class or test method level.

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.Alpha2 view tag
Release date 2011-12-03
Released by Aslak Knutsen
Compiled against
  • Arquillian Core – 1.0.0.CR6

Published artifacts org.jboss.arquillian.extension

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

Release notes and resolved issues 8

API review

Bug
  • ARQ-662 - Error when running a test that is not related to persistence extension
  • ARQ-663 - @Expected annotation giving false positives due to improper usage of DBUnit assertions
Enhancement
  • ARQ-680 - Separate DBUnit DatabaseConnection creation in dedicated event.
  • ARQ-681 - Rename dataset annotations
  • ARQ-682 - Introduce convention for datasets files lookup from datasets folder first.
Feature Request
  • ARQ-653 - Add Persistence configuration to Archive instead of client callback
  • ARQ-654 - Change Persistence TransactionStarted event to StartTransaction

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