Skip to content
Arquillian Extension for Google Web Toolkit
Find file
Latest commit 1261e57 @csadilek csadilek Removed debugging info

Arquillian Google Web Toolkit Extension

The Arquillian GWT extension brings true integration testing to GWT. This means that GWT integration tests can break free and execute in the actual runtime container instead of being tied to GWT’s embedded Jetty server. Further it is possible to combine GWT client-side and standard in-container tests in the same test class. This allows to test features without having to worry about the client-server bridge and should pave the way for future support of Arquillian Warp and Drone in GWT integration tests.

Getting Started

If you're new to Arquillian take a look a the Getting Started Guide. To start using the Arquillian GWT extension just add the following dependency to your project.


Make sure this dependency is specified before all GWT dependencies (gwt-user, gwt-dev, gwt-servlet) in your pom.xml. The Arquillian GWT extension requires GWT 2.5.0 or higher.

Writing Arquillian GWT tests

To run a test method as a GWT integration test either annotate the test class or test method with @RunAsGwtClient and specifiy the GWT module. If you annotate the test class all test methods in that class will run as GWT integration tests.

public class MyTestClass {

  @RunAsGwtClient(moduleName = "org.myapp.MyGwtModule")
  public void myGwtTest() {


Here's a complete example:

public class GreeterRpcTest extends ArquillianGwtTestCase {

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

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

      public void onSuccess(String result) {
        assertEquals("Received invalid response from Server", "Welcome!", result);

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


Something went wrong with that request. Please try again.