-
Notifications
You must be signed in to change notification settings - Fork 0
Setup
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 :
- gwt-test-utils-csv : use this module if you want to write complex test scenario easily.
- gwt-test-utils-gxt2 : use this module if you want to test UI designed with the popular GXT 2.x librairy.
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.
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>All artifacts are available in the Download section.
The framework requiers some third-party librairies you should add to your project test classpath :
- 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.jsonAPI
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.
- antlr-runtime-3.1.1+.jar
- gxt-2.2+.jar
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.
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
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>