Skip to content
Gael Lazzari edited this page Aug 27, 2012 · 12 revisions

Using Maven

Simply add the following dependency :

  <dependency>
    <groupId>com.googlecode.gwt-test-utils</groupId>
    <artifactId>gwt-test-utils</artifactId>
    <version>X</version>
  </dependency>

Some other modules are available, listed here by theirs artifactId :

Note : GXT 3.0 support is not ready yet, but will come soon !

Note that those artifact all directly depend on gwt-test-utils-X core. You could add them all if your project needs it. However, you should always use the same version when combining them in a single project.

Snapshots configuration

gwt-test-utils snapshot versions are hosted on Sonatype OSS Maven repository. If you need to use one of them, you'll have to add the following repository :

  <repository>
    <id>sonatype-snapshots</id>
    <url>http://oss.sonatype.org/content/repositories/snapshots</url>
    <snapshots>
      <enabled>true</enabled>
    </snapshots>
    <releases>
      <enabled>false</enabled>
    </releases>
  </repository>

Without Maven

All artifacts are available in the Download section.

The framework requiers some third-party librairies you should add to your project test classpath :

gwt-test-utils :
  • gwt-user-2.0.1+.jar
  • gwt-servlet-2.0.1+.jar
  • gwt-dev-2.0.1+.jar
  • javassist-3.12+.jar
  • junit-4.5+.jar
  • fest-assert-core-2.0M7+.jar
  • fest-util-1.2.2+.jar
  • paranamer-2.0+.jar
  • javaparser-1.0.8+.jar
  • slf4j-api-1.6+.jar (with the adapter of your choice)
  • jackson-core-asl-1.9.1+.jar if you use com.google.gwt.json API

If you are interested in using a java mocking framework, gwt-test-utils has been tested with :

  • easymock-3.0+.jar
  • mockito-core-1.8.5+.jar

If you are interested in testing a GWT + Spring application with gwt-test-utils, you'll need to add spring-test-2.5+ and all its related dependencies in your test classpath.

Additional dependencies for gwt-test-utils-csv :
  • antlr-runtime-3.1.1+.jar
Additional dependencies for gwt-test-utils-gxt2 :
  • gxt-2.2+.jar

Running your tests

gwt-test-utils tests are standard JUnit tests :-)

But, since simulating complex DOM structures can be memory expensive, you may have to increase the memory available.

Under Eclipse

Just open a new JUnit Run configuration, and specify in the JVM Arguments text area the amount of memory you'll need for your tests. For example :

-Xmx512M -XX:MaxPermSize=128M

With Maven

In your pom.xml, configure the maven-surefire-plugin to increase the amount of memory available :

  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <configuration>
      <argLine>-Xmx512M -XX:MaxPermSize=128M</argLine>
    </configuration>
  </plugin>

Clone this wiki locally