Arquillian Persistence Extension 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 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

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 6

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
Bug
  • ARQ-685 - Failing to locate datasets when deploying as WAR archive.

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

Arquillian Persistence Extension 1.0.0.Alpha2 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.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

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 8

API review

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

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

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

Some of the highlights in this release

Seeding database using @Data annotation on either class or method level.

Verifying database state after test execution using @Expected annotation.

@Test
@Data("datasets/users.yml")
@Expected("datasets/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);
}
users.yml
useraccount:
  - id: 1
    firstname: John
    lastname: Smith
    username: doovde
    password: password
  - id: 2
    firstname: Clark
    lastname: Kent
    username: superman
    password: kryptonite
expected-users.yml
useraccount:
  - firstname: John
    lastname: Smith
    username: doovde
    password: password
  - firstname: Clark
    lastname: Kent
    username: superman
    password: LexLuthor

Support for following formats as DBUnit data sets:

  • YAML
  • Flat XML
  • Excel

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.Alpha1 view tag
Release date 2011-11-14
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 1

Initial version of the Arquillian Persistence Extension

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