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

Some of the highlights in this release

Test enrichment for @In injection points from the Seam 2 Context.

Packaging support for adding the Seam 2 framework.

Ability to override Seam and JBoss EL versions defined in POM (so you can easily check if you app works with different Seam versions). Default are JBoss Seam 2.2.2.Final and JBoss EL 1.0_02.CR5.

arquillian.xml
<arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns="http://jboss.org/schema/arquillian"
  xsi:schemaLocation="
      http://jboss.org/schema/arquillian
      http://jboss.org/schema/arquillian/arquillian_1_0.xsd">

  <extension qualifier="seam2">
    <property name="seamVersion">2.2.1.Final</property>
    <property name="jbossElVersion">1.0_02.CR6</property>
  </extension>

</arquillian>

Tests were verified on JBoss AS 4.2.3.GA and 5.1.0.Final (both managed and remote).

Example below shows simple Seam component and the way how to write Arquillian test using this extension.

@Name("fluidOuncesConverter")
public class FluidOuncesConverter {
    public Double convertToMillilitres(Double ounces) {
        return ounces * 29.5735296;
    }
}

@RunWith(Arquillian.class)
public class ComponentInjectionTestCase {
    @Deployment
    public static Archive<?> createDeployment() {
        return ShrinkWrap.create(WebArchive.class, "test.war")
                .addClass(FluidOuncesConverter.class)
                .addAsResource(EmptyAsset.INSTANCE, "seam.properties")
                .setWebXML("web.xml");
    }

    @In
    FluidOuncesConverter fluidOuncesConverter;

    @Test
    public void shouldInjectSeamComponent() throws Exception {
        assertThat(fluidOuncesConverter).isNotNull();
    }

    @Test
    public void shouldConvertFluidOuncesToMillilitres() throws Exception {
        // given
        Double ouncesToConver = Double.valueOf(8.0d);
        Double expectedMillilitres = Double.valueOf(236.5882368d);

        // when
        Double millilitres = fluidOuncesConverter.convertToMillilitres(ouncesToConver);

        // then
        assertThat(millilitres).isEqualTo(expectedMillilitres);
    }
}

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 Seam 2 Extension
Version 1.0.0.Alpha1 view tag
Release date 2012-02-12
Released by Aslak Knutsen
Compiled against

Published artifacts org.jboss.arquillian.extension

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

Release notes and resolved issues 2

Initial release

Feature Request

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