Arquillian Core 1.1.2.Final Released

Since we wrote this post we didn't laze around. Check our latest announcement.

The Arquillian team is proud to announce the 1.1.2.Final release of the Arquillian Core component!

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 Core
Version 1.1.2.Final view tag
Release date 2013-11-15
Released by Aslak Knutsen
Compiled against

Published artifacts org.jboss.arquillian.core

  • org.jboss.arquillian.core » arquillian-core-api jar javadoc pom
  • org.jboss.arquillian.core » arquillian-core-spi jar javadoc pom
  • org.jboss.arquillian.core » arquillian-core-impl-base jar javadoc pom
  • org.jboss.arquillian.config » arquillian-config-api jar javadoc pom
  • org.jboss.arquillian.config » arquillian-config-spi jar javadoc pom
  • org.jboss.arquillian.config » arquillian-config-impl-base jar javadoc pom
  • org.jboss.arquillian.test » arquillian-test-api jar javadoc pom
  • org.jboss.arquillian.test » arquillian-test-spi jar javadoc pom
  • org.jboss.arquillian.test » arquillian-test-impl-base jar javadoc pom
  • org.jboss.arquillian.container » arquillian-container-spi jar javadoc pom
  • org.jboss.arquillian.container » arquillian-container-impl-base jar javadoc pom
  • org.jboss.arquillian.container » arquillian-container-test-api jar javadoc pom
  • org.jboss.arquillian.container » arquillian-container-test-spi jar javadoc pom
  • org.jboss.arquillian.container » arquillian-container-test-impl-base jar javadoc pom
  • org.jboss.arquillian.junit » arquillian-junit-core jar javadoc pom
  • org.jboss.arquillian.junit » arquillian-junit-standalone jar javadoc pom
  • org.jboss.arquillian.junit » arquillian-junit-container jar javadoc pom
  • org.jboss.arquillian.testng » arquillian-testng-core jar javadoc pom
  • org.jboss.arquillian.testng » arquillian-testng-standalone jar javadoc pom
  • org.jboss.arquillian.testng » arquillian-testng-container jar javadoc pom
  • org.jboss.arquillian.testenricher » arquillian-testenricher-cdi jar javadoc pom
  • org.jboss.arquillian.testenricher » arquillian-testenricher-ejb jar javadoc pom
  • org.jboss.arquillian.testenricher » arquillian-testenricher-resource jar javadoc pom
  • org.jboss.arquillian.testenricher » arquillian-testenricher-initialcontext jar javadoc pom
  • org.jboss.arquillian.protocol » arquillian-protocol-servlet jar javadoc pom
  • org.jboss.arquillian.protocol » arquillian-protocol-jmx jar javadoc pom
  • org.jboss.arquillian » arquillian-bom pom

Release notes and resolved issues 3

Enhancement
  • ARQ-1471 - Provide documentation for @Observes annotation
Feature Request
  • ARQ-986 - Add more advanced exception matching logic in @ShouldThrowException

Thanks to the following list of contributors: Aslak Knutsen, Lincoln Baxter, III, Karel Piwko, Ivan St. Ivanov

Arquillian Portal Extension 1.1.0.Alpha1 Released

The Arquillian team is proud to announce the 1.1.0.Alpha1 release of the Arquillian Portal Extension component!

You may have noticed that we jumped from 1.0.0.CR1 to 1.1.0.Alpha1! No, we’re not going crazy, but given the stability inherit within 1.0.0.CR1 and the changes we were
looking to introduce into the extension, it made sense to bump the version to 1.1.0.

This release contained quite a large amount of changes, compared to previously.

Some of the highlights in this release

GateIn and Pluto portlet container implementations are now included as implementations of the portal extension instead of being in separate repositories.

Add the ability to run integration testing against the portlet containers, and different servlet containers.

Extend Warp to cater for regular and JSF Portlets.

Warp extensions for portlets

For non JSF portlets we can specify an Inspection method with either @BeforePortletPhase or @AfterPortletPhase to specify whether we want to the method executed before or after the particular PortletRequest specified by the value on the annotation. An example of executing an inspection after a RenderRequest would be:

@AfterPortletPhase(Phase.RENDER)
public void afterRender() {
    assertTrue(true);
}

It’s also possible to inject the request and response objects into the Inspection. You can choose to either use a generic PortletRequest or more specific request types based on the portlet lifecycle phase, such as ActionRequest. Here’s an example:

@ArquillianResource
ActionResponse actionResponse;

@BeforePortletPhase(Phase.ACTION)
public void beforeActionRequest() {
    String[] values = actionResponse.getRenderParameterMap().get("data");
    assertNull("Render parameter for data should not be set.", values);
}

@AfterPortletPhase(Phase.ACTION)
public void afterActionRequest() {
    String[] values = actionResponse.getRenderParameterMap().get("data");
    assertTrue("Render parameter for data should be set.", values.length == 1);
    assertEquals("Render parameter set to incorrect value.", BasicPortlet.ACTION, values[0]);
}

For JSF portlets we can still use @BeforePortletPhase and @AfterPortletPhase, but these don’t allow us to inspect the JSF lifecycle. To perform inspection on the JSF lifecycle, we need to use @PortletPhase in combination with the JSF lifecycle annotations from Warp. To inspect when JSF changes the value of a bean on form submission for a portlet:

@ManagedProperty("")
Bean bean;

@PortletPhase(ACTION) @BeforePhase(Phase.UPDATE_MODEL_VALUES)
public void testBeanValueBeforeUpdate() {
    assertEquals("Bean value should not be updated yet.", "originalValue", bean.getText());
}

@PortletPhase(ACTION) @AfterPhase(Phase.UPDATE_MODEL_VALUES)
public void testBeanValueAfterUpdate() {
    assertEquals("Bean value should now be updated.", "newValue", bean.getText());
}

One point of note when writing Warp tests for portlets is that most portlet containers perform a redirect after an Action or Event request, but before the portlet is rendered. To be able to inspect on both an Action and Render request, we need to use Warp request groups:

Warp
    .initiate(new Activity() {
        public void perform() {
            // Do something
        }
    })
    .group()
        .observe(request().index(1))
        .inspect(new Inspection() {
            private static final long serialVersionUID = 1L;

            @PortletPhase(ACTION) @BeforePhase(Phase.UPDATE_MODEL_VALUES)
            public void testBeanValueBeforeUpdate() {
                // Asserts
            }
        })
    .group()
        .observe(request().index(2))
        .inspect(new Inspection() {
            private static final long serialVersionUID = 1L;

            @PortletPhase(RENDER) @BeforePhase(Phase.RENDER_RESPONSE)
            public void testBeanValueBeforeRenderResponse() {
                // Asserts
            }
        })
    .execute();

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 Portal Extension
Version 1.1.0.Alpha1 view tag
Release date 2013-10-31
Released by Ken Finnigan
Compiled against

Published artifacts org.jboss.arquillian.extension

  • org.jboss.arquillian.extension » arquillian-portal-shrinkwrap-api jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-portal-shrinkwrap-impl jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-portal-api jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-portal-spi jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-portal-impl-base jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-portal-impl-gatein jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-portal-impl-pluto-container jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-portal-impl-pluto-jetty-bom pom
  • org.jboss.arquillian.extension » arquillian-portal-impl-pluto-jsf jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-portal jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-portal-warp-api jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-portal-warp-portlet jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-portal-warp-jsf jar javadoc pom

Release notes and resolved issues 4

Feature Request
  • ARQ-1539 - Support for Warp testing with Portlets
Task
  • ARQ-1540 - Migrate implementations into Portal Extension
  • ARQ-1542 - Add integration testing to portal extension

Thanks to the following list of contributors: Ken Finnigan

Arquillian Warp 1.0.0.Alpha5 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.Alpha5 release of the Arquillian Warp component!

This release was focused on fixing issues and setting up container interoperability tests.

I’m really proud for all the fixes which you submitted and, as I promised, we release this Alpha to allow you grab and test those changes on a monthly basis.

Container Compatibility

Thanks to the Arquillian Container adapters, it was pretty easy to setup container compatibility tests. You can see the results on Jenkins CloudBees instance

If you are missing support for your favorite container, speak up and we will add the desired configuration to the matrix!

As you can see from the results of compatibility tests, Warp and Warp JSF tests pass 100% on following containers:

  • WildFly 8.0.0.Beta1
  • JBoss AS 7.1.1.Final

Some tests have minor issues on TomEE 1.5.1 and unfortunately a number of tests fail on GlassFish 3.1. If any of these containers are of interest to you, please don’t hesitate to lend us a helping hand getting these up to 100% as well.

Warp Extensions – REST and Portlets

Warp REST extension was released in its Alpha1 version recently. Thanks Jakub Narloch and Bernard Labno for their hard work with extending Warp cross-framework coverage.

Ken Finnigan is also finalizing Warp Portlet support – his efforts helped to refine Warp core in this release significantly.

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 Warp
Version 1.0.0.Alpha5 view tag
Release date 2013-10-30
Released by Lukas Fryc
Compiled against

Published artifacts org.jboss.arquillian.extension

  • org.jboss.arquillian.extension » arquillian-warp-bom pom
  • org.jboss.arquillian.extension » arquillian-warp-api jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-warp-spi jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-warp-impl jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-warp-jsf jar javadoc pom

Release notes and resolved issues 6

Bug Fixes + Portlet Support

Enhancement
  • ARQ-1538 - Provide the ability for Inspection methods to have multiple qualifiers
  • ARQ-1552 - Rewrite any absolute urls in Warp response content with Proxy URL
Feature Request
  • ARQ-1261 - Warp: setup container-compatibility integration builds
Bug
  • ARQ-1478 - Warp JSF: Nonexistent facelet file causes IllegalArgumentException
  • ARQ-1494 - Warp: fails when ProxyURLProvider is called more than once per test
  • ARQ-1556 - Warp Inspection methods with multiple qualifiers are executed but incorrectly verified

Thanks to the following list of contributors: Lukas Fryc, Ken Finnigan, Jan Dosoudil

Arquillian Transaction Extension 1.0.0.Final 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.Final release of the Arquillian Transaction Extension component!

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 Transaction Extension
Version 1.0.0.Final view tag
Release date 2013-10-29
Released by Aslak Knutsen
Compiled against

Published artifacts org.jboss.arquillian.extension

  • org.jboss.arquillian.extension » arquillian-transaction-api jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-transaction-spi jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-transaction-impl-base jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-transaction-jta jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-transaction-bom pom

Release notes and resolved issues 4

Enhancement
  • ARQ-1529 - Enhance error reporting when user transaction cannot be found
Feature Request
Bug
  • ARQ-1473 - JUnit @Before and @After cause nested transaction

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

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

This is the first release of the Arquillian REST extension.

At the moment it consist of two complementary parts:

REST client

Simplifies writing the client side of testing REST services

Warp REST extension

An extension, that with a bit of magic allows you to intercept the state of the Service prior or after to it’s execution

REST client

Sometimes you need to test your REST app as a black box. You know the interface (the contract), you have some input and know what results you expect. For this purpose Arquillian REST Client Extension is your friend. It makes your code shorter by injecting configured artifacts. The extension is based on the RestEasy client library. Both RestEasy 2.x and 3.x are supported. You only need to add the proper dependency to your classpath.

@RunWith(Arquillian.class)
public class RestClientTestCase {

  @ArquillianResource
  private URL deploymentURL;

  @Deployment(testable = false)
  public static WebArchive create()
  {
      return ShrinkWrap.create(WebArchive.class)
          .addPackage(Customer.class.getPackage())
          .addClasses(CustomerResource.class, CustomerResourceImpl.class, JaxRsActivator.class);
  }

  /**
   * Arquillian calculates resource path by using deployment URL+ArquillianResteasyResource.value
   * which is by default "rest". If your API is located under different root i.e.
   * "api_v2" then use @ArquillianResteasyResource("api_v2")
   *
   * @param customerResource configured resource ready for use, injected by Arquillian
   */
  @Test
  public void getCustomerById(@ArquillianResteasyResource CustomerResource customerResource)
  {
      // Given
      final String name = "Acme Corporation";
      final long customerId = 1L;

      // When
      final Customer result = customerResource.getCustomerById(customerId);

      // Then
      assertNotNull(result);
      assertNotNull(result.getId());
      assertEquals(name, result.getName());
  }
}

For more examples on how to use these extensions and quickly get started with development you can take a look at the integration tests that are part of project source code.

Warp REST

Arquillian Warp makes it possible to perform a gray-box testing of any servlet based in-container application. Now we are introducing an API that allows you to intercept the state of the REST services and validate the generated response including, but not limiting to the security context, response HTTP status code, HTTP headers and the response entities. The actual HTTP servlet request and responses are also being recorded, allowing you to verify them directly on the server. All of this happens in the application container, before the response is returned to the invoking client!

The WARP extension targets JAX-RS major versions and already has support for JAX-RS 1.1 and 2.0.

The JAX-RS 1.1 specification did not define any support for request interception, while this has been widely supported through implementation specific hooks, that is why in order to use the extension with JAX-RS 1.1 one of JAX-RS provider specific implementation need to be chosen. Fortunately we already support most the popular providers:

  • RESTEasy
  • Jersey
  • CXF

Now, let’s write some code:

StockServiceResourceTestCase.java
@Test
@RunAsClient
public void testStockGetWarp() {

  Warp.initiate(new Activity() {
      @Override
      public void perform() {

          // invokes the service
          stockService.getStock(1L);
      }
  }).inspect(new Inspection() {

      private static final long serialVersionUID = 1L;

      @ArquillianResource
      private RestContext restContext;

      @AfterServlet
      public void testGetStock() {

          // validates the service response
          assertEquals(HttpMethod.GET, restContext.getHttpRequest().getMethod());
          assertEquals(200, restContext.getHttpResponse().getStatusCode());
          assertEquals("application/json", restContext.getHttpResponse().getContentType());
          assertNotNull(restContext.getHttpResponse().getEntity());
      }
  });
}

For more examples on how to use these extensions and quickly get started with development you can take a look at the integration tests that are part of the projects source code.

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 REST Extension
Version 1.0.0.Alpha1 view tag
Release date 2013-10-23
Released by Aslak Knutsen
Compiled against

Published artifacts org.jboss.arquillian.extension

  • org.jboss.arquillian.extension » arquillian-rest-client-api jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-rest-client-impl-base jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-rest-client-impl-2x jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-rest-client-impl-3x jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-rest-warp-api jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-rest-warp-spi jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-rest-warp-impl-base jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-rest-warp-impl-resteasy jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-rest-warp-impl-jersey jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-rest-warp-impl-cxf jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-rest-warp-impl-jaxrs-2.0 jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-rest-warp-bom pom

Release notes and resolved issues 3

Feature Request
  • ARQ-912 - Setup a declarative REST testing extension
  • ARQ-1341 - Warp JAX-RS testing

Thanks to the following list of contributors: Bernard Labno, Aslak Knutsen, Jakub Narloch, Lukas Fryc