Arquillian GWT Testing extension 1.0.0.Alpha2 Released

The Arquillian team is proud to announce the 1.0.0.Alpha2 release of the Arquillian GWT Testing extension component!

This is an update of the Arquillian GWT extension to remove the need for the custom GwtArchive class. Arquillian GWT tests can now leverage the standard ShrinkWrap API for specifiying their deployments. The WebArchive is automatically enhanced to include all dependencies and configurations relevant to the GWT deployment.

Here’s an updated example of a complete test class:

GreeterRpcTest.java

@RunWith(Arquillian.class)
public class GreeterRpcTest extends ArquillianGwtTestCase {

  @Deployment
  public static WebArchive createDeployment() {
    return ShrinkWrap.create(WebArchive.class, "test.war")
      .addClass(Greeter.class)
      .addClass(GreetingService.class)
      .addClass(GreetingServiceImpl.class)
      .addAsWebInfResource(new File("src/main/webapp/WEB-INF/web.xml"));
  }

  @Test
  @RunAsGwtClient(moduleName = "org.myapp.MyGwtModule")
  public void testGreetingService() {
    GreetingServiceAsync greetingService = GWT.create(GreetingService.class);
    greetingService.greetServer("Hello!", new AsyncCallback<String>() {
      @Override
      public void onFailure(Throwable caught) {
        Assert.fail("Request failure: " + caught.getMessage());
      }

      @Override
      public void onSuccess(String result) {
        assertEquals("Received invalid response from Server", "Welcome!", result);
        finishTest();
      }
    });
    delayTestFinish(5000);
  }
}

Note that you will only need to extend ArquillianGwtTestCase if you want to inherit GWT’s asynchronous testing methods (finishTest and delayTestFinish).

We look forward to your feedback on 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 GWT Testing extension
Version 1.0.0.Alpha2 view tag
Release date 2013-04-15
Released by Christian Sadilek
Compiled against

Published artifacts org.jboss.arquillian.extension

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

Release notes and resolved issues 2

Automatic deployment archive enhancement for GWT

Feature Request
  • ARQ-1354 - Automatically enhance the deployment archive to include all dependencies and configurations relevant to the GWT deployment

Thanks to the following list of contributors: Christian Sadilek