The arquillian universe

A tour around the astrophysics lab

Vineet Reynolds L. P.

Red Hat

Testing

too hard > too slow > no time > no fun

The purpose of automated testing is to enable change. Verifying correctness is just a nice side-effect. - Jeremy Norris

Core Principles

Tests should be portable to any supported container.
Tests should be executable from IDEs and build tools.
The platform should integrate existing test frameworks.



Arquillian Core

So you can rule your code, not the bugs!




Extensible

&

Flexible

Core extensions

You'll usually need these...


  • Container
  • Test
  • Container Test

test Extensions

Test as you usually do....

  • JUnit
  • TestNG

Or drive your development through tests...

  • Spock
  • JBehave*

Container Extensions

You want to run your tests like they're in production, right?

  • JBoss AS
  • GlassFish
  • Jetty
  • Tomcat
  • WebSphere
  • WebLogic
  • Spring, Weld
  • OpenShift
  • CloudBees
  • ...

More?

No problems!

Implement your own.

Arquillian Persistence

So you don't fight your Data Access Layer

Rollback or Commit on every test?

Prefer commits. Test your database engine thoroughly.

Transaction Isolation levels


@Test
@UsingDataSet("customer.xml")
@ShouldMatchDataSet("customer-with-account.xml")
public void testCreateAccountForCustomer() {
    // Setup. Query for a customer
    Customer customer = em.find(Customer.class, 1L);

    // Execute. Associate an account with the queried entity
    customerService.createAccount(customer);

    // Verify. Query for the updated customer
    // Avoid this, for REPEATABLE_READ/SERIALIZABLE
    em.flush();
    em.clear();
    Customer updatedCustomer = em.find(Customer.class, 1L);
    assertThat(updatedCustomer.getAccount(), equalTo(expectedAccount));
}
                            

Automate Dataset preparation

Dataset explosion

Avoid large datasets if you can.

Design and prepare datasets for reuse across tests.

Arquillian Drone

Selenium/WebDriver for functional black box tests

Arquillian Warp

Don't let your black box tests fool you



That's it?

Far from it!

  • Arquillian Graphene
  • Arquillian JRebel
  • Arquillian RushEye
  • Arquillian Performance
  • Arquillian Android

And...

  • Arquillian Byteman
  • Arquillian Seam2
  • Arquillian Portal
  • Arquillian Jacoco

And...

  • Arquillian Maven
  • Forge Plugin Arquillian

the arquillian universe

By vineetreynolds

the arquillian universe

  • 1,752