Arquillian GWT Testing extension

Parent POM for JBoss projects. Provides default project build configuration.

License

License

Categories

Categories

JBoss Container Application Servers GWT (Google Web Toolkit) User Interface Web Frameworks Arquillian Application Testing & Monitoring
GroupId

GroupId

org.jboss.arquillian.extension
ArtifactId

ArtifactId

arquillian-gwt
Last Version

Last Version

1.0.0.Alpha2
Release Date

Release Date

Type

Type

jar
Description

Description

Arquillian GWT Testing extension
Parent POM for JBoss projects. Provides default project build configuration.
Project URL

Project URL

http://www.jboss.org/arquillian-gwt
Project Organization

Project Organization

JBoss by Red Hat

Download arquillian-gwt

How to add to project

<!-- https://jarcasting.com/artifacts/org.jboss.arquillian.extension/arquillian-gwt/ -->
<dependency>
    <groupId>org.jboss.arquillian.extension</groupId>
    <artifactId>arquillian-gwt</artifactId>
    <version>1.0.0.Alpha2</version>
</dependency>
// https://jarcasting.com/artifacts/org.jboss.arquillian.extension/arquillian-gwt/
implementation 'org.jboss.arquillian.extension:arquillian-gwt:1.0.0.Alpha2'
// https://jarcasting.com/artifacts/org.jboss.arquillian.extension/arquillian-gwt/
implementation ("org.jboss.arquillian.extension:arquillian-gwt:1.0.0.Alpha2")
'org.jboss.arquillian.extension:arquillian-gwt:jar:1.0.0.Alpha2'
<dependency org="org.jboss.arquillian.extension" name="arquillian-gwt" rev="1.0.0.Alpha2">
  <artifact name="arquillian-gwt" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.jboss.arquillian.extension', module='arquillian-gwt', version='1.0.0.Alpha2')
)
libraryDependencies += "org.jboss.arquillian.extension" % "arquillian-gwt" % "1.0.0.Alpha2"
[org.jboss.arquillian.extension/arquillian-gwt "1.0.0.Alpha2"]

Dependencies

compile (8)

Group / Artifact Type Version
org.jboss.arquillian.core : arquillian-core-spi jar
org.jboss.arquillian.test : arquillian-test-spi jar
org.jboss.arquillian.container : arquillian-container-test-api jar
org.jboss.arquillian.container : arquillian-container-test-impl-base jar
org.jboss.arquillian.container : arquillian-container-spi jar
org.jboss.arquillian.config : arquillian-config-api jar
org.jboss.shrinkwrap.resolver : shrinkwrap-resolver-impl-maven jar
org.jboss.shrinkwrap : shrinkwrap-api jar

provided (6)

Group / Artifact Type Version
com.google.gwt : gwt-servlet jar 2.5.0
com.google.gwt : gwt-user jar 2.5.0
com.google.gwt : gwt-dev jar 2.5.0
net.sourceforge.htmlunit : htmlunit jar 2.9
org.jboss.spec : jboss-javaee-6.0 pom 1.0.0.Final
junit : junit jar 4.8.2

test (1)

Group / Artifact Type Version
org.jboss.arquillian.junit : arquillian-junit-container jar

Project Modules

There are no modules declared in this project.

Obsolete

We don't maintain this code base anymore. If you are interested in picking it up from where we left please reach out to us through Arquillian forum.

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.

<dependency>
    <groupId>org.jboss.arquillian.extension</groupId>
    <artifactId>arquillian-gwt</artifactId>
    <version>1.0.0.Alpha1</version>
</dependency>

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.

@RunWith(Arquillian.class)
public class MyTestClass {

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

Here's a complete example:

@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);
  }
}

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

Community/Help/Feedback

org.jboss.arquillian.extension

An Innovative Testing Platform for the JVM

Versions

Version
1.0.0.Alpha2
1.0.0.Alpha1